net.spals.appbuilder.graph.model.PrintableVertex Maven / Gradle / Ivy
The newest version!
package net.spals.appbuilder.graph.model;
import com.google.auto.value.AutoValue;
import com.google.inject.Key;
/**
* A {@link ServiceDAGVertex} wrapper which
* allows a caller to customize the separator
* string used in serializing the vertex.
*
* @author tkral
*/
@AutoValue
public abstract class PrintableVertex implements IServiceGraphVertex {
public static PrintableVertex createPrintableVertex(final IServiceGraphVertex delegate,
final String separator) {
return new AutoValue_PrintableVertex<>(delegate, separator);
}
abstract IServiceGraphVertex getDelegate();
abstract String getSeparator();
@Override
public Key getGuiceKey() {
return getDelegate().getGuiceKey();
}
@Override
public T getServiceInstance() {
return getDelegate().getServiceInstance();
}
@Override
public final String toString() {
return toString(getSeparator());
}
@Override
public String toString(final String separator) {
return getDelegate().toString(separator);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy