@Test public void testIsValidType() { Assert.assertFalse(SortFieldConfig.isValidType("")); Assert.assertFalse(SortFieldConfig.isValidType(null)); Assert.assertFalse(SortFieldConfig.isValidType("testinvalid")); Assert.assertTrue(SortFieldConfig .isValidType(SortFieldConfig.FieldType.DATE.toString().toUpperCase())); Assert.assertTrue(SortFieldConfig .isValidType(SortFieldConfig.FieldType.DATE.toString().toLowerCase())); Assert.assertTrue(SortFieldConfig .isValidType(SortFieldConfig.FieldType.NUMBER.toString().toUpperCase())); Assert.assertTrue(SortFieldConfig .isValidType(SortFieldConfig.FieldType.NUMBER.toString().toLowerCase())); Assert.assertTrue(SortFieldConfig .isValidType(SortFieldConfig.FieldType.STRING.toString().toUpperCase())); Assert.assertTrue(SortFieldConfig .isValidType(SortFieldConfig.FieldType.STRING.toString().toLowerCase())); }
public static boolean isValidType(String type) { return (FieldType.NUMBER.toString().equalsIgnoreCase(type) || FieldType.DATE.toString().equalsIgnoreCase(type) || FieldType.STRING.toString().equalsIgnoreCase(type)); }
SortFieldConfig implements Config { public static boolean isValidType(String type) { return (FieldType.NUMBER.toString().equalsIgnoreCase(type) || FieldType.DATE.toString().equalsIgnoreCase(type) || FieldType.STRING.toString().equalsIgnoreCase(type)); } }
SortFieldConfig implements Config { public static boolean isValidType(String type) { return (FieldType.NUMBER.toString().equalsIgnoreCase(type) || FieldType.DATE.toString().equalsIgnoreCase(type) || FieldType.STRING.toString().equalsIgnoreCase(type)); } SortFieldConfig(@NonNull FieldType fieldType, @NonNull String dataField);  SortFieldConfig(@NonNull String type, @NonNull String dataField);  SortFieldConfig(@NonNull JSONObject jsonObject);  SortFieldConfig(); }
SortFieldConfig implements Config { public static boolean isValidType(String type) { return (FieldType.NUMBER.toString().equalsIgnoreCase(type) || FieldType.DATE.toString().equalsIgnoreCase(type) || FieldType.STRING.toString().equalsIgnoreCase(type)); } SortFieldConfig(@NonNull FieldType fieldType, @NonNull String dataField);  SortFieldConfig(@NonNull String type, @NonNull String dataField);  SortFieldConfig(@NonNull JSONObject jsonObject);  SortFieldConfig(); FieldType getType(); void setType(@NonNull FieldType type); void setType(@NonNull String type); static boolean isValidType(String type); String getDataField(); void setDataField(@NonNull String dataField); static SortFieldConfig[] extractSortFieldConfigs(@NonNull MapBoxStyleHelper styleHelper); @Override boolean isValid(); @Override JSONObject toJsonObject(); }
SortFieldConfig implements Config { public static boolean isValidType(String type) { return (FieldType.NUMBER.toString().equalsIgnoreCase(type) || FieldType.DATE.toString().equalsIgnoreCase(type) || FieldType.STRING.toString().equalsIgnoreCase(type)); } SortFieldConfig(@NonNull FieldType fieldType, @NonNull String dataField);  SortFieldConfig(@NonNull String type, @NonNull String dataField);  SortFieldConfig(@NonNull JSONObject jsonObject);  SortFieldConfig(); FieldType getType(); void setType(@NonNull FieldType type); void setType(@NonNull String type); static boolean isValidType(String type); String getDataField(); void setDataField(@NonNull String dataField); static SortFieldConfig[] extractSortFieldConfigs(@NonNull MapBoxStyleHelper styleHelper); @Override boolean isValid(); @Override JSONObject toJsonObject(); static final String KEY_DATA_FIELD; static final String KEY_TYPE; }