com.cosmicpush.gateway.internal.UserAgent Maven / Gradle / Ivy
/*
* Copyright (c) 2014 Jacob D. Parr
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cosmicpush.gateway.internal;
import com.fasterxml.jackson.annotation.*;
import org.crazyyak.dev.common.StringUtils;
//@JsonIgnoreProperties(ignoreUnknown = true)
public class UserAgent {
@JsonProperty
private String agentType;
@JsonProperty
private String agentName;
@JsonProperty
private String agentVersion;
@JsonProperty
private String agentLanguage;
@JsonProperty
private String agentLanguageTag;
@JsonProperty
private String osType;
@JsonProperty
private String osName;
@JsonProperty
private String osProducer;
@JsonProperty
private String osProducerUrl;
@JsonProperty
private String osVersionName;
@JsonProperty
private String osVersionNumber;
@JsonProperty
private String linuxDistibution;
private UserAgent() {
}
public UserAgent(String agentType, String agentName, String agentVersion, String agentLanguage, String agentLanguageTag, String osType, String osName, String osProducer, String osProducerUrl, String osVersionName, String osVersionNumber, String linuxDistibution) {
this.agentType = agentType;
this.agentName = agentName;
this.agentVersion = agentVersion;
this.agentLanguage = agentLanguage;
this.agentLanguageTag = agentLanguageTag;
this.osType = osType;
this.osName = osName;
this.osProducer = osProducer;
this.osProducerUrl = osProducerUrl;
this.osVersionName = osVersionName;
this.osVersionNumber = osVersionNumber;
this.linuxDistibution = linuxDistibution;
}
public String getAgentType() {
return agentType;
}
public String getAgentName() {
return agentName;
}
public String getAgentVersion() {
return agentVersion;
}
public String getAgentLanguage() {
return agentLanguage;
}
public String getAgentLanguageTag() {
return agentLanguageTag;
}
public String getOsType() {
return osType;
}
public String getOsName() {
return osName;
}
public String getOsProducer() {
return osProducer;
}
public String getOsProducerUrl() {
return osProducerUrl;
}
public String getOsVersionName() {
return osVersionName;
}
public String getOsVersionNumber() {
return osVersionNumber;
}
public String getLinuxDistibution() {
return linuxDistibution;
}
@JsonIgnore
public String getOs() {
String retVal = "";
if (osName != null) retVal = (retVal + " " + osName).trim();
if (osVersionNumber != null) retVal = (retVal + " " + osVersionNumber).trim();
if (osVersionName != null) retVal = (retVal + " " + osVersionName).trim();
return StringUtils.isBlank(retVal) ? null : retVal;
}
@JsonIgnore
public String getAgent() {
String retVal = "";
if (agentName != null) retVal = (retVal + " " + agentName).trim();
if (agentVersion != null) retVal = (retVal + " " + agentVersion).trim();
if (agentLanguage != null) retVal = (retVal + " " + agentLanguage).trim();
return StringUtils.isBlank(retVal) ? null : retVal;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy