/** * Sets the value of this model to a new {@link NumberValue} holding the * specified {@code Number}. * * @param val the new value * @return a reference to this */ default T set(final Number val) { return set(ofNumber(val)); }
/** * Creates a public final static {@link Field} with the specified value and * adds it to this model. * * @param name the name of the field * @param type the type of the field * @param value the value of the field * @return a reference to this * * @since 2.5 */ default T constant(final String name, Type type, Number value) { return constant(name, type, ofNumber(value)); }
/** * Use the specified key-value pair when referencing the annotation. If you * only want to show a single value without any key, consider using the * {@link #set(Value)} method. * <p> * This method works like {@link #put(String, Value)} except that the type * of the value is automatically determined as a {@link NumberValue}. * * @param key the key * @param numberValue the value * @return a reference to this model * * @since 2.5 */ default AnnotationUsage put(String key, Number numberValue) { return put(key, Value.ofNumber(numberValue)); }
EnumConstant.of(javaName) .add(Value.ofText(constant)) .add(Value.ofNumber(ordinal));
/** * Sets the value of this model to a new {@link NumberValue} holding the * specified {@code Number}. * * @param val the new value * @return a reference to this */ default T set(final Number val) { return set(ofNumber(val)); }
/** * Creates a public final static {@link Field} with the specified value and * adds it to this model. * * @param name the name of the field * @param type the type of the field * @param value the value of the field * @return a reference to this * * @since 2.5 */ default T constant(final String name, Type type, Number value) { return constant(name, type, ofNumber(value)); }
/** * Use the specified key-value pair when referencing the annotation. If you * only want to show a single value without any key, consider using the * {@link #set(Value)} method. * <p> * This method works like {@link #put(String, Value)} except that the type * of the value is automatically determined as a {@link NumberValue}. * * @param key the key * @param numberValue the value * @return a reference to this model * * @since 2.5 */ default AnnotationUsage put(String key, Number numberValue) { return put(key, Value.ofNumber(numberValue)); }