• 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 /** Verifies that an object is mutable, throwing if not. */
11 interface MutabilityOracle {
12   static final MutabilityOracle IMMUTABLE =
13       new MutabilityOracle() {
14         @Override
15         public void ensureMutable() {
16           throw new UnsupportedOperationException();
17         }
18       };
19 
20   /** Throws an {@link UnsupportedOperationException} if not mutable. */
ensureMutable()21   void ensureMutable();
22 }
23