001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.petstore.dto; 018 019/** 020 * Order domain bean. 021 * 022 * <p> 023 * Represents an order placed against a {@link Pet}. 024 * 025 * <h5 class='section'>See Also:</h5><ul> 026 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauPetstore">juneau-petstore</a> 027 * </ul> 028 */ 029public class Order { 030 031 private long id; 032 private long petId; 033 private String shipDate; 034 private OrderStatus status; 035 036 /** 037 * Returns the order ID. 038 * 039 * @return The order ID. 040 */ 041 public long getId() { 042 return id; 043 } 044 045 /** 046 * Sets the order ID. 047 * 048 * @param value The new value. 049 * @return This object. 050 */ 051 public Order setId(long value) { 052 id = value; 053 return this; 054 } 055 056 /** 057 * Returns the ID of the pet being ordered. 058 * 059 * @return The ID of the pet being ordered. 060 */ 061 public long getPetId() { 062 return petId; 063 } 064 065 /** 066 * Sets the ID of the pet being ordered. 067 * 068 * @param value The new value. 069 * @return This object. 070 */ 071 public Order setPetId(long value) { 072 petId = value; 073 return this; 074 } 075 076 /** 077 * Returns the shipping date as an ISO 8601 string. 078 * 079 * @return The shipping date as an ISO 8601 string. Can be <jk>null</jk> if the order has not yet shipped. 080 */ 081 public String getShipDate() { 082 return shipDate; 083 } 084 085 /** 086 * Sets the shipping date. 087 * 088 * @param value The new value. Can be <jk>null</jk> to indicate the order has not shipped. 089 * @return This object. 090 */ 091 public Order setShipDate(String value) { 092 shipDate = value; 093 return this; 094 } 095 096 /** 097 * Returns the lifecycle status of the order. 098 * 099 * @return The lifecycle status of the order. 100 */ 101 public OrderStatus getStatus() { 102 return status; 103 } 104 105 /** 106 * Sets the lifecycle status of the order. 107 * 108 * @param value The new value. 109 * @return This object. 110 */ 111 public Order setStatus(OrderStatus value) { 112 status = value; 113 return this; 114 } 115}