Package org.onosproject.ui.topo
Class NodeBadge
- java.lang.Object
-
- org.onosproject.ui.topo.NodeBadge
-
public final class NodeBadge extends Object
Designates a badge to be applied to a node in the topology view.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeBadge.Status
Designates the badge status.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeBadge
glyph(String gid)
Returns a glyph badge, with default status.static NodeBadge
glyph(NodeBadge.Status s, String gid)
Returns a glyph badge, with the given status.static NodeBadge
glyph(NodeBadge.Status s, String gid, String msg)
Returns a glyph badge, with the given status and optional message.boolean
isGlyph()
Returns true if the text for this badge designates a glyph ID.String
message()
Returns the message associated with the badge.static NodeBadge
number(int n)
Returns a numeric badge, with default status.static NodeBadge
number(NodeBadge.Status s, int n)
Returns a numeric badge, with the given status and optional message.static NodeBadge
number(NodeBadge.Status s, int n, String msg)
Returns a numeric badge, with the given status and optional message.NodeBadge.Status
status()
Returns the badge status.String
text()
Returns the text for the badge.static NodeBadge
text(String txt)
Returns an arbitrary text badge, with default status.static NodeBadge
text(NodeBadge.Status s, String txt)
Returns an arbitrary text badge, with the given status.static NodeBadge
text(NodeBadge.Status s, String txt, String msg)
Returns an arbitrary text badge, with the given status and optional message.String
toString()
-
-
-
Method Detail
-
status
public NodeBadge.Status status()
Returns the badge status.- Returns:
- badge status
-
isGlyph
public boolean isGlyph()
Returns true if the text for this badge designates a glyph ID.- Returns:
- true if badge uses glyph
-
text
public String text()
Returns the text for the badge. Note that ifisGlyph
is true, the text is a glyph ID, otherwise the text is displayed verbatim in the badge.- Returns:
- text for badge
-
message
public String message()
Returns the message associated with the badge.- Returns:
- associated message
-
text
public static NodeBadge text(String txt)
Returns an arbitrary text badge, with default status.- Parameters:
txt
- the text- Returns:
- node badge to display text
-
glyph
public static NodeBadge glyph(String gid)
Returns a glyph badge, with default status.- Parameters:
gid
- the glyph ID- Returns:
- node badge to display glyph
-
number
public static NodeBadge number(int n)
Returns a numeric badge, with default status.- Parameters:
n
- the number- Returns:
- node badge to display a number
-
text
public static NodeBadge text(NodeBadge.Status s, String txt)
Returns an arbitrary text badge, with the given status.- Parameters:
s
- the statustxt
- the text- Returns:
- node badge to display text
-
glyph
public static NodeBadge glyph(NodeBadge.Status s, String gid)
Returns a glyph badge, with the given status.- Parameters:
s
- the statusgid
- the glyph ID- Returns:
- node badge to display glyph
-
number
public static NodeBadge number(NodeBadge.Status s, int n)
Returns a numeric badge, with the given status and optional message.- Parameters:
s
- the statusn
- the number- Returns:
- node badge to display a number
-
text
public static NodeBadge text(NodeBadge.Status s, String txt, String msg)
Returns an arbitrary text badge, with the given status and optional message.- Parameters:
s
- the statustxt
- the textmsg
- the optional message- Returns:
- node badge to display text
-
glyph
public static NodeBadge glyph(NodeBadge.Status s, String gid, String msg)
Returns a glyph badge, with the given status and optional message.- Parameters:
s
- the statusgid
- the glyph IDmsg
- the optional message- Returns:
- node badge to display glyph
-
number
public static NodeBadge number(NodeBadge.Status s, int n, String msg)
Returns a numeric badge, with the given status and optional message.- Parameters:
s
- the statusn
- the numbermsg
- the optional message- Returns:
- node badge to display a number
-
-