001 002package com.commercetools.api.models.message; 003 004import java.time.*; 005import java.util.*; 006 007import com.fasterxml.jackson.annotation.JsonCreator; 008import com.fasterxml.jackson.annotation.JsonProperty; 009import com.fasterxml.jackson.databind.annotation.*; 010 011import io.vrap.rmf.base.client.ModelBase; 012import io.vrap.rmf.base.client.utils.Generated; 013 014import org.apache.commons.lang3.builder.EqualsBuilder; 015import org.apache.commons.lang3.builder.HashCodeBuilder; 016 017/** 018 * <p>Generated after a successful Set Valid From and Until update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class StandalonePriceValidFromAndUntilSetMessagePayloadImpl 022 implements StandalonePriceValidFromAndUntilSetMessagePayload, ModelBase { 023 024 private String type; 025 026 private java.time.ZonedDateTime validFrom; 027 028 private java.time.ZonedDateTime previousValidFrom; 029 030 private java.time.ZonedDateTime validUntil; 031 032 private java.time.ZonedDateTime previousValidUntil; 033 034 /** 035 * create instance with all properties 036 */ 037 @JsonCreator 038 StandalonePriceValidFromAndUntilSetMessagePayloadImpl( 039 @JsonProperty("validFrom") final java.time.ZonedDateTime validFrom, 040 @JsonProperty("previousValidFrom") final java.time.ZonedDateTime previousValidFrom, 041 @JsonProperty("validUntil") final java.time.ZonedDateTime validUntil, 042 @JsonProperty("previousValidUntil") final java.time.ZonedDateTime previousValidUntil) { 043 this.validFrom = validFrom; 044 this.previousValidFrom = previousValidFrom; 045 this.validUntil = validUntil; 046 this.previousValidUntil = previousValidUntil; 047 this.type = STANDALONE_PRICE_VALID_FROM_AND_UNTIL_SET; 048 } 049 050 /** 051 * create empty instance 052 */ 053 public StandalonePriceValidFromAndUntilSetMessagePayloadImpl() { 054 this.type = STANDALONE_PRICE_VALID_FROM_AND_UNTIL_SET; 055 } 056 057 /** 058 * 059 */ 060 061 public String getType() { 062 return this.type; 063 } 064 065 /** 066 * <p>Value of StandalonePrice <code>validFrom</code> after the Set Valid From and Until update action.</p> 067 */ 068 069 public java.time.ZonedDateTime getValidFrom() { 070 return this.validFrom; 071 } 072 073 /** 074 * <p>Value of StandalonePrice <code>validFrom</code> before the Set Valid From and Until update action.</p> 075 */ 076 077 public java.time.ZonedDateTime getPreviousValidFrom() { 078 return this.previousValidFrom; 079 } 080 081 /** 082 * <p>Value of StandalonePrice <code>validUntil</code> after the Set Valid From and Until update action.</p> 083 */ 084 085 public java.time.ZonedDateTime getValidUntil() { 086 return this.validUntil; 087 } 088 089 /** 090 * <p>Value of StandalonePrice <code>validUntil</code> before the Set Valid From and Until update action.</p> 091 */ 092 093 public java.time.ZonedDateTime getPreviousValidUntil() { 094 return this.previousValidUntil; 095 } 096 097 public void setValidFrom(final java.time.ZonedDateTime validFrom) { 098 this.validFrom = validFrom; 099 } 100 101 public void setPreviousValidFrom(final java.time.ZonedDateTime previousValidFrom) { 102 this.previousValidFrom = previousValidFrom; 103 } 104 105 public void setValidUntil(final java.time.ZonedDateTime validUntil) { 106 this.validUntil = validUntil; 107 } 108 109 public void setPreviousValidUntil(final java.time.ZonedDateTime previousValidUntil) { 110 this.previousValidUntil = previousValidUntil; 111 } 112 113 @Override 114 public boolean equals(Object o) { 115 if (this == o) 116 return true; 117 118 if (o == null || getClass() != o.getClass()) 119 return false; 120 121 StandalonePriceValidFromAndUntilSetMessagePayloadImpl that = (StandalonePriceValidFromAndUntilSetMessagePayloadImpl) o; 122 123 return new EqualsBuilder().append(type, that.type) 124 .append(validFrom, that.validFrom) 125 .append(previousValidFrom, that.previousValidFrom) 126 .append(validUntil, that.validUntil) 127 .append(previousValidUntil, that.previousValidUntil) 128 .isEquals(); 129 } 130 131 @Override 132 public int hashCode() { 133 return new HashCodeBuilder(17, 37).append(type) 134 .append(validFrom) 135 .append(previousValidFrom) 136 .append(validUntil) 137 .append(previousValidUntil) 138 .toHashCode(); 139 } 140 141}