Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
2.2 kB
1
Indexable
Never
    @Convert(converter = FeatureEnumConverter.class)
    private Feature feature;

    @Convert(converter = JsonConverter.class)
    private JsonNode content;

    @Convert(converter = JsonConverter.class)
    private ObjectNode hookResponse;

    @Transient
    private String requesterName;

        ObjectNode resultData = new ObjectNode(JsonNodeFactory.instance);

    @Value("classpath:/feature-changes/*")
    private Resource[] resources;

    private TaskScheduler hookScheduler;

 .flatMap(List::stream)

        ScheduledExecutorService localExecutor = Executors.newSingleThreadScheduledExecutor();
        hookScheduler = new ConcurrentTaskScheduler(localExecutor);

if (resource.getFilename().matches("feature-change-config-.*\\.xml")) {
                List<FeatureChangeConfig> featureConfigList = new XmlMapper().readValue(
                        resource.getInputStream(),
                        new TypeReference<List<FeatureChangeConfig>>() {
                        });

    private Handlebars handlebars;
        handlebars = new Handlebars();
        handlebars.registerHelper("json", Jackson2Helper.INSTANCE);
        handlebars.registerHelper("eq", ConditionalHelpers.eq);
        handlebars.registerHelper("neq", ConditionalHelpers.neq);
        handlebars.registerHelper("not", ConditionalHelpers.not);
        handlebars.registerHelper("numberFormat", StringHelpers.numberFormat);
        handlebars.registerHelper("customDateFormat",
                FeatureChangeStringHelpers.customDateFormat);
        handlebars.registerHelper("fromResource", FeatureChangeStringHelpers.fromResource);

  @VisibleForTesting
    public List<Country> getTargetServerCountries(FeatureChange featureChange) {
        try {
            if (featureChange.getContent().has(COLUMN_FAILURES)) {
                return objectMapper.readValue(featureChange.getContent().get(COLUMN_FAILURES)
                        .toString(), new TypeReference<List<Country>>() {});
            }
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }

 objectMapper.valueToTree(failures));
Leave a Comment