arekusuri commented on a change in pull request #2910: URL: https://github.com/apache/incubator-gobblin/pull/2910#discussion_r428382264
########## File path: gobblin-salesforce/src/main/java/org/apache/gobblin/typedconfig/ConstraintUtil.java ########## @@ -0,0 +1,80 @@ +package org.apache.gobblin.typedconfig; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import org.apache.gobblin.typedconfig.compiletime.EnumOptions; +import org.apache.gobblin.typedconfig.compiletime.IntRange; +import org.apache.gobblin.typedconfig.compiletime.LongRange; +import org.apache.gobblin.typedconfig.compiletime.StringRegex; + + +public class ConstraintUtil { + private ConstraintUtil() { + } + + public static Object constraint(Field field, Object value, Object defaultValue) { + if (value == null) { + return defaultValue; + } + Class type = field.getType(); + if (type == int.class) { Review comment: create separate function for each type of data. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org