blob: 5c5008a5ab1905a88372289350e3d9bc2b1b15f2 [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.runtime.web.vaadin.databinding.properties;
import com.vaadin.data.Property;
public class PropertyInfo {
private final Object id;
private final Property<?> prop;
public PropertyInfo(Object id, Property<?> prop) {
super();
this.id = id;
this.prop = prop;
}
/**
* @return the id
*/
public Object getId() {
return id;
}
/**
* @return the prop
*/
public Property<?> getProperty() {
return prop;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((prop == null) ? 0 : prop.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
PropertyInfo other = (PropertyInfo) obj;
if (id == null) {
if (other.id != null) {
return false;
}
} else if (!id.equals(other.id)) {
return false;
}
if (prop == null) {
if (other.prop != null) {
return false;
}
} else if (!prop.equals(other.prop)) {
return false;
}
return true;
}
}