com.remondis.remap.Projection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of remap Show documentation
Show all versions of remap Show documentation
A declarative mapping library for converting objects field by field.
package com.remondis.remap;
/**
* This class defines a projection from a type to another type.
*
* @param
* The source type
* @param
* The destination type
* @author schuettec
*
*/
class Projection {
private Class source;
private Class destination;
Projection(Class source, Class destination) {
super();
this.source = source;
this.destination = destination;
}
/**
* @return the source
*/
public Class getSource() {
return source;
}
/**
* @return the destination
*/
public Class getDestination() {
return destination;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((destination == null) ? 0 : destination.hashCode());
result = prime * result + ((source == null) ? 0 : source.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;
@SuppressWarnings("rawtypes")
Projection other = (Projection) obj;
if (destination == null) {
if (other.destination != null)
return false;
} else if (!destination.equals(other.destination))
return false;
if (source == null) {
if (other.source != null)
return false;
} else if (!source.equals(other.source))
return false;
return true;
}
@Override
public String toString() {
return "Projection [source=" + source + ", destination=" + destination + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy