Class SecurityLevelConfig
- java.lang.Object
-
- com.inductiveautomation.ignition.common.auth.security.level.SecurityLevelConfig
-
- All Implemented Interfaces:
java.io.Serializable
public class SecurityLevelConfig extends java.lang.Object implements java.io.Serializable
A SecurityLevelConfig is a node on a security level tree which encapsulates the node's name, its description, and its children.- See Also:
SecurityLevelConfig.GsonAdapter
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SecurityLevelConfig.GsonAdapter
Support for Gson serialization and deserialization
-
Field Summary
Fields Modifier and Type Field Description static com.inductiveautomation.ignition.common.gson.Gson
GSON
-
Constructor Summary
Constructors Constructor Description SecurityLevelConfig(java.lang.String name)
SecurityLevelConfig(java.lang.String name, java.lang.String description, com.google.common.collect.ImmutableCollection<SecurityLevelConfig> children)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
static java.util.Optional<SecurityLevelConfig>
find(com.google.common.collect.ImmutableCollection<SecurityLevelConfig> children, java.lang.String... path)
java.util.Optional<SecurityLevelConfig>
find(java.lang.String... path)
static SecurityLevelConfig
fromJson(java.lang.String s)
static SecurityLevelConfig
fromJsonTree(com.inductiveautomation.ignition.common.gson.JsonElement jsonElement)
static com.google.common.collect.ImmutableSet<SecurityLevelConfig>
fromPaths(java.lang.String[]... paths)
Merges an arbitrary number of security level paths into a security level tree according to the merging behavior specified bymerge(SecurityLevelConfig...)
.com.google.common.collect.ImmutableSet<SecurityLevelConfig>
getChildren()
java.lang.String
getDescription()
java.lang.String
getName()
int
hashCode()
static com.google.common.collect.ImmutableSet<SecurityLevelConfig>
merge(SecurityLevelConfig... configs)
Given n number ofSecurityLevelConfigs
, merges them together such that for each duplicate security level (identified based on the security level name), the duplicates are merged so the resulting security level has the duplicate name, the description of the last duplicate security level in the given array, and children resulting from recursively merging them together using this method.java.lang.String
toJson()
com.inductiveautomation.ignition.common.gson.JsonElement
toJsonTree()
java.lang.String[][]
toPaths()
java.lang.String
toString()
-
-
-
Constructor Detail
-
SecurityLevelConfig
public SecurityLevelConfig(java.lang.String name)
-
SecurityLevelConfig
public SecurityLevelConfig(java.lang.String name, java.lang.String description, com.google.common.collect.ImmutableCollection<SecurityLevelConfig> children)
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getDescription
public java.lang.String getDescription()
-
getChildren
public com.google.common.collect.ImmutableSet<SecurityLevelConfig> getChildren()
-
find
public static java.util.Optional<SecurityLevelConfig> find(com.google.common.collect.ImmutableCollection<SecurityLevelConfig> children, java.lang.String... path)
-
find
public java.util.Optional<SecurityLevelConfig> find(java.lang.String... path)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
fromJson
public static SecurityLevelConfig fromJson(java.lang.String s)
-
fromJsonTree
public static SecurityLevelConfig fromJsonTree(com.inductiveautomation.ignition.common.gson.JsonElement jsonElement)
-
toJson
public java.lang.String toJson()
-
toJsonTree
public com.inductiveautomation.ignition.common.gson.JsonElement toJsonTree()
-
merge
public static com.google.common.collect.ImmutableSet<SecurityLevelConfig> merge(SecurityLevelConfig... configs)
Given n number ofSecurityLevelConfigs
, merges them together such that for each duplicate security level (identified based on the security level name), the duplicates are merged so the resulting security level has the duplicate name, the description of the last duplicate security level in the given array, and children resulting from recursively merging them together using this method. All nullSecurityLevelConfig
s are ignored.- Parameters:
configs
- theSecurityLevelConfigs
to merge- Returns:
- the merged
ImmutableSet
ofSecurityLevelConfigs
-
fromPaths
public static com.google.common.collect.ImmutableSet<SecurityLevelConfig> fromPaths(java.lang.String[]... paths)
Merges an arbitrary number of security level paths into a security level tree according to the merging behavior specified by
merge(SecurityLevelConfig...)
.Each security level path is represented as a
String
array where the element at position n represents the name of the node at level n + 1 of a security level sub-tree under the root public node containing only the nodes specified in the path.The resultant security level tree is represented as an
ImmutableSet
ofSecurityLevelConfig
s where each member of the collection is:- A direct child of the implied root Public security level
- Itself the root of a security level sub-tree
Any null paths or paths with no elements are ignored.
- Parameters:
paths
- the security levels paths to merge- Returns:
- the security level tree
- See Also:
merge(SecurityLevelConfig...)
-
toPaths
public java.lang.String[][] toPaths()
- Returns:
- a flattened array of security level paths from the root node of this security level config tree to the leaf nodes
-
-