Class BaseMapOptionData<T extends BaseMapOptionData<T>>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T assignOptionValue​(java.lang.String key, java.lang.Object value)
      Sets the given value on the data object.
      <R> java.util.Optional<R> getOptionValue​(java.lang.String name)
      Retrieves a value with the given name from a data object.
      com.google.gson.JsonObject toJson()  
      java.util.Map<java.lang.String,​java.lang.Object> toMap()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BaseMapOptionData

        public BaseMapOptionData()
      • BaseMapOptionData

        public BaseMapOptionData​(java.util.Map<java.lang.String,​java.lang.Object> options)
      • BaseMapOptionData

        public BaseMapOptionData​(java.lang.String json)
    • Method Detail

      • assignOptionValue

        public T assignOptionValue​(java.lang.String key,
                                   java.lang.Object value)
        Sets the given value on the data object.
        Parameters:
        key - Key name.
        value - The actual value to set.
        Returns:
        self instance for chaining.
      • getOptionValue

        public <R> java.util.Optional<R> getOptionValue​(java.lang.String name)
        Retrieves a value with the given name from a data object. This method does not perform any type transformation, but rather just tries to cast the received value to the given type, so be careful while providing a very specific result type value to not get a type cast error.
        Type Parameters:
        R - The expected value type.
        Parameters:
        name - Key name.
        Returns:
        The actual value.
      • toMap

        public java.util.Map<java.lang.String,​java.lang.Object> toMap()
      • toJson

        public com.google.gson.JsonObject toJson()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object