From ef269d41a974c38ec79e292712ce9e82d79b6304 Mon Sep 17 00:00:00 2001 From: Dusan Jakub Date: Fri, 26 Aug 2022 14:16:43 +0200 Subject: [PATCH] Oops :D (I'll squash it before merge). fabric8io/kubernetes-client#4350 --- .../crd/generator/annotation/SchemaSwap.java | 5 +++- .../crd/generator/annotation/SchemaSwaps.java | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/SchemaSwaps.java diff --git a/crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/SchemaSwap.java b/crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/SchemaSwap.java index 3c01f566c8b..6a7c7b7f8fb 100644 --- a/crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/SchemaSwap.java +++ b/crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/SchemaSwap.java @@ -17,10 +17,13 @@ import java.lang.annotation.*; -@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE_USE, ElementType.TYPE}) +@Target({ ElementType.ANNOTATION_TYPE, ElementType.TYPE_USE, ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) +@Repeatable(SchemaSwaps.class) public @interface SchemaSwap { Class originalType(); + String fieldName(); + Class targetType() default void.class; } diff --git a/crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/SchemaSwaps.java b/crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/SchemaSwaps.java new file mode 100644 index 00000000000..c734e473187 --- /dev/null +++ b/crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/SchemaSwaps.java @@ -0,0 +1,27 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.fabric8.crd.generator.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.TYPE_USE, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface SchemaSwaps { + SchemaSwap[] value(); +}