• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 package com.google.protobuf;
9 
10 /**
11  * Lite interface that generated extensions implement.
12  *
13  * <p>Methods are for use by generated code only. You can hold a reference to extensions using this
14  * type name.
15  */
16 public abstract class ExtensionLite<ContainingType extends MessageLite, Type> {
17 
18   /** Returns the field number of the extension. */
getNumber()19   public abstract int getNumber();
20 
21   /** Returns the type of the field. */
getLiteType()22   public abstract WireFormat.FieldType getLiteType();
23 
24   /** Returns whether it is a repeated field. */
isRepeated()25   public abstract boolean isRepeated();
26 
27   /** Returns the default value of the extension field. */
getDefaultValue()28   public abstract Type getDefaultValue();
29 
30   /** Returns the default instance of the extension field, if it's a message extension. */
getMessageDefaultInstance()31   public abstract MessageLite getMessageDefaultInstance();
32 
33   /** Returns whether or not this extension is a Lite Extension. */
isLite()34   boolean isLite() {
35     return true;
36   }
37 }
38