org.ioc.commons.ui.impl.Field Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons-ext Show documentation
Show all versions of ioc-commons-ext Show documentation
Library which contains some extension classes for the library IOC-Commons.
It provides some interface definitions and some tool classes which are non-dependent from the used technology;
i.e. the classes and interfaces from this library do not depend on the choosen ioc-commons-implementation library.
package org.ioc.commons.ui.impl;
import org.ioc.commons.ui.IsWidget;
class Field {
private final String fieldName;
private final IsWidget fieldOwner;
public Field(String fieldName, IsWidget fieldOwner) {
this.fieldName = fieldName;
this.fieldOwner = fieldOwner;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((fieldName == null) ? 0 : fieldName.hashCode());
result = prime * result + ((fieldOwner == null) ? 0 : fieldOwner.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;
Field other = (Field) obj;
if (fieldName == null) {
if (other.fieldName != null)
return false;
} else if (!fieldName.equals(other.fieldName))
return false;
if (fieldOwner == null) {
if (other.fieldOwner != null)
return false;
} else if (!fieldOwner.equals(other.fieldOwner))
return false;
return true;
}
public String getFieldName() {
return fieldName;
}
public IsWidget getFieldOwner() {
return fieldOwner;
}
}