/** * * * <pre> * One or more of the following must be set. All fields are optional, but * when set must be valid date or time values. * </pre> * * <code>.google.type.Date date = 1;</code> */ public Builder mergeDate(com.google.type.Date value) { if (dateBuilder_ == null) { if (date_ != null) { date_ = com.google.type.Date.newBuilder(date_).mergeFrom(value).buildPartial(); } else { date_ = value; } onChanged(); } else { dateBuilder_.mergeFrom(value); } return this; } /**
/** <code>.google.type.Date date_value = 7;</code> */ public com.google.type.Date getDateValue() { if (typeCase_ == 7) { return (com.google.type.Date) type_; } return com.google.type.Date.getDefaultInstance(); } /** <code>.google.type.Date date_value = 7;</code> */
/** <code>.google.type.Date date_value = 7;</code> */ public Builder mergeDateValue(com.google.type.Date value) { if (dateValueBuilder_ == null) { if (typeCase_ == 7 && type_ != com.google.type.Date.getDefaultInstance()) { type_ = com.google.type.Date.newBuilder((com.google.type.Date) type_) .mergeFrom(value) .buildPartial(); } else { type_ = value; } onChanged(); } else { if (typeCase_ == 7) { dateValueBuilder_.mergeFrom(value); } dateValueBuilder_.setMessage(value); } typeCase_ = 7; return this; } /** <code>.google.type.Date date_value = 7;</code> */
public Builder mergeFrom(com.google.type.Date other) { if (other == com.google.type.Date.getDefaultInstance()) return this; if (other.getYear() != 0) { setYear(other.getYear()); } if (other.getMonth() != 0) { setMonth(other.getMonth()); } if (other.getDay() != 0) { setDay(other.getDay()); } onChanged(); return this; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + YEAR_FIELD_NUMBER; hash = (53 * hash) + getYear(); hash = (37 * hash) + MONTH_FIELD_NUMBER; hash = (53 * hash) + getMonth(); hash = (37 * hash) + DAY_FIELD_NUMBER; hash = (53 * hash) + getDay(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.type.Date)) { return super.equals(obj); } com.google.type.Date other = (com.google.type.Date) obj; boolean result = true; result = result && (getYear() == other.getYear()); result = result && (getMonth() == other.getMonth()); result = result && (getDay() == other.getDay()); return result; }
case 7: hash = (37 * hash) + DATE_VALUE_FIELD_NUMBER; hash = (53 * hash) + getDateValue().hashCode(); break; case 8:
break; case 7: result = result && getDateValue().equals(other.getDateValue()); break; case 8:
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.type.Date prototype) {
mutable_bitField0_ |= 0x00000001; dates_.add(input.readMessage(com.google.type.Date.parser(), extensionRegistry)); break;
/** * <code>.google.type.Date date_value = 7;</code> */ public Builder mergeDateValue(com.google.type.Date value) { if (dateValueBuilder_ == null) { if (typeCase_ == 7 && type_ != com.google.type.Date.getDefaultInstance()) { type_ = com.google.type.Date.newBuilder((com.google.type.Date) type_) .mergeFrom(value).buildPartial(); } else { type_ = value; } onChanged(); } else { if (typeCase_ == 7) { dateValueBuilder_.mergeFrom(value); } dateValueBuilder_.setMessage(value); } typeCase_ = 7; return this; } /**
static java.util.Date convertFromGoogleDate(com.google.type.Date date) { Calendar cal = Calendar.getInstance(); cal.setLenient(false); cal.set(Calendar.YEAR, date.getYear()); // Months start at 0, not 1 cal.set(Calendar.MONTH, date.getMonth() - 1); cal.set(Calendar.DAY_OF_MONTH, date.getDay()); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasDate()) { hash = (37 * hash) + DATE_FIELD_NUMBER; hash = (53 * hash) + getDate().hashCode(); } hash = (37 * hash) + DAY_OF_WEEK_FIELD_NUMBER; hash = (53 * hash) + dayOfWeek_; if (hasTime()) { hash = (37 * hash) + TIME_FIELD_NUMBER; hash = (53 * hash) + getTime().hashCode(); } if (hasTimeZone()) { hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; hash = (53 * hash) + getTimeZone().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.privacy.dlp.v2.DateTime)) { return super.equals(obj); } com.google.privacy.dlp.v2.DateTime other = (com.google.privacy.dlp.v2.DateTime) obj; boolean result = true; result = result && (hasDate() == other.hasDate()); if (hasDate()) { result = result && getDate().equals(other.getDate()); } result = result && dayOfWeek_ == other.dayOfWeek_; result = result && (hasTime() == other.hasTime()); if (hasTime()) { result = result && getTime().equals(other.getTime()); } result = result && (hasTimeZone() == other.hasTimeZone()); if (hasTimeZone()) { result = result && getTimeZone().equals(other.getTimeZone()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public static Builder newBuilder(com.google.type.Date prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
/** <code>.google.type.Date date_value = 7;</code> */ public com.google.type.DateOrBuilder getDateValueOrBuilder() { if (typeCase_ == 7) { return (com.google.type.Date) type_; } return com.google.type.Date.getDefaultInstance(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasStartDate()) { hash = (37 * hash) + START_DATE_FIELD_NUMBER; hash = (53 * hash) + getStartDate().hashCode(); } if (hasEndDate()) { hash = (37 * hash) + END_DATE_FIELD_NUMBER; hash = (53 * hash) + getEndDate().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }