YamlNode
Defines YAML node.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait YamlCollectiontrait YamlMappingclass YamlCollectionFacadetrait YamlSequencetrait YamlScalartrait YamlBooleanobject YamlNull.typetrait YamlNumbertrait YamlStringtrait YamlTimestampShow all
Members list
Value members
Concrete methods
Gets value in YAML mapping.
Gets value in YAML mapping.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
ClassCastException
if not YamlMapping
Gets value in YAML sequence.
Gets value in YAML sequence.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
ClassCastException
if not YamlSequence
Collects values with given mapping key while traversing nested mappings and sequences.
Collects values with given mapping key while traversing nested mappings and sequences.
import shampoo.yaml.{ Yaml, \\, given }
val yaml = Yaml.load("""
node:
name: localhost
users:
- id: 0
name: root
- id: 1000
name: lupita
""")
val names = (yaml \\ "name").map(_.as[String])
assert { names == Seq("localhost", "root", "lupita") }
Value parameters
- key
-
mappings key
Attributes
Gets node.
Gets node.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.util.NoSuchElementException
if key or value does not exist
Gets node.
Gets node.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
Constructs data.
Constructs data.
Value parameters
- constructor
-
data constructor
Attributes
Tests for key.
Tests for key.
Value parameters
- key
-
mapping key
Attributes
Gets keys.
Gets keys.
Attributes
Gets collection size.
Gets collection size.
Attributes
Gets key-node map.
Gets key-node map.
Attributes
Gets node sequence.
Gets node sequence.
Attributes
Inherited methods
Constructs data.
Optionally gets node.
Gets node as BigDecimal
.
Gets node as BigDecimal
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as BigDecimal
.
Gets node as BigDecimal
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as BigInt
.
Gets node as BigInt
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as BigInt
.
Gets node as BigInt
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as Boolean
.
Gets node as Boolean
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as Boolean
.
Gets node as Boolean
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as Double
.
Gets node as Double
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as Double
.
Gets node as Double
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as Float
.
Gets node as Float
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as Float
.
Gets node as Float
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as Instant
.
Gets node as Instant
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as Instant
.
Gets node as Instant
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as Int
.
Gets node as Int
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as Int
.
Gets node as Int
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as LocalDate
.
Gets node as LocalDate
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as LocalDate
.
Gets node as LocalDate
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as LocalDateTime
.
Gets node as LocalDateTime
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as LocalDateTime
.
Gets node as LocalDateTime
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as Long
.
Gets node as Long
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as Long
.
Gets node as Long
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as YamlMapping
.
Gets node as YamlMapping
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as YamlMapping
.
Gets node as YamlMapping
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as OffsetDateTime
.
Gets node as OffsetDateTime
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as OffsetDateTime
.
Gets node as OffsetDateTime
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node or returns default node.
Gets node or returns default node.
Value parameters
- default
-
default node
- key
-
mapping key
Attributes
- Inherited from:
- YamlMapping
Gets node as YamlSequence
.
Gets node as YamlSequence
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as YamlSequence
.
Gets node as YamlSequence
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Gets node as String
.
Gets node as String
.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Gets node as String
.
Gets node as String
.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Tests for empty.
Tests for null.
Tests for null.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
- Inherited from:
- YamlSequence
Tests for null.
Tests for null.
Value parameters
- key
-
mapping key
Attributes
- Throws
-
java.util.NoSuchElementException
if key does not exist
- Inherited from:
- YamlMapping
Tests for non-empty.
Reads constructed data.
Reads constructed data.
Value parameters
- index
-
sequence index
Attributes
- Throws
-
java.lang.IndexOutOfBoundsException
if index is out of bounds
java.lang.NullPointerExceptionif node is null
- Inherited from:
- YamlSequence
Reads constructed data.
Reads constructed data.
Value parameters
- constructor
-
data constructor
- key
-
mapping key
Attributes
- Throws
-
java.lang.NullPointerException
if node is null
java.util.NoSuchElementExceptionif key does not exist
- Inherited from:
- YamlMapping
Optionally reads constructed data.
Optionally reads constructed data.
Value parameters
- constructor
-
data constructor
- key
-
mapping key
Attributes
- Returns
-
Some
constructed data, orNone
if key does not exists or its associated node is null - Inherited from:
- YamlMapping
Reads constructed data or returns default value.
Reads constructed data or returns default value.
Value parameters
- constructor
-
data constructor
- key
-
mapping key
Attributes
- Returns
-
constructed data, or default value if key does not exist or its associated node is null
- Inherited from:
- YamlMapping