Class Accountables
toString(Accountable} can be used to quickly debug the nested structure of any
Accountable.
The namedAccountable and namedAccountables methods return type-safe,
point-in-time snapshots of the provided resources.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AccountablenamedAccountable(String description, long bytes) Returns an accountable with the provided description and bytes.static AccountablenamedAccountable(String description, Collection<Accountable> children, long bytes) Returns an accountable with the provided description, children and bytes.static AccountablenamedAccountable(String description, Accountable in) Augments an existing accountable with the provided description.static Collection<Accountable> namedAccountables(String prefix, Map<?, ? extends Accountable> in) Converts a map of resources to a collection.static StringReturns a String description of an Accountable and any nested resources.
-
Method Details
-
toString
Returns a String description of an Accountable and any nested resources. This is intended for development and debugging. -
namedAccountable
Augments an existing accountable with the provided description.The resource description is constructed in this format:
description [toString()]This is a point-in-time type safe view: consumers will not be able to cast or manipulate the resource in any way.
-
namedAccountable
Returns an accountable with the provided description and bytes. -
namedAccountables
public static Collection<Accountable> namedAccountables(String prefix, Map<?, ? extends Accountable> in) Converts a map of resources to a collection.The resource descriptions are constructed in this format:
prefix 'key' [toString()]This is a point-in-time type safe view: consumers will not be able to cast or manipulate the resources in any way.
-
namedAccountable
public static Accountable namedAccountable(String description, Collection<Accountable> children, long bytes) Returns an accountable with the provided description, children and bytes.The resource descriptions are constructed in this format:
description [toString()]This is a point-in-time type safe view: consumers will not be able to cast or manipulate the resources in any way, provided that the passed in children Accountables (and all their descendants) were created with one of the namedAccountable functions.
-