| 1 | /* | |
| 2 | * Copyright 2004 the original author or authors. | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package com.ancientprogramming.fixedformat4j.format.data; | |
| 17 | ||
| 18 | import com.ancientprogramming.fixedformat4j.annotation.EnumFormat; | |
| 19 | ||
| 20 | /** | |
| 21 | * Immutable data object mirroring the {@code @FixedFormatEnum} annotation values. | |
| 22 | * | |
| 23 | * @author Jacob von Eyben - <a href="https://eybenconsult.com">https://eybenconsult.com</a> | |
| 24 | * @since 1.7.0 | |
| 25 | */ | |
| 26 | public class FixedFormatEnumData { | |
| 27 | ||
| 28 | public static final FixedFormatEnumData DEFAULT = new FixedFormatEnumData(EnumFormat.LITERAL); | |
| 29 | ||
| 30 | private final EnumFormat enumFormat; | |
| 31 | ||
| 32 | /** | |
| 33 | * Creates an enum data holder with the given format mode. | |
| 34 | * | |
| 35 | * @param enumFormat the serialization format for the enum field | |
| 36 | */ | |
| 37 | public FixedFormatEnumData(EnumFormat enumFormat) { | |
| 38 |
1
1. <init> : Removed assignment to member variable enumFormat → KILLED |
this.enumFormat = enumFormat; |
| 39 | } | |
| 40 | ||
| 41 | /** | |
| 42 | * Returns the serialization format. | |
| 43 | * | |
| 44 | * @return the {@link EnumFormat} for this field | |
| 45 | */ | |
| 46 | public EnumFormat getEnumFormat() { | |
| 47 |
1
1. getEnumFormat : replaced return value with null for com/ancientprogramming/fixedformat4j/format/data/FixedFormatEnumData::getEnumFormat → KILLED |
return enumFormat; |
| 48 | } | |
| 49 | ||
| 50 | @Override | |
| 51 | public String toString() { | |
| 52 |
5
1. toString : replaced call to java/lang/String::format with argument → KILLED 2. toString : replaced return value with "" for com/ancientprogramming/fixedformat4j/format/data/FixedFormatEnumData::toString → KILLED 3. toString : Substituted 0 with 1 → KILLED 4. toString : Substituted 1 with 0 → KILLED 5. toString : removed call to java/lang/String::format → KILLED |
return String.format("FixedFormatEnumData{enumFormat=%s}", enumFormat); |
| 53 | } | |
| 54 | } | |
Mutations | ||
| 38 |
1.1 |
|
| 47 |
1.1 |
|
| 52 |
1.1 2.2 3.3 4.4 5.5 |