@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StandardZoneRules) { StandardZoneRules other = (StandardZoneRules) obj; return Arrays.equals(standardTransitions, other.standardTransitions) && Arrays.equals(standardOffsets, other.standardOffsets) && Arrays.equals(savingsInstantTransitions, other.savingsInstantTransitions) && Arrays.equals(wallOffsets, other.wallOffsets) && Arrays.equals(lastRules, other.lastRules); } if (obj instanceof Fixed) { return isFixedOffset() && getOffset(Instant.EPOCH).equals(((Fixed) obj).getOffset(Instant.EPOCH)); } return false; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StandardZoneRules) { StandardZoneRules other = (StandardZoneRules) obj; return Arrays.equals(standardTransitions, other.standardTransitions) && Arrays.equals(standardOffsets, other.standardOffsets) && Arrays.equals(savingsInstantTransitions, other.savingsInstantTransitions) && Arrays.equals(wallOffsets, other.wallOffsets) && Arrays.equals(lastRules, other.lastRules); } if (obj instanceof Fixed) { return isFixedOffset() && getOffset(Instant.EPOCH).equals(((Fixed) obj).getOffset(Instant.EPOCH)); } return false; }
/** * Obtains an instance of {@code ZoneRules} that always uses the same offset. * <p> * The returned rules always have the same offset. * * @param offset the offset, not null * @return the zone rules, not null */ public static ZoneRules of(ZoneOffset offset) { Jdk8Methods.requireNonNull(offset, "offset"); return new Fixed(offset); }
/** * Obtains an instance of {@code ZoneRules} that always uses the same offset. * <p> * The returned rules always have the same offset. * * @param offset the offset, not null * @return the zone rules, not null */ public static ZoneRules of(ZoneOffset offset) { Jdk8Methods.requireNonNull(offset, "offset"); return new Fixed(offset); }