@Override public String toString() { return "ProjectionTransform{" + "projectionFields=" + projectionFields + '}'+super.toString(); } }
public static boolean isList (Object value) { return isSubType(List.class, value); } // min and max are inclusive
public static boolean isStringAndNotEmpty (Object value) { return isString(value) && !StringUtils.isEmpty((String) value); }
protected void validateBooleanFields (String[] fieldNames, boolean areRequiredFields, Map<String, Object> conf) throws ComponentConfigException { for (String fieldName : fieldNames) { Object value = conf.get(fieldName); boolean isValid = true; if (areRequiredFields) { // validate no matter what for required fields if (!ConfigFieldValidation.isBoolean(value)) { isValid = false; } } else { // for optional fields validate only if user updated the // default value which means UI put it in json if ((value != null) && !ConfigFieldValidation.isBoolean(value)) { isValid = false; } } if (!isValid) { throw new ComponentConfigException(String.format(TopologyLayoutConstants.ERR_MSG_MISSING_INVALID_CONFIG, fieldName)); } } }
protected void validateStringFields (String[] fieldNames, boolean areRequiredFields, Map<String, Object> conf) throws ComponentConfigException { for (String fieldName: fieldNames) { Object value = conf.get(fieldName); boolean isValid = true; if (areRequiredFields) { // validate no matter what for required fields if (!ConfigFieldValidation.isStringAndNotEmpty(value)) { isValid = false; } } else { // for optional fields validate only if user updated the // default value which means UI put it in json if ((value != null) && !ConfigFieldValidation.isStringAndNotEmpty(value)) { isValid = false; } } if (!isValid) { throw new ComponentConfigException(String.format(TopologyLayoutConstants.ERR_MSG_MISSING_INVALID_CONFIG, fieldName)); } } }
protected void validateFloatOrDoubleFields (String[] fieldNames, boolean areRequiredFields) throws ComponentConfigException { for (String fieldName : fieldNames) { Object value = conf.get(fieldName); boolean isValid = true; if (areRequiredFields) { // validate no matter what for required fields if (!ConfigFieldValidation.isFloatOrDouble(value)) { isValid = false; } } else { // for optional fields validate only if user updated the // default value which means UI put it in json if ((value != null) && !ConfigFieldValidation.isFloatOrDouble(value)) { isValid = false; } } if (!isValid) { throw new ComponentConfigException(String.format(TopologyLayoutConstants.ERR_MSG_MISSING_INVALID_CONFIG, fieldName)); } } }
public static boolean isLong (Object value) { return isSubType(Long.class, value); }
@Override public String toString() { return "EnrichmentTransform{" + "fieldsToBeEnriched=" + fieldsToBeEnriched + ", transformDataProvider=" + transformDataProvider + ", maxCacheSize=" + maxCacheSize + ", entryExpirationInterval=" + entryExpirationInterval + ", entryRefreshInterval=" + entryRefreshInterval + '}'+super.toString(); } }
public static boolean isDouble (Object value) { return isSubType(Double.class, value); }
@Override public String toString() { return "AddHeaderTransform{" + "fixedHeader=" + fixedHeader + '}'+super.toString(); } }
public static boolean isBoolean (Object value) { return isSubType(Boolean.class, value); }
@Override public String toString() { return "MergeTransform{" + "defaults=" + defaults + '}'+super.toString(); } }
public static boolean isInteger (Object value) { return isSubType(Integer.class, value); }
@Override public String toString() { return "SubstituteTransform{" + "fields=" + fields + '}'+super.toString(); } }
public static boolean isString (Object value) { return isSubType(String.class, value); }