Package io.github.qishr.cascara.common.property
Class Properties
java.lang.Object
io.github.qishr.cascara.common.property.Properties
All Implemented Interfaces:
TabularData, Duplicable<Properties>, Iterable<Property<?>>
Direct Known Subtypes:
JarManifest
public class Properties
Nested Class Summary
| Modifier and Type | Class | Description |
|---|---|---|
| public static | io.github.qishr.cascara.common.property.Properties.PropertyParser |
Constructor Summary
| Constructor | Description |
|---|---|
| Properties() |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public boolean | containsKey(String k) | |
| public Map<String, Object> | getValuesMap() | |
| public List<Property<?>> | asList() | |
| public Property |
getProperty(String name) | |
| public Object | getValue(String name) | |
| public T | get(String name) | |
| public String | getString(String name) | |
| public String | getString(String name, String defaultValue) | |
| public int | getInt(String name, int defaultValue) | |
| public long | getLong(String name, long defaultValue) | |
| public double | getDouble(String name, double defaultValue) | |
| public double | getNumber(String name, double defaultValue) | For consistency with JSONSchema |
| public long | getInteger(String name, long defaultValue) | For consistency with JSONSchema |
| public boolean | getBoolean(String name, boolean defaultValue) | |
| public Properties | set(String name, Object value) | |
| public Properties | set(String k, double v) | |
| public Properties | set(String k, int v) | |
| public Properties | set(String k, boolean v) | |
| public Properties | addAll(Properties properties) | |
| public Properties | add(Property<?> property) | |
| public Properties | add(String name, Object value) | |
| public Object[] | getValues() | |
| public void | remove(String k) | |
| public void | remove(Property<?> property) | |
| public void | clear() | |
| public boolean | isEmpty() | |
| public Properties | duplicate() | |
| public String | toString() | |
| public Iterator<Property<?>> | iterator() | Returns Iterator instance |
| public static Properties | fromSystemProperties() | |
| public static Properties | parse(String text) | |
| public static Properties | load(Path path) |
Method Details
containsKey
public boolean containsKey(String k)
getValuesMap
public Map<String, Object> getValuesMap()
Specified By:
asList
public List<Property<?>> asList()
getProperty
@io.github.qishr.cascara.common.annotation.Nullable
public Property
getValue
public Object getValue(String name)
Specified By:
get
@io.github.qishr.cascara.common.annotation.Nullable
public T get(String name)
getString
@io.github.qishr.cascara.common.annotation.Nullable
public String getString(String name)
Specified By:
getString
public String getString(String name, String defaultValue)
getInt
public int getInt(String name, int defaultValue)
getLong
public long getLong(String name, long defaultValue)
getDouble
public double getDouble(String name, double defaultValue)
getNumber
public double getNumber(String name, double defaultValue)
For consistency with JSONSchema
getInteger
public long getInteger(String name, long defaultValue)
For consistency with JSONSchema
getBoolean
public boolean getBoolean(String name, boolean defaultValue)
set
public Properties set(String name, Object value)
set
public Properties set(String k, double v)
set
public Properties set(String k, int v)
set
public Properties set(String k, boolean v)
addAll
public Properties addAll(Properties properties)
add
public Properties add(Property<?> property)
add
public Properties add(String name, Object value)
getValues
public Object[] getValues()
Specified By:
remove
public void remove(String k)
remove
public void remove(Property<?> property)
clear
public void clear()
isEmpty
public boolean isEmpty()
duplicate
public Properties duplicate()
Specified By:
toString
public String toString()
Overrides:
iterator
public Iterator<Property<?>> iterator()
Returns Iterator instance
Specified By:
fromSystemProperties
public static Properties fromSystemProperties()
parse
public static Properties parse(String text)
load
public static Properties load(Path path)
Throws: