Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2013-2019 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*
* If the program is linked with libraries which are licensed under one of
* the following licenses, the combination of the program with the linked
* library is not considered a "derivative work" of the program:
*
* - Apache License, version 2.0
* - Apache Software License, version 1.0
* - GNU Lesser General Public License, version 3
* - Mozilla Public License, versions 1.0, 1.1 and 2.0
* - Common Development and Distribution License (CDDL), version 1.0
*
* Therefore the distribution of the program linked with libraries licensed
* under the aforementioned licenses, is permitted by the copyright holders
* if the distribution is compliant with both the GNU General Public License
* version 2 and the aforementioned licenses.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
package org.n52.io.response;
import java.text.Collator;
import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
import org.n52.io.request.IoParameters;
import org.n52.series.spi.srv.RawFormats;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract class ParameterOutput implements CollatorComparable, RawFormats {
public static final String ID = "id";
public static final String HREF = "href";
public static final String HREF_BASE = HREF;
public static final String DOMAIN_ID = "domainid";
public static final String LABEL = "label";
public static final String EXTRAS = "extras";
public static final String RAWFORMATS = "service";
private String id;
private OptionalOutput href;
private OptionalOutput hrefBase;
private OptionalOutput domainId;
private OptionalOutput label;
@Deprecated
private OptionalOutput license;
private OptionalOutput> extras;
private OptionalOutput> rawFormats;
public void setValue(String parameter,
T value,
IoParameters parameters,
Consumer> consumer) {
Set fields = parameters.getFields();
boolean serialize = fields.isEmpty() || fields.contains(parameter);
consumer.accept(OptionalOutput.of(value, serialize));
}
protected T getIfSerialized(OptionalOutput optional) {
return getIfSet(optional, false);
}
protected , E> T getIfSerializedCollection(OptionalOutput optional) {
return getIfSetCollection(optional, false);
}
protected Map getIfSerializedMap(OptionalOutput