@Override void before(AppendingStringBuffer buffer, String idAttr, StringBuilder extraLabelAttributes, CharSequence renderValue) { buffer.append("<label for=\"") .append(Strings.escapeMarkup(idAttr)) .append('"') .append(extraLabelAttributes) .append('>') .append(renderValue) .append("</label>"); } },
/** * Converts this StringValue to a given type or {@code null} if the value is empty. * * @param type * The type to convert to * @return The converted value * @throws StringValueConversionException */ public final <T> T toOptional(final Class<T> type) throws StringValueConversionException { return Strings.isEmpty(text) ? null : to(type); }
/** * Convert to object types, returning null if text is null or empty. * * @return converted * @throws StringValueConversionException */ public final Duration toOptionalDuration() throws StringValueConversionException { return Strings.isEmpty(text) ? null : toDuration(); }
/** * Convert to object types, returning null if text is null or empty. * * @return converted * @throws StringValueConversionException */ public final Long toOptionalLong() throws StringValueConversionException { return Strings.isEmpty(text) ? null : toLongObject(); }
/** * Convert to object types, returning null if text is null or empty. * * @return converted * @throws StringValueConversionException */ public final Boolean toOptionalBoolean() throws StringValueConversionException { return Strings.isEmpty(text) ? null : toBooleanObject(); }
/** * Convert to object types, returning null if text is null or empty. * * @return converted * @throws StringValueConversionException */ public final Character toOptionalCharacter() throws StringValueConversionException { return Strings.isEmpty(text) ? null : toCharacter(); }
/** * Convert to object types, returning null if text is null or empty. * * @return converted * @throws StringValueConversionException */ public final Double toOptionalDouble() throws StringValueConversionException { return Strings.isEmpty(text) ? null : toDoubleObject(); }
@Override public String name(int value) { if (value < LOOKUP_TABLE_SIZE) { return lookupTable()[value]; } return super.name(value); }
@Override void after(AppendingStringBuffer buffer, String idAttr, StringBuilder extraLabelAttributes, CharSequence renderValue) { buffer.append("<label for=\"") .append(Strings.escapeMarkup(idAttr)) .append('"') .append(extraLabelAttributes) .append('>') .append(renderValue) .append("</label>"); } },