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

com.flextrade.jfixture.jodatime.customisation.ReadableIntervalRelay Maven / Gradle / Ivy

There is a newer version: 2.7.2
Show newest version
package com.flextrade.jfixture.jodatime.customisation;

import com.flextrade.jfixture.NoSpecimen;
import com.flextrade.jfixture.SpecimenBuilder;
import com.flextrade.jfixture.SpecimenContext;
import org.joda.time.Interval;
import org.joda.time.MutableInterval;
import org.joda.time.ReadWritableInterval;
import org.joda.time.ReadableInterval;

public class ReadableIntervalRelay implements SpecimenBuilder {

    @Override
    public Object create(Object request, SpecimenContext context) {
        if (!(request.equals(ReadableInterval.class) || request.equals(ReadWritableInterval.class)))
            return new NoSpecimen();

        Interval interval = (Interval) context.resolve(Interval.class);
        return new MutableInterval(interval);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy