/** * Returns a builder for a property having as value a list of {@code <T>}. The * format of the individual items is the same as for {@linkplain #enumProperty(String, Map)}. * * @param name Name of the property to build * @param nameToValue Map of labels to values. The null key is ignored. * @param <T> Value type of the property * * @return A new builder */ public static <T> GenericCollectionPropertyBuilder<T, List<T>> enumListProperty(String name, Map<String, T> nameToValue) { return enumProperty(name, nameToValue).toList().delim(MultiValuePropertyDescriptor.DEFAULT_DELIMITER); }
private static PropertyDescriptor<Boolean> booleanPropertyFor(String id, String label) { PropertyDescriptor<Boolean> prop = PROPERTY_DESCRIPTORS_BY_ID.get(id); if (prop != null) { return prop; } prop = PropertyFactory.booleanProperty(id).defaultValue(true).desc("Include " + label + " column").build(); PROPERTY_DESCRIPTORS_BY_ID.put(id, prop); return prop; }
/** * Returns a builder for a property having as value a list of characters. The * format of the individual items is the same as for {@linkplain #charProperty(String) charProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Character, List<Character>> charListProperty(String name) { return charProperty(name).toList(); }
/** * Returns a builder for a property having as value a list of integers. The * format of the individual items is the same as for {@linkplain #intProperty(String) intProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Integer, List<Integer>> intListProperty(String name) { return intProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
/** * Returns a builder for a property having as value a list of decimal numbers. The * format of the individual items is the same as for {@linkplain #doubleProperty(String) doubleProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Double, List<Double>> doubleListProperty(String name) { return doubleProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
private static PropertyDescriptor<List<String>> propertyFor(String stmtName) { return PropertyFactory.enumListProperty("check" + StringUtils.capitalize(stmtName) + "LoopTypes", LOOP_TYPES_MAPPINGS) .desc("List of loop types in which " + stmtName + " statements will be checked") .defaultValue(DEFAULTS) .build(); }
/** * Returns a builder for a property having as value a list of long integers. The * format of the individual items is the same as for {@linkplain #longIntProperty(String)} longIntProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Long, List<Long>> longIntListProperty(String name) { return longIntProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
/** Returns a pre-filled builder with the given name and display name (for the description). */ RegexPropertyBuilder defaultProp(String name, String displayName) { return PropertyFactory.regexProperty(name + "Pattern") .desc("Regex which applies to " + displayName.trim() + " names") .defaultValue(defaultConvention()); }
/** * Returns a builder for a property having as value a list of strings. The * format of the individual items is the same as for {@linkplain #stringProperty(String) stringProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<String, List<String>> stringListProperty(String name) { return stringProperty(name).toList(); }
public MockRule() { super(); setLanguage(LanguageRegistry.getLanguage("Dummy")); definePropertyDescriptor(PropertyFactory.intProperty("testIntProperty").desc("testIntProperty").require(inRange(1, 100)).defaultValue(1).build()); }
/** * Returns a builder for a property having as value a list of decimal numbers. The * format of the individual items is the same as for {@linkplain #doubleProperty(String) doubleProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Double, List<Double>> doubleListProperty(String name) { return doubleProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
private static PropertyDescriptor<List<String>> propertyFor(String stmtName) { return PropertyFactory.enumListProperty("check" + StringUtils.capitalize(stmtName) + "LoopTypes", LOOP_TYPES_MAPPINGS) .desc("List of loop types in which " + stmtName + " statements will be checked") .defaultValue(DEFAULTS) .build(); }
/** * Returns a builder for a property having as value a list of long integers. The * format of the individual items is the same as for {@linkplain #longIntProperty(String)} longIntProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Long, List<Long>> longIntListProperty(String name) { return longIntProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
/** Returns a pre-filled builder with the given name and display name (for the description). */ RegexPropertyBuilder defaultProp(String name, String displayName) { return PropertyFactory.regexProperty(name + "Pattern") .desc("Regex which applies to " + displayName.trim() + " names") .defaultValue(defaultConvention()); }
/** * Returns a builder for a property having as value a list of strings. The * format of the individual items is the same as for {@linkplain #stringProperty(String) stringProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<String, List<String>> stringListProperty(String name) { return stringProperty(name).toList(); }
private static GenericPropertyBuilder<CommentRequirement> requirementPropertyBuilder(String name, String commentType) { DESCRIPTOR_NAME_TO_COMMENT_TYPE.put(name, commentType); return PropertyFactory.enumProperty(name, CommentRequirement.mappings()) .desc(commentType + ". Possible values: " + CommentRequirement.labels()) .defaultValue(CommentRequirement.Required); } }
/** * Returns a builder for a property having as value a list of integers. The * format of the individual items is the same as for {@linkplain #intProperty(String) intProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Integer, List<Integer>> intListProperty(String name) { return intProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
private static PropertyDescriptor<Boolean> booleanPropertyFor(String id, String label) { PropertyDescriptor<Boolean> prop = PROPERTY_DESCRIPTORS_BY_ID.get(id); if (prop != null) { return prop; } prop = PropertyFactory.booleanProperty(id).defaultValue(true).desc("Include " + label + " column").build(); PROPERTY_DESCRIPTORS_BY_ID.put(id, prop); return prop; }
/** * Returns a builder for a property having as value a list of characters. The * format of the individual items is the same as for {@linkplain #charProperty(String) charProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Character, List<Character>> charListProperty(String name) { return charProperty(name).toList(); }
/** * Returns a builder for a property having as value a list of {@code <T>}. The * format of the individual items is the same as for {@linkplain #enumProperty(String, Map)}. * * @param name Name of the property to build * @param nameToValue Map of labels to values. The null key is ignored. * @param <T> Value type of the property * * @return A new builder */ public static <T> GenericCollectionPropertyBuilder<T, List<T>> enumListProperty(String name, Map<String, T> nameToValue) { return enumProperty(name, nameToValue).toList().delim(MultiValuePropertyDescriptor.DEFAULT_DELIMITER); }