@ProtoField(number = 7) public void setAnalyzer(String analyzer) { this.analyzer = analyzer; } }
if (annotation.number() == 0) { throw new ProtoSchemaBuilderException("0 is not a valid Protobuf field number: " + field); String fieldName = annotation.name(); if (fieldName.isEmpty()) { fieldName = field.getName(); boolean isRequired = annotation.required(); if (isRepeated && isRequired) { throw new ProtoSchemaBuilderException("Repeated field '" + fieldName + "' of " + clazz + " cannot be marked required."); Class<?> javaType = annotation.javaType(); if (javaType == void.class) { if (isRepeated) { Object defaultValue = getDefaultValue(clazz, fieldName, javaType, annotation.defaultValue()); Class<?> collectionImplementation = getCollectionImplementation(clazz, field.getType(), annotation.collectionImplementation(), fieldName, isRepeated); Type protobufType = getProtobufType(javaType, annotation.type()); ProtoTypeMetadata protoTypeMetadata = null; if (protobufType == Type.ENUM || protobufType == Type.MESSAGE || protobufType == Type.GROUP) { protoTypeMetadata = protoSchemaGenerator.scanAnnotations(javaType); ProtoFieldMetadata fieldMetadata = new ProtoFieldMetadata(clazz, annotation.number(), fieldName, javaType, collectionImplementation, protobufType, protoTypeMetadata, isRequired, isRepeated, isArray, defaultValue, field); ProtoFieldMetadata existing = fieldsByNumber.get(annotation.number()); if (existing != null) {
@ProtoField(number = 1) public void setName(String name) { this.name = name; }
@ProtoField(number = 6) public void setSearchable(Boolean searchable) { this.searchable = searchable; }
@ProtoField(number = 3, javaType = Message.class, collectionImplementation = HashSet.class) public void setMessages(Set<Message> messages) { this.messages = messages; } }
@ProtoField(number = 4) public void setIndex(Integer index) { this.index = index; }
@ProtoField(number = 3, javaType = Message.class, collectionImplementation = HashSet.class) public void setMessages(Set<Message> messages) { this.messages = messages; } }
@ProtoField(number = 2, javaType = Field.class, collectionImplementation = HashSet.class) public void setFields(Set<Field> fields) { this.fields = fields; } }
@ProtoField(number = 7) public void setAnalyzer(String analyzer) { this.analyzer = analyzer; } }
@ProtoField(number = 2) public void setPkg(String pkg) { this.pkg = pkg; }
@ProtoField(number = 1) public void setScope(ProtobufScope scope) { this.scope = scope; }
@ProtoField(number = 2) public void setType(String type) { this.type = type; }
@ProtoField(number = 2, javaType = Field.class, collectionImplementation = HashSet.class) public void setFields(Set<Field> fields) { this.fields = fields; } }
@ProtoField(number = 1) public void setName(String name) { this.name = name; }
@ProtoField(number = 2) public void setPkg(String pkg) { this.pkg = pkg; }
@ProtoField(number = 1) public void setName(String name) { this.name = name; }
@ProtoField(number = 3) public void setName(String name) { this.name = name; }
@ProtoField(number = 5) public void setSortable(Boolean sortable) { this.sortable = sortable; }
@ProtoField(number = 1) public void setScope(ProtobufScope scope) { this.scope = scope; }
@ProtoField(number = 2) public void setType(String type) { this.type = type; }