private Set<Field> buildDefaultField(KProperty<?> prop, ProtobufType int32) { return Collections.singleton(this.createField(ProtobufScope.OPTIONAL, int32, this.sanitize(prop.getName()), prop.isSortable(), prop.isSearchable())); }
private Set<Field> buildDefaultField(KProperty<?> prop, ProtobufType int32) { return Collections.singleton(this.createField(ProtobufScope.OPTIONAL, int32, this.sanitize(prop.getName()), prop.isSortable(), prop.isSearchable())); }
new HashSet<>(Arrays.asList(String.class)), property.isSortable(), property.isSearchable())); new HashSet<>(Arrays.asList(Long.class)), property.isSortable(), property.isSearchable())); new HashSet<>(Arrays.asList(Long.class)), property.isSortable(), property.isSearchable())); new HashSet<>(Arrays.asList(String.class)), property.isSortable(), property.isSearchable())); new HashSet<>(Arrays.asList(property.getValue().getClass())), property.isSortable(), property.isSearchable()));
private MetaProperty newMetaProperty(final KProperty<?> property) { Set<Class<?>> types = new CopyOnWriteArraySet<Class<?>>() {{ add(property.getValue().getClass()); }}; return new MetaPropertyImpl(property.getName(), property.isSearchable(), property.isSortable(), types); } }
new HashSet<>(Arrays.asList(String.class)), property.isSortable(), property.isSearchable())); new HashSet<>(Arrays.asList(Long.class)), property.isSortable(), property.isSearchable())); new HashSet<>(Arrays.asList(Long.class)), property.isSortable(), property.isSearchable())); new HashSet<>(Arrays.asList(String.class)), property.isSortable(), property.isSearchable())); new HashSet<>(Arrays.asList(property.getValue().getClass())), property.isSortable(), property.isSearchable()));
public void updateMetaModel(final KObject object) { final MetaObject metaObject = metaModelStore.getMetaObject(object.getType().getName()); if (metaObject == null) { metaModelStore.add(newMetaObject(object)); } else { Optional.ofNullable(object.getProperties()) .ifPresent(kProperties -> { for (final KProperty property : object.getProperties()) { final Optional<MetaProperty> metaProperty = metaObject.getProperty(property.getName()); if (!metaProperty.isPresent()) { metaObject.addProperty(newMetaProperty(property)); } else { metaProperty.get().addType(property.getValue().getClass()); if (property.isSearchable()) { metaProperty.get().setAsSearchable(); } } } metaModelStore.update(metaObject); }); } }
MetaObject.META_OBJECT_FULL_TEXT, props.values().stream() .filter(kProperty -> kProperty.isSearchable() && !(kProperty.getValue() instanceof Boolean)) .map(kProperty -> String.valueOf(kProperty.getValue()).toLowerCase()) .collect(joining("\n")));
MetaObject.META_OBJECT_FULL_TEXT, props.values().stream() .filter(kProperty -> kProperty.isSearchable() && !(kProperty.getValue() instanceof Boolean)) .map(kProperty -> String.valueOf(kProperty.getValue()).toLowerCase()) .collect(joining("\n")));
if (property.isSearchable()) { return new IndexableField[]{new TextField(property.getName(), property.getValue().toString().toLowerCase(), if (property.isSearchable()) { return new IndexableField[]{new TextField(property.getName(), property.getValue().toString(), if (property.isSearchable()) { return new IndexableField[]{new TextField(property.getName(), ((Boolean) property.getValue()) ? "0" : "1", if (property.isSearchable()) { return new IndexableField[]{new LegacyIntField(property.getName(), (Integer) property.getValue(), if (property.isSearchable()) { return new IndexableField[]{new LegacyLongField(property.getName(), (Long) property.getValue(), if (property.isSearchable()) { return new IndexableField[]{new LegacyDoubleField(property.getName(), (Double) property.getValue(), if (property.isSearchable()) { return new IndexableField[]{new LegacyFloatField(property.getName(), (Float) property.getValue(), if (property.isSearchable()) {