Package jsonvalues
Class JsPair
- java.lang.Object
-
- jsonvalues.JsPair
-
public final class JsPair extends Object
Immutable pair which represents a value and its location: (path, value).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object that)
Returns true if that is a pair and both represents the same element at the same location.int
hashCode()
Returns the hashcode of this pair.static JsPair
of(String key, boolean b)
Returns a json pair from the key and the boolean.static JsPair
of(String key, double d)
Returns a json pair from the key and the double.static JsPair
of(String key, int i)
Returns a json pair from the key and the integer.static JsPair
of(String key, long l)
Returns a json pair from the key and the long.static JsPair
of(String key, String s)
Returns a json pair from the key and the string.static JsPair
of(String key, BigDecimal bd)
Returns a json pair from the key and the big decimal.static JsPair
of(String key, BigInteger bi)
Returns a json pair from the key and the big integer.static JsPair
of(JsPath path, boolean b)
Returns a json pair from the path and the boolean.static JsPair
of(JsPath path, double d)
Returns a json pair from the path and the double.static JsPair
of(JsPath path, int i)
Returns a json pair from the path and the integer.static JsPair
of(JsPath path, long l)
Returns a json pair from the path and the long.static JsPair
of(JsPath path, String s)
Returns a json pair from the path and the string.static JsPair
of(JsPath path, BigDecimal bd)
Returns a json pair from the path and the big decimal.static JsPair
of(JsPath path, BigInteger bi)
Returns a json pair from the path and the big integer.static JsPair
of(JsPath path, JsValue elem)
Returns a json pair from the path and the json element.String
toString()
-
-
-
Method Detail
-
of
public static JsPair of(JsPath path, JsValue elem)
Returns a json pair from the path and the json element.- Parameters:
path
- the JsPath objectelem
- the JsElem- Returns:
- an immutable JsPair
-
of
public static JsPair of(JsPath path, int i)
Returns a json pair from the path and the integer.- Parameters:
path
- the JsPathi
- the integer- Returns:
- an immutable JsPair
-
of
public static JsPair of(String key, int i)
Returns a json pair from the key and the integer.- Parameters:
key
- the keyi
- the integer- Returns:
- an immutable JsPair
-
of
public static JsPair of(JsPath path, double d)
Returns a json pair from the path and the double.- Parameters:
path
- the JsPathd
- the double- Returns:
- an immutable JsPair
-
of
public static JsPair of(String key, double d)
Returns a json pair from the key and the double.- Parameters:
key
- the keyd
- the double- Returns:
- an immutable JsPair
-
of
public static JsPair of(JsPath path, long l)
Returns a json pair from the path and the long.- Parameters:
path
- the JsPathl
- the long- Returns:
- an immutable JsPair
-
of
public static JsPair of(String key, long l)
Returns a json pair from the key and the long.- Parameters:
key
- the keyl
- the long- Returns:
- an immutable JsPair
-
of
public static JsPair of(JsPath path, boolean b)
Returns a json pair from the path and the boolean.- Parameters:
path
- the JsPathb
- the boolean- Returns:
- an immutable JsPair
-
of
public static JsPair of(String key, boolean b)
Returns a json pair from the key and the boolean.- Parameters:
key
- the keyb
- the boolean- Returns:
- an immutable JsPair
-
of
public static JsPair of(JsPath path, String s)
Returns a json pair from the path and the string.- Parameters:
path
- the JsPaths
- the string- Returns:
- an immutable JsPair
-
of
public static JsPair of(String key, String s)
Returns a json pair from the key and the string.- Parameters:
key
- the JsPaths
- the string- Returns:
- an immutable JsPair
-
of
public static JsPair of(JsPath path, BigDecimal bd)
Returns a json pair from the path and the big decimal.- Parameters:
path
- the JsPathbd
- the big decimal- Returns:
- an immutable JsPair
-
of
public static JsPair of(String key, BigDecimal bd)
Returns a json pair from the key and the big decimal.- Parameters:
key
- the keybd
- the big decimal- Returns:
- an immutable JsPair
-
of
public static JsPair of(JsPath path, BigInteger bi)
Returns a json pair from the path and the big integer.- Parameters:
path
- the JsPathbi
- the big integer- Returns:
- an immutable JsPair
-
of
public static JsPair of(String key, BigInteger bi)
Returns a json pair from the key and the big integer.- Parameters:
key
- the keybi
- the big integer- Returns:
- an immutable JsPair
-
hashCode
public int hashCode()
Returns the hashcode of this pair.
-
equals
public boolean equals(Object that)
Returns true if that is a pair and both represents the same element at the same location.
-
-