com.almende.eve.capabilities.handler.SimpleHandler Maven / Gradle / Ivy
/*
* Copyright: Almende B.V. (2014), Rotterdam, The Netherlands
* License: The Apache Software License, Version 2.0
*/
package com.almende.eve.capabilities.handler;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* The Class SimpleHandler.
*
* @param
* the generic type
*/
public class SimpleHandler implements Handler {
private T referent = null;
/**
* Instantiates a new simple handler.
*
* @param referent
* the referent
*/
public SimpleHandler(final T referent) {
this.referent = referent;
}
/*
* (non-Javadoc)
*
* @see com.almende.eve.capabilities.handler.Handler#get()
*/
@Override
@JsonIgnore
public T get() {
return referent;
}
/* (non-Javadoc)
* @see com.almende.eve.capabilities.handler.Handler#getNoWait()
*/
@Override
@JsonIgnore
public T getNoWait() {
return referent;
}
/*
* (non-Javadoc)
*
* @see com.almende.eve.capabilities.handler.Handler#update(com.almende.eve.
* capabilities.handler.Handler)
*/
@Override
public void update(final Handler newHandler) {
this.referent = newHandler.get();
}
/*
* (non-Javadoc)
*
* @see com.almende.eve.capabilities.handler.Handler#getKey()
*/
@Override
public String getKey() {
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy