Class SchemaSet
- java.lang.Object
-
- org.apache.curator.framework.schema.SchemaSet
-
public class SchemaSet extends java.lang.ObjectCollection of all schemas for a Curator instance
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SchemaSetgetDefaultSchemaSet()Return the default (empty) schema setstatic java.lang.StringgetNamedPath(CuratorFramework client, java.lang.String name)Utility to return a ZNode path for the given nameSchemagetNamedSchema(java.lang.String name)Return the schema with the given key/nameSchemagetSchema(java.lang.String path)Find the first matching schema for the path and return itjava.util.Collection<Schema>getSchemas()Return the schemasjava.lang.StringtoDocumentation()Build a user displayable documentation string for the schemas in this set
-
-
-
Constructor Detail
-
SchemaSet
public SchemaSet(java.util.List<Schema> schemas, boolean useDefaultSchema)
Define a schema set. Schemas are matched in a well defined order:- Exact match on full path (i.e. non-regex)
- Match on the first regex path, searched in the order given to this constructor
- Parameters:
schemas- the schemas for the set.useDefaultSchema- if true, return a default schema when there is no match. Otherwise, an exception is thrown
-
-
Method Detail
-
getDefaultSchemaSet
public static SchemaSet getDefaultSchemaSet()
Return the default (empty) schema set- Returns:
- default schema set
-
getSchemas
public java.util.Collection<Schema> getSchemas()
Return the schemas- Returns:
- schemas
-
getSchema
public Schema getSchema(java.lang.String path)
Find the first matching schema for the path and return it- Parameters:
path- ZNode full path- Returns:
- matching schema or a default schema
-
getNamedPath
public static java.lang.String getNamedPath(CuratorFramework client, java.lang.String name)
Utility to return a ZNode path for the given name- Parameters:
client- Curator clientname- path/schema name- Returns:
- ZNode path
-
getNamedSchema
public Schema getNamedSchema(java.lang.String name)
Return the schema with the given key/name- Parameters:
name- name- Returns:
- schema or null
-
toDocumentation
public java.lang.String toDocumentation()
Build a user displayable documentation string for the schemas in this set- Returns:
- documentation
-
-