Package com.tailf.navu
Class NavuChoice
Object
com.tailf.navu.NavuChoice
This class handles YANG presentation and setting of YANG choices.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if a given case node is a case of this choice.boolean
containsChoice
(MaapiSchemas.CSChoice choice) Checks if a choice is contained in a case of this choice.boolean
Checks if a node is contained directly within this choice.entrySet()
Deprecated.getCase
(MaapiSchemas.CSChoice choice) Returns the case in which a choice is contained within.getCase
(MaapiSchemas.CSNode node) Returns the case in which a node is contained within.getCaseChoices
(String casename) getCaseNodes
(String casename) getName()
Returns the choice name according to the YANG model.Returns the previous case of the choice.Returns the current case.boolean
Checks if a given case is the currently selected case.boolean
isEmpty()
Checks if it is an empty choice.boolean
isOper()
boolean
Checks if the node is writable.boolean
Checks if the node is writable for all data.put
(MaapiSchemas.CSNode node, MaapiSchemas.CSCase cAse) Adds node-case relation to the choice.void
putAll
(Map<? extends MaapiSchemas.CSNode, ? extends MaapiSchemas.CSCase> m) Adds a node-case map to the choice.int
size()
The number of cases contained in the choice.boolean
update()
values()
Return a list of cases contained within this choice.
-
Method Details
-
containsNode
Checks if a node is contained directly within this choice.- Parameters:
node
- - the schema node to check for.- Returns:
- true if is contained.
-
containsChoice
Checks if a choice is contained in a case of this choice.- Parameters:
choice
- - the schema choice to check for.- Returns:
- true if is contained.
-
containsCase
Checks if a given case node is a case of this choice.- Parameters:
cAse
- the case to check.- Returns:
- true if the case is contained.
-
entrySet
Deprecated.- Returns:
- a set of contained nodes with matching cases.
-
getCaseNodes
- Parameters:
casename
-- Returns:
- a set of CSNode for a give case name
-
getCaseChoices
- Parameters:
casename
-- Returns:
- a set of CSNode for a give case name
-
getCase
Returns the case in which a node is contained within.- Parameters:
node
- the node to get the case for.- Returns:
- a case matching the given node.
-
getCase
Returns the case in which a choice is contained within.- Parameters:
choice
- the choice to get the case for.- Returns:
- a case matching the given node.
-
getName
Returns the choice name according to the YANG model.- Returns:
- the name of the choice.
-
getPreviousCase
Returns the previous case of the choice.- Returns:
- the previous case. null if the case has not been changed.
-
getSelectedCase
Returns the current case.- Returns:
- the current case. null if no case has been selected yet.
-
isCurrentCase
Checks if a given case is the currently selected case.- Parameters:
cAse
- the case to check against.- Returns:
- true if it is a match.
-
isEmpty
public boolean isEmpty()Checks if it is an empty choice. I.e. if no case nodes exist.- Returns:
- true, if no nodes are contained in the choice.
-
put
Adds node-case relation to the choice.- Parameters:
node
-cAse
-- Returns:
- the inserted case.
-
putAll
Adds a node-case map to the choice.- Parameters:
m
- a node-case map.
-
size
public int size()The number of cases contained in the choice.- Returns:
- number of cases contained within the choice.
-
values
Return a list of cases contained within this choice.- Returns:
- a list of cases.
-
update
public boolean update()- Returns:
- true if the case was updated.
-
isOper
public boolean isOper() -
isWritable
public boolean isWritable()Checks if the node is writable.- Returns:
- true if the node is writable.
-
isWritableAll
public boolean isWritableAll()Checks if the node is writable for all data.- Returns:
- true if the node is writable for all data.
-