Record YamlMap

java.lang.Object
java.lang.Record
io.memoria.jutils.adapter.yaml.YamlMap
All Implemented Interfaces:
Yaml

public record YamlMap(io.vavr.collection.Map<java.lang.String,​java.lang.Object> map)
extends java.lang.Record
implements Yaml
  • Constructor Summary

    Constructors 
    Constructor Description
    YamlMap​(io.vavr.collection.Map<java.lang.String,​java.lang.Object> map)
    Creates an instance of a YamlMap record.
    YamlMap​(java.util.Map<java.lang.String,​java.lang.Object> conf)  
  • Method Summary

    Modifier and Type Method Description
    io.vavr.control.Option<java.lang.Boolean> asBoolean​(java.lang.String key)  
    io.vavr.control.Option<io.vavr.collection.List<java.lang.Boolean>> asBooleanList​(java.lang.String key)  
    io.vavr.control.Option<java.lang.Double> asDouble​(java.lang.String key)  
    io.vavr.control.Option<io.vavr.collection.List<java.lang.Double>> asDoubleList​(java.lang.String key)  
    io.vavr.control.Option<java.lang.Integer> asInteger​(java.lang.String key)  
    io.vavr.control.Option<io.vavr.collection.List<java.lang.Integer>> asIntegerList​(java.lang.String key)  
    io.vavr.control.Option<java.lang.Long> asLong​(java.lang.String key)  
    io.vavr.control.Option<io.vavr.collection.List<java.lang.Long>> asLongList​(java.lang.String key)  
    io.vavr.control.Option<java.lang.String> asString​(java.lang.String key)  
    io.vavr.control.Option<io.vavr.collection.List<java.lang.String>> asStringList​(java.lang.String key)  
    io.vavr.control.Option<Yaml> asYaml​(java.lang.String key)  
    boolean equals​(java.lang.Object o)
    Indicates whether some other object is "equal to" this one.
    int hashCode()
    Returns a hash code value for this object.
    io.vavr.collection.Map<java.lang.String,​java.lang.Object> map()
    Returns the value of the map record component.
    java.lang.String toString()
    Returns a string representation of this record.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • YamlMap

      public YamlMap​(java.util.Map<java.lang.String,​java.lang.Object> conf)
    • YamlMap

      public YamlMap​(io.vavr.collection.Map<java.lang.String,​java.lang.Object> map)
      Creates an instance of a YamlMap record.
      Parameters:
      map - the value for the map record component
  • Method Details

    • asBoolean

      public io.vavr.control.Option<java.lang.Boolean> asBoolean​(java.lang.String key)
      Specified by:
      asBoolean in interface Yaml
    • asBooleanList

      public io.vavr.control.Option<io.vavr.collection.List<java.lang.Boolean>> asBooleanList​(java.lang.String key)
      Specified by:
      asBooleanList in interface Yaml
    • asDouble

      public io.vavr.control.Option<java.lang.Double> asDouble​(java.lang.String key)
      Specified by:
      asDouble in interface Yaml
    • asDoubleList

      public io.vavr.control.Option<io.vavr.collection.List<java.lang.Double>> asDoubleList​(java.lang.String key)
      Specified by:
      asDoubleList in interface Yaml
    • asInteger

      public io.vavr.control.Option<java.lang.Integer> asInteger​(java.lang.String key)
      Specified by:
      asInteger in interface Yaml
    • asIntegerList

      public io.vavr.control.Option<io.vavr.collection.List<java.lang.Integer>> asIntegerList​(java.lang.String key)
      Specified by:
      asIntegerList in interface Yaml
    • asLong

      public io.vavr.control.Option<java.lang.Long> asLong​(java.lang.String key)
      Specified by:
      asLong in interface Yaml
    • asLongList

      public io.vavr.control.Option<io.vavr.collection.List<java.lang.Long>> asLongList​(java.lang.String key)
      Specified by:
      asLongList in interface Yaml
    • asString

      public io.vavr.control.Option<java.lang.String> asString​(java.lang.String key)
      Specified by:
      asString in interface Yaml
    • asStringList

      public io.vavr.control.Option<io.vavr.collection.List<java.lang.String>> asStringList​(java.lang.String key)
      Specified by:
      asStringList in interface Yaml
    • asYaml

      public io.vavr.control.Option<Yaml> asYaml​(java.lang.String key)
      Specified by:
      asYaml in interface Yaml
    • toString

      public java.lang.String toString()
      Returns a string representation of this record. The representation contains the name of the type, followed by the name and value of each of the record components.
      Specified by:
      toString in class java.lang.Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class java.lang.Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals​(java.lang.Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class java.lang.Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • map

      public io.vavr.collection.Map<java.lang.String,​java.lang.Object> map()
      Returns the value of the map record component.
      Specified by:
      map in interface Yaml
      Returns:
      the value of the map record component