@Override public void readFields(DataInput in) throws IOException { salesDateTime.readFields(in); storeCode.readFields(in); itemCode.readFields(in); amount.readFields(in); unitSellingPrice.readFields(in); sellingPrice.readFields(in); fileName.readFields(in); } }
@Override @SuppressWarnings("deprecation") public void copyFrom(SalesDetail other) { this.salesDateTime.copyFrom(other.salesDateTime); this.storeCode.copyFrom(other.storeCode); this.itemCode.copyFrom(other.itemCode); this.amount.copyFrom(other.amount); this.unitSellingPrice.copyFrom(other.unitSellingPrice); this.sellingPrice.copyFrom(other.sellingPrice); this.fileName.copyFrom(other.fileName); } /**
private DateTime time(int y, int m, int d, int h, int min, int s) { int days = DateUtil.getDayFromDate(y, m, d); int secs = DateUtil.getSecondFromTime(h, min, s); DateTime date = new DateTime(); date.setElapsedSeconds((long) days * 86400 + secs); return date; }
/** * Returns the month of this date and time. * @return the month (1-12) */ public int getMonth() { int days = DateUtil.getDayFromSeconds(elapsedSeconds); int year = getYear(); int dayInYear = days - DateUtil.getDayFromYear(year); return DateUtil.getMonthOfYear(dayInYear, DateUtil.isLeap(year)); }
/** * Returns the day of this date and time. * @return the day (1-31) */ public int getDay() { int year = getYear(); int days = DateUtil.getDayFromSeconds(elapsedSeconds); int dayInYear = days - DateUtil.getDayFromYear(year); return DateUtil.getDayOfMonth(dayInYear, DateUtil.isLeap(year)); }
private Date date(int y, int m, int d) { int elapsed = DateUtil.getDayFromDate(y, m, d); Date date = new Date(); date.setElapsedDays(elapsed); return date; }
@SuppressWarnings("deprecation") private void setDate(ValueOption<?> target, java.sql.Date entity) { ((DateOption) target).modify(DateUtil.getDayFromDate(entity)); } }
/** * Returns the value which this object represents. * @param alternate the alternative value for {@code null} * @return the value which this object represents, or the alternative one if this object represents {@code null} */ public long or(long alternate) { if (nullValue) { return alternate; } return get().getElapsedSeconds(); }
/** * Returns the value which this object represents. * @param alternate the alternative value for {@code null} * @return the value which this object represents, or the alternative one if this object represents {@code null} */ public int or(int alternate) { if (nullValue) { return alternate; } return get().getElapsedDays(); }
/** * Returns the month of this date. * @return the month (1-12) */ public int getMonth() { int year = getYear(); int dayInYear = elapsedDays - DateUtil.getDayFromYear(year); return DateUtil.getMonthOfYear(dayInYear, DateUtil.isLeap(year)); }
/** * Returns the day of this date. * @return the day (1-31) */ public int getDay() { int year = getYear(); int dayInYear = elapsedDays - DateUtil.getDayFromYear(year); return DateUtil.getDayOfMonth(dayInYear, DateUtil.isLeap(year)); }
/** * Returns whether both this object and the specified value represents an equivalent value or not. * @param other the target value (nullable) * @return {@code true} if this object has the specified value, otherwise {@code false} */ public boolean has(Date other) { if (isNull()) { return other == null; } return entity.equals(other); }
private DateTime time(int y, int m, int d, int h, int min, int s) { int days = DateUtil.getDayFromDate(y, m, d); int secs = DateUtil.getSecondFromTime(h, min, s); DateTime date = new DateTime(); date.setElapsedSeconds((long) days * 86400 + secs); return date; }