If you want to modify the logging of reference values you can either just silence it using ref() rather than ref(String) or you need to instantiate the SelfDescribingReferenceImpl by yourself and override the method describeValue(Description).
This is for example needed if the toString() method of the value is way to chatty.
Either the value should be truncated automatically at a given length (but what?) or another alternative is to provide a factory method which comes with a matching toString-converter for a given value. Example API:
Reference<MyObject> ref = References.ref("D", new ToStringProvider<MyObject>() {
public String describe(MyObject m) {
...
});
A default implementation of the ToStringProvider() could just add automatic truncation so both solutions are available.
If you want to modify the logging of reference values you can either just silence it using
ref()rather thanref(String)or you need to instantiate theSelfDescribingReferenceImplby yourself and override the methoddescribeValue(Description).This is for example needed if the
toString()method of the value is way to chatty.Either the value should be truncated automatically at a given length (but what?) or another alternative is to provide a factory method which comes with a matching toString-converter for a given value. Example API:
A default implementation of the
ToStringProvider()could just add automatic truncation so both solutions are available.