Arr

zio.json.ast.Json$.Arr
See theArr companion object
final case class Arr(elements: Chunk[Json]) extends Json

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Json
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def asArray: Some[Chunk[Json]]

Attributes

Definition Classes
def isEmpty: Boolean
override def mapArray(f: Chunk[Json] => Chunk[Json]): Arr

Attributes

Definition Classes
override def mapArrayValues(f: Json => Json): Arr

Attributes

Definition Classes
def merge(that: Arr): Arr
def nonEmpty: Boolean

Inherited methods

final def arrayOrObject[X](or: => X, jsonArray: Chunk[Json] => X, jsonObject: Obj => X): X

Attributes

Inherited from:
Json
final def as[A](implicit decoder: JsonDecoder[A]): Either[String, A]

Attributes

Inherited from:
Json
def asBoolean: Option[Boolean]

Attributes

Inherited from:
Json
def asNull: Option[Unit]

Attributes

Inherited from:
Json
def asNumber: Option[Num]

Attributes

Inherited from:
Json
def asObject: Option[Obj]

Attributes

Inherited from:
Json
def asString: Option[String]

Attributes

Inherited from:
Json
final def delete(cursor: JsonCursor[_, _]): Either[String, Json]

Deletes json node specified by given cursor

Deletes json node specified by given cursor

Value parameters

cursor

Cursor which specifies node to delete

Attributes

Returns

Json without specified node if node specified by cursor exists, error otherwise

Inherited from:
Json
final override def equals(that: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Json -> Any
Inherited from:
Json
final def foldDown[A](initial: A)(f: (A, Json) => A): A

Attributes

Inherited from:
Json
final def foldDownSome[A](initial: A)(pf: PartialFunction[(A, Json), A]): A

Attributes

Inherited from:
Json
final def foldUp[A](initial: A)(f: (A, Json) => A): A

Attributes

Inherited from:
Json
final def foldUpSome[A](initial: A)(pf: PartialFunction[(A, Json), A]): A

Attributes

Inherited from:
Json
final def get[A <: Json](cursor: JsonCursor[_, A]): Either[String, A]

Attributes

Inherited from:
Json
final override def hashCode: Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Json -> Any
Inherited from:
Json
final def intersect(that: Json): Either[String, Json]

Intersects JSON values. If both values are Obj or Arr method returns intersections of its fields/elements, otherwise it returns error

Intersects JSON values. If both values are Obj or Arr method returns intersections of its fields/elements, otherwise it returns error

Attributes

Returns

Intersected json if type are compatible, error otherwise

Inherited from:
Json
def mapBoolean(f: Boolean => Boolean): Json

Attributes

Inherited from:
Json

Attributes

Inherited from:
Json
def mapObject(f: Obj => Obj): Json

Attributes

Inherited from:
Json
def mapObjectEntries(f: ((String, Json)) => (String, Json)): Json

Attributes

Inherited from:
Json
def mapObjectKeys(f: String => String): Json

Attributes

Inherited from:
Json

Attributes

Inherited from:
Json
def mapString(f: String => String): Json

Attributes

Inherited from:
Json
final def merge(that: Json): Json
  • merging objects results in a new objects with all pairs of both sides, with the right hand side being used on key conflicts

  • merging arrays results in all of the individual elements being merged

  • scalar values will be replaced by the right hand side

Attributes

Inherited from:
Json
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
final def relocate(from: JsonCursor[_, _], to: JsonCursor[_, _]): Either[String, Json]

Relocates Json node from location specified by from cursor to location specified by to cursor.

Relocates Json node from location specified by from cursor to location specified by to cursor.

Value parameters

from

Cursor which specifies node to relocate

to

Cursor which specifies location where to relocate node

Attributes

Returns

Json without specified node if node specified by cursor exists, error otherwise

Inherited from:
Json
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Json -> Any
Inherited from:
Json
final def transformAt[A <: Json](cursor: JsonCursor[_, A])(f: A => Json): Either[String, Json]

Transforms json node specified by given cursor

Transforms json node specified by given cursor

Type parameters

A

refined node type

Value parameters

cursor

Cursor which specifies node to transform

f

Function used to transform node

Attributes

Returns

Json with transformed node if node specified by cursor exists, error otherwise

Inherited from:
Json
final def transformDown(f: Json => Json): Json

Attributes

Inherited from:
Json
final def transformDownSome(pf: PartialFunction[Json, Json]): Json

Attributes

Inherited from:
Json
final def transformUp(f: Json => Json): Json

Attributes

Inherited from:
Json
final def transformUpSome(pf: PartialFunction[Json, Json]): Json

Attributes

Inherited from:
Json
final def widen: Json

Attributes

Inherited from:
Json