@Test public void testIsFieldAnArrayCount_True(){ String arrayFieldName = "arrayField"; Fields fields = new Fields(null); fields.addNew(new ArrayField(arrayFieldName)); assertTrue(PredefinedFields.isFieldAnArrayCount(arrayFieldName + PredefinedFields.FIELD_ARRAY_COUNT_POSTFIX, fields)); }
public static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields){ if(!doesFieldNameMatchArrayCountPattern(fieldName)){ return false; } Field field = metadataFields.getField(createArrayFieldNameFromCountField(fieldName)); if((field != null) && (field instanceof ArrayField)){ return true; } return false; }
PredefinedFields { public static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields){ if(!doesFieldNameMatchArrayCountPattern(fieldName)){ return false; } Field field = metadataFields.getField(createArrayFieldNameFromCountField(fieldName)); if((field != null) && (field instanceof ArrayField)){ return true; } return false; } }
PredefinedFields { public static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields){ if(!doesFieldNameMatchArrayCountPattern(fieldName)){ return false; } Field field = metadataFields.getField(createArrayFieldNameFromCountField(fieldName)); if((field != null) && (field instanceof ArrayField)){ return true; } return false; } private  PredefinedFields(); }
PredefinedFields { public static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields){ if(!doesFieldNameMatchArrayCountPattern(fieldName)){ return false; } Field field = metadataFields.getField(createArrayFieldNameFromCountField(fieldName)); if((field != null) && (field instanceof ArrayField)){ return true; } return false; } private  PredefinedFields(); static void ensurePredefinedFields(EntityMetadata md); static void updateArraySizes(EntityMetadata md, JsonNodeFactory factory, JsonDoc doc); static boolean isFieldObjectType(String fieldName); static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields); static boolean isPredefinedField(String fieldName, Fields fields); static String createArrayFieldNameFromCountField(String countField); static String createArrayCountFieldName(String arrayFieldName); }
PredefinedFields { public static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields){ if(!doesFieldNameMatchArrayCountPattern(fieldName)){ return false; } Field field = metadataFields.getField(createArrayFieldNameFromCountField(fieldName)); if((field != null) && (field instanceof ArrayField)){ return true; } return false; } private  PredefinedFields(); static void ensurePredefinedFields(EntityMetadata md); static void updateArraySizes(EntityMetadata md, JsonNodeFactory factory, JsonDoc doc); static boolean isFieldObjectType(String fieldName); static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields); static boolean isPredefinedField(String fieldName, Fields fields); static String createArrayFieldNameFromCountField(String countField); static String createArrayCountFieldName(String arrayFieldName); static final String OBJECTTYPE_FIELD; static final String FIELD_ARRAY_COUNT_POSTFIX; static final Path OBJECTTYPE_PATH; }