Interface StringProperty

All Superinterfaces:
Functor<String>, Property<String>
All Known Subinterfaces:
MutableStringProperty, ObservableStringProperty
All Known Implementing Classes:
AdaptiveStringProperty, DeserializedStringProperty, FixedStringProperty, JoinedStringProperty, SimpleMutableStringProperty, SimpleObservableStringProperty, StoredStringProperty, StringConfigOption, SystemProperty
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface StringProperty extends Property<String>
A property with a string value.
  • Method Details

    • append

      @Contract("_ -> new") default JoinedStringProperty append(String string)
      See Also:
    • append

      @Contract("_ -> new") default JoinedStringProperty append(StringProperty stringProperty)
      Returns a string property whose value is the value of this property, followed by the value of stringProperty.
      Parameters:
      stringProperty - The string property to append to this property
      Returns:
      A joined string property that combines both string properties.
    • prepend

      @Contract("_ -> new") default JoinedStringProperty prepend(String string)
      See Also:
    • prepend

      @Contract("_ -> new") default JoinedStringProperty prepend(StringProperty stringProperty)
      Returns a string property whose value is the value of stringProperty, followed by the value of this property.
      Parameters:
      stringProperty - The string property to prepend to this property
      Returns:
      A joined string property that combines both string properties.
    • replaceNull

      default StringProperty replaceNull(String defaultValue)
      Description copied from interface: Property
      Returns a property whose value is the value of this property, or defaultValue if the value of this property is null.
      Specified by:
      replaceNull in interface Property<String>
      Returns:
      A property whose value is never null.
    • parse

      default <T> Property<T> parse(Parser<T> parser)
      Returns a property whose value is the result of parsing the value of this property.

      The return value of this method is not restricted to ParsedProperty, because some string properties use a different implementation. For example, the default implementation of FixedStringProperty.parse(Parser) returns a FixedObjectProperty, because the input string, and therefore the result of the parser, is never going to change.

      In case you rely on the return value being of type ParsedProperty, use Parser.parseProperty(StringProperty) instead.

      Type Parameters:
      T - The type of result of the parser
      Parameters:
      parser - The parser to use
      Returns:
      The parsed property.
      See Also:
    • toStringProperty

      @Contract("-> this") default StringProperty toStringProperty()
      Returns this property.
      Specified by:
      toStringProperty in interface Property<String>
      Returns:
      This property.
    • lengthProperty

      default IntProperty lengthProperty()
      Returns an integer property whose value is the length of the value of this property.
      Returns:
      An integer property representing the length of the value of this property.
    • toUpperCaseProperty

      default StringProperty toUpperCaseProperty()
      Returns a string property whose value is the value of this property converted to upper case.
      Returns:
      A string property whose value is the value of this property converted to upper case.
    • toLowerCaseProperty

      default StringProperty toLowerCaseProperty()
      Returns a string property whose value is the value of this property converted to lower case.
      Returns:
      A string property whose value is the value of this property converted to lower case.
    • fromProperty

      static StringProperty fromProperty(StringProperty property)
    • fromProperty

      @Contract("_ -> new") static StringProperty fromProperty(Property<String> property)