public abstract class AbstractMonitoringRecord extends java.lang.Object implements IMonitoringRecord
IMonitoringRecord.BinaryFactory, IMonitoringRecord.Factory
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_SIZE_BOOLEAN |
static int |
TYPE_SIZE_BYTE |
static int |
TYPE_SIZE_CHARACTER |
static int |
TYPE_SIZE_DOUBLE |
static int |
TYPE_SIZE_FLOAT |
static int |
TYPE_SIZE_INT |
static int |
TYPE_SIZE_LONG |
static int |
TYPE_SIZE_SHORT |
static int |
TYPE_SIZE_STRING |
Constructor and Description |
---|
AbstractMonitoringRecord() |
Modifier and Type | Method and Description |
---|---|
static void |
checkArray(java.lang.Object[] values,
java.lang.Class<?>[] valueTypes)
This method checks the given arrays, making sure that they have the same length and that the value elements are compatible with the given value types.
|
static java.lang.Class<? extends IMonitoringRecord> |
classForName(java.lang.String classname)
This method tries to find a monitoring record class with the given name.
|
int |
compareTo(IMonitoringRecord otherRecord)
Provides an ordering of IMonitoringRecords by the loggingTimestamp.
|
static IMonitoringRecord |
createFromArray(java.lang.Class<? extends IMonitoringRecord> clazz,
java.lang.Object[] values)
This method creates a new monitoring record from the given data.
|
static IMonitoringRecord |
createFromArray(java.lang.String recordClassName,
java.lang.Object[] values) |
static IMonitoringRecord |
createFromDeserializer(java.lang.String recordClassName,
IValueDeserializer deserializer) |
static IMonitoringRecord |
createFromStringArray(java.lang.Class<? extends IMonitoringRecord> clazz,
java.lang.String[] values)
This method creates a new monitoring record from the given data encoded in strings.
|
boolean |
equals(java.lang.Object obj)
Performs a null-check, a this-check, and a class-check.
|
static java.lang.Object[] |
fromStringArrayToTypedArray(java.lang.String[] recordFields,
java.lang.Class<?>[] valueTypes)
This helper method converts the given array with string objects into an array containing objects from the specified type.
|
long |
getLoggingTimestamp()
Delivers the current timestamp of the record.
|
int |
hashCode() |
protected static boolean |
isNotEqual(double x,
double y) |
protected static boolean |
isNotEqual(float x,
float y) |
void |
setLoggingTimestamp(long timestamp)
Sets the logging timestamp to a new value.
|
java.lang.String |
toString()
Creates a string representation of this record.
This method should not be used for serialization purposes since this is not the purpose of Object's toString method. |
static java.lang.Class<?>[] |
typesForClass(java.lang.Class<? extends IMonitoringRecord> clazz)
This method delivers the types array of the given class, either by finding the declared field (in case of a factory record) or via the
getValueTypes
method. |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getSize, getValueNames, getValueTypes, initFromArray, registerStrings, serialize, toArray
public static final int TYPE_SIZE_INT
public static final int TYPE_SIZE_LONG
public static final int TYPE_SIZE_FLOAT
public static final int TYPE_SIZE_DOUBLE
public static final int TYPE_SIZE_SHORT
public static final int TYPE_SIZE_BYTE
public static final int TYPE_SIZE_CHARACTER
public static final int TYPE_SIZE_STRING
public static final int TYPE_SIZE_BOOLEAN
protected static boolean isNotEqual(double x, double y)
protected static boolean isNotEqual(float x, float y)
public final long getLoggingTimestamp()
IMonitoringRecord
getLoggingTimestamp
in interface IMonitoringRecord
public final void setLoggingTimestamp(long timestamp)
IMonitoringRecord
setLoggingTimestamp
in interface IMonitoringRecord
timestamp
- The new timestamp for the record.public final java.lang.String toString()
IMonitoringRecord
toString
in interface IMonitoringRecord
toString
in class java.lang.Object
public int compareTo(IMonitoringRecord otherRecord)
compareTo
in interface java.lang.Comparable<IMonitoringRecord>
otherRecord
- The record to be compared.public boolean equals(java.lang.Object obj)
Performs a null-check, a this-check, and a class-check. Moreover, it checks each attribute for equality.
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public static final void checkArray(java.lang.Object[] values, java.lang.Class<?>[] valueTypes)
IllegalArgumentException
.values
- The values.valueTypes
- The value types.public static final java.lang.Object[] fromStringArrayToTypedArray(java.lang.String[] recordFields, java.lang.Class<?>[] valueTypes) throws java.lang.IllegalArgumentException
valueOf
methods).recordFields
- The array containing the string objects.valueTypes
- The array containing the types the new array will have.java.lang.IllegalArgumentException
- If one or more of the given types are not supported.public static final java.lang.Class<? extends IMonitoringRecord> classForName(java.lang.String classname) throws MonitoringRecordException
classname
- The name of the class.Class
instance corresponding to the given name, if it exists.MonitoringRecordException
- If either a class with the given name could not be found or if the class doesn't implement IMonitoringRecord
.public static final java.lang.Class<?>[] typesForClass(java.lang.Class<? extends IMonitoringRecord> clazz) throws MonitoringRecordException
getValueTypes
method.clazz
- The record class.MonitoringRecordException
- If this method failed to access the value types.public static final IMonitoringRecord createFromArray(java.lang.Class<? extends IMonitoringRecord> clazz, java.lang.Object[] values) throws MonitoringRecordException
clazz
- The class of the monitoring record.values
- The array which will be used to initialize the fields of the record.MonitoringRecordException
- If this method failed to create the record for some reason.public static final IMonitoringRecord createFromStringArray(java.lang.Class<? extends IMonitoringRecord> clazz, java.lang.String[] values) throws MonitoringRecordException
clazz
- The class of the monitoring record.values
- The string array which will be used to initialize the fields of the record.MonitoringRecordException
- If this method failed to create the record for some reason.public static final IMonitoringRecord createFromDeserializer(java.lang.String recordClassName, IValueDeserializer deserializer) throws java.nio.BufferUnderflowException, MonitoringRecordException
java.nio.BufferUnderflowException
MonitoringRecordException
public static final IMonitoringRecord createFromArray(java.lang.String recordClassName, java.lang.Object[] values) throws MonitoringRecordException
MonitoringRecordException
Copyright 2017 Kieker Project, http://kieker-monitoring.net