org.terracotta.management.stats
Class ContextualStatistics
java.lang.Object
org.terracotta.management.stats.ContextualStatistics
- All Implemented Interfaces:
- Serializable, Iterable<Statistic<?,?>>
public final class ContextualStatistics
- extends Object
- implements Iterable<Statistic<?,?>>, Serializable
This class holds the Statistic list quered from a specific context
- Author:
- Mathieu Carbou
- See Also:
- Serialized Form
ContextualStatistics
public ContextualStatistics(String capability,
Context context,
Map<String,Statistic<?,?>> statistics)
getCapability
public String getCapability()
size
public int size()
isEmpty
public boolean isEmpty()
iterator
public Iterator<Statistic<?,?>> iterator()
- Specified by:
iterator in interface Iterable<Statistic<?,?>>
getStatistics
public Map<String,Statistic<?,?>> getStatistics()
getStatistic
public <T extends Statistic<?,?>> T getStatistic(Class<T> type)
throws NoSuchElementException
- Returns the only possible statistic for a specific type
- Type Parameters:
T - The Statistic type- Parameters:
type - The type of the statistic to return
- Returns:
- The statistic found
- Throws:
NoSuchElementException - If there is 0 or more than 1 statistic for given type
getStatistic
public <T extends Statistic<?,?>> T getStatistic(Class<T> type,
String name)
throws NoSuchElementException
- Returns the only possible statistic for a specific type and name
- Type Parameters:
T - The Statistic type- Parameters:
type - The type of the statistic to returnname - The name of the statistic to return
- Returns:
- The statistic found
- Throws:
NoSuchElementException - If there is 0 or more than 1 statistic for given type
getStatistics
public <T extends Statistic<?,?>> Map<String,T> getStatistics(Class<T> type)
getContext
public Context getContext()
toString
public String toString()
- Overrides:
toString in class Object
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
Copyright © 2016. All Rights Reserved.