All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.rpi.tw.twks.configuration.TwksGeoSPARQLConfiguration Maven / Gradle / Ivy

The newest version!
package edu.rpi.tw.twks.configuration;

import com.google.common.base.MoreObjects;

public final class TwksGeoSPARQLConfiguration extends AbstractConfiguration {
    private final boolean enable;

    private TwksGeoSPARQLConfiguration(final Builder builder) {
        this.enable = builder.getEnable();
    }

    public final static Builder builder() {
        return new Builder();
    }

    public final boolean getEnable() {
        return enable;
    }

    @Override
    protected final MoreObjects.ToStringHelper toStringHelper() {
        return super.toStringHelper().add("enable", enable);
    }

    public final static class Builder extends AbstractConfiguration.Builder {
        private boolean enable = PropertyDefinitions.ENABLE.getDefault();

        @Override
        public TwksGeoSPARQLConfiguration build() {
            return new TwksGeoSPARQLConfiguration(this);
        }

        public final boolean getEnable() {
            return enable;
        }

        public final Builder setEnable(final boolean enable) {
            this.enable = enable;
            markDirty();
            return this;
        }

        @Override
        public final Builder set(final ConfigurationWrapper properties) {
            properties.getBoolean(PropertyDefinitions.ENABLE).ifPresent(value -> setEnable(value));
            return this;
        }
    }

    private final static class PropertyDefinitions {
        public final static PropertyDefinitionWithDefault ENABLE = new PropertyDefinitionWithDefault<>(Boolean.FALSE, "enableGeoSPARQL");
//        public final static PropertyDefinition GEOMETRY_INDEX_SIZE = new PropertyDefinition("GeoSPARQLGeometryIndexSize");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy