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

net.contextfw.web.application.configuration.SetProperty Maven / Gradle / Ivy

package net.contextfw.web.application.configuration;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class SetProperty extends BaseProperty> implements AddableProperty, V> {

    public SetProperty(String key) {
        super(key);
    }

    @Override
    public Set unserialize(String value) {
        return null;
    }

    @Override
    public String serialize(Set value) {
        return null;
    }

    @Override
    public Set validate(Set value) {
        if (value == null) {
            return Collections.emptySet();
        } else {
            return Collections.unmodifiableSet(value);
        }
    }

    @Override
    public Set add(Set collection, V value) {
        Set rv = new HashSet();
        if (collection != null) {
            rv.addAll(collection);
        }
        rv.add(value);
        return rv;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy