Class OptionalFeature

java.lang.Object
net.minheur.potoflux.settings.OptionalFeature

public class OptionalFeature extends Object
Container for a feature's value
  • Constructor Details

    • OptionalFeature

      public OptionalFeature(@NotNull @NotNull String stringValue)
      Creates a value of String
      Parameters:
      stringValue - value of the feature
    • OptionalFeature

      public OptionalFeature(@NotNull @NotNull Integer intValue)
      Creates a value of Integer
      Parameters:
      intValue - value of the feature
    • OptionalFeature

      public OptionalFeature(@NotNull @NotNull Boolean boolValue)
      Creates a value of Boolean
      Parameters:
      boolValue - value of the feature
  • Method Details

    • get

      public Object get()
      Gets the value as an Object
      Returns:
      the value depending on the type
    • set

      public void set(Object value)
      Modifies the value, from an Object
      Parameters:
      value - to set in the field corresponding to type
      Throws:
      ClassCastException - if the value given cannot be put into the right field
    • getType

      public OptionalFeature.Type getType()
      Getter for the type
      Returns:
      type