org.joda.time.base.BasePartial Java Examples

The following examples show how to use org.joda.time.base.BasePartial. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BasePartialRelay.java    From jfixture with MIT License 6 votes vote down vote up
@Override
public Object create(Object request, SpecimenContext context) {

    if (!(request instanceof SpecimenType)) {
        return new NoSpecimen();
    }

    SpecimenType type = (SpecimenType) request;
    if (!BasePartial.class.isAssignableFrom(type.getRawType())) {
        return new NoSpecimen();
    }

    try {
        Date date = (Date) context.resolve(Date.class);
        long instant = date.getTime();
        return type.getRawType().getDeclaredConstructor(long.class).newInstance(instant);
    } catch (Exception e) {
        e.printStackTrace();
        return new NoSpecimen();
    }
}
 
Example #2
Source File: InstitutionPrecedentDegreeInformation.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public LocalDate getConclusionDate() {
    final BasePartial date =
            isBolonha() ? (getStudentCurricularPlan().getCycle(getCycleType()) != null ? getStudentCurricularPlan()
                    .getConclusionDate(getCycleType()) : null) : getRegistration().getConclusionDate();
    return date != null ? new LocalDate(date) : null;
}
 
Example #3
Source File: HourMinuteSecond.java    From fenixedu-academic with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * Constructs a HourMinuteSecond with chronology from this instance and new
 * values.
 * 
 * @param partial
 *            the partial to base this new instance on
 * @param values
 *            the new set of values
 */
public HourMinuteSecond(BasePartial partial, int[] values) {
    super(partial, values);
}
 
Example #4
Source File: HourMinuteSecond.java    From fenixedu-academic with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * Constructs a HourMinuteSecond with values from this instance and a new
 * chronology.
 * 
 * @param partial
 *            the partial to base this new instance on
 * @param chrono
 *            the new chronology
 */
public HourMinuteSecond(BasePartial partial, Chronology chrono) {
    super(partial, chrono);
}