|
| 1 | +/* |
| 2 | + * -------------------------------------------------------------------------------- |
| 3 | + * <copyright company="Aspose"> |
| 4 | + * Copyright (c) 2021 Aspose.Tasks Cloud |
| 5 | + * </copyright> |
| 6 | + * <summary> |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | + * |
| 14 | + * The above copyright notice and this permission notice shall be included in all |
| 15 | + * copies or substantial portions of the Software. |
| 16 | + * |
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | + * SOFTWARE. |
| 24 | + * </summary> |
| 25 | + * -------------------------------------------------------------------------------- |
| 26 | + */ |
| 27 | + |
| 28 | +package com.aspose.tasks.cloud.model; |
| 29 | + |
| 30 | +import java.util.Objects; |
| 31 | +import java.util.Arrays; |
| 32 | +import io.swagger.annotations.ApiModel; |
| 33 | +import com.google.gson.annotations.SerializedName; |
| 34 | + |
| 35 | +import java.io.IOException; |
| 36 | +import com.google.gson.TypeAdapter; |
| 37 | +import com.google.gson.annotations.JsonAdapter; |
| 38 | +import com.google.gson.stream.JsonReader; |
| 39 | +import com.google.gson.stream.JsonWriter; |
| 40 | + |
| 41 | +/** |
| 42 | + * Specifies type of Primavera activity. |
| 43 | + */ |
| 44 | +@JsonAdapter(PrimaveraActivityType.Adapter.class) |
| 45 | +public enum PrimaveraActivityType { |
| 46 | + |
| 47 | + NONE("None"), |
| 48 | + |
| 49 | + STARTMILESTONE("StartMilestone"), |
| 50 | + |
| 51 | + FINISHMILESTONE("FinishMilestone"), |
| 52 | + |
| 53 | + TASKDEPENDENT("TaskDependent"), |
| 54 | + |
| 55 | + RESOURCEDEPENDENT("ResourceDependent"), |
| 56 | + |
| 57 | + LEVELOFEFFORT("LevelOfEffort"), |
| 58 | + |
| 59 | + WBSSUMMARY("WbsSummary"); |
| 60 | + |
| 61 | + private String value; |
| 62 | + |
| 63 | + PrimaveraActivityType(String value) { |
| 64 | + this.value = value; |
| 65 | + } |
| 66 | + |
| 67 | + public String getValue() { |
| 68 | + return value; |
| 69 | + } |
| 70 | + |
| 71 | + @Override |
| 72 | + public String toString() { |
| 73 | + return String.valueOf(value); |
| 74 | + } |
| 75 | + |
| 76 | + public static PrimaveraActivityType fromValue(String text) { |
| 77 | + for (PrimaveraActivityType b : PrimaveraActivityType.values()) { |
| 78 | + if (String.valueOf(b.value).equals(text)) { |
| 79 | + return b; |
| 80 | + } |
| 81 | + } |
| 82 | + return null; |
| 83 | + } |
| 84 | + |
| 85 | + public static class Adapter extends TypeAdapter<PrimaveraActivityType> { |
| 86 | + @Override |
| 87 | + public void write(final JsonWriter jsonWriter, final PrimaveraActivityType enumeration) throws IOException { |
| 88 | + jsonWriter.value(enumeration.getValue()); |
| 89 | + } |
| 90 | + |
| 91 | + @Override |
| 92 | + public PrimaveraActivityType read(final JsonReader jsonReader) throws IOException { |
| 93 | + String value = jsonReader.nextString(); |
| 94 | + return PrimaveraActivityType.fromValue(String.valueOf(value)); |
| 95 | + } |
| 96 | + } |
| 97 | +} |
| 98 | + |
0 commit comments