Skip to content

Commit

Permalink
HSEARCH-2172 Cache the string form representation for markers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Dec 19, 2016
1 parent d1a336c commit ff0d70b
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -16,17 +16,19 @@
public class ToStringNullMarker implements NullMarker {

private final Object indexNullAs;
private final String stringRepresentation;

public ToStringNullMarker(final Object indexNullAs) {
if ( indexNullAs == null ) {
throw new NullPointerException( "The constructor parameter is mandatory" );
}
this.indexNullAs = indexNullAs;
this.stringRepresentation = indexNullAs.toString();
}

@Override
public String nullRepresentedAsString() {
return indexNullAs.toString();
return stringRepresentation;
}

@Override
Expand All @@ -39,5 +41,4 @@ public String toString() {
return getClass().getSimpleName() + "[" + indexNullAs + "]";
}


}

0 comments on commit ff0d70b

Please sign in to comment.