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

joynr.types.DiscoveryEntry Maven / Gradle / Ivy

There is a newer version: 1.25.0
Show newest version
		/*
		 *
		 * Copyright (C) 2011 - 2015 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.types;
import java.io.Serializable;

import io.joynr.subtypes.JoynrType;

import joynr.types.CommunicationMiddleware;
import joynr.types.ProviderQos;
import java.util.List;
import java.util.ArrayList;
import com.google.common.collect.Lists;

// 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.

/**
 */
@SuppressWarnings("serial")
public class DiscoveryEntry implements Serializable, JoynrType {
	private String domain;
	private String interfaceName;
	private String participantId;
	private ProviderQos qos;
	private List connections = Lists.newArrayList();

	/**
	 * Default Constructor
	 */
	public DiscoveryEntry() {
		this.domain = "";
		this.interfaceName = "";
		this.participantId = "";
		this.qos = new ProviderQos();
		this.connections = new ArrayList();
	}

	/**
	 * Copy constructor
	 *
	 * @param discoveryEntryObj reference to the object to be copied
	 */
	public DiscoveryEntry(DiscoveryEntry discoveryEntryObj) {
		this.domain = discoveryEntryObj.domain;
		this.interfaceName = discoveryEntryObj.interfaceName;
		this.participantId = discoveryEntryObj.participantId;
		this.qos = new ProviderQos(discoveryEntryObj.qos);
		this.connections = new ArrayList(discoveryEntryObj.connections);
	}

	/**
	 * Parameterized constructor
	 *
	 * @param domain the domain to register the provider with
	 * @param interfaceName the name of the provider interface
	 * @param participantId the participant ID of the provider
	 * @param qos the qos of the provider
	 * @param connections a list of communications middlewares that can be used to access the provider
	 */
	public DiscoveryEntry(
		String domain,
		String interfaceName,
		String participantId,
		ProviderQos qos,
		List connections
		) {
		this.domain = domain;
		this.interfaceName = interfaceName;
		this.participantId = participantId;
		this.qos = qos;
		this.connections = connections;
	}

	/**
	 * Gets Domain
	 *
	 * @return the domain to register the provider with
	 */
	public String getDomain() {
		return this.domain;
	}

	/**
	 * Sets Domain
	 *
	 * @param domain the domain to register the provider with
	 */
	public void setDomain(String domain) {
		this.domain = domain;
	}

	/**
	 * Gets InterfaceName
	 *
	 * @return the name of the provider interface
	 */
	public String getInterfaceName() {
		return this.interfaceName;
	}

	/**
	 * Sets InterfaceName
	 *
	 * @param interfaceName the name of the provider interface
	 */
	public void setInterfaceName(String interfaceName) {
		this.interfaceName = interfaceName;
	}

	/**
	 * Gets ParticipantId
	 *
	 * @return the participant ID of the provider
	 */
	public String getParticipantId() {
		return this.participantId;
	}

	/**
	 * Sets ParticipantId
	 *
	 * @param participantId the participant ID of the provider
	 */
	public void setParticipantId(String participantId) {
		this.participantId = participantId;
	}

	/**
	 * Gets Qos
	 *
	 * @return the qos of the provider
	 */
	public ProviderQos getQos() {
		return this.qos;
	}

	/**
	 * Sets Qos
	 *
	 * @param qos the qos of the provider
	 */
	public void setQos(ProviderQos qos) {
		this.qos = qos;
	}

	/**
	 * Gets Connections
	 *
	 * @return a list of communications middlewares that can be used to access the provider
	 */
	public List getConnections() {
		return this.connections;
	}

	/**
	 * Sets Connections
	 *
	 * @param connections a list of communications middlewares that can be used to access the provider
	 */
	public void setConnections(List connections) {
		this.connections = connections;
	}


	/**
	 * Stringifies the class
	 *
	 * @return stringified class content
	 */
	@Override
	public String toString() {
		return "DiscoveryEntry ["
		+ "domain=" + this.domain + ", "
		+ "interfaceName=" + this.interfaceName + ", "
		+ "participantId=" + this.participantId + ", "
		+ "qos=" + this.qos + ", "
		+ "connections=" + this.connections
		+ "]";
	}

	/**
	 * 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;
		DiscoveryEntry other = (DiscoveryEntry) obj;
		if (this.domain == null) {
			if (other.domain != null) {
				return false;
			}
		} else if (!this.domain.equals(other.domain)){
			return false;
		}
		if (this.interfaceName == null) {
			if (other.interfaceName != null) {
				return false;
			}
		} else if (!this.interfaceName.equals(other.interfaceName)){
			return false;
		}
		if (this.participantId == null) {
			if (other.participantId != null) {
				return false;
			}
		} else if (!this.participantId.equals(other.participantId)){
			return false;
		}
		if (this.qos == null) {
			if (other.qos != null) {
				return false;
			}
		} else if (!this.qos.equals(other.qos)){
			return false;
		}
		if (this.connections == null) {
			if (other.connections != null) {
				return false;
			}
		} else if (!this.connections.equals(other.connections)){
			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.domain == null) ? 0 : this.domain.hashCode());
		result = prime * result + ((this.interfaceName == null) ? 0 : this.interfaceName.hashCode());
		result = prime * result + ((this.participantId == null) ? 0 : this.participantId.hashCode());
		result = prime * result + ((this.qos == null) ? 0 : this.qos.hashCode());
		result = prime * result + ((this.connections == null) ? 0 : this.connections.hashCode());
		return result;
	}
}

	




© 2015 - 2024 Weber Informatics LLC | Privacy Policy