Skip to content

Commit

Permalink
Removed unnecessary builder
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Dec 11, 2023
1 parent 55c7ae1 commit e448d3d
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,9 @@ private static SemanticTextFieldMapper toType(FieldMapper in) {
return (SemanticTextFieldMapper) in;
}

private static Builder builder(FieldMapper in) {
return ((SemanticTextFieldMapper) in).builder;
}

public static class Builder extends FieldMapper.Builder {

private final Parameter<String> modelId = Parameter.stringParam("model_id", false, m -> builder(m).modelId.get(), null)
private final Parameter<String> modelId = Parameter.stringParam("model_id", false, m -> toType(m).fieldType().modelId, null)
.addValidator(v -> {
if (Strings.isEmpty(v)) {
throw new IllegalArgumentException("field [model_id] must be specified");
Expand Down

0 comments on commit e448d3d

Please sign in to comment.