Skip to content

Commit

Permalink
AVRO-4040 | @AvroInternal annotation for getSchema() and getSpecificD…
Browse files Browse the repository at this point in the history
…ata() methods
  • Loading branch information
bgalek committed Aug 27, 2024
1 parent ea2c54b commit 7e4279b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
*
* https://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 org.apache.avro.specific;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Indicates that an annotated accessor is an Avro internal
* and should be ignored when introspecting @AvroGenerated classes.
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface AvroInternal {
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ public class ${this.mangleTypeIdentifier($schema.getName())} extends ${this.getS

#end
@Override
@org.apache.avro.specific.AvroInternal
public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }

@Override
@org.apache.avro.specific.AvroInternal
public org.apache.avro.Schema getSchema() { return SCHEMA$; }

// Used by DatumWriter. Applications should not call.
Expand Down

0 comments on commit 7e4279b

Please sign in to comment.