class ShutdownReasonFactory {

    public static ShutdownReason fromJson(final JsonObject jsonObject) {
        checkNotNull(jsonObject, "reason JSON object");

        final ShutdownReasonType type = getReasonType(jsonObject);

        if (ShutdownReasonType.Known.PURGE_NAMESPACE.equals(type)) {
            return PurgeNamespaceReason.fromJson(jsonObject);
        } else if (ShutdownReasonType.Known.PURGE_ENTITIES.equals(type)) {
            return PurgeEntitiesReason.fromJson(jsonObject);
        } else {
            return ShutdownNoReason.INSTANCE;
        }
    }

    private  ShutdownReasonFactory();

}