Interface ReadOnlyAstObject

All Superinterfaces:
ReadOnlyAstNode
All Known Subinterfaces:
AstObject, Config, NativeAstObject
All Known Implementing Classes:
AstObjectWrapper, ChildConfig, ConfigImpl, ImmutableAstObject, MapAstObject, MapBasedAstObject, ReadOnlyAstObjectWrapper, ReadOnlyMergedAstObject, RootConfig

public interface ReadOnlyAstObject extends ReadOnlyAstNode
Author:
Bruno Salmon
  • Method Details

    • has

      default boolean has(String key)
      Test whether a given key has present.
    • keys

      All keys of the object.
    • size

      default int size()
      Specified by:
      size in interface ReadOnlyAstNode
    • get

      <T> T get(String key)
      Return the element as a value or wrapped object/array.
    • isObject

      default boolean isObject(String key)
    • isArray

      default boolean isArray(String key)
    • isScalar

      default boolean isScalar(String key)
    • getObject

      default ReadOnlyAstObject getObject(String key)
      Return the element as a JsonObject. If the type is not an object, this can result in runtime errors.
    • getArray

      default ReadOnlyAstArray getArray(String key)
      Return the element as a JsonArray. If the type is not an array, this can result in runtime errors.
    • getScalar

      default <T> T getScalar(String key)
    • getScalar

      default <T> T getScalar(String key, T defaultValue)
    • isTrue

      default boolean isTrue(String key)
    • getBoolean

      default Boolean getBoolean(String key)
      Return the element as a boolean. If the type is not a boolean, this can result in runtime errors.
    • getBoolean

      default Boolean getBoolean(String key, Boolean defaultValue)
      Return the element as a boolean. If the type is not a boolean, this can result in runtime errors.
    • getString

      default String getString(String key)
      Return the element as a String. If the type is not a String, this can result in runtime errors.
    • getString

      default String getString(String key, String defaultValue)
      Return the element as a String. If the type is not a String, this can result in runtime errors.
    • getInteger

      default Integer getInteger(String key)
      Return the element as an int. If the type is not a int, this can result in runtime errors.
    • getInteger

      default Integer getInteger(String key, Integer defaultValue)
      Return the element as an int. If the type is not a int, this can result in runtime errors.
    • getLong

      default Long getLong(String key)
      Return the element as a long. If the type is not a long, this can result in runtime errors.
    • getLong

      default Long getLong(String key, Long defaultValue)
      Return the element as a long. If the type is not a long, this can result in runtime errors.
    • getDouble

      default Double getDouble(String key)
      Return the element as a double. If the type is not a double, this can result in runtime errors.
    • getDouble

      default Double getDouble(String key, Double defaultValue)
      Return the element as a double. If the type is not a double, this can result in runtime errors.
    • getInstant

      default Instant getInstant(String key)
      Return the element as an instant. If the type is not an instant, this can result in runtime errors.
    • getInstant

      default Instant getInstant(String key, Instant defaultValue)
      Return the element as an instant. If the type is not an instant, this can result in runtime errors.