下面列出了怎么用org.joda.time.base.BasePartial的API类实例代码及写法,或者点击链接到github查看源代码。
@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();
}
}
@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;
}
/**
* 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);
}
/**
* 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);
}