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

com.distelli.jackson.transform.Property Maven / Gradle / Ivy

package com.distelli.jackson.transform;

import com.fasterxml.jackson.core.type.TypeReference;

class Property {
    private ToProperty toProperty;
    private FromProperty fromProperty;
    private TypeReference type;
    public Property(ToProperty toProperty, FromProperty fromProperty, TypeReference type) {
        this.toProperty = toProperty;
        this.fromProperty = fromProperty;
        this.type = type;
    }
    public U toProperty(T inst) {
        return toProperty.toProperty(inst);
    }
    public boolean hasToProperty() {
        return null != toProperty;
    }
    public void fromProperty(B builder, U property) {
        if ( null == fromProperty ) return;
        fromProperty.fromProperty(builder, property);
    }
    public ToProperty getToProperty() {
        return toProperty;
    }
    public FromProperty getFromProperty() {
        return fromProperty;
    }
    public TypeReference getType() {
        return type;
    }
}