
org.randombits.confluence.intercom.tracker.LocalTrackerConnection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of confluence-intercom Show documentation
Show all versions of confluence-intercom Show documentation
This is a support library for Confluence plugins, providing some
commonly-used classes and libraries.
The newest version!
package org.randombits.confluence.intercom.tracker;
/**
* Provides an object of a particular type.
*
* @author David Peterson
*/
public class LocalTrackerConnection implements TrackerConnection {
private final Object value;
/**
* Constructs the provider with the specified value.
*
* @param value
* The value to provide.
*/
public LocalTrackerConnection( Object value ) {
this.value = value;
}
/**
* Returns the value as an instance of the specified type, if the current
* value supports it. If the type
is null
or
* the value does not support it, null
is returned.
*/
public T getValue( Class type ) {
if ( type != null && type.isInstance( value ) )
return type.cast( value );
return null;
}
@Override
public String toString() {
return getClass().getSimpleName() + "[ " + value + " ]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy