joynr.vehicle.RadioStation Maven / Gradle / Ivy
/*
*
* Copyright (C) 2011 - 2016 BMW Car IT GmbH
*
* 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.
*/
// #####################################################
//#######################################################
//### ###
//## WARNING: This file is generated. DO NOT EDIT ##
//## All changes will be lost! ##
//### ###
//#######################################################
// #####################################################
package joynr.vehicle;
import java.io.Serializable;
import io.joynr.subtypes.JoynrType;
import joynr.vehicle.Country;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonIgnore;
// NOTE: serialVersionUID is not defined since we don't support Franca versions right now.
// The compiler will generate a serialVersionUID based on the class and its members
// (cf. http://docs.oracle.com/javase/6/docs/platform/serialization/spec/class.html#4100),
// which is probably more restrictive than what we want.
/**
* Record describing a Radio station
*/
@SuppressWarnings("serial")
public class RadioStation implements Serializable, JoynrType {
public static final int MAJOR_VERSION = 0;
public static final int MINOR_VERSION = 0;
@JsonProperty("name")
private String name;
@JsonProperty("trafficService")
private Boolean trafficService;
@JsonProperty("country")
private Country country;
/**
* Default Constructor
*/
public RadioStation() {
this.name = "";
this.trafficService = false;
this.country = Country.AUSTRALIA;
}
/**
* Copy constructor
*
* @param radioStationObj reference to the object to be copied
*/
public RadioStation(RadioStation radioStationObj) {
this.name = radioStationObj.name;
this.trafficService = radioStationObj.trafficService;
this.country = radioStationObj.country;
}
/**
* Parameterized constructor
*
* @param name The station name
* @param trafficService True, if the radio station provides a traffic service, false otherwise
* @param country The country, where the station is located
*/
public RadioStation(
String name,
Boolean trafficService,
Country country
) {
this.name = name;
this.trafficService = trafficService;
this.country = country;
}
/**
* Gets Name
*
* @return The station name
*/
@JsonIgnore
public String getName() {
return this.name;
}
/**
* Sets Name
*
* @param name The station name
*/
@JsonIgnore
public void setName(String name) {
this.name = name;
}
/**
* Gets TrafficService
*
* @return True, if the radio station provides a traffic service, false otherwise
*/
@JsonIgnore
public Boolean getTrafficService() {
return this.trafficService;
}
/**
* Sets TrafficService
*
* @param trafficService True, if the radio station provides a traffic service, false otherwise
*/
@JsonIgnore
public void setTrafficService(Boolean trafficService) {
this.trafficService = trafficService;
}
/**
* Gets Country
*
* @return The country, where the station is located
*/
@JsonIgnore
public Country getCountry() {
return this.country;
}
/**
* Sets Country
*
* @param country The country, where the station is located
*/
@JsonIgnore
public void setCountry(Country country) {
this.country = country;
}
/**
* Stringifies the class
*
* @return stringified class content
*/
@Override
public String toString() {
return "RadioStation ["
+ "name=" + this.name + ", "
+ "trafficService=" + this.trafficService + ", "
+ "country=" + this.country
+ "]";
}
/**
* Check for equality
*
* @param obj Reference to the object to compare to
* @return true, if objects are equal, false otherwise
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RadioStation other = (RadioStation) obj;
if (this.name == null) {
if (other.name != null) {
return false;
}
} else if (!this.name.equals(other.name)){
return false;
}
if (this.trafficService == null) {
if (other.trafficService != null) {
return false;
}
} else if (!this.trafficService.equals(other.trafficService)){
return false;
}
if (this.country == null) {
if (other.country != null) {
return false;
}
} else if (!this.country.equals(other.country)){
return false;
}
return true;
}
/**
* Calculate code for hashing based on member contents
*
* @return The calculated hash code
*/
@Override
public int hashCode() {
int result = 1;
final int prime = 31;
result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
result = prime * result + ((this.trafficService == null) ? 0 : this.trafficService.hashCode());
result = prime * result + ((this.country == null) ? 0 : this.country.hashCode());
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy