public class Accountables extends Object
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.
Modifier and Type | Method and Description |
---|---|
static Accountable |
namedAccountable(String description,
Accountable in)
Augments an existing accountable with the provided description.
|
static Accountable |
namedAccountable(String description,
Collection<Accountable> children,
long bytes)
Returns an accountable with the provided description, children and bytes.
|
static Accountable |
namedAccountable(String description,
long bytes)
Returns an accountable with the provided description and bytes.
|
static Collection<Accountable> |
namedAccountables(String prefix,
Map<?,? extends Accountable> in)
Converts a map of resources to a collection.
|
static String |
toString(Accountable a)
Returns a String description of an Accountable and any nested resources.
|
public static String toString(Accountable a)
public static Accountable namedAccountable(String description, Accountable in)
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.
public static Accountable namedAccountable(String description, long bytes)
public static Collection<Accountable> namedAccountables(String prefix, Map<?,? extends Accountable> in)
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.
public static Accountable namedAccountable(String description, Collection<Accountable> children, long 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.
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.