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 * Base interface for methods common to {@link MessageLite} and {@link MessageLite.Builder} to 12 * provide type equivalency. 13 * 14 * @author jonp@google.com (Jon Perlow) 15 */ 16 @CheckReturnValue 17 public interface MessageLiteOrBuilder { 18 /** 19 * Get an instance of the type with no fields set. Because no fields are set, all getters for 20 * singular fields will return default values and repeated fields will appear empty. This may or 21 * may not be a singleton. This differs from the {@code getDefaultInstance()} method of generated 22 * message classes in that this method is an abstract method of the {@code MessageLite} interface 23 * whereas {@code getDefaultInstance()} is a static method of a specific class. They return the 24 * same thing. 25 */ getDefaultInstanceForType()26 MessageLite getDefaultInstanceForType(); 27 28 /** 29 * Returns true if all required fields in the message and all embedded messages are set, false 30 * otherwise. 31 * 32 * <p>See also: {@link MessageOrBuilder#getInitializationErrorString()} 33 */ isInitialized()34 boolean isInitialized(); 35 } 36