blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
07f286cb58fbef2526bf9f65056b93c07073050b | dcf370b2227f21e2f5ff272ceb9d2868135f9138 | /module6/hw3/Guitar.java | 72ff40d3c63c4cdc0892ab9876d71e351bfe79ba | [] | no_license | alifyrenko/GoITHomeWork | 6b54d3b87e71559f66f80a05d89f2f1c20448c7d | e9561c1e5820e5874ca894dd5214be23048cd18b | refs/heads/master | 2021-01-21T15:19:35.232439 | 2016-07-02T09:44:36 | 2016-07-02T09:44:36 | 59,817,217 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.goit.gojavaonline.module6.hw3;
/**
* Created by ANTON on 08.06.2016.
*/
public class Guitar extends MusicalInstrument {
@Override
public void play() {
System.out.println("Guitar play");
}
}
| [
"alifyrenko@gmail.com"
] | alifyrenko@gmail.com |
50c7ab6d66b041633cca2da62344ecaa2c46270a | 9b3bd9c5c230e9fbf08a2411b3f206cf972630d0 | /ORM Converter/src/org/netbeans/jsonb/converter/compiler/NillableSnippet.java | 49b8530fafb82255d3c77c5e7309d9b1c64b32d5 | [
"Apache-2.0"
] | permissive | MHTaleb/jeddict | 1b6f29adaa3ef6e9d6d171d899a8ba28b9d48e90 | 5c98f01269811e69a14e0a8b4278ebaa0cb9d21c | refs/heads/master | 2020-12-02T17:57:43.042540 | 2017-07-02T19:46:38 | 2017-07-02T19:46:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,857 | java | /**
* Copyright [2017] Gaurav Gupta
*
* 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 org.netbeans.jsonb.converter.compiler;
import org.netbeans.orm.converter.compiler.*;
import java.util.Collection;
import java.util.Collections;
import static org.netbeans.jcode.jsonb.JSONBConstants.JSONB_NILLABLE;
import static org.netbeans.jcode.jsonb.JSONBConstants.JSONB_NILLABLE_FQN;
import static org.netbeans.jpa.modeler.settings.code.CodePanel.isGenerateDefaultValue;
import static org.netbeans.orm.converter.util.ORMConverterUtil.CLOSE_PARANTHESES;
import static org.netbeans.orm.converter.util.ORMConverterUtil.OPEN_PARANTHESES;
public class NillableSnippet implements Snippet {
private final Boolean nillable;
public NillableSnippet(Boolean nillable) {
this.nillable = nillable;
}
@Override
public String getSnippet() throws InvalidDataException {
StringBuilder builder = new StringBuilder();
builder.append("@").append(JSONB_NILLABLE);
if (isGenerateDefaultValue() || !nillable) {
builder.append(OPEN_PARANTHESES).append(nillable).append(CLOSE_PARANTHESES);
}
return builder.toString();
}
@Override
public Collection<String> getImportSnippets() throws InvalidDataException {
return Collections.singletonList(JSONB_NILLABLE_FQN);
}
}
| [
"gaurav.gupta.jc@gmail.com"
] | gaurav.gupta.jc@gmail.com |
c868395fdc53cbce7cad5d20fda65e6c9b9886f4 | 4c44d906b397c2d9a06512003552f856de754696 | /src/net/sourceforge/kolmafia/KoLmafia.java | aa12aa48b2b279eb7d9f927a521eae33784d3415 | [] | no_license | kolmafia/kolmafia-cvs | 12358628cdb0f7f2eddabbb61a0dfb79fb094505 | f4e08c8e125dc7e62e4808e5059dcaf6349c5073 | refs/heads/master | 2023-04-19T11:28:35.815619 | 2006-07-08T08:58:27 | 2006-07-08T08:58:27 | 365,226,941 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 80,231 | java | /**
* Copyright (c) 2005, KoLmafia development team
* http://kolmafia.sourceforge.net/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* [1] Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* [2] Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* [3] Neither the name "KoLmafia development team" nor the names of
* its contributors may be used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package net.sourceforge.kolmafia;
import java.net.URL;
import java.net.URLEncoder;
import java.net.URLDecoder;
import java.awt.Component;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Date;
import java.util.List;
import java.util.TreeMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.math.BigInteger;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
import net.java.dev.spellcast.utilities.LockableListModel;
import net.java.dev.spellcast.utilities.SortedListModel;
/**
* The main class for the <code>KoLmafia</code> package. This
* class encapsulates most of the data relevant to any given
* session of <code>Kingdom of Loathing</code> and currently
* functions as the blackboard in the architecture. When data
* listeners are implemented, it will continue to manage most
* of the interactions.
*/
public abstract class KoLmafia implements KoLConstants
{
static
{
System.setProperty( "com.apple.mrj.application.apple.menu.about.name", "KoLmafia" );
System.setProperty( "com.apple.mrj.application.live-resize", "true" );
System.setProperty( "com.apple.mrj.application.growbox.intrudes", "false" );
JEditorPane.registerEditorKitForContentType( "text/html", "net.sourceforge.kolmafia.RequestEditorKit" );
System.setProperty( "apple.laf.useScreenMenuBar", "true" );
}
protected static PrintStream sessionStream = NullStream.INSTANCE;
protected static PrintStream macroStream = NullStream.INSTANCE;
protected static PrintStream debugStream = NullStream.INSTANCE;
protected static PrintStream outputStream = NullStream.INSTANCE;
protected static PrintStream mirrorStream = NullStream.INSTANCE;
protected static LimitedSizeChatBuffer commandBuffer = new LimitedSizeChatBuffer( "KoLmafia: Graphical CLI", true, false );
private static final String [] OVERRIDE_DATA =
{
"adventures.dat",
"buffbots.dat",
"buffs.dat",
"classskills.dat",
"combats.dat",
"concoctions.dat",
"equipment.dat",
"familiars.dat",
"itemdescs.dat",
"monsters.dat",
"npcstores.dat",
"outfits.dat",
"packages.dat",
"plurals.dat",
"statuseffects.dat",
"tradeitems.dat",
"zonelist.dat"
};
public static final int SNOWCONE = 0;
public static final int HILARIOUS = 1;
public static final int SAUCECRAFTING = 2;
public static final int PASTAMASTERY = 3;
public static final int COCKTAILCRAFTING = 4;
public static String [][] BREAKFAST_SKILLS =
{
{ "Summon Snowcone", "1" },
{ "Summon Hilarious Objects", "1" },
{ "Advanced Saucecrafting", "3" },
{ "Pastamastery", "3" },
{ "Advanced Cocktailcrafting", "3" }
};
protected static final String [] trapperItemNames = { "yak skin", "penguin skin", "hippopotamus skin" };
protected static final int [] trapperItemNumbers = { 394, 393, 395 };
private static boolean recoveryActive = false;
protected static boolean isMakingRequest = false;
protected static KoLRequest currentRequest = null;
private static String currentIterationString = "";
protected static int continuationState = CONTINUE_STATE;
protected int [] initialStats = new int[3];
protected int [] fullStatGain = new int[3];
protected SortedListModel saveStateNames = new SortedListModel();
protected List recentEffects = new ArrayList();
private static TreeMap seenPlayerIDs = new TreeMap();
private static TreeMap seenPlayerNames = new TreeMap();
protected SortedListModel contactList = new SortedListModel();
protected SortedListModel tally = new SortedListModel();
protected SortedListModel missingItems = new SortedListModel();
protected SortedListModel hermitItems = new SortedListModel();
protected SortedListModel hunterItems = new SortedListModel();
protected LockableListModel restaurantItems = new LockableListModel();
protected LockableListModel microbreweryItems = new LockableListModel();
protected LockableListModel galaktikCures = new LockableListModel();
protected boolean useDisjunction = false;
protected SortedListModel conditions = new SortedListModel();
protected LockableListModel adventureList = new LockableListModel();
protected SortedListModel encounterList = new SortedListModel();
/**
* The main method. Currently, it instantiates a single instance
* of the <code>KoLmafiaGUI</code>.
*/
public static void main( String [] args )
{
boolean useGUI = true;
for ( int i = 0; i < args.length; ++i )
{
if ( args[i].equals( "--CLI" ) )
useGUI = false;
if ( args[i].equals( "--GUI" ) )
useGUI = true;
}
if ( useGUI )
KoLmafiaGUI.main( args );
else
KoLmafiaCLI.main( args );
// All that completed, check to see if there is an auto-login
// which should occur.
String autoLogin = StaticEntity.getProperty( "autoLogin" );
if ( !autoLogin.equals( "" ) )
{
// Make sure that a password was stored for this
// character (would fail otherwise):
String password = StaticEntity.getClient().getSaveState( autoLogin );
if ( password != null && !password.equals( "" ) )
(new RequestThread( new LoginRequest( StaticEntity.getClient(), autoLogin, password ) )).start();
}
}
/**
* Constructs a new <code>KoLmafia</code> object. All data fields
* are initialized to their default values, the global settings
* are loaded from disk.
*/
public KoLmafia()
{
this.useDisjunction = false;
StaticEntity.reloadSettings();
String [] currentNames = StaticEntity.getProperty( "saveState" ).split( "//" );
for ( int i = 0; i < currentNames.length; ++i )
saveStateNames.add( currentNames[i] );
// This line is added to clear out data from previous
// releases of KoLmafia - the extra disk access does
// affect performance, but not significantly.
storeSaveStates();
// Also clear out any outdated data files -- this
// includes everything except for the adventure table,
// since changing that actually does something.
String version = StaticEntity.getProperty( "previousUpdateVersion" );
if ( version == null || !version.equals( VERSION_NAME ) )
{
StaticEntity.setProperty( "previousUpdateVersion", VERSION_NAME );
for ( int i = 1; i < OVERRIDE_DATA.length; ++i )
{
File outdated = new File( "data/" + OVERRIDE_DATA[i] );
if ( outdated.exists() )
outdated.delete();
}
}
}
/**
* Updates the currently active display in the <code>KoLmafia</code>
* session.
*/
public static synchronized final void updateDisplay( String message )
{ updateDisplay( CONTINUE_STATE, message );
}
/**
* Updates the currently active display in the <code>KoLmafia</code>
* session.
*/
public static synchronized final void updateDisplay( int state, String message )
{
if ( continuationState == ABORT_STATE || message.equals( "" ) )
return;
continuationState = state;
debugStream.println( message );
outputStream.println( message );
mirrorStream.println( message );
if ( state == ERROR_STATE )
sessionStream.println( message );
StringBuffer colorBuffer = new StringBuffer();
if ( message.indexOf( LINE_BREAK ) != -1 )
colorBuffer.append( "<pre>" );
if ( state == ERROR_STATE || state == ABORT_STATE )
colorBuffer.append( "<font color=red>" );
else
colorBuffer.append( "<font color=black>" );
colorBuffer.append( message );
colorBuffer.append( "</font>" );
if ( message.indexOf( LINE_BREAK ) != -1 )
colorBuffer.append( "</pre>" );
colorBuffer.append( LINE_BREAK );
colorBuffer.append( "<br>" );
LocalRelayServer.addStatusMessage( colorBuffer.toString() );
commandBuffer.append( colorBuffer.toString() );
if ( !existingFrames.isEmpty() )
updateDisplayState( CONTINUE_STATE, message );
}
private static synchronized final void updateDisplayState( int state, String message )
{
// Next, update all of the panels with the
// desired update message.
WeakReference [] references = new WeakReference[ existingPanels.size() ];
existingPanels.toArray( references );
for ( int i = 0; i < references.length; ++i )
{
if ( references[i].get() != null )
{
if ( references[i].get() instanceof KoLPanel && message != null )
((KoLPanel) references[i].get()).setStatusMessage( state, message );
((Component)references[i].get()).setEnabled( state != CONTINUE_STATE );
}
}
KoLFrame [] frames = new KoLFrame[ existingFrames.size() ];
existingFrames.toArray( frames );
for ( int i = 0; i < frames.length; ++i )
frames[i].updateDisplayState( state );
if ( KoLDesktop.instanceExists() )
KoLDesktop.getInstance().updateDisplayState( state );
}
public synchronized static void enableDisplay()
{
updateDisplayState(
continuationState == ABORT_STATE || continuationState == ERROR_STATE ? ABORT_STATE : ENABLE_STATE, null );
}
/**
* Initializes the <code>KoLmafia</code> session. Called after
* the login has been confirmed to notify the client that the
* login was successful, the user-specific settings should be
* loaded, and the user can begin adventuring.
*/
public synchronized void initialize( String username, boolean getBreakfast, boolean isQuickLogin )
{
this.conditions.clear();
// Initialize the variables to their initial
// states to avoid null pointers getting thrown
// all over the place
if ( !permitsContinue() )
{
deinitialize();
return;
}
StaticEntity.setProperty( "lastUsername", username );
KoLCharacter.reset( username );
StaticEntity.reloadSettings();
KoLmafia.openSessionStream();
if ( isQuickLogin )
{
(new AccountRequest( this )).run();
return;
}
this.refreshSession();
if ( refusesContinue() )
{
deinitialize();
return;
}
// Always reset the auto-repair settings, because the
// auto-repair situation is usually desired unless
// the person is trying to explode boxes.
if ( StaticEntity.getProperty( "autoRepairBoxes" ).equals( "false" ) )
StaticEntity.setProperty( "autoRepairBoxes", String.valueOf( KoLCharacter.canInteract() ) );
if ( StaticEntity.getProperty( "createWithoutBoxServants" ).equals( "false" ) )
StaticEntity.setProperty( "createWithoutBoxServants", String.valueOf( KoLCharacter.isHardcore() ) );
// If the password hash is non-null, then that means you
// might be mid-transition.
if ( KoLRequest.passwordHash != null && KoLRequest.passwordHash.equals( "" ) )
return;
registerPlayer( username, String.valueOf( KoLCharacter.getUserID() ) );
if ( getBreakfast )
{
String today = DATED_FILENAME_FORMAT.format( new Date() );
String lastBreakfast = StaticEntity.getProperty( "lastBreakfast." + username.toLowerCase() );
StaticEntity.setProperty( "lastBreakfast." + username.toLowerCase(), today );
if ( lastBreakfast == null || !lastBreakfast.equals( today ) )
getBreakfast( true );
}
String scriptSetting = StaticEntity.getProperty( "loginScript." + username.toLowerCase() );
if ( !scriptSetting.equals( "" ) )
DEFAULT_SHELL.executeLine( scriptSetting );
}
public void resetBreakfastSummonings()
{
setBreakfastSummonings( SNOWCONE, 1 );
setBreakfastSummonings( HILARIOUS, 1 );
setBreakfastSummonings( SAUCECRAFTING, 3 );
setBreakfastSummonings( PASTAMASTERY, 3 );
setBreakfastSummonings( COCKTAILCRAFTING, 3 );
}
public void setBreakfastSummonings( int index, int count )
{ BREAKFAST_SKILLS[index][1] = String.valueOf( count );
}
public void getBreakfast( boolean checkSettings )
{
if ( KoLCharacter.hasToaster() )
for ( int i = 0; i < 3 && permitsContinue(); ++i )
(new CampgroundRequest( this, "toast" )).run();
if ( KoLCharacter.hasArches() )
(new CampgroundRequest( this, "arches" )).run();
boolean shouldCast = false;
String skillSetting = StaticEntity.getProperty( "breakfast" + (KoLCharacter.isHardcore() ? "Hardcore" : "Softcore") );
if ( skillSetting != null )
{
for ( int i = 0; i < BREAKFAST_SKILLS.length; ++i )
{
shouldCast = !checkSettings || skillSetting.indexOf( BREAKFAST_SKILLS[i][0] ) != -1;
shouldCast &= KoLCharacter.hasSkill( BREAKFAST_SKILLS[i][0] );
if ( checkSettings && shouldCast && KoLCharacter.isHardcore() )
{
if ( BREAKFAST_SKILLS[i][0].equals( "Pastamastery" ) && !KoLCharacter.canEat() )
shouldCast = false;
if ( BREAKFAST_SKILLS[i][0].equals( "Advanced Cocktailcrafting" ) && !KoLCharacter.canDrink() )
shouldCast = false;
}
if ( shouldCast )
getBreakfast( BREAKFAST_SKILLS[i][0], StaticEntity.parseInt( BREAKFAST_SKILLS[i][1] ) );
}
}
forceContinue();
}
public void getBreakfast( String skillname, int standardCast )
{ (new UseSkillRequest( this, skillname, "", standardCast )).run();
}
public final void refreshSession()
{
KoLCharacter.reset( KoLCharacter.getUsername() );
KoLmafiaCLI.reset();
KoLMailManager.reset();
MushroomPlot.reset();
StoreManager.reset();
CakeArenaManager.reset();
MuseumManager.reset();
ClanManager.reset();
this.hermitItems.clear();
this.hermitItems.add( "banjo strings" );
this.hermitItems.add( "catsup" );
this.hermitItems.add( "digny planks" );
this.hermitItems.add( "fortune cookie" );
this.hermitItems.add( "golden twig" );
this.hermitItems.add( "hot buttered roll" );
this.hermitItems.add( "jaba\u00f1ero pepper" );
this.hermitItems.add( "ketchup" );
this.hermitItems.add( "sweet rims" );
this.hermitItems.add( "volleyball" );
this.hermitItems.add( "wooden figurine" );
this.hunterItems.clear();
this.restaurantItems.clear();
this.microbreweryItems.clear();
this.galaktikCures.clear();
// Retrieve the character sheet first. It's necessary to do
// this before concoctions have a chance to get refreshed.
(new CharsheetRequest( this )).run();
if ( refusesContinue() )
return;
// Retrieve the items which are available for consumption
// and item creation.
(new EquipmentRequest( this, EquipmentRequest.CLOSET )).run();
if ( refusesContinue() )
return;
// If the password hash is non-null, then that means you
// might be mid-transition.
if ( KoLRequest.passwordHash != null && KoLRequest.passwordHash.equals( "" ) )
{
ConcoctionsDatabase.getConcoctions().clear();
KoLCharacter.refreshCalculatedLists();
return;
}
// Get current moon phases
(new MoonPhaseRequest( this )).run();
if ( refusesContinue() )
return;
// Retrieve the list of familiars which are available to
// the player, if they haven't opted to skip them.
(new FamiliarRequest( this )).run();
if ( refusesContinue() )
return;
// Retrieve campground data to see if the user is able to
// cook, make drinks or make toast.
updateDisplay( "Retrieving campground data..." );
(new CampgroundRequest( this )).run();
if ( refusesContinue() )
return;
// Finally, if the player is in Ronin (and not in hardcore),
// then pull their storage data.
if ( !KoLCharacter.canInteract() && !KoLCharacter.isHardcore() )
(new ItemStorageRequest( this )).run();
updateDisplay( "Data refreshed." );
resetSession();
applyRecentEffects();
ConcoctionsDatabase.getConcoctions().clear();
KoLCharacter.recalculateAdjustments( false );
KoLCharacter.refreshCalculatedLists();
}
/**
* Utility method used to notify the client that it should attempt
* to retrieve breakfast.
*/
/**
* Deinitializes the <code>KoLmafia</code> session. Called after
* the user has logged out.
*/
public void deinitialize()
{
KoLRequest.sessionID = null;
KoLRequest.passwordHash = null;
closeDebugStream();
closeMacroStream();
}
/**
* Used to reset the session tally to its original values.
*/
public void resetSession()
{
tally.clear();
this.recentEffects.clear();
this.missingItems.clear();
this.encounterList.clear();
this.adventureList.clear();
initialStats[0] = KoLCharacter.calculateBasePoints( KoLCharacter.getTotalMuscle() );
initialStats[1] = KoLCharacter.calculateBasePoints( KoLCharacter.getTotalMysticality() );
initialStats[2] = KoLCharacter.calculateBasePoints( KoLCharacter.getTotalMoxie() );
fullStatGain[0] = 0;
fullStatGain[1] = 0;
fullStatGain[2] = 0;
tally.add( new AdventureResult( AdventureResult.ADV ) );
processResult( new AdventureResult( AdventureResult.MEAT ) );
processResult( new AdventureResult( AdventureResult.SUBSTATS ) );
processResult( new AdventureResult( AdventureResult.DIVIDER ) );
}
/**
* Utility method to parse an individual adventuring result.
* This method determines what the result actually was and
* adds it to the tally.
*
* @param result String to parse for the result
*/
public boolean parseResult( String result )
{
String trimResult = result.trim();
// Because of the simplified parsing, there's a chance that
// the "gain" acquired wasn't a subpoint (in other words, it
// includes the word "a" or "some"), which causes a NFE or
// possibly a ParseException to be thrown. catch them and
// do nothing (eventhough it's technically bad style).
if ( trimResult.startsWith( "You gain a" ) || trimResult.startsWith( "You gain some" ) )
return false;
try
{
debugStream.println( "Parsing result: " + trimResult );
return processResult( AdventureResult.parseResult( trimResult ) );
}
catch ( Exception e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
}
return false;
}
public void parseItem( String result )
{
debugStream.println( "Parsing item: " + result );
// We do the following in order to not get confused by:
//
// Frobozz Real-Estate Company Instant House (TM)
// stone tablet (Sinister Strumming)
// stone tablet (Squeezings of Woe)
// stone tablet (Really Evil Rhythm)
//
// which otherwise cause an exception and a stack trace
// Look for a verbatim match
int itemID = TradeableItemDatabase.getItemID( result.trim() );
if ( itemID != -1 )
{
processResult( new AdventureResult( itemID, 1 ) );
return;
}
// Remove parenthesized number and match again.
String name = result;
int count = 1;
int index = result.lastIndexOf( " (" );
if ( index != -1 )
{
name = result.substring( 0, index );
count = StaticEntity.parseInt( result.substring( index ) );
}
processResult( new AdventureResult( name, count, false ) );
}
public boolean parseEffect( String result )
{
debugStream.println( "Parsing effect: " + result );
StringTokenizer parsedEffect = new StringTokenizer( result, "()" );
String parsedEffectName = parsedEffect.nextToken().trim();
String parsedDuration = parsedEffect.hasMoreTokens() ? parsedEffect.nextToken() : "1";
return processResult( new AdventureResult( parsedEffectName, StaticEntity.parseInt( parsedDuration ), true ) );
}
/**
* Utility method used to process a result. By default, this
* method will also add an adventure result to the tally directly.
* This is used whenever the nature of the result is already known
* and no additional parsing is needed.
*
* @param result Result to add to the running tally of adventure results
*/
public boolean processResult( AdventureResult result )
{ return processResult( result, true );
}
/**
* Utility method used to process a result, and the user wishes to
* specify whether or not the result should be added to the running
* tally. This is used whenever the nature of the result is already
* known and no additional parsing is needed.
*
* @param result Result to add to the running tally of adventure results
* @param shouldTally Whether or not the result should be added to the running tally
*/
public boolean processResult( AdventureResult result, boolean shouldTally )
{
// This should not happen, but check just in case and
// return if the result was null.
if ( result == null )
return false;
debugStream.println( "Processing result: " + result );
String resultName = result.getName();
// This should not happen, but check just in case and
// return if the result name was null.
if ( resultName == null )
return false;
boolean shouldRefresh = false;
// Process the adventure result in this section; if
// it's a status effect, then add it to the recent
// effect list. Otherwise, add it to the tally.
if ( result.isStatusEffect() )
{
AdventureResult.addResultToList( recentEffects, result );
shouldRefresh |= !KoLCharacter.getEffects().containsAll( recentEffects );
}
else if ( resultName.equals( AdventureResult.ADV ) && result.getCount() < 0 )
AdventureResult.addResultToList( tally, result.getNegation() );
else if ( result.isItem() || resultName.equals( AdventureResult.SUBSTATS ) || resultName.equals( AdventureResult.MEAT ) )
{
if ( shouldTally )
AdventureResult.addResultToList( tally, result );
}
int effectCount = KoLCharacter.getEffects().size();
KoLCharacter.processResult( result );
shouldRefresh |= effectCount != KoLCharacter.getEffects().size();
if ( !shouldTally )
return shouldRefresh;
// Now, if it's an actual stat gain, be sure to update the
// list to reflect the current value of stats so far.
if ( resultName.equals( AdventureResult.SUBSTATS ) && tally.size() >= 3 )
{
int currentTest = KoLCharacter.calculateBasePoints( KoLCharacter.getTotalMuscle() ) - initialStats[0];
shouldRefresh |= fullStatGain[0] != currentTest;
fullStatGain[0] = currentTest;
currentTest = KoLCharacter.calculateBasePoints( KoLCharacter.getTotalMysticality() ) - initialStats[1];
shouldRefresh |= fullStatGain[1] != currentTest;
fullStatGain[1] = currentTest;
currentTest = KoLCharacter.calculateBasePoints( KoLCharacter.getTotalMoxie() ) - initialStats[2];
shouldRefresh |= fullStatGain[2] != currentTest;
fullStatGain[2] = currentTest;
if ( tally.size() > 3 )
tally.set( 3, new AdventureResult( AdventureResult.FULLSTATS, fullStatGain ) );
else
tally.add( new AdventureResult( AdventureResult.FULLSTATS, fullStatGain ) );
}
// Process the adventure result through the conditions
// list, removing it if the condition is satisfied.
int conditionsIndex = conditions.indexOf( result );
if ( !resultName.equals( AdventureResult.ADV ) && conditionsIndex != -1 )
{
if ( resultName.equals( AdventureResult.SUBSTATS ) )
{
// If the condition is a substat condition,
// then zero out the appropriate count, if
// applicable, and remove the substat condition
// if the overall count dropped to zero.
AdventureResult condition = (AdventureResult) conditions.get( conditionsIndex );
int [] substats = new int[3];
for ( int i = 0; i < 3; ++i )
substats[i] = Math.max( 0, condition.getCount(i) - result.getCount(i) );
condition = new AdventureResult( AdventureResult.SUBSTATS, substats );
if ( condition.getCount() == 0 )
conditions.remove( conditionsIndex );
else
conditions.set( conditionsIndex, condition );
}
else if ( result.getCount( conditions ) <= result.getCount() )
{
// If this results in the satisfaction of a
// condition, then remove it.
conditions.remove( conditionsIndex );
}
else
{
// Otherwise, this was a partial satisfaction
// of a condition. Decrement the count by the
// negation of this result.
AdventureResult.addResultToList( conditions, result.getNegation() );
}
}
return shouldRefresh;
}
/**
* Adds the recent effects accumulated so far to the actual effects.
* This should be called after the previous effects were decremented,
* if adventuring took place.
*/
public void applyRecentEffects()
{
if ( recentEffects.isEmpty() )
return;
for ( int j = 0; j < recentEffects.size(); ++j )
AdventureResult.addResultToList( KoLCharacter.getEffects(), (AdventureResult) recentEffects.get(j) );
KoLCharacter.getEffects().sort();
recentEffects.clear();
KoLCharacter.recalculateAdjustments( false );
}
/**
* Returns the string form of the player ID associated
* with the given player name.
*
* @param playerID The ID of the player
* @return The player's name if it has been seen, or null if it has not
* yet appeared in the chat (not likely, but possible).
*/
public static String getPlayerName( String playerID )
{ return (String) seenPlayerNames.get( playerID );
}
/**
* Returns the string form of the player ID associated
* with the given player name.
*
* @param playerName The name of the player
* @return The player's ID if the player has been seen, or the player's name
* with spaces replaced with underscores and other elements encoded
* if the player's ID has not been seen.
*/
public static String getPlayerID( String playerName )
{
if ( playerName == null )
return null;
String playerID = (String) seenPlayerIDs.get( playerName.toLowerCase() );
return playerID != null ? playerID : playerName;
}
/**
* Registers the given player name and player ID with
* KoLmafia's player name tracker.
*
* @param playerName The name of the player
* @param playerID The player ID associated with this player
*/
public static void registerPlayer( String playerName, String playerID )
{
if ( !seenPlayerIDs.containsKey( playerName.toLowerCase() ) )
{
seenPlayerIDs.put( playerName.toLowerCase(), playerID );
seenPlayerNames.put( playerID, playerName );
}
}
public void registerContact( String playerName, String playerID )
{
registerPlayer( playerName, playerID );
if ( !contactList.contains( playerName ) )
contactList.add( playerName );
}
/**
* Returns the character's contact list.
*/
public SortedListModel getContactList()
{ return contactList;
}
/**
* Returns the list of items which are available from the hermit today.
*/
public SortedListModel getHermitItems()
{ return hermitItems;
}
/**
* Returns the list of items which are available from the
* bounty hunter hunter today.
*/
public SortedListModel getBountyHunterItems()
{ return hunterItems;
}
/**
* Returns the list of items which are available from
* Chez Snootee today.
*/
public LockableListModel getRestaurantItems()
{ return restaurantItems;
}
/**
* Returns the list of items which are available from the
* Gnomish Micromicrobrewery today.
*/
public LockableListModel getMicrobreweryItems()
{ return microbreweryItems;
}
/**
* Returns the list of cures which are currently available from
* Doc Galaktik
*/
public LockableListModel getGalaktikCures()
{ return galaktikCures;
}
/**
* Returns whether or not the current user has a ten-leaf clover.
*
* @return <code>true</code>
*/
public boolean isLuckyCharacter()
{ return KoLCharacter.getInventory().contains( SewerRequest.CLOVER );
}
/**
* Utility method which ensures that the amount needed exists,
* and if not, calls the appropriate scripts to do so.
*/
private final boolean recover( int needed, String settingName, String currentName, String maximumName, Object [] techniques ) throws Exception
{
if ( refusesContinue() )
return false;
boolean checkBeatenUp = settingName.startsWith( "hp" ) &&
KoLCharacter.getEffects().contains( KoLAdventure.BEATEN_UP );
Object [] empty = new Object[0];
Method currentMethod, maximumMethod;
currentMethod = KoLCharacter.class.getMethod( currentName, new Class[0] );
maximumMethod = KoLCharacter.class.getMethod( maximumName, new Class[0] );
int initial = needed;
int maximum = ((Number)maximumMethod.invoke( null, empty )).intValue();
// First, check against the restore trigger to see if
// any restoration needs to take place.
double setting = StaticEntity.parseDouble( StaticEntity.getProperty( settingName ) );
if ( !BuffBotHome.isBuffBotActive() )
needed = Math.max( needed, (int) Math.max( setting * (double) maximum, (double) needed ) );
int last = -1;
int current = ((Number)currentMethod.invoke( null, empty )).intValue();
// If a buffbot is currently running, only restore MP to
// max when what you have is less than what you need.
if ( BuffBotHome.isBuffBotActive() )
{
if ( current < needed )
needed = maximum - 1;
}
else if ( needed >= maximum )
{
needed = maximum - 1;
}
if ( current >= needed )
return true;
// Next, check against the restore target to see how
// far you need to go.
int threshold = initial == 0 ? needed : needed - 1;
setting = StaticEntity.parseDouble( StaticEntity.getProperty( settingName + "Target" ) );
if ( initial == 0 )
needed = (int) ( setting * (double) maximum );
// If it gets this far, then you should attempt to recover
// using the selected items. This involves a few extra
// reflection methods.
String restoreSetting = StaticEntity.getProperty( settingName + "Items" ).trim().toLowerCase();
// Iterate through every single restore item, checking to
// see if the settings wish to use this item. If so, go ahead
// and process the item's usage.
String currentTechniqueName;
for ( int i = 0; i < techniques.length && (current <= threshold || checkBeatenUp); ++i )
{
currentTechniqueName = techniques[i].toString().toLowerCase();
if ( restoreSetting.indexOf( currentTechniqueName ) != -1 )
{
last = -1;
while ( (current <= threshold || checkBeatenUp) && last != current && !refusesContinue() )
{
last = current;
recoverOnce( techniques[i], currentTechniqueName, needed );
current = ((Number)currentMethod.invoke( null, empty )).intValue();
checkBeatenUp &= KoLCharacter.getEffects().contains( KoLAdventure.BEATEN_UP );
}
}
}
// Fall-through check, just in case you've reached the
// desired value.
if ( refusesContinue() )
return false;
if ( current > threshold )
return true;
updateDisplay( ABORT_STATE, "Autorecovery failed." );
return false;
}
/**
* Utility method called inbetween battles. This method
* checks to see if the character's HP has dropped below
* the tolerance value, and recovers if it has (if
* the user has specified this in their settings).
*/
protected final boolean recoverHP()
{ return recoverHP( 0 );
}
public final boolean recoverHP( int recover )
{
try
{
return recover( recover, "hpAutoRecovery", "getCurrentHP", "getMaximumHP", HPRestoreItemList.CONFIGURES );
}
catch ( Exception e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
return false;
}
}
/**
* Utility method which uses the given recovery technique (not specified
* in a script) in order to restore.
*/
private final void recoverOnce( Object technique, String techniqueName, int needed )
{
// If the technique is an item, and the item is not readily available,
// then don't bother with this item -- however, if it is the only item
// present, then rethink it.
if ( technique instanceof HPRestoreItemList.HPRestoreItem )
((HPRestoreItemList.HPRestoreItem)technique).recoverHP( needed );
if ( technique instanceof MPRestoreItemList.MPRestoreItem )
((MPRestoreItemList.MPRestoreItem)technique).recoverMP( needed );
}
/**
* Returns the total number of mana restores currently
* available to the player.
*/
public int getRestoreCount()
{
int restoreCount = 0;
String mpRestoreSetting = StaticEntity.getProperty( "mpRestores" );
for ( int i = 0; i < MPRestoreItemList.CONFIGURES.length; ++i )
if ( mpRestoreSetting.indexOf( MPRestoreItemList.CONFIGURES[i].toString() ) != -1 )
restoreCount += MPRestoreItemList.CONFIGURES[i].getItem().getCount( KoLCharacter.getInventory() );
return restoreCount;
}
/**
* Utility method called inbetween commands. This method
* checks to see if the character's MP has dropped below
* the tolerance value, and recovers if it has (if
* the user has specified this in their settings).
*/
protected final boolean recoverMP()
{ return recoverMP( 0 );
}
/**
* Utility method which restores the character's current
* mana points above the given value.
*/
public final boolean recoverMP( int mpNeeded )
{
try
{
return recover( mpNeeded, "mpAutoRecovery", "getCurrentMP", "getMaximumMP", MPRestoreItemList.CONFIGURES );
}
catch ( Exception e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
return false;
}
}
/**
* Utility method used to process the results of any adventure
* in the Kingdom of Loathing. This method searches for items,
* stat gains, and losses within the provided string.
*
* @param results The string containing the results of the adventure
* @return <code>true</code> if any results existed
*/
public final boolean processResults( String results )
{
debugStream.println( "Processing results..." );
if ( results.indexOf( "gains a pound" ) != -1 )
KoLCharacter.incrementFamilarWeight();
String plainTextResult = results.replaceAll( "<.*?>", "\n" );
StringTokenizer parsedResults = new StringTokenizer( plainTextResult, "\n" );
String lastToken = null;
Matcher damageMatcher = Pattern.compile( "you for ([\\d,]+) damage" ).matcher( plainTextResult );
int lastDamageIndex = 0;
while ( damageMatcher.find( lastDamageIndex ) )
{
lastDamageIndex = damageMatcher.end();
String message = "You lose " + damageMatcher.group(1) + " hit points";
KoLmafiaCLI.printLine( message );
parseResult( message );
}
damageMatcher = Pattern.compile( "You drop .*? ([\\d,]+) damage" ).matcher( plainTextResult );
lastDamageIndex = 0;
while ( damageMatcher.find( lastDamageIndex ) )
{
lastDamageIndex = damageMatcher.end();
String message = "You lose " + damageMatcher.group(1) + " hit points";
KoLmafiaCLI.printLine( message );
parseResult( message );
}
boolean requiresRefresh = false;
while ( parsedResults.hasMoreTokens() )
{
lastToken = parsedResults.nextToken();
// Skip effect acquisition - it's followed by a boldface
// which makes the parser think it's found an item.
if ( lastToken.startsWith( "You acquire" ) )
{
String acquisition = lastToken;
if ( lastToken.indexOf( "effect" ) == -1 )
{
String item = parsedResults.nextToken();
if ( lastToken.indexOf( "an item" ) != -1 )
{
KoLmafiaCLI.printLine( acquisition + " " + item );
parseItem( item );
}
else
{
// The name of the item follows the number
// that appears after the first index.
String countString = item.split( " " )[0];
int spaceIndex = item.indexOf( " " );
String itemName = spaceIndex == -1 ? item : item.substring( spaceIndex ).trim();
boolean isNumeric = spaceIndex != -1;
for ( int i = 0; isNumeric && i < countString.length(); ++i )
isNumeric &= Character.isDigit( countString.charAt(i) ) || countString.charAt(i) == ',';
if ( !isNumeric )
countString = "1";
else if ( itemName.equals( "evil golden arches" ) )
itemName = "evil golden arch";
KoLmafiaCLI.printLine( acquisition + " " + item );
parseItem( itemName + " (" + countString + ")" );
}
}
else
{
String effectName = parsedResults.nextToken();
lastToken = parsedResults.nextToken();
KoLmafiaCLI.printLine( acquisition + " " + effectName + " " + lastToken );
if ( lastToken.indexOf( "duration" ) == -1 )
{
parseEffect( effectName );
}
else
{
String duration = lastToken.substring( 11, lastToken.length() - 11 ).trim();
requiresRefresh |= parseEffect( effectName + " (" + duration + ")" );
}
}
}
else if ( (lastToken.startsWith( "You gain" ) || lastToken.startsWith( "You lose " )) )
{
int periodIndex = lastToken.indexOf( "." );
if ( periodIndex != -1 )
lastToken = lastToken.substring( 0, periodIndex );
int parenIndex = lastToken.indexOf( "(" );
if ( parenIndex != -1 )
lastToken = lastToken.substring( 0, parenIndex );
KoLmafiaCLI.printLine( lastToken );
requiresRefresh |= parseResult( lastToken.trim() );
}
}
return requiresRefresh;
}
public void makeRequest( Runnable request )
{ makeRequest( request, 1 );
}
/**
* Makes the given request for the given number of iterations,
* or until continues are no longer possible, either through
* user cancellation or something occuring which prevents the
* requests from resuming.
*
* @param request The request made by the user
* @param iterations The number of times the request should be repeated
*/
public void makeRequest( Runnable request, int iterations )
{
try
{
macroStream.print( KoLmafiaCLI.deriveCommand( request, iterations ) );
// Handle the gym, which is the only adventure type
// which needs to be specially handled.
if ( request instanceof KoLAdventure )
{
KoLAdventure adventure = (KoLAdventure) request;
if ( adventure.getRequest() instanceof ClanGymRequest )
{
((ClanGymRequest)adventure.getRequest()).setTurnCount( iterations );
((ClanGymRequest)adventure.getRequest()).run();
return;
}
}
// Execute the request as initially intended by calling
// a subroutine.
executeRequest( request, iterations );
}
catch ( Exception e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
}
}
private void executeRequest( Runnable request, int iterations )
{
boolean isCheckExempt = !(request instanceof KoLAdventure) || ((KoLAdventure)request).getRequest() instanceof CampgroundRequest ||
KoLCharacter.getInebriety() > 25;
if ( KoLCharacter.isFallingDown() && !isCheckExempt )
{
updateDisplay( ERROR_STATE, "You are too drunk to continue." );
return;
}
// Check to see if there are any end conditions. If
// there are conditions, be sure that they are checked
// during the iterations.
int initialConditions = conditions.size();
int remainingConditions = initialConditions;
// If this is an adventure request, make sure that it
// gets validated before running.
if ( request instanceof KoLAdventure )
{
// Validate the adventure
AdventureDatabase.validateAdventure( (KoLAdventure) request );
StaticEntity.setProperty( "lastAdventure", request.toString() );
}
// Begin the adventuring process, or the request execution
// process (whichever is applicable).
int currentIteration = 0;
boolean shouldEnableRefreshStatus = RequestFrame.isRefreshStatusEnabled();
RequestFrame.setRefreshStatusEnabled( false );
while ( permitsContinue() && ++currentIteration <= iterations )
{
if ( request instanceof KoLAdventure )
{
String nextAdventure = StaticEntity.getProperty( "nextAdventure" );
// If we got redirected, get a new request
if ( !nextAdventure.equals( "" ) )
{
request = AdventureDatabase.getAdventure( nextAdventure );
StaticEntity.setProperty( "lastAdventure", request.toString() );
StaticEntity.setProperty( "nextAdventure", "" );
}
}
// Account for the possibility that you could have run
// out of adventures mid-request.
if ( KoLCharacter.getAdventuresLeft() == 0 && request instanceof KoLAdventure )
{
iterations = currentIteration;
break;
}
// If the conditions existed and have been satisfied,
// then you should stop.
if ( conditions.size() < remainingConditions )
{
if ( conditions.size() == 0 || useDisjunction )
{
conditions.clear();
remainingConditions = 0;
break;
}
}
remainingConditions = conditions.size();
// Otherwise, disable the display and update the user
// and the current request number. Different requests
// have different displays. They are handled here.
if ( request instanceof KoLAdventure && iterations > 1 )
currentIterationString = "Request " + currentIteration + " of " + iterations + " (" + request.toString() + ") in progress...";
else if ( request instanceof KoLAdventure )
currentIterationString = "Visit to " + request.toString() + " in progress...";
else
currentIterationString = "";
if ( refusesContinue() )
return;
if ( !(request instanceof KoLAdventure) )
updateDisplay( currentIterationString );
request.run();
// Decrement the counter to null out the increment
// effect on the next iteration of the loop.
if ( request instanceof KoLAdventure && ((KoLAdventure)request).getRequest().getAdventuresUsed() == 0 )
--currentIteration;
// Prevent drunkenness adventures from occurring by
// testing inebriety levels after the request is run.
if ( KoLCharacter.isFallingDown() && !isCheckExempt )
{
updateDisplay( ERROR_STATE, "You are too drunk to continue." );
return;
}
if ( KoLCharacter.getCurrentHP() == 0 && !isCheckExempt )
{
updateDisplay( ERROR_STATE, "Ran out of health." );
return;
}
}
if ( shouldEnableRefreshStatus )
{
RequestFrame.setRefreshStatusEnabled( true );
RequestFrame.refreshStatus();
}
currentIterationString = "";
if ( !permitsContinue() )
return;
// If you've completed the requests, make sure to update
// the display.
if ( request instanceof KoLAdventure && !conditions.isEmpty() )
updateDisplay( ERROR_STATE, "Conditions not satisfied after " + (currentIteration - 1) +
((currentIteration == 2) ? " request." : " requests.") );
else if ( initialConditions != 0 && conditions.isEmpty() )
updateDisplay( "Conditions satisfied after " + (currentIteration - 1) +
((currentIteration == 2) ? " request." : " requests.") );
else if ( !(request instanceof UseSkillRequest || request instanceof LoginRequest || request instanceof LogoutRequest) )
updateDisplay( iterations > 1 ? "Requests completed." : "Request completed." );
}
/**
* Removes the effects which are removed through a tiny house.
* This checks each status effect and checks the database to
* see if a tiny house will remove it.
*/
public void applyTinyHouseEffect()
{
Object [] effects = KoLCharacter.getEffects().toArray();
AdventureResult currentEffect;
for ( int i = effects.length - 1; i >= 0; --i )
{
currentEffect = (AdventureResult) effects[i];
if ( StatusEffectDatabase.isTinyHouseClearable( currentEffect.getName() ) )
KoLCharacter.getEffects().remove(i);
}
}
/**
* Makes a request which attempts to remove the given effect.
*/
public abstract void makeUneffectRequest();
/**
* Makes a request which attempts to zap a chosen item
*/
public abstract void makeZapRequest();
/**
* Makes a request which attempts to smash a chosen item
*/
public abstract void makePulverizeRequest();
/**
* Makes a request to the hermit in order to trade worthless
* items for more useful items.
*/
public abstract void makeHermitRequest();
/**
* Makes a request to the trapper to trade yeti furs for
* other kinds of furs.
*/
public abstract void makeTrapperRequest();
/**
* Makes a request to the hunter to trade today's bounty
* items in for meat.
*/
public abstract void makeHunterRequest();
/**
* Makes a request to the untinkerer to untinker items
* into their component parts.
*/
public abstract void makeUntinkerRequest();
/**
* Makes a request to set the mind control device to the desired value
*/
public abstract void makeMindControlRequest();
/**
* Completes the infamous tavern quest.
*/
public int locateTavernFaucet()
{
// Determine if the faucet has already been solved
// before; if it has, don't bother trying again.
StringBuffer lastUse = new StringBuffer( StaticEntity.getProperty( "lastFaucetUse" ) );
Integer searchIndex = Integer.valueOf( StaticEntity.getProperty( "lastFaucetLocation" ) );
String lastUseString = lastUse.toString();
if ( !lastUseString.startsWith( KoLCharacter.getAscensions() + ":" ) )
{
searchIndex = new Integer( -1 );
lastUse.setLength( 0 );
lastUse.append( KoLCharacter.getAscensions() );
lastUse.append( ": " );
lastUseString = lastUse.toString();
StaticEntity.setProperty( "lastFaucetUse", lastUseString );
StaticEntity.setProperty( "lastFaucetLocation", "-1" );
}
// Determine which elements have already been checked
// so you don't check through them again.
ArrayList searchList = new ArrayList();
for ( int i = 1; i <= 25; ++i )
{
if ( lastUseString.indexOf( "[" + i + "]" ) == -1 )
searchList.add( new Integer(i) );
}
// If the faucet has not yet been found, then go through
// the process of trying to locate it.
KoLAdventure adventure = new KoLAdventure( this, "", "rats.php", "", "Typical Tavern (Pre-Rat)" );
boolean foundFaucet = false;
if ( searchIndex.intValue() < 0 )
{
if ( KoLCharacter.getLevel() < 3 )
{
updateDisplay( ERROR_STATE, "You need to level up first." );
return -1;
}
KoLRequest request = new KoLRequest( this, "council.php", true );
request.run();
if ( request.responseText != null && request.responseText.indexOf( "rat problems" ) == -1 )
{
updateDisplay( ERROR_STATE, "This quest is not available." );
return -1;
}
updateDisplay( "Searching for faucet..." );
adventure.run();
// Random guess instead of straightforward search
// for the location of the faucet (lowers the chance
// of bad results if the faucet is near the end).
do
{
searchIndex = (Integer) searchList.remove( RNG.nextInt( searchList.size() ) );
lastUse.append( '[' );
lastUse.append( searchIndex );
lastUse.append( ']' );
StaticEntity.setProperty( "lastFaucetUse", lastUse.toString() );
adventure.getRequest().clearDataFields();
adventure.getRequest().addFormField( "where", searchIndex.toString() );
adventure.run();
foundFaucet = adventure.getRequest().responseText != null &&
adventure.getRequest().responseText.indexOf( "faucetoff" ) != -1;
}
while ( !foundFaucet && KoLCharacter.getCurrentHP() > 0 && KoLCharacter.getAdventuresLeft() > 0 );
}
// If you have not yet found the faucet, be sure
// to set the settings so that your next attempt
// does not repeat located squares.
if ( !foundFaucet )
{
updateDisplay( ERROR_STATE, "Unable to find faucet. " + searchList.size() + " squares unchecked." );
return -1;
}
// Otherwise, you've found it! So notify the user
// that the faucet has been found.
StaticEntity.setProperty( "lastFaucetLocation", searchIndex.toString() );
int faucetRow = (int) ((searchIndex.intValue() - 1) / 5) + 1;
int faucetColumn = (searchIndex.intValue() - 1) % 5 + 1;
updateDisplay( "Faucet found in row " + faucetRow + ", column " + faucetColumn );
return searchIndex.intValue();
}
/**
* Trades items with the guardian of the goud.
*/
public void tradeGourdItems()
{
updateDisplay( "Determining items needed..." );
KoLRequest request = new KoLRequest( this, "town_right.php?place=gourd", true );
request.run();
// For every class, it's the same -- the message reads, "Bring back"
// and then the number of the item needed. Compare how many you need
// with how many you have.
Matcher neededMatcher = Pattern.compile( "Bring back (\\d+)" ).matcher( request.responseText );
AdventureResult item;
switch ( KoLCharacter.getPrimeIndex() )
{
case 0:
item = new AdventureResult( 747, 5 );
break;
case 1:
item = new AdventureResult( 559, 5 );
break;
default:
item = new AdventureResult( 27, 5 );
}
int neededCount = neededMatcher.find() ? StaticEntity.parseInt( neededMatcher.group(1) ) : 26;
while ( neededCount <= 25 && neededCount <= item.getCount( KoLCharacter.getInventory() ) )
{
updateDisplay( "Giving up " + neededCount + " " + item.getName() + "s..." );
request = new KoLRequest( this, "town_right.php?place=gourd&action=gourd", true );
request.run();
processResult( item.getInstance( 0 - neededCount++ ) );
}
int totalProvided = 0;
for ( int i = 5; i < neededCount; ++i )
totalProvided += i;
updateDisplay( "Gourd trading complete (" + totalProvided + " " + item.getName() + "s given so far)." );
}
public void unlockGuildStore()
{
// Refresh the player's stats in order to get current
// stat values to see if the quests can be completed.
(new CharsheetRequest( this )).run();
int baseStatValue = 0;
int totalStatValue = 0;
switch ( KoLCharacter.getPrimeIndex() )
{
case 0:
baseStatValue = KoLCharacter.getBaseMuscle();
totalStatValue = baseStatValue + KoLCharacter.getAdjustedMuscle();
break;
case 1:
baseStatValue = KoLCharacter.getBaseMysticality();
totalStatValue = baseStatValue + KoLCharacter.getAdjustedMysticality();
break;
case 2:
baseStatValue = KoLCharacter.getBaseMoxie();
totalStatValue = baseStatValue + KoLCharacter.getAdjustedMoxie();
break;
}
// The wiki claims that your prime stats are somehow connected,
// but the exact procedure is uncertain. Therefore, just allow
// the person to attempt to unlock their store, regardless of
// their current stats.
updateDisplay( "Entering guild challenge area..." );
KoLRequest request = new KoLRequest( this, "guild.php?place=challenge", true );
request.run();
for ( int i = 1; i <= 4; ++i )
{
updateDisplay( "Completing guild task " + i + "..." );
request = new KoLRequest( this, "guild.php?action=chal", true );
request.run();
}
processResult( new AdventureResult( AdventureResult.ADV, -4 ) );
if ( KoLCharacter.getLevel() >= 4 )
{
request = new KoLRequest( this, "guild.php?place=paco", true );
request.run();
}
updateDisplay( "Guild store unlocked (maybe)." );
}
public void priceItemsAtLowestPrice()
{
(new StoreManageRequest( this )).run();
// Now determine the desired prices on items.
// If the value of an item is currently 100,
// then remove the item from the store.
StoreManager.SoldItem [] sold = new StoreManager.SoldItem[ StoreManager.getSoldItemList().size() ];
StoreManager.getSoldItemList().toArray( sold );
int [] itemID = new int[ sold.length ];
int [] prices = new int[ sold.length ];
int [] limits = new int[ sold.length ];
for ( int i = 0; i < sold.length; ++i )
{
limits[i] = sold[i].getLimit();
itemID[i] = sold[i].getItemID();
int minimumPrice = TradeableItemDatabase.getPriceByID( sold[i].getItemID() ) * 2;
if ( sold[i].getPrice() == 999999999 && minimumPrice > 0 )
{
minimumPrice = Math.max( 100, minimumPrice );
int desiredPrice = sold[i].getLowest() - (sold[i].getLowest() % 100);
prices[i] = desiredPrice < minimumPrice ? minimumPrice : desiredPrice;
}
else
prices[i] = sold[i].getPrice();
}
(new StoreManageRequest( this, itemID, prices, limits )).run();
updateDisplay( "Repricing complete." );
}
/**
* Show an HTML string to the user
*/
public abstract void showHTML( String text, String title );
/**
* Retrieves whether or not continuation of an adventure or request
* is permitted by the client, or by current circumstances in-game.
*
* @return <code>true</code> if requests are allowed to continue
*/
public static synchronized final boolean permitsContinue()
{ return continuationState == CONTINUE_STATE;
}
/**
* Retrieves whether or not continuation of an adventure or request
* will be denied by the client, regardless of continue state reset,
* until the display is enable (ie: in an abort state).
*
* @return <code>true</code> if requests are allowed to continue
*/
public static synchronized final boolean refusesContinue()
{ return continuationState == ABORT_STATE;
}
/**
* Forces a continue state. This should only be called when
* there is no doubt that a continue should occur.
*
* @return <code>true</code> if requests are allowed to continue
*/
public static synchronized final void forceContinue()
{ continuationState = CONTINUE_STATE;
}
/**
* Initializes a stream for logging debugging information. This
* method creates a <code>KoLmafia.log</code> file in the default
* directory if one does not exist, or appends to the existing
* log. This method should only be invoked if the user wishes to
* assist in beta testing because the output is VERY verbose.
*/
public static final void openDebugStream()
{
// First, ensure that a log stream has not already been
// initialized - this can be checked by observing what
// class the current log stream is.
if ( !(debugStream instanceof NullStream) )
return;
try
{
File f = new File( "KoLmafia.log" );
if ( !f.exists() )
f.createNewFile();
debugStream = new LogStream( f );
debugStream.println();
debugStream.println();
debugStream.println( "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" );
debugStream.println( " Beginning New Logging Session (" + VERSION_NAME + ")" );
debugStream.println( "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" );
debugStream.println( " Please note: do not post these logs in the KoLmafia thread. If " );
debugStream.println( " you would like us to look at the log, please instead email logs " );
debugStream.println( " to holatuwol@hotmail.com using the subject [KoLmafia] Debug Log " );
debugStream.println( "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" );
debugStream.println();
debugStream.println();
}
catch ( IOException e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
}
}
public static final void closeDebugStream()
{
debugStream.close();
debugStream = NullStream.INSTANCE;
}
/**
* Initializes a stream for logging debugging information. This
* method creates a <code>KoLmafia.log</code> file in the default
* directory if one does not exist, or appends to the existing
* log. This method should only be invoked if the user wishes to
* assist in beta testing because the output is VERY verbose.
*/
public static final void openSessionStream()
{
// First, ensure that a log stream has not already been
// initialized - this can be checked by observing what
// class the current log stream is.
if ( !(sessionStream instanceof NullStream) )
return;
if ( KoLCharacter.getUsername().equals( "" ) )
return;
try
{
File f = new File( "sessions/" + KoLCharacter.getUsername() + "_" +
DATED_FILENAME_FORMAT.format( new Date() ) + ".txt" );
if ( !f.getParentFile().exists() )
f.getParentFile().mkdirs();
if ( !f.exists() )
f.createNewFile();
sessionStream = new LogStream( f );
}
catch ( IOException e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
}
}
public static final void closeSessionStream()
{
sessionStream.close();
sessionStream = NullStream.INSTANCE;
}
/**
* Retrieves the stream currently used for logging output for
* the URL/session logger.
*/
public static final PrintStream getSessionStream()
{ return sessionStream;
}
/**
* Retrieves the stream currently used for logging debug output.
* @return The stream used for debug output
*/
public static final PrintStream getDebugStream()
{ return debugStream;
}
/**
* Initializes the macro recording stream. This will only
* work if no macro streams are currently running. If
* a call is made while a macro stream exists, this method
* does nothing.
*
* @param filename The name of the file to be created
*/
public static final void openMacroStream( String filename )
{
// First, ensure that a macro stream has not already been
// initialized - this can be checked by observing what
// class the current macro stream is.
if ( !(macroStream instanceof NullStream) )
return;
try
{
File f = new File( filename );
if ( !f.exists() )
{
f.getParentFile().mkdirs();
f.createNewFile();
}
macroStream = new PrintStream( new FileOutputStream( f, false ) );
}
catch ( IOException e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
}
}
/**
* Retrieves the macro stream.
* @return The macro stream associated with this client
*/
public static final PrintStream getMacroStream()
{ return macroStream;
}
/**
* Deinitializes the macro stream.
*/
public static final void closeMacroStream()
{
macroStream.close();
macroStream = NullStream.INSTANCE;
}
/**
* Utility method used to decode a saved password.
* This should be called whenever a new password
* intends to be stored in the global file.
*/
public final void addSaveState( String username, String password )
{
try
{
if ( !saveStateNames.contains( username ) )
saveStateNames.add( username );
storeSaveStates();
String utfString = URLEncoder.encode( password, "UTF-8" );
StringBuffer encodedString = new StringBuffer();
char currentCharacter;
for ( int i = 0; i < utfString.length(); ++i )
{
currentCharacter = utfString.charAt(i);
switch ( currentCharacter )
{
case '-': encodedString.append( "2D" ); break;
case '.': encodedString.append( "2E" ); break;
case '*': encodedString.append( "2A" ); break;
case '_': encodedString.append( "5F" ); break;
case '+': encodedString.append( "20" ); break;
case '%':
encodedString.append( utfString.charAt( ++i ) );
encodedString.append( utfString.charAt( ++i ) );
break;
default:
encodedString.append( Integer.toHexString( (int) currentCharacter ).toUpperCase() );
break;
}
}
StaticEntity.setProperty( "saveState." + username.toLowerCase(), (new BigInteger( encodedString.toString(), 36 )).toString( 10 ) );
}
catch ( java.io.UnsupportedEncodingException e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
}
}
public void removeSaveState( String loginname )
{
if ( loginname == null )
return;
for ( int i = 0; i < saveStateNames.size(); ++i )
if ( ((String)saveStateNames.get(i)).equalsIgnoreCase( loginname ) )
{
saveStateNames.remove( i );
storeSaveStates();
return;
}
}
private final void storeSaveStates()
{
StringBuffer saveStateBuffer = new StringBuffer();
String [] names = new String[ saveStateNames.size() ];
saveStateNames.toArray( names );
List lowerCaseNames = new ArrayList();
for ( int i = 0; i < names.length; ++i )
{
if ( lowerCaseNames.contains( names[i].toLowerCase() ) )
{
saveStateNames.remove( names[i] );
lowerCaseNames.remove( names[i].toLowerCase() );
}
lowerCaseNames.add( names[i].toLowerCase() );
}
if ( names.length != saveStateNames.size() )
{
names = new String[ saveStateNames.size() ];
saveStateNames.toArray( names );
}
if ( names.length > 0 )
{
saveStateBuffer.append( names[0] );
for ( int i = 1; i < names.length; ++i )
{
saveStateBuffer.append( "//" );
saveStateBuffer.append( names[i] );
}
}
StaticEntity.setProperty( "saveState", saveStateBuffer.toString() );
}
/**
* Utility method used to decode a saved password.
* This should be called whenever a new password
* intends to be stored in the global file.
*/
public final String getSaveState( String loginname )
{
try
{
String password = StaticEntity.getProperty( "saveState." + loginname.toLowerCase() );
if ( password == null || password.length() == 0 )
return null;
String hexString = (new BigInteger( password, 10 )).toString( 36 );
StringBuffer utfString = new StringBuffer();
for ( int i = 0; i < hexString.length(); ++i )
{
utfString.append( '%' );
utfString.append( hexString.charAt(i) );
utfString.append( hexString.charAt(++i) );
}
return URLDecoder.decode( utfString.toString(), "UTF-8" );
}
catch ( java.io.UnsupportedEncodingException e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e );
return null;
}
}
public SortedListModel getSessionTally()
{ return tally;
}
public SortedListModel getConditions()
{ return conditions;
}
public LockableListModel getAdventureList()
{ return adventureList;
}
public LockableListModel getEncounterList()
{ return encounterList;
}
public boolean checkRequirements( List requirements )
{
AdventureResult [] requirementsArray = new AdventureResult[ requirements.size() ];
requirements.toArray( requirementsArray );
int missingCount;
missingItems.clear();
// Check the items required for this quest,
// retrieving any items which might be inside
// of a closet somewhere.
for ( int i = 0; i < requirementsArray.length; ++i )
{
if ( requirementsArray[i] == null )
continue;
missingCount = 0;
if ( requirementsArray[i].isItem() )
{
AdventureDatabase.retrieveItem( requirementsArray[i] );
missingCount = requirementsArray[i].getCount() - requirementsArray[i].getCount( KoLCharacter.getInventory() );
if ( KoLCharacter.hasEquipped( requirementsArray[i] ) )
--missingCount;
}
else if ( requirementsArray[i].isStatusEffect() )
{
// Status effects should be compared against
// the status effects list. This is used to
// help people detect which effects they are
// missing (like in PVP).
missingCount = requirementsArray[i].getCount() - requirementsArray[i].getCount( KoLCharacter.getEffects() );
}
else if ( requirementsArray[i].getName().equals( AdventureResult.MEAT ) )
{
// Currency is compared against the amount
// actually liquid -- amount in closet is
// ignored in this case.
missingCount = requirementsArray[i].getCount() - KoLCharacter.getAvailableMeat();
}
if ( missingCount > 0 )
{
// If there are any missing items, add
// them to the list of needed items.
missingItems.add( requirementsArray[i].getInstance( missingCount ) );
}
}
// If there are any missing requirements
// be sure to return false. Otherwise,
// you managed to get everything.
return missingItems.isEmpty();
}
/**
* Utility method used to print a list to the given output
* stream. If there's a need to print to the current output
* stream, simply pass the output stream to this method.
*/
protected void printList( List printing )
{
Object [] elements = new Object[ printing.size() ];
printing.toArray( elements );
for ( int i = 0; i < elements.length; ++i )
KoLmafiaCLI.printLine( elements[i].toString() );
}
/**
* Utility method used to purchase the given number of items
* from the mall using the given purchase requests.
*/
public void makePurchases( List results, Object [] purchases, int maxPurchases )
{
if ( purchases.length > 0 && purchases[0] instanceof MallPurchaseRequest )
macroStream.print( "buy " + maxPurchases + " " + ((MallPurchaseRequest)purchases[0]).getItemName() );
MallPurchaseRequest currentRequest;
int purchaseCount = 0;
for ( int i = 0; i < purchases.length && purchaseCount != maxPurchases && permitsContinue(); ++i )
{
if ( purchases[i] instanceof MallPurchaseRequest )
{
currentRequest = (MallPurchaseRequest) purchases[i];
if ( !KoLCharacter.canInteract() && currentRequest.getQuantity() != MallPurchaseRequest.MAX_QUANTITY )
{
updateDisplay( ERROR_STATE, "You are not yet out of ronin." );
return;
}
AdventureResult result = new AdventureResult( currentRequest.getItemName(), 0, false );
// Keep track of how many of the item you had before
// you run the purchase request
int oldResultCount = result.getCount( KoLCharacter.getInventory() );
int previousLimit = currentRequest.getLimit();
currentRequest.setLimit( Math.min( previousLimit, maxPurchases - purchaseCount ) );
currentRequest.run();
// Calculate how many of the item you have now after
// you run the purchase request
int newResultCount = result.getCount( KoLCharacter.getInventory() );
purchaseCount += newResultCount - oldResultCount;
// Remove the purchase from the list! Because you
// have already made a purchase from the store
if ( permitsContinue() )
{
if ( currentRequest.getQuantity() == currentRequest.getLimit() )
results.remove( currentRequest );
else if ( currentRequest.getQuantity() == MallPurchaseRequest.MAX_QUANTITY )
currentRequest.setLimit( MallPurchaseRequest.MAX_QUANTITY );
else
{
if ( currentRequest.getLimit() == previousLimit )
currentRequest.setCanPurchase( false );
currentRequest.setQuantity( currentRequest.getQuantity() - currentRequest.getLimit() );
currentRequest.setLimit( previousLimit );
}
}
else
currentRequest.setLimit( previousLimit );
}
}
// With all that information parsed out, we should
// refresh the lists at the very end.
if ( purchaseCount == maxPurchases || maxPurchases == Integer.MAX_VALUE )
updateDisplay( "Purchases complete." );
else
updateDisplay( ERROR_STATE, "Desired purchase quantity not reached." );
}
/**
* Utility method used to register a given adventure in
* the running adventure summary.
*/
public void registerAdventure( KoLAdventure adventureLocation )
{
String adventureName = StaticEntity.getProperty( "lastAdventure" );
RegisteredEncounter lastAdventure = (RegisteredEncounter) adventureList.lastElement();
if ( lastAdventure != null && lastAdventure.name.equals( adventureName ) )
{
++lastAdventure.encounterCount;
// Manually set to force repainting in GUI
adventureList.set( adventureList.size() - 1, lastAdventure );
}
else
adventureList.add( new RegisteredEncounter( adventureName ) );
StaticEntity.setProperty( "lastAdventure", adventureLocation.toString() );
}
/**
* Utility method used to register a given encounter in
* the running adventure summary.
*/
public void registerEncounter( String encounterName )
{
encounterName = encounterName.trim();
RegisteredEncounter [] encounters = new RegisteredEncounter[ encounterList.size() ];
encounterList.toArray( encounters );
for ( int i = 0; i < encounters.length; ++i )
{
if ( encounters[i].name.equals( encounterName ) )
{
++encounters[i].encounterCount;
// Manually set to force repainting in GUI
encounterList.set( i, encounters[i] );
return;
}
}
encounterList.add( new RegisteredEncounter( encounterName ) );
}
private class RegisteredEncounter implements Comparable
{
private String name;
private int encounterCount;
public RegisteredEncounter( String name )
{
this.name = name;
encounterCount = 1;
}
public String toString()
{ return name + " (" + encounterCount + ")";
}
public int compareTo( Object o )
{
return !(o instanceof RegisteredEncounter) || o == null ? -1 :
name.compareToIgnoreCase( ((RegisteredEncounter)o).name );
}
}
public KoLRequest getCurrentRequest()
{ return currentRequest;
}
public void setCurrentRequest( KoLRequest request)
{ currentRequest = request;
}
public final String [] extractTargets( String targetList )
{
// If there are no targets in the list, then
// return absolutely nothing.
if ( targetList == null || targetList.trim().length() == 0 )
return new String[0];
// Otherwise, split the list of targets, and
// determine who all the unique targets are.
String [] targets = targetList.trim().split( "\\s*,\\s*" );
for ( int i = 0; i < targets.length; ++i )
targets[i] = getPlayerID( targets[i] ) == null ? targets[i] :
getPlayerID( targets[i] );
// Sort the list in order to increase the
// speed of duplicate detection.
Arrays.sort( targets );
// Determine who all the duplicates are.
int uniqueListSize = targets.length;
for ( int i = 1; i < targets.length; ++i )
{
if ( targets[i].equals( targets[ i - 1 ] ) )
{
targets[ i - 1 ] = null;
--uniqueListSize;
}
}
// Now, create the list of unique targets;
// if the list has the same size as the original,
// you can skip this step.
if ( uniqueListSize != targets.length )
{
int addedCount = 0;
String [] uniqueList = new String[ uniqueListSize ];
for ( int i = 0; i < targets.length; ++i )
if ( targets[i] != null )
uniqueList[ addedCount++ ] = targets[i];
targets = uniqueList;
}
// Convert all the user IDs back to the
// original player names so that the results
// are easy to understand for the user.
for ( int i = 0; i < targets.length; ++i )
targets[i] = getPlayerName( targets[i] ) == null ? targets[i] :
getPlayerName( targets[i] );
// Sort the list one more time, this time
// by player name.
Arrays.sort( targets );
// Parsing complete. Return the list of
// unique targets.
return targets;
}
public final void downloadAdventureOverride()
{
updateDisplay( "Downloading override data files..." );
try
{
for ( int i = 0; i < OVERRIDE_DATA.length; ++i )
{
BufferedReader reader = new BufferedReader( new InputStreamReader(
(InputStream) (new URL( "http://kolmafia.sourceforge.net/data/" + OVERRIDE_DATA[i] )).getContent() ) );
File output = new File( "data/" + OVERRIDE_DATA[i] );
if ( output.exists() )
output.delete();
String line;
PrintStream writer = new PrintStream( new FileOutputStream( output ) );
while ( (line = reader.readLine()) != null )
writer.println( line );
writer.close();
}
}
catch ( IOException e )
{
// This should not happen. Therefore, print
// a stack trace for debug purposes.
StaticEntity.printStackTrace( e, "Data file update failed" );
return;
}
updateDisplay( "Download completed. Please restart to complete the update." );
}
public static boolean isRunningBetweenBattleChecks()
{ return recoveryActive;
}
public void runBetweenBattleChecks()
{
// Do not run between battle checks if you are in the middle
// of your checks or if you have aborted.
if ( recoveryActive || refusesContinue() )
return;
if ( !(getCurrentRequest() instanceof CampgroundRequest) )
{
recoveryActive = true;
// First, run the between battle script defined by the
// user, which may make it so that none of the built
// in behavior needs to run.
String scriptPath = StaticEntity.getProperty( "betweenBattleScript" );
if ( !scriptPath.equals( "" ) )
DEFAULT_SHELL.executeLine( scriptPath );
// Now, run the built-in behavior to take care of
// any loose ends.
MoodSettings.execute();
recoverHP();
recoverMP();
recoveryActive = false;
}
if ( permitsContinue() )
{
updateDisplay( currentIterationString );
currentIterationString = "";
}
}
public void startRelayServer()
{
LocalRelayServer.startThread();
// Wait for 5 seconds before giving up
// on the relay server.
for ( int i = 0; i < 50 && !LocalRelayServer.isRunning(); ++i )
KoLRequest.delay( 100 );
if ( !LocalRelayServer.isRunning() )
return;
// Even after the wait, sometimes, the
// worker threads have not been filled.
StaticEntity.openSystemBrowser( "http://127.0.0.1:" + LocalRelayServer.getPort() + (KoLRequest.isCompactMode ? "/main_c.html" : "/main.html") );
}
public void launchSimulator()
{
LocalRelayServer.startThread();
// Wait for 5 seconds before giving up
// on the relay server.
for ( int i = 0; i < 50 && !LocalRelayServer.isRunning(); ++i )
KoLRequest.delay( 100 );
if ( !LocalRelayServer.isRunning() )
return;
// Even after the wait, sometimes, the
// worker threads have not been filled.
StaticEntity.openSystemBrowser( "http://127.0.0.1:" + LocalRelayServer.getPort() + "/KoLmafia/simulator/index.html" );
}
public static synchronized final void declareWorldPeace()
{
KoLmafiaCLI.printLine( "KoLmafia declares world peace." );
updateDisplay( ABORT_STATE, "KoLmafia declares world peace." );
}
public boolean shouldMakeConflictingRequest()
{ return currentRequest == null || !(currentRequest instanceof FightRequest) || currentRequest.getAdventuresUsed() == 1;
}
public void removeAllItemsFromStore()
{
(new StoreManageRequest( this )).run();
// Now determine the desired prices on items.
// If the value of an item is currently 100,
// then remove the item from the store.
StoreManager.SoldItem [] sold = new StoreManager.SoldItem[ StoreManager.getSoldItemList().size() ];
StoreManager.getSoldItemList().toArray( sold );
for ( int i = 0; i < sold.length && permitsContinue(); ++i )
(new StoreManageRequest( this, sold[i].getItemID() )).run();
updateDisplay( "Store emptying complete." );
}
/**
* Hosts a massive sale on the items currently in your store.
* Utilizes the "minimum meat" principle.
*/
public void makeEndOfRunSaleRequest()
{
if ( !KoLCharacter.canInteract() )
{
updateDisplay( ERROR_STATE, "You are not yet out of ronin." );
return;
}
if ( JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog( null,
"Are you sure you'd like to host an end-of-run sale?", "MASSIVE SALE", JOptionPane.YES_NO_OPTION ) )
return;
// Find all tradeable items. Tradeable items
// are marked by an autosell value of nonzero.
AdventureResult [] items = new AdventureResult[ KoLCharacter.getInventory().size() ];
KoLCharacter.getInventory().toArray( items );
ArrayList autosell = new ArrayList();
ArrayList automall = new ArrayList();
// Only place items in the mall which are not
// sold in NPC stores -- everything else, make
// sure you autosell.
for ( int i = 0; i < items.length; ++i )
{
if ( TradeableItemDatabase.getPriceByID( items[i].getItemID() ) != 0 )
{
if ( NPCStoreDatabase.contains( items[i].getName(), false ) )
autosell.add( items[i] );
else
automall.add( items[i] );
}
}
// Now, place all the items in the mall at the
// maximum possible price. This allows KoLmafia
// to determine the minimum price.
if ( autosell.size() > 0 && permitsContinue() )
(new AutoSellRequest( this, autosell.toArray(), AutoSellRequest.AUTOSELL )).run();
if ( automall.size() > 0 && permitsContinue() )
(new AutoSellRequest( this, automall.toArray(), AutoSellRequest.AUTOMALL )).run();
// Now, remove all the items that you intended
// to remove from the store due to pricing issues.
if ( permitsContinue() )
priceItemsAtLowestPrice();
updateDisplay( "Undercutting sale complete." );
}
protected void handleAscension()
{
refreshSession();
MoodSettings.setMood( "apathetic" );
enableDisplay();
sessionStream.println();
sessionStream.println();
sessionStream.println( "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" );
sessionStream.println( " Beginning New Ascension " );
sessionStream.println( "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" );
sessionStream.println();
sessionStream.println();
}
public void loadPreferredBrowser()
{
if ( StaticEntity.getProperty( "defaultToRelayBrowser" ).equals( "true" ) )
startRelayServer();
else
(new CreateFrameRunnable( RequestFrame.class )).run();
}
}
| [
"shwei@users.sourceforge.net"
] | shwei@users.sourceforge.net |
2997b3c5b6a88731c93fcef2883cb34ad189b8c4 | 45e739efcd364adbfb3bdef0266fad14faa0d7d7 | /src/main/java/com/challenge/ridesharer/model/Poll.java | 794c534285b6db60d67f73444d2ac732f16ba3eb | [
"Apache-2.0"
] | permissive | AadityaDev/RideSharer | 3ef25a9c25907f168da60dc112145393a3d431fd | ae629ac2c3b23f69696154be7f3781079670508e | refs/heads/master | 2020-03-14T12:08:28.899268 | 2018-05-02T18:38:35 | 2018-05-02T18:38:35 | 131,605,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,965 | java | package com.challenge.ridesharer.model;
import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import com.challenge.ridesharer.model.audit.UserDateAudit;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
@Entity
@Table(name = "polls")
public class Poll extends UserDateAudit {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotBlank
@Size(max = 140)
private String question;
@OneToMany(
mappedBy = "poll",
cascade = CascadeType.ALL,
fetch = FetchType.EAGER,
orphanRemoval = true
)
@Size(min = 2, max = 6)
@Fetch(FetchMode.SELECT)
@BatchSize(size = 30)
private List<Choice> choices = new ArrayList<>();
@NotNull
private Instant expirationDateTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public List<Choice> getChoices() {
return choices;
}
public void setChoices(List<Choice> choices) {
this.choices = choices;
}
public Instant getExpirationDateTime() {
return expirationDateTime;
}
public void setExpirationDateTime(Instant expirationDateTime) {
this.expirationDateTime = expirationDateTime;
}
public void addChoice(Choice choice) {
choices.add(choice);
choice.setPoll(this);
}
public void removeChoice(Choice choice) {
choices.remove(choice);
choice.setPoll(null);
}
}
| [
"adityaverma.dev@gmail.com"
] | adityaverma.dev@gmail.com |
0d5e620fcba3375a83dc62c370d6b0b4f16edbd7 | 094f9626316e41eef403922284e75577c26c3f62 | /src/main/java/mesosphere/marathon/Protos.java | 633421dcc6a0a20586e5260c59e079750542ecc0 | [
"Apache-2.0"
] | permissive | devops06/marathon | 19872aed45f517a9f6b2f646740af99d26093681 | 940fbd11a6488ece0fe220145dbb1e57ee56f7d8 | refs/heads/master | 2020-03-23T04:33:29.074490 | 2018-07-16T05:40:12 | 2018-07-16T05:40:12 | 141,090,903 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 1,198,496 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: marathon.proto
package mesosphere.marathon;
public final class Protos {
private Protos() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface ConstraintOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string field = 1;
/**
* <code>required string field = 1;</code>
*/
boolean hasField();
/**
* <code>required string field = 1;</code>
*/
java.lang.String getField();
/**
* <code>required string field = 1;</code>
*/
com.google.protobuf.ByteString
getFieldBytes();
// required .mesosphere.marathon.Constraint.Operator operator = 2;
/**
* <code>required .mesosphere.marathon.Constraint.Operator operator = 2;</code>
*/
boolean hasOperator();
/**
* <code>required .mesosphere.marathon.Constraint.Operator operator = 2;</code>
*/
mesosphere.marathon.Protos.Constraint.Operator getOperator();
// optional string value = 3;
/**
* <code>optional string value = 3;</code>
*/
boolean hasValue();
/**
* <code>optional string value = 3;</code>
*/
java.lang.String getValue();
/**
* <code>optional string value = 3;</code>
*/
com.google.protobuf.ByteString
getValueBytes();
}
/**
* Protobuf type {@code mesosphere.marathon.Constraint}
*/
public static final class Constraint extends
com.google.protobuf.GeneratedMessage
implements ConstraintOrBuilder {
// Use Constraint.newBuilder() to construct.
private Constraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Constraint(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Constraint defaultInstance;
public static Constraint getDefaultInstance() {
return defaultInstance;
}
public Constraint getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Constraint(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
field_ = input.readBytes();
break;
}
case 16: {
int rawValue = input.readEnum();
mesosphere.marathon.Protos.Constraint.Operator value = mesosphere.marathon.Protos.Constraint.Operator.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(2, rawValue);
} else {
bitField0_ |= 0x00000002;
operator_ = value;
}
break;
}
case 26: {
bitField0_ |= 0x00000004;
value_ = input.readBytes();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Constraint_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Constraint_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.Constraint.class, mesosphere.marathon.Protos.Constraint.Builder.class);
}
public static com.google.protobuf.Parser<Constraint> PARSER =
new com.google.protobuf.AbstractParser<Constraint>() {
public Constraint parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Constraint(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Constraint> getParserForType() {
return PARSER;
}
/**
* Protobuf enum {@code mesosphere.marathon.Constraint.Operator}
*/
public enum Operator
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>UNIQUE = 0;</code>
*
* <pre>
* Field must be unique across all tasks.
* </pre>
*/
UNIQUE(0, 0),
/**
* <code>LIKE = 1;</code>
*
* <pre>
* Field must match the regex given by value.
* </pre>
*/
LIKE(1, 1),
/**
* <code>CLUSTER = 2;</code>
*
* <pre>
* Tasks will be clustered, i.e. all tasks need to have the same value. If value is not set, any value will be
* accepted for the first task, and subsequent tasks must use that same value.
* </pre>
*/
CLUSTER(2, 2),
/**
* <code>GROUP_BY = 3;</code>
*
* <pre>
* Tasks will be grouped by field. Value specifies the minimum size of each group.
* </pre>
*/
GROUP_BY(3, 3),
/**
* <code>UNLIKE = 4;</code>
*
* <pre>
* Field must not match the regex given by value.
* </pre>
*/
UNLIKE(4, 4),
;
/**
* <code>UNIQUE = 0;</code>
*
* <pre>
* Field must be unique across all tasks.
* </pre>
*/
public static final int UNIQUE_VALUE = 0;
/**
* <code>LIKE = 1;</code>
*
* <pre>
* Field must match the regex given by value.
* </pre>
*/
public static final int LIKE_VALUE = 1;
/**
* <code>CLUSTER = 2;</code>
*
* <pre>
* Tasks will be clustered, i.e. all tasks need to have the same value. If value is not set, any value will be
* accepted for the first task, and subsequent tasks must use that same value.
* </pre>
*/
public static final int CLUSTER_VALUE = 2;
/**
* <code>GROUP_BY = 3;</code>
*
* <pre>
* Tasks will be grouped by field. Value specifies the minimum size of each group.
* </pre>
*/
public static final int GROUP_BY_VALUE = 3;
/**
* <code>UNLIKE = 4;</code>
*
* <pre>
* Field must not match the regex given by value.
* </pre>
*/
public static final int UNLIKE_VALUE = 4;
public final int getNumber() { return value; }
public static Operator valueOf(int value) {
switch (value) {
case 0: return UNIQUE;
case 1: return LIKE;
case 2: return CLUSTER;
case 3: return GROUP_BY;
case 4: return UNLIKE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<Operator>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<Operator>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Operator>() {
public Operator findValueByNumber(int number) {
return Operator.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return mesosphere.marathon.Protos.Constraint.getDescriptor().getEnumTypes().get(0);
}
private static final Operator[] VALUES = values();
public static Operator valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private Operator(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:mesosphere.marathon.Constraint.Operator)
}
private int bitField0_;
// required string field = 1;
public static final int FIELD_FIELD_NUMBER = 1;
private java.lang.Object field_;
/**
* <code>required string field = 1;</code>
*/
public boolean hasField() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string field = 1;</code>
*/
public java.lang.String getField() {
java.lang.Object ref = field_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
field_ = s;
}
return s;
}
}
/**
* <code>required string field = 1;</code>
*/
public com.google.protobuf.ByteString
getFieldBytes() {
java.lang.Object ref = field_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
field_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required .mesosphere.marathon.Constraint.Operator operator = 2;
public static final int OPERATOR_FIELD_NUMBER = 2;
private mesosphere.marathon.Protos.Constraint.Operator operator_;
/**
* <code>required .mesosphere.marathon.Constraint.Operator operator = 2;</code>
*/
public boolean hasOperator() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .mesosphere.marathon.Constraint.Operator operator = 2;</code>
*/
public mesosphere.marathon.Protos.Constraint.Operator getOperator() {
return operator_;
}
// optional string value = 3;
public static final int VALUE_FIELD_NUMBER = 3;
private java.lang.Object value_;
/**
* <code>optional string value = 3;</code>
*/
public boolean hasValue() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string value = 3;</code>
*/
public java.lang.String getValue() {
java.lang.Object ref = value_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
value_ = s;
}
return s;
}
}
/**
* <code>optional string value = 3;</code>
*/
public com.google.protobuf.ByteString
getValueBytes() {
java.lang.Object ref = value_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
value_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private void initFields() {
field_ = "";
operator_ = mesosphere.marathon.Protos.Constraint.Operator.UNIQUE;
value_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasField()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasOperator()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getFieldBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeEnum(2, operator_.getNumber());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, getValueBytes());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getFieldBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, operator_.getNumber());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, getValueBytes());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.Constraint parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.Constraint parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.Constraint parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.Constraint parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.Constraint parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.Constraint parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.Constraint parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.Constraint parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.Constraint parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.Constraint parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.Constraint prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.Constraint}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ConstraintOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Constraint_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Constraint_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.Constraint.class, mesosphere.marathon.Protos.Constraint.Builder.class);
}
// Construct using mesosphere.marathon.Protos.Constraint.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
field_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
operator_ = mesosphere.marathon.Protos.Constraint.Operator.UNIQUE;
bitField0_ = (bitField0_ & ~0x00000002);
value_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Constraint_descriptor;
}
public mesosphere.marathon.Protos.Constraint getDefaultInstanceForType() {
return mesosphere.marathon.Protos.Constraint.getDefaultInstance();
}
public mesosphere.marathon.Protos.Constraint build() {
mesosphere.marathon.Protos.Constraint result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.Constraint buildPartial() {
mesosphere.marathon.Protos.Constraint result = new mesosphere.marathon.Protos.Constraint(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.field_ = field_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.operator_ = operator_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.value_ = value_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.Constraint) {
return mergeFrom((mesosphere.marathon.Protos.Constraint)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.Constraint other) {
if (other == mesosphere.marathon.Protos.Constraint.getDefaultInstance()) return this;
if (other.hasField()) {
bitField0_ |= 0x00000001;
field_ = other.field_;
onChanged();
}
if (other.hasOperator()) {
setOperator(other.getOperator());
}
if (other.hasValue()) {
bitField0_ |= 0x00000004;
value_ = other.value_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasField()) {
return false;
}
if (!hasOperator()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.Constraint parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.Constraint) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string field = 1;
private java.lang.Object field_ = "";
/**
* <code>required string field = 1;</code>
*/
public boolean hasField() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string field = 1;</code>
*/
public java.lang.String getField() {
java.lang.Object ref = field_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
field_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string field = 1;</code>
*/
public com.google.protobuf.ByteString
getFieldBytes() {
java.lang.Object ref = field_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
field_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string field = 1;</code>
*/
public Builder setField(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
field_ = value;
onChanged();
return this;
}
/**
* <code>required string field = 1;</code>
*/
public Builder clearField() {
bitField0_ = (bitField0_ & ~0x00000001);
field_ = getDefaultInstance().getField();
onChanged();
return this;
}
/**
* <code>required string field = 1;</code>
*/
public Builder setFieldBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
field_ = value;
onChanged();
return this;
}
// required .mesosphere.marathon.Constraint.Operator operator = 2;
private mesosphere.marathon.Protos.Constraint.Operator operator_ = mesosphere.marathon.Protos.Constraint.Operator.UNIQUE;
/**
* <code>required .mesosphere.marathon.Constraint.Operator operator = 2;</code>
*/
public boolean hasOperator() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .mesosphere.marathon.Constraint.Operator operator = 2;</code>
*/
public mesosphere.marathon.Protos.Constraint.Operator getOperator() {
return operator_;
}
/**
* <code>required .mesosphere.marathon.Constraint.Operator operator = 2;</code>
*/
public Builder setOperator(mesosphere.marathon.Protos.Constraint.Operator value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
operator_ = value;
onChanged();
return this;
}
/**
* <code>required .mesosphere.marathon.Constraint.Operator operator = 2;</code>
*/
public Builder clearOperator() {
bitField0_ = (bitField0_ & ~0x00000002);
operator_ = mesosphere.marathon.Protos.Constraint.Operator.UNIQUE;
onChanged();
return this;
}
// optional string value = 3;
private java.lang.Object value_ = "";
/**
* <code>optional string value = 3;</code>
*/
public boolean hasValue() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string value = 3;</code>
*/
public java.lang.String getValue() {
java.lang.Object ref = value_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
value_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string value = 3;</code>
*/
public com.google.protobuf.ByteString
getValueBytes() {
java.lang.Object ref = value_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
value_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string value = 3;</code>
*/
public Builder setValue(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
value_ = value;
onChanged();
return this;
}
/**
* <code>optional string value = 3;</code>
*/
public Builder clearValue() {
bitField0_ = (bitField0_ & ~0x00000004);
value_ = getDefaultInstance().getValue();
onChanged();
return this;
}
/**
* <code>optional string value = 3;</code>
*/
public Builder setValueBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
value_ = value;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.Constraint)
}
static {
defaultInstance = new Constraint(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.Constraint)
}
public interface HealthCheckDefinitionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;
/**
* <code>required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;</code>
*/
boolean hasProtocol();
/**
* <code>required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;</code>
*/
mesosphere.marathon.Protos.HealthCheckDefinition.Protocol getProtocol();
// optional uint32 portIndex = 2;
/**
* <code>optional uint32 portIndex = 2;</code>
*/
boolean hasPortIndex();
/**
* <code>optional uint32 portIndex = 2;</code>
*/
int getPortIndex();
// optional uint32 gracePeriodSeconds = 3 [default = 15];
/**
* <code>optional uint32 gracePeriodSeconds = 3 [default = 15];</code>
*/
boolean hasGracePeriodSeconds();
/**
* <code>optional uint32 gracePeriodSeconds = 3 [default = 15];</code>
*/
int getGracePeriodSeconds();
// optional uint32 intervalSeconds = 4 [default = 10];
/**
* <code>optional uint32 intervalSeconds = 4 [default = 10];</code>
*/
boolean hasIntervalSeconds();
/**
* <code>optional uint32 intervalSeconds = 4 [default = 10];</code>
*/
int getIntervalSeconds();
// optional uint32 timeoutSeconds = 5 [default = 20];
/**
* <code>optional uint32 timeoutSeconds = 5 [default = 20];</code>
*/
boolean hasTimeoutSeconds();
/**
* <code>optional uint32 timeoutSeconds = 5 [default = 20];</code>
*/
int getTimeoutSeconds();
// optional string path = 6 [default = "/"];
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
boolean hasPath();
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
java.lang.String getPath();
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
com.google.protobuf.ByteString
getPathBytes();
// optional uint32 maxConsecutiveFailures = 7 [default = 3];
/**
* <code>optional uint32 maxConsecutiveFailures = 7 [default = 3];</code>
*/
boolean hasMaxConsecutiveFailures();
/**
* <code>optional uint32 maxConsecutiveFailures = 7 [default = 3];</code>
*/
int getMaxConsecutiveFailures();
// optional .mesos.CommandInfo command = 8;
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
boolean hasCommand();
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
org.apache.mesos.Protos.CommandInfo getCommand();
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
org.apache.mesos.Protos.CommandInfoOrBuilder getCommandOrBuilder();
// optional bool ignoreHttp1xx = 9 [default = false];
/**
* <code>optional bool ignoreHttp1xx = 9 [default = false];</code>
*/
boolean hasIgnoreHttp1Xx();
/**
* <code>optional bool ignoreHttp1xx = 9 [default = false];</code>
*/
boolean getIgnoreHttp1Xx();
// optional uint32 port = 10;
/**
* <code>optional uint32 port = 10;</code>
*/
boolean hasPort();
/**
* <code>optional uint32 port = 10;</code>
*/
int getPort();
}
/**
* Protobuf type {@code mesosphere.marathon.HealthCheckDefinition}
*/
public static final class HealthCheckDefinition extends
com.google.protobuf.GeneratedMessage
implements HealthCheckDefinitionOrBuilder {
// Use HealthCheckDefinition.newBuilder() to construct.
private HealthCheckDefinition(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private HealthCheckDefinition(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final HealthCheckDefinition defaultInstance;
public static HealthCheckDefinition getDefaultInstance() {
return defaultInstance;
}
public HealthCheckDefinition getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private HealthCheckDefinition(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
int rawValue = input.readEnum();
mesosphere.marathon.Protos.HealthCheckDefinition.Protocol value = mesosphere.marathon.Protos.HealthCheckDefinition.Protocol.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(1, rawValue);
} else {
bitField0_ |= 0x00000001;
protocol_ = value;
}
break;
}
case 16: {
bitField0_ |= 0x00000002;
portIndex_ = input.readUInt32();
break;
}
case 24: {
bitField0_ |= 0x00000004;
gracePeriodSeconds_ = input.readUInt32();
break;
}
case 32: {
bitField0_ |= 0x00000008;
intervalSeconds_ = input.readUInt32();
break;
}
case 40: {
bitField0_ |= 0x00000010;
timeoutSeconds_ = input.readUInt32();
break;
}
case 50: {
bitField0_ |= 0x00000020;
path_ = input.readBytes();
break;
}
case 56: {
bitField0_ |= 0x00000040;
maxConsecutiveFailures_ = input.readUInt32();
break;
}
case 66: {
org.apache.mesos.Protos.CommandInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000080) == 0x00000080)) {
subBuilder = command_.toBuilder();
}
command_ = input.readMessage(org.apache.mesos.Protos.CommandInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(command_);
command_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000080;
break;
}
case 72: {
bitField0_ |= 0x00000100;
ignoreHttp1Xx_ = input.readBool();
break;
}
case 80: {
bitField0_ |= 0x00000200;
port_ = input.readUInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_HealthCheckDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_HealthCheckDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.HealthCheckDefinition.class, mesosphere.marathon.Protos.HealthCheckDefinition.Builder.class);
}
public static com.google.protobuf.Parser<HealthCheckDefinition> PARSER =
new com.google.protobuf.AbstractParser<HealthCheckDefinition>() {
public HealthCheckDefinition parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new HealthCheckDefinition(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<HealthCheckDefinition> getParserForType() {
return PARSER;
}
/**
* Protobuf enum {@code mesosphere.marathon.HealthCheckDefinition.Protocol}
*/
public enum Protocol
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>HTTP = 0;</code>
*/
HTTP(0, 0),
/**
* <code>TCP = 1;</code>
*/
TCP(1, 1),
/**
* <code>COMMAND = 2;</code>
*/
COMMAND(2, 2),
/**
* <code>HTTPS = 3;</code>
*/
HTTPS(3, 3),
;
/**
* <code>HTTP = 0;</code>
*/
public static final int HTTP_VALUE = 0;
/**
* <code>TCP = 1;</code>
*/
public static final int TCP_VALUE = 1;
/**
* <code>COMMAND = 2;</code>
*/
public static final int COMMAND_VALUE = 2;
/**
* <code>HTTPS = 3;</code>
*/
public static final int HTTPS_VALUE = 3;
public final int getNumber() { return value; }
public static Protocol valueOf(int value) {
switch (value) {
case 0: return HTTP;
case 1: return TCP;
case 2: return COMMAND;
case 3: return HTTPS;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<Protocol>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<Protocol>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Protocol>() {
public Protocol findValueByNumber(int number) {
return Protocol.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return mesosphere.marathon.Protos.HealthCheckDefinition.getDescriptor().getEnumTypes().get(0);
}
private static final Protocol[] VALUES = values();
public static Protocol valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private Protocol(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:mesosphere.marathon.HealthCheckDefinition.Protocol)
}
private int bitField0_;
// required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;
public static final int PROTOCOL_FIELD_NUMBER = 1;
private mesosphere.marathon.Protos.HealthCheckDefinition.Protocol protocol_;
/**
* <code>required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;</code>
*/
public boolean hasProtocol() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinition.Protocol getProtocol() {
return protocol_;
}
// optional uint32 portIndex = 2;
public static final int PORTINDEX_FIELD_NUMBER = 2;
private int portIndex_;
/**
* <code>optional uint32 portIndex = 2;</code>
*/
public boolean hasPortIndex() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional uint32 portIndex = 2;</code>
*/
public int getPortIndex() {
return portIndex_;
}
// optional uint32 gracePeriodSeconds = 3 [default = 15];
public static final int GRACEPERIODSECONDS_FIELD_NUMBER = 3;
private int gracePeriodSeconds_;
/**
* <code>optional uint32 gracePeriodSeconds = 3 [default = 15];</code>
*/
public boolean hasGracePeriodSeconds() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional uint32 gracePeriodSeconds = 3 [default = 15];</code>
*/
public int getGracePeriodSeconds() {
return gracePeriodSeconds_;
}
// optional uint32 intervalSeconds = 4 [default = 10];
public static final int INTERVALSECONDS_FIELD_NUMBER = 4;
private int intervalSeconds_;
/**
* <code>optional uint32 intervalSeconds = 4 [default = 10];</code>
*/
public boolean hasIntervalSeconds() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional uint32 intervalSeconds = 4 [default = 10];</code>
*/
public int getIntervalSeconds() {
return intervalSeconds_;
}
// optional uint32 timeoutSeconds = 5 [default = 20];
public static final int TIMEOUTSECONDS_FIELD_NUMBER = 5;
private int timeoutSeconds_;
/**
* <code>optional uint32 timeoutSeconds = 5 [default = 20];</code>
*/
public boolean hasTimeoutSeconds() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional uint32 timeoutSeconds = 5 [default = 20];</code>
*/
public int getTimeoutSeconds() {
return timeoutSeconds_;
}
// optional string path = 6 [default = "/"];
public static final int PATH_FIELD_NUMBER = 6;
private java.lang.Object path_;
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public boolean hasPath() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public java.lang.String getPath() {
java.lang.Object ref = path_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
path_ = s;
}
return s;
}
}
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public com.google.protobuf.ByteString
getPathBytes() {
java.lang.Object ref = path_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
path_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional uint32 maxConsecutiveFailures = 7 [default = 3];
public static final int MAXCONSECUTIVEFAILURES_FIELD_NUMBER = 7;
private int maxConsecutiveFailures_;
/**
* <code>optional uint32 maxConsecutiveFailures = 7 [default = 3];</code>
*/
public boolean hasMaxConsecutiveFailures() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional uint32 maxConsecutiveFailures = 7 [default = 3];</code>
*/
public int getMaxConsecutiveFailures() {
return maxConsecutiveFailures_;
}
// optional .mesos.CommandInfo command = 8;
public static final int COMMAND_FIELD_NUMBER = 8;
private org.apache.mesos.Protos.CommandInfo command_;
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public boolean hasCommand() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public org.apache.mesos.Protos.CommandInfo getCommand() {
return command_;
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public org.apache.mesos.Protos.CommandInfoOrBuilder getCommandOrBuilder() {
return command_;
}
// optional bool ignoreHttp1xx = 9 [default = false];
public static final int IGNOREHTTP1XX_FIELD_NUMBER = 9;
private boolean ignoreHttp1Xx_;
/**
* <code>optional bool ignoreHttp1xx = 9 [default = false];</code>
*/
public boolean hasIgnoreHttp1Xx() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>optional bool ignoreHttp1xx = 9 [default = false];</code>
*/
public boolean getIgnoreHttp1Xx() {
return ignoreHttp1Xx_;
}
// optional uint32 port = 10;
public static final int PORT_FIELD_NUMBER = 10;
private int port_;
/**
* <code>optional uint32 port = 10;</code>
*/
public boolean hasPort() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>optional uint32 port = 10;</code>
*/
public int getPort() {
return port_;
}
private void initFields() {
protocol_ = mesosphere.marathon.Protos.HealthCheckDefinition.Protocol.HTTP;
portIndex_ = 0;
gracePeriodSeconds_ = 15;
intervalSeconds_ = 10;
timeoutSeconds_ = 20;
path_ = "/";
maxConsecutiveFailures_ = 3;
command_ = org.apache.mesos.Protos.CommandInfo.getDefaultInstance();
ignoreHttp1Xx_ = false;
port_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasProtocol()) {
memoizedIsInitialized = 0;
return false;
}
if (hasCommand()) {
if (!getCommand().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeEnum(1, protocol_.getNumber());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeUInt32(2, portIndex_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeUInt32(3, gracePeriodSeconds_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeUInt32(4, intervalSeconds_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeUInt32(5, timeoutSeconds_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeBytes(6, getPathBytes());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeUInt32(7, maxConsecutiveFailures_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeMessage(8, command_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
output.writeBool(9, ignoreHttp1Xx_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
output.writeUInt32(10, port_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, protocol_.getNumber());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, portIndex_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, gracePeriodSeconds_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(4, intervalSeconds_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(5, timeoutSeconds_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(6, getPathBytes());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(7, maxConsecutiveFailures_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(8, command_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(9, ignoreHttp1Xx_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(10, port_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.HealthCheckDefinition parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.HealthCheckDefinition prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.HealthCheckDefinition}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_HealthCheckDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_HealthCheckDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.HealthCheckDefinition.class, mesosphere.marathon.Protos.HealthCheckDefinition.Builder.class);
}
// Construct using mesosphere.marathon.Protos.HealthCheckDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getCommandFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
protocol_ = mesosphere.marathon.Protos.HealthCheckDefinition.Protocol.HTTP;
bitField0_ = (bitField0_ & ~0x00000001);
portIndex_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
gracePeriodSeconds_ = 15;
bitField0_ = (bitField0_ & ~0x00000004);
intervalSeconds_ = 10;
bitField0_ = (bitField0_ & ~0x00000008);
timeoutSeconds_ = 20;
bitField0_ = (bitField0_ & ~0x00000010);
path_ = "/";
bitField0_ = (bitField0_ & ~0x00000020);
maxConsecutiveFailures_ = 3;
bitField0_ = (bitField0_ & ~0x00000040);
if (commandBuilder_ == null) {
command_ = org.apache.mesos.Protos.CommandInfo.getDefaultInstance();
} else {
commandBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000080);
ignoreHttp1Xx_ = false;
bitField0_ = (bitField0_ & ~0x00000100);
port_ = 0;
bitField0_ = (bitField0_ & ~0x00000200);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_HealthCheckDefinition_descriptor;
}
public mesosphere.marathon.Protos.HealthCheckDefinition getDefaultInstanceForType() {
return mesosphere.marathon.Protos.HealthCheckDefinition.getDefaultInstance();
}
public mesosphere.marathon.Protos.HealthCheckDefinition build() {
mesosphere.marathon.Protos.HealthCheckDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.HealthCheckDefinition buildPartial() {
mesosphere.marathon.Protos.HealthCheckDefinition result = new mesosphere.marathon.Protos.HealthCheckDefinition(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.protocol_ = protocol_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.portIndex_ = portIndex_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.gracePeriodSeconds_ = gracePeriodSeconds_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.intervalSeconds_ = intervalSeconds_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.timeoutSeconds_ = timeoutSeconds_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.path_ = path_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.maxConsecutiveFailures_ = maxConsecutiveFailures_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
if (commandBuilder_ == null) {
result.command_ = command_;
} else {
result.command_ = commandBuilder_.build();
}
if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
to_bitField0_ |= 0x00000100;
}
result.ignoreHttp1Xx_ = ignoreHttp1Xx_;
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000200;
}
result.port_ = port_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.HealthCheckDefinition) {
return mergeFrom((mesosphere.marathon.Protos.HealthCheckDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.HealthCheckDefinition other) {
if (other == mesosphere.marathon.Protos.HealthCheckDefinition.getDefaultInstance()) return this;
if (other.hasProtocol()) {
setProtocol(other.getProtocol());
}
if (other.hasPortIndex()) {
setPortIndex(other.getPortIndex());
}
if (other.hasGracePeriodSeconds()) {
setGracePeriodSeconds(other.getGracePeriodSeconds());
}
if (other.hasIntervalSeconds()) {
setIntervalSeconds(other.getIntervalSeconds());
}
if (other.hasTimeoutSeconds()) {
setTimeoutSeconds(other.getTimeoutSeconds());
}
if (other.hasPath()) {
bitField0_ |= 0x00000020;
path_ = other.path_;
onChanged();
}
if (other.hasMaxConsecutiveFailures()) {
setMaxConsecutiveFailures(other.getMaxConsecutiveFailures());
}
if (other.hasCommand()) {
mergeCommand(other.getCommand());
}
if (other.hasIgnoreHttp1Xx()) {
setIgnoreHttp1Xx(other.getIgnoreHttp1Xx());
}
if (other.hasPort()) {
setPort(other.getPort());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasProtocol()) {
return false;
}
if (hasCommand()) {
if (!getCommand().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.HealthCheckDefinition parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.HealthCheckDefinition) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;
private mesosphere.marathon.Protos.HealthCheckDefinition.Protocol protocol_ = mesosphere.marathon.Protos.HealthCheckDefinition.Protocol.HTTP;
/**
* <code>required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;</code>
*/
public boolean hasProtocol() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinition.Protocol getProtocol() {
return protocol_;
}
/**
* <code>required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;</code>
*/
public Builder setProtocol(mesosphere.marathon.Protos.HealthCheckDefinition.Protocol value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
protocol_ = value;
onChanged();
return this;
}
/**
* <code>required .mesosphere.marathon.HealthCheckDefinition.Protocol protocol = 1;</code>
*/
public Builder clearProtocol() {
bitField0_ = (bitField0_ & ~0x00000001);
protocol_ = mesosphere.marathon.Protos.HealthCheckDefinition.Protocol.HTTP;
onChanged();
return this;
}
// optional uint32 portIndex = 2;
private int portIndex_ ;
/**
* <code>optional uint32 portIndex = 2;</code>
*/
public boolean hasPortIndex() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional uint32 portIndex = 2;</code>
*/
public int getPortIndex() {
return portIndex_;
}
/**
* <code>optional uint32 portIndex = 2;</code>
*/
public Builder setPortIndex(int value) {
bitField0_ |= 0x00000002;
portIndex_ = value;
onChanged();
return this;
}
/**
* <code>optional uint32 portIndex = 2;</code>
*/
public Builder clearPortIndex() {
bitField0_ = (bitField0_ & ~0x00000002);
portIndex_ = 0;
onChanged();
return this;
}
// optional uint32 gracePeriodSeconds = 3 [default = 15];
private int gracePeriodSeconds_ = 15;
/**
* <code>optional uint32 gracePeriodSeconds = 3 [default = 15];</code>
*/
public boolean hasGracePeriodSeconds() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional uint32 gracePeriodSeconds = 3 [default = 15];</code>
*/
public int getGracePeriodSeconds() {
return gracePeriodSeconds_;
}
/**
* <code>optional uint32 gracePeriodSeconds = 3 [default = 15];</code>
*/
public Builder setGracePeriodSeconds(int value) {
bitField0_ |= 0x00000004;
gracePeriodSeconds_ = value;
onChanged();
return this;
}
/**
* <code>optional uint32 gracePeriodSeconds = 3 [default = 15];</code>
*/
public Builder clearGracePeriodSeconds() {
bitField0_ = (bitField0_ & ~0x00000004);
gracePeriodSeconds_ = 15;
onChanged();
return this;
}
// optional uint32 intervalSeconds = 4 [default = 10];
private int intervalSeconds_ = 10;
/**
* <code>optional uint32 intervalSeconds = 4 [default = 10];</code>
*/
public boolean hasIntervalSeconds() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional uint32 intervalSeconds = 4 [default = 10];</code>
*/
public int getIntervalSeconds() {
return intervalSeconds_;
}
/**
* <code>optional uint32 intervalSeconds = 4 [default = 10];</code>
*/
public Builder setIntervalSeconds(int value) {
bitField0_ |= 0x00000008;
intervalSeconds_ = value;
onChanged();
return this;
}
/**
* <code>optional uint32 intervalSeconds = 4 [default = 10];</code>
*/
public Builder clearIntervalSeconds() {
bitField0_ = (bitField0_ & ~0x00000008);
intervalSeconds_ = 10;
onChanged();
return this;
}
// optional uint32 timeoutSeconds = 5 [default = 20];
private int timeoutSeconds_ = 20;
/**
* <code>optional uint32 timeoutSeconds = 5 [default = 20];</code>
*/
public boolean hasTimeoutSeconds() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional uint32 timeoutSeconds = 5 [default = 20];</code>
*/
public int getTimeoutSeconds() {
return timeoutSeconds_;
}
/**
* <code>optional uint32 timeoutSeconds = 5 [default = 20];</code>
*/
public Builder setTimeoutSeconds(int value) {
bitField0_ |= 0x00000010;
timeoutSeconds_ = value;
onChanged();
return this;
}
/**
* <code>optional uint32 timeoutSeconds = 5 [default = 20];</code>
*/
public Builder clearTimeoutSeconds() {
bitField0_ = (bitField0_ & ~0x00000010);
timeoutSeconds_ = 20;
onChanged();
return this;
}
// optional string path = 6 [default = "/"];
private java.lang.Object path_ = "/";
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public boolean hasPath() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public java.lang.String getPath() {
java.lang.Object ref = path_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
path_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public com.google.protobuf.ByteString
getPathBytes() {
java.lang.Object ref = path_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
path_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public Builder setPath(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
path_ = value;
onChanged();
return this;
}
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public Builder clearPath() {
bitField0_ = (bitField0_ & ~0x00000020);
path_ = getDefaultInstance().getPath();
onChanged();
return this;
}
/**
* <code>optional string path = 6 [default = "/"];</code>
*
* <pre>
* used for HTTP only
* </pre>
*/
public Builder setPathBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
path_ = value;
onChanged();
return this;
}
// optional uint32 maxConsecutiveFailures = 7 [default = 3];
private int maxConsecutiveFailures_ = 3;
/**
* <code>optional uint32 maxConsecutiveFailures = 7 [default = 3];</code>
*/
public boolean hasMaxConsecutiveFailures() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional uint32 maxConsecutiveFailures = 7 [default = 3];</code>
*/
public int getMaxConsecutiveFailures() {
return maxConsecutiveFailures_;
}
/**
* <code>optional uint32 maxConsecutiveFailures = 7 [default = 3];</code>
*/
public Builder setMaxConsecutiveFailures(int value) {
bitField0_ |= 0x00000040;
maxConsecutiveFailures_ = value;
onChanged();
return this;
}
/**
* <code>optional uint32 maxConsecutiveFailures = 7 [default = 3];</code>
*/
public Builder clearMaxConsecutiveFailures() {
bitField0_ = (bitField0_ & ~0x00000040);
maxConsecutiveFailures_ = 3;
onChanged();
return this;
}
// optional .mesos.CommandInfo command = 8;
private org.apache.mesos.Protos.CommandInfo command_ = org.apache.mesos.Protos.CommandInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.CommandInfo, org.apache.mesos.Protos.CommandInfo.Builder, org.apache.mesos.Protos.CommandInfoOrBuilder> commandBuilder_;
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public boolean hasCommand() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public org.apache.mesos.Protos.CommandInfo getCommand() {
if (commandBuilder_ == null) {
return command_;
} else {
return commandBuilder_.getMessage();
}
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public Builder setCommand(org.apache.mesos.Protos.CommandInfo value) {
if (commandBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
command_ = value;
onChanged();
} else {
commandBuilder_.setMessage(value);
}
bitField0_ |= 0x00000080;
return this;
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public Builder setCommand(
org.apache.mesos.Protos.CommandInfo.Builder builderForValue) {
if (commandBuilder_ == null) {
command_ = builderForValue.build();
onChanged();
} else {
commandBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000080;
return this;
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public Builder mergeCommand(org.apache.mesos.Protos.CommandInfo value) {
if (commandBuilder_ == null) {
if (((bitField0_ & 0x00000080) == 0x00000080) &&
command_ != org.apache.mesos.Protos.CommandInfo.getDefaultInstance()) {
command_ =
org.apache.mesos.Protos.CommandInfo.newBuilder(command_).mergeFrom(value).buildPartial();
} else {
command_ = value;
}
onChanged();
} else {
commandBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000080;
return this;
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public Builder clearCommand() {
if (commandBuilder_ == null) {
command_ = org.apache.mesos.Protos.CommandInfo.getDefaultInstance();
onChanged();
} else {
commandBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000080);
return this;
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public org.apache.mesos.Protos.CommandInfo.Builder getCommandBuilder() {
bitField0_ |= 0x00000080;
onChanged();
return getCommandFieldBuilder().getBuilder();
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
public org.apache.mesos.Protos.CommandInfoOrBuilder getCommandOrBuilder() {
if (commandBuilder_ != null) {
return commandBuilder_.getMessageOrBuilder();
} else {
return command_;
}
}
/**
* <code>optional .mesos.CommandInfo command = 8;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.CommandInfo, org.apache.mesos.Protos.CommandInfo.Builder, org.apache.mesos.Protos.CommandInfoOrBuilder>
getCommandFieldBuilder() {
if (commandBuilder_ == null) {
commandBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.CommandInfo, org.apache.mesos.Protos.CommandInfo.Builder, org.apache.mesos.Protos.CommandInfoOrBuilder>(
command_,
getParentForChildren(),
isClean());
command_ = null;
}
return commandBuilder_;
}
// optional bool ignoreHttp1xx = 9 [default = false];
private boolean ignoreHttp1Xx_ ;
/**
* <code>optional bool ignoreHttp1xx = 9 [default = false];</code>
*/
public boolean hasIgnoreHttp1Xx() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>optional bool ignoreHttp1xx = 9 [default = false];</code>
*/
public boolean getIgnoreHttp1Xx() {
return ignoreHttp1Xx_;
}
/**
* <code>optional bool ignoreHttp1xx = 9 [default = false];</code>
*/
public Builder setIgnoreHttp1Xx(boolean value) {
bitField0_ |= 0x00000100;
ignoreHttp1Xx_ = value;
onChanged();
return this;
}
/**
* <code>optional bool ignoreHttp1xx = 9 [default = false];</code>
*/
public Builder clearIgnoreHttp1Xx() {
bitField0_ = (bitField0_ & ~0x00000100);
ignoreHttp1Xx_ = false;
onChanged();
return this;
}
// optional uint32 port = 10;
private int port_ ;
/**
* <code>optional uint32 port = 10;</code>
*/
public boolean hasPort() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>optional uint32 port = 10;</code>
*/
public int getPort() {
return port_;
}
/**
* <code>optional uint32 port = 10;</code>
*/
public Builder setPort(int value) {
bitField0_ |= 0x00000200;
port_ = value;
onChanged();
return this;
}
/**
* <code>optional uint32 port = 10;</code>
*/
public Builder clearPort() {
bitField0_ = (bitField0_ & ~0x00000200);
port_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.HealthCheckDefinition)
}
static {
defaultInstance = new HealthCheckDefinition(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.HealthCheckDefinition)
}
public interface ReadinessCheckDefinitionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional string name = 1;
/**
* <code>optional string name = 1;</code>
*/
boolean hasName();
/**
* <code>optional string name = 1;</code>
*/
java.lang.String getName();
/**
* <code>optional string name = 1;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
// optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;
/**
* <code>optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;</code>
*/
boolean hasProtocol();
/**
* <code>optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;</code>
*/
mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol getProtocol();
// optional string path = 3;
/**
* <code>optional string path = 3;</code>
*/
boolean hasPath();
/**
* <code>optional string path = 3;</code>
*/
java.lang.String getPath();
/**
* <code>optional string path = 3;</code>
*/
com.google.protobuf.ByteString
getPathBytes();
// optional string portName = 4;
/**
* <code>optional string portName = 4;</code>
*/
boolean hasPortName();
/**
* <code>optional string portName = 4;</code>
*/
java.lang.String getPortName();
/**
* <code>optional string portName = 4;</code>
*/
com.google.protobuf.ByteString
getPortNameBytes();
// optional uint64 intervalMillis = 5;
/**
* <code>optional uint64 intervalMillis = 5;</code>
*/
boolean hasIntervalMillis();
/**
* <code>optional uint64 intervalMillis = 5;</code>
*/
long getIntervalMillis();
// optional uint64 timeoutMillis = 6;
/**
* <code>optional uint64 timeoutMillis = 6;</code>
*/
boolean hasTimeoutMillis();
/**
* <code>optional uint64 timeoutMillis = 6;</code>
*/
long getTimeoutMillis();
// repeated uint32 httpStatusCodeForReady = 7;
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
java.util.List<java.lang.Integer> getHttpStatusCodeForReadyList();
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
int getHttpStatusCodeForReadyCount();
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
int getHttpStatusCodeForReady(int index);
// optional bool preserveLastResponse = 8;
/**
* <code>optional bool preserveLastResponse = 8;</code>
*/
boolean hasPreserveLastResponse();
/**
* <code>optional bool preserveLastResponse = 8;</code>
*/
boolean getPreserveLastResponse();
}
/**
* Protobuf type {@code mesosphere.marathon.ReadinessCheckDefinition}
*/
public static final class ReadinessCheckDefinition extends
com.google.protobuf.GeneratedMessage
implements ReadinessCheckDefinitionOrBuilder {
// Use ReadinessCheckDefinition.newBuilder() to construct.
private ReadinessCheckDefinition(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ReadinessCheckDefinition(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ReadinessCheckDefinition defaultInstance;
public static ReadinessCheckDefinition getDefaultInstance() {
return defaultInstance;
}
public ReadinessCheckDefinition getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ReadinessCheckDefinition(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
name_ = input.readBytes();
break;
}
case 16: {
int rawValue = input.readEnum();
mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol value = mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(2, rawValue);
} else {
bitField0_ |= 0x00000002;
protocol_ = value;
}
break;
}
case 26: {
bitField0_ |= 0x00000004;
path_ = input.readBytes();
break;
}
case 34: {
bitField0_ |= 0x00000008;
portName_ = input.readBytes();
break;
}
case 40: {
bitField0_ |= 0x00000010;
intervalMillis_ = input.readUInt64();
break;
}
case 48: {
bitField0_ |= 0x00000020;
timeoutMillis_ = input.readUInt64();
break;
}
case 56: {
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
httpStatusCodeForReady_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000040;
}
httpStatusCodeForReady_.add(input.readUInt32());
break;
}
case 58: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040) && input.getBytesUntilLimit() > 0) {
httpStatusCodeForReady_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000040;
}
while (input.getBytesUntilLimit() > 0) {
httpStatusCodeForReady_.add(input.readUInt32());
}
input.popLimit(limit);
break;
}
case 64: {
bitField0_ |= 0x00000040;
preserveLastResponse_ = input.readBool();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
httpStatusCodeForReady_ = java.util.Collections.unmodifiableList(httpStatusCodeForReady_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ReadinessCheckDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ReadinessCheckDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ReadinessCheckDefinition.class, mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder.class);
}
public static com.google.protobuf.Parser<ReadinessCheckDefinition> PARSER =
new com.google.protobuf.AbstractParser<ReadinessCheckDefinition>() {
public ReadinessCheckDefinition parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ReadinessCheckDefinition(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ReadinessCheckDefinition> getParserForType() {
return PARSER;
}
/**
* Protobuf enum {@code mesosphere.marathon.ReadinessCheckDefinition.Protocol}
*/
public enum Protocol
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>HTTP = 0;</code>
*/
HTTP(0, 0),
/**
* <code>HTTPS = 1;</code>
*/
HTTPS(1, 1),
;
/**
* <code>HTTP = 0;</code>
*/
public static final int HTTP_VALUE = 0;
/**
* <code>HTTPS = 1;</code>
*/
public static final int HTTPS_VALUE = 1;
public final int getNumber() { return value; }
public static Protocol valueOf(int value) {
switch (value) {
case 0: return HTTP;
case 1: return HTTPS;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<Protocol>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<Protocol>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Protocol>() {
public Protocol findValueByNumber(int number) {
return Protocol.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return mesosphere.marathon.Protos.ReadinessCheckDefinition.getDescriptor().getEnumTypes().get(0);
}
private static final Protocol[] VALUES = values();
public static Protocol valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private Protocol(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:mesosphere.marathon.ReadinessCheckDefinition.Protocol)
}
private int bitField0_;
// optional string name = 1;
public static final int NAME_FIELD_NUMBER = 1;
private java.lang.Object name_;
/**
* <code>optional string name = 1;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
name_ = s;
}
return s;
}
}
/**
* <code>optional string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;
public static final int PROTOCOL_FIELD_NUMBER = 2;
private mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol protocol_;
/**
* <code>optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;</code>
*/
public boolean hasProtocol() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol getProtocol() {
return protocol_;
}
// optional string path = 3;
public static final int PATH_FIELD_NUMBER = 3;
private java.lang.Object path_;
/**
* <code>optional string path = 3;</code>
*/
public boolean hasPath() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string path = 3;</code>
*/
public java.lang.String getPath() {
java.lang.Object ref = path_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
path_ = s;
}
return s;
}
}
/**
* <code>optional string path = 3;</code>
*/
public com.google.protobuf.ByteString
getPathBytes() {
java.lang.Object ref = path_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
path_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional string portName = 4;
public static final int PORTNAME_FIELD_NUMBER = 4;
private java.lang.Object portName_;
/**
* <code>optional string portName = 4;</code>
*/
public boolean hasPortName() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string portName = 4;</code>
*/
public java.lang.String getPortName() {
java.lang.Object ref = portName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
portName_ = s;
}
return s;
}
}
/**
* <code>optional string portName = 4;</code>
*/
public com.google.protobuf.ByteString
getPortNameBytes() {
java.lang.Object ref = portName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
portName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional uint64 intervalMillis = 5;
public static final int INTERVALMILLIS_FIELD_NUMBER = 5;
private long intervalMillis_;
/**
* <code>optional uint64 intervalMillis = 5;</code>
*/
public boolean hasIntervalMillis() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional uint64 intervalMillis = 5;</code>
*/
public long getIntervalMillis() {
return intervalMillis_;
}
// optional uint64 timeoutMillis = 6;
public static final int TIMEOUTMILLIS_FIELD_NUMBER = 6;
private long timeoutMillis_;
/**
* <code>optional uint64 timeoutMillis = 6;</code>
*/
public boolean hasTimeoutMillis() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional uint64 timeoutMillis = 6;</code>
*/
public long getTimeoutMillis() {
return timeoutMillis_;
}
// repeated uint32 httpStatusCodeForReady = 7;
public static final int HTTPSTATUSCODEFORREADY_FIELD_NUMBER = 7;
private java.util.List<java.lang.Integer> httpStatusCodeForReady_;
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public java.util.List<java.lang.Integer>
getHttpStatusCodeForReadyList() {
return httpStatusCodeForReady_;
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public int getHttpStatusCodeForReadyCount() {
return httpStatusCodeForReady_.size();
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public int getHttpStatusCodeForReady(int index) {
return httpStatusCodeForReady_.get(index);
}
// optional bool preserveLastResponse = 8;
public static final int PRESERVELASTRESPONSE_FIELD_NUMBER = 8;
private boolean preserveLastResponse_;
/**
* <code>optional bool preserveLastResponse = 8;</code>
*/
public boolean hasPreserveLastResponse() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional bool preserveLastResponse = 8;</code>
*/
public boolean getPreserveLastResponse() {
return preserveLastResponse_;
}
private void initFields() {
name_ = "";
protocol_ = mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol.HTTP;
path_ = "";
portName_ = "";
intervalMillis_ = 0L;
timeoutMillis_ = 0L;
httpStatusCodeForReady_ = java.util.Collections.emptyList();
preserveLastResponse_ = false;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getNameBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeEnum(2, protocol_.getNumber());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, getPathBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(4, getPortNameBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeUInt64(5, intervalMillis_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeUInt64(6, timeoutMillis_);
}
for (int i = 0; i < httpStatusCodeForReady_.size(); i++) {
output.writeUInt32(7, httpStatusCodeForReady_.get(i));
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBool(8, preserveLastResponse_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getNameBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, protocol_.getNumber());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, getPathBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, getPortNameBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(5, intervalMillis_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(6, timeoutMillis_);
}
{
int dataSize = 0;
for (int i = 0; i < httpStatusCodeForReady_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeUInt32SizeNoTag(httpStatusCodeForReady_.get(i));
}
size += dataSize;
size += 1 * getHttpStatusCodeForReadyList().size();
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(8, preserveLastResponse_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ReadinessCheckDefinition parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ReadinessCheckDefinition prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ReadinessCheckDefinition}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ReadinessCheckDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ReadinessCheckDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ReadinessCheckDefinition.class, mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ReadinessCheckDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
name_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
protocol_ = mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol.HTTP;
bitField0_ = (bitField0_ & ~0x00000002);
path_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
portName_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
intervalMillis_ = 0L;
bitField0_ = (bitField0_ & ~0x00000010);
timeoutMillis_ = 0L;
bitField0_ = (bitField0_ & ~0x00000020);
httpStatusCodeForReady_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
preserveLastResponse_ = false;
bitField0_ = (bitField0_ & ~0x00000080);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ReadinessCheckDefinition_descriptor;
}
public mesosphere.marathon.Protos.ReadinessCheckDefinition getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ReadinessCheckDefinition.getDefaultInstance();
}
public mesosphere.marathon.Protos.ReadinessCheckDefinition build() {
mesosphere.marathon.Protos.ReadinessCheckDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ReadinessCheckDefinition buildPartial() {
mesosphere.marathon.Protos.ReadinessCheckDefinition result = new mesosphere.marathon.Protos.ReadinessCheckDefinition(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.name_ = name_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.protocol_ = protocol_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.path_ = path_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.portName_ = portName_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.intervalMillis_ = intervalMillis_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.timeoutMillis_ = timeoutMillis_;
if (((bitField0_ & 0x00000040) == 0x00000040)) {
httpStatusCodeForReady_ = java.util.Collections.unmodifiableList(httpStatusCodeForReady_);
bitField0_ = (bitField0_ & ~0x00000040);
}
result.httpStatusCodeForReady_ = httpStatusCodeForReady_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000040;
}
result.preserveLastResponse_ = preserveLastResponse_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ReadinessCheckDefinition) {
return mergeFrom((mesosphere.marathon.Protos.ReadinessCheckDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ReadinessCheckDefinition other) {
if (other == mesosphere.marathon.Protos.ReadinessCheckDefinition.getDefaultInstance()) return this;
if (other.hasName()) {
bitField0_ |= 0x00000001;
name_ = other.name_;
onChanged();
}
if (other.hasProtocol()) {
setProtocol(other.getProtocol());
}
if (other.hasPath()) {
bitField0_ |= 0x00000004;
path_ = other.path_;
onChanged();
}
if (other.hasPortName()) {
bitField0_ |= 0x00000008;
portName_ = other.portName_;
onChanged();
}
if (other.hasIntervalMillis()) {
setIntervalMillis(other.getIntervalMillis());
}
if (other.hasTimeoutMillis()) {
setTimeoutMillis(other.getTimeoutMillis());
}
if (!other.httpStatusCodeForReady_.isEmpty()) {
if (httpStatusCodeForReady_.isEmpty()) {
httpStatusCodeForReady_ = other.httpStatusCodeForReady_;
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureHttpStatusCodeForReadyIsMutable();
httpStatusCodeForReady_.addAll(other.httpStatusCodeForReady_);
}
onChanged();
}
if (other.hasPreserveLastResponse()) {
setPreserveLastResponse(other.getPreserveLastResponse());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ReadinessCheckDefinition parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ReadinessCheckDefinition) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// optional string name = 1;
private java.lang.Object name_ = "";
/**
* <code>optional string name = 1;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string name = 1;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
name_ = value;
onChanged();
return this;
}
/**
* <code>optional string name = 1;</code>
*/
public Builder clearName() {
bitField0_ = (bitField0_ & ~0x00000001);
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>optional string name = 1;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
name_ = value;
onChanged();
return this;
}
// optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;
private mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol protocol_ = mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol.HTTP;
/**
* <code>optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;</code>
*/
public boolean hasProtocol() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol getProtocol() {
return protocol_;
}
/**
* <code>optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;</code>
*/
public Builder setProtocol(mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
protocol_ = value;
onChanged();
return this;
}
/**
* <code>optional .mesosphere.marathon.ReadinessCheckDefinition.Protocol protocol = 2;</code>
*/
public Builder clearProtocol() {
bitField0_ = (bitField0_ & ~0x00000002);
protocol_ = mesosphere.marathon.Protos.ReadinessCheckDefinition.Protocol.HTTP;
onChanged();
return this;
}
// optional string path = 3;
private java.lang.Object path_ = "";
/**
* <code>optional string path = 3;</code>
*/
public boolean hasPath() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string path = 3;</code>
*/
public java.lang.String getPath() {
java.lang.Object ref = path_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
path_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string path = 3;</code>
*/
public com.google.protobuf.ByteString
getPathBytes() {
java.lang.Object ref = path_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
path_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string path = 3;</code>
*/
public Builder setPath(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
path_ = value;
onChanged();
return this;
}
/**
* <code>optional string path = 3;</code>
*/
public Builder clearPath() {
bitField0_ = (bitField0_ & ~0x00000004);
path_ = getDefaultInstance().getPath();
onChanged();
return this;
}
/**
* <code>optional string path = 3;</code>
*/
public Builder setPathBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
path_ = value;
onChanged();
return this;
}
// optional string portName = 4;
private java.lang.Object portName_ = "";
/**
* <code>optional string portName = 4;</code>
*/
public boolean hasPortName() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string portName = 4;</code>
*/
public java.lang.String getPortName() {
java.lang.Object ref = portName_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
portName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string portName = 4;</code>
*/
public com.google.protobuf.ByteString
getPortNameBytes() {
java.lang.Object ref = portName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
portName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string portName = 4;</code>
*/
public Builder setPortName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
portName_ = value;
onChanged();
return this;
}
/**
* <code>optional string portName = 4;</code>
*/
public Builder clearPortName() {
bitField0_ = (bitField0_ & ~0x00000008);
portName_ = getDefaultInstance().getPortName();
onChanged();
return this;
}
/**
* <code>optional string portName = 4;</code>
*/
public Builder setPortNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
portName_ = value;
onChanged();
return this;
}
// optional uint64 intervalMillis = 5;
private long intervalMillis_ ;
/**
* <code>optional uint64 intervalMillis = 5;</code>
*/
public boolean hasIntervalMillis() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional uint64 intervalMillis = 5;</code>
*/
public long getIntervalMillis() {
return intervalMillis_;
}
/**
* <code>optional uint64 intervalMillis = 5;</code>
*/
public Builder setIntervalMillis(long value) {
bitField0_ |= 0x00000010;
intervalMillis_ = value;
onChanged();
return this;
}
/**
* <code>optional uint64 intervalMillis = 5;</code>
*/
public Builder clearIntervalMillis() {
bitField0_ = (bitField0_ & ~0x00000010);
intervalMillis_ = 0L;
onChanged();
return this;
}
// optional uint64 timeoutMillis = 6;
private long timeoutMillis_ ;
/**
* <code>optional uint64 timeoutMillis = 6;</code>
*/
public boolean hasTimeoutMillis() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional uint64 timeoutMillis = 6;</code>
*/
public long getTimeoutMillis() {
return timeoutMillis_;
}
/**
* <code>optional uint64 timeoutMillis = 6;</code>
*/
public Builder setTimeoutMillis(long value) {
bitField0_ |= 0x00000020;
timeoutMillis_ = value;
onChanged();
return this;
}
/**
* <code>optional uint64 timeoutMillis = 6;</code>
*/
public Builder clearTimeoutMillis() {
bitField0_ = (bitField0_ & ~0x00000020);
timeoutMillis_ = 0L;
onChanged();
return this;
}
// repeated uint32 httpStatusCodeForReady = 7;
private java.util.List<java.lang.Integer> httpStatusCodeForReady_ = java.util.Collections.emptyList();
private void ensureHttpStatusCodeForReadyIsMutable() {
if (!((bitField0_ & 0x00000040) == 0x00000040)) {
httpStatusCodeForReady_ = new java.util.ArrayList<java.lang.Integer>(httpStatusCodeForReady_);
bitField0_ |= 0x00000040;
}
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public java.util.List<java.lang.Integer>
getHttpStatusCodeForReadyList() {
return java.util.Collections.unmodifiableList(httpStatusCodeForReady_);
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public int getHttpStatusCodeForReadyCount() {
return httpStatusCodeForReady_.size();
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public int getHttpStatusCodeForReady(int index) {
return httpStatusCodeForReady_.get(index);
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public Builder setHttpStatusCodeForReady(
int index, int value) {
ensureHttpStatusCodeForReadyIsMutable();
httpStatusCodeForReady_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public Builder addHttpStatusCodeForReady(int value) {
ensureHttpStatusCodeForReadyIsMutable();
httpStatusCodeForReady_.add(value);
onChanged();
return this;
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public Builder addAllHttpStatusCodeForReady(
java.lang.Iterable<? extends java.lang.Integer> values) {
ensureHttpStatusCodeForReadyIsMutable();
super.addAll(values, httpStatusCodeForReady_);
onChanged();
return this;
}
/**
* <code>repeated uint32 httpStatusCodeForReady = 7;</code>
*/
public Builder clearHttpStatusCodeForReady() {
httpStatusCodeForReady_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
return this;
}
// optional bool preserveLastResponse = 8;
private boolean preserveLastResponse_ ;
/**
* <code>optional bool preserveLastResponse = 8;</code>
*/
public boolean hasPreserveLastResponse() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional bool preserveLastResponse = 8;</code>
*/
public boolean getPreserveLastResponse() {
return preserveLastResponse_;
}
/**
* <code>optional bool preserveLastResponse = 8;</code>
*/
public Builder setPreserveLastResponse(boolean value) {
bitField0_ |= 0x00000080;
preserveLastResponse_ = value;
onChanged();
return this;
}
/**
* <code>optional bool preserveLastResponse = 8;</code>
*/
public Builder clearPreserveLastResponse() {
bitField0_ = (bitField0_ & ~0x00000080);
preserveLastResponse_ = false;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ReadinessCheckDefinition)
}
static {
defaultInstance = new ReadinessCheckDefinition(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ReadinessCheckDefinition)
}
public interface IpAddressOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated string groups = 1;
/**
* <code>repeated string groups = 1;</code>
*/
java.util.List<java.lang.String>
getGroupsList();
/**
* <code>repeated string groups = 1;</code>
*/
int getGroupsCount();
/**
* <code>repeated string groups = 1;</code>
*/
java.lang.String getGroups(int index);
/**
* <code>repeated string groups = 1;</code>
*/
com.google.protobuf.ByteString
getGroupsBytes(int index);
// repeated .mesos.Label labels = 2;
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
java.util.List<org.apache.mesos.Protos.Label>
getLabelsList();
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
org.apache.mesos.Protos.Label getLabels(int index);
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
int getLabelsCount();
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getLabelsOrBuilderList();
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
org.apache.mesos.Protos.LabelOrBuilder getLabelsOrBuilder(
int index);
// optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
boolean hasDiscoveryInfo();
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
mesosphere.marathon.Protos.DiscoveryInfo getDiscoveryInfo();
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
mesosphere.marathon.Protos.DiscoveryInfoOrBuilder getDiscoveryInfoOrBuilder();
}
/**
* Protobuf type {@code mesosphere.marathon.IpAddress}
*/
public static final class IpAddress extends
com.google.protobuf.GeneratedMessage
implements IpAddressOrBuilder {
// Use IpAddress.newBuilder() to construct.
private IpAddress(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private IpAddress(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final IpAddress defaultInstance;
public static IpAddress getDefaultInstance() {
return defaultInstance;
}
public IpAddress getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private IpAddress(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
groups_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
groups_.add(input.readBytes());
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
labels_ = new java.util.ArrayList<org.apache.mesos.Protos.Label>();
mutable_bitField0_ |= 0x00000002;
}
labels_.add(input.readMessage(org.apache.mesos.Protos.Label.PARSER, extensionRegistry));
break;
}
case 26: {
mesosphere.marathon.Protos.DiscoveryInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
subBuilder = discoveryInfo_.toBuilder();
}
discoveryInfo_ = input.readMessage(mesosphere.marathon.Protos.DiscoveryInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(discoveryInfo_);
discoveryInfo_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000001;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
groups_ = new com.google.protobuf.UnmodifiableLazyStringList(groups_);
}
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_IpAddress_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_IpAddress_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.IpAddress.class, mesosphere.marathon.Protos.IpAddress.Builder.class);
}
public static com.google.protobuf.Parser<IpAddress> PARSER =
new com.google.protobuf.AbstractParser<IpAddress>() {
public IpAddress parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new IpAddress(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<IpAddress> getParserForType() {
return PARSER;
}
private int bitField0_;
// repeated string groups = 1;
public static final int GROUPS_FIELD_NUMBER = 1;
private com.google.protobuf.LazyStringList groups_;
/**
* <code>repeated string groups = 1;</code>
*/
public java.util.List<java.lang.String>
getGroupsList() {
return groups_;
}
/**
* <code>repeated string groups = 1;</code>
*/
public int getGroupsCount() {
return groups_.size();
}
/**
* <code>repeated string groups = 1;</code>
*/
public java.lang.String getGroups(int index) {
return groups_.get(index);
}
/**
* <code>repeated string groups = 1;</code>
*/
public com.google.protobuf.ByteString
getGroupsBytes(int index) {
return groups_.getByteString(index);
}
// repeated .mesos.Label labels = 2;
public static final int LABELS_FIELD_NUMBER = 2;
private java.util.List<org.apache.mesos.Protos.Label> labels_;
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label> getLabelsList() {
return labels_;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getLabelsOrBuilderList() {
return labels_;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public int getLabelsCount() {
return labels_.size();
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public org.apache.mesos.Protos.Label getLabels(int index) {
return labels_.get(index);
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public org.apache.mesos.Protos.LabelOrBuilder getLabelsOrBuilder(
int index) {
return labels_.get(index);
}
// optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;
public static final int DISCOVERYINFO_FIELD_NUMBER = 3;
private mesosphere.marathon.Protos.DiscoveryInfo discoveryInfo_;
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public boolean hasDiscoveryInfo() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public mesosphere.marathon.Protos.DiscoveryInfo getDiscoveryInfo() {
return discoveryInfo_;
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public mesosphere.marathon.Protos.DiscoveryInfoOrBuilder getDiscoveryInfoOrBuilder() {
return discoveryInfo_;
}
private void initFields() {
groups_ = com.google.protobuf.LazyStringArrayList.EMPTY;
labels_ = java.util.Collections.emptyList();
discoveryInfo_ = mesosphere.marathon.Protos.DiscoveryInfo.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
for (int i = 0; i < getLabelsCount(); i++) {
if (!getLabels(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasDiscoveryInfo()) {
if (!getDiscoveryInfo().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < groups_.size(); i++) {
output.writeBytes(1, groups_.getByteString(i));
}
for (int i = 0; i < labels_.size(); i++) {
output.writeMessage(2, labels_.get(i));
}
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeMessage(3, discoveryInfo_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < groups_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(groups_.getByteString(i));
}
size += dataSize;
size += 1 * getGroupsList().size();
}
for (int i = 0; i < labels_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, labels_.get(i));
}
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, discoveryInfo_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.IpAddress parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.IpAddress parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.IpAddress parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.IpAddress parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.IpAddress parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.IpAddress parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.IpAddress parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.IpAddress parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.IpAddress parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.IpAddress parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.IpAddress prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.IpAddress}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.IpAddressOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_IpAddress_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_IpAddress_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.IpAddress.class, mesosphere.marathon.Protos.IpAddress.Builder.class);
}
// Construct using mesosphere.marathon.Protos.IpAddress.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getLabelsFieldBuilder();
getDiscoveryInfoFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
groups_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
labelsBuilder_.clear();
}
if (discoveryInfoBuilder_ == null) {
discoveryInfo_ = mesosphere.marathon.Protos.DiscoveryInfo.getDefaultInstance();
} else {
discoveryInfoBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_IpAddress_descriptor;
}
public mesosphere.marathon.Protos.IpAddress getDefaultInstanceForType() {
return mesosphere.marathon.Protos.IpAddress.getDefaultInstance();
}
public mesosphere.marathon.Protos.IpAddress build() {
mesosphere.marathon.Protos.IpAddress result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.IpAddress buildPartial() {
mesosphere.marathon.Protos.IpAddress result = new mesosphere.marathon.Protos.IpAddress(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
groups_ = new com.google.protobuf.UnmodifiableLazyStringList(
groups_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.groups_ = groups_;
if (labelsBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.labels_ = labels_;
} else {
result.labels_ = labelsBuilder_.build();
}
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000001;
}
if (discoveryInfoBuilder_ == null) {
result.discoveryInfo_ = discoveryInfo_;
} else {
result.discoveryInfo_ = discoveryInfoBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.IpAddress) {
return mergeFrom((mesosphere.marathon.Protos.IpAddress)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.IpAddress other) {
if (other == mesosphere.marathon.Protos.IpAddress.getDefaultInstance()) return this;
if (!other.groups_.isEmpty()) {
if (groups_.isEmpty()) {
groups_ = other.groups_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureGroupsIsMutable();
groups_.addAll(other.groups_);
}
onChanged();
}
if (labelsBuilder_ == null) {
if (!other.labels_.isEmpty()) {
if (labels_.isEmpty()) {
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureLabelsIsMutable();
labels_.addAll(other.labels_);
}
onChanged();
}
} else {
if (!other.labels_.isEmpty()) {
if (labelsBuilder_.isEmpty()) {
labelsBuilder_.dispose();
labelsBuilder_ = null;
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00000002);
labelsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getLabelsFieldBuilder() : null;
} else {
labelsBuilder_.addAllMessages(other.labels_);
}
}
}
if (other.hasDiscoveryInfo()) {
mergeDiscoveryInfo(other.getDiscoveryInfo());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
for (int i = 0; i < getLabelsCount(); i++) {
if (!getLabels(i).isInitialized()) {
return false;
}
}
if (hasDiscoveryInfo()) {
if (!getDiscoveryInfo().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.IpAddress parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.IpAddress) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// repeated string groups = 1;
private com.google.protobuf.LazyStringList groups_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureGroupsIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
groups_ = new com.google.protobuf.LazyStringArrayList(groups_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated string groups = 1;</code>
*/
public java.util.List<java.lang.String>
getGroupsList() {
return java.util.Collections.unmodifiableList(groups_);
}
/**
* <code>repeated string groups = 1;</code>
*/
public int getGroupsCount() {
return groups_.size();
}
/**
* <code>repeated string groups = 1;</code>
*/
public java.lang.String getGroups(int index) {
return groups_.get(index);
}
/**
* <code>repeated string groups = 1;</code>
*/
public com.google.protobuf.ByteString
getGroupsBytes(int index) {
return groups_.getByteString(index);
}
/**
* <code>repeated string groups = 1;</code>
*/
public Builder setGroups(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureGroupsIsMutable();
groups_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string groups = 1;</code>
*/
public Builder addGroups(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureGroupsIsMutable();
groups_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string groups = 1;</code>
*/
public Builder addAllGroups(
java.lang.Iterable<java.lang.String> values) {
ensureGroupsIsMutable();
super.addAll(values, groups_);
onChanged();
return this;
}
/**
* <code>repeated string groups = 1;</code>
*/
public Builder clearGroups() {
groups_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>repeated string groups = 1;</code>
*/
public Builder addGroupsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureGroupsIsMutable();
groups_.add(value);
onChanged();
return this;
}
// repeated .mesos.Label labels = 2;
private java.util.List<org.apache.mesos.Protos.Label> labels_ =
java.util.Collections.emptyList();
private void ensureLabelsIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
labels_ = new java.util.ArrayList<org.apache.mesos.Protos.Label>(labels_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder> labelsBuilder_;
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label> getLabelsList() {
if (labelsBuilder_ == null) {
return java.util.Collections.unmodifiableList(labels_);
} else {
return labelsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public int getLabelsCount() {
if (labelsBuilder_ == null) {
return labels_.size();
} else {
return labelsBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public org.apache.mesos.Protos.Label getLabels(int index) {
if (labelsBuilder_ == null) {
return labels_.get(index);
} else {
return labelsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder setLabels(
int index, org.apache.mesos.Protos.Label value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.set(index, value);
onChanged();
} else {
labelsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder setLabels(
int index, org.apache.mesos.Protos.Label.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.set(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder addLabels(org.apache.mesos.Protos.Label value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(value);
onChanged();
} else {
labelsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder addLabels(
int index, org.apache.mesos.Protos.Label value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(index, value);
onChanged();
} else {
labelsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder addLabels(
org.apache.mesos.Protos.Label.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder addLabels(
int index, org.apache.mesos.Protos.Label.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder addAllLabels(
java.lang.Iterable<? extends org.apache.mesos.Protos.Label> values) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
super.addAll(values, labels_);
onChanged();
} else {
labelsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder clearLabels() {
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
labelsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public Builder removeLabels(int index) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.remove(index);
onChanged();
} else {
labelsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public org.apache.mesos.Protos.Label.Builder getLabelsBuilder(
int index) {
return getLabelsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public org.apache.mesos.Protos.LabelOrBuilder getLabelsOrBuilder(
int index) {
if (labelsBuilder_ == null) {
return labels_.get(index); } else {
return labelsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getLabelsOrBuilderList() {
if (labelsBuilder_ != null) {
return labelsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(labels_);
}
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public org.apache.mesos.Protos.Label.Builder addLabelsBuilder() {
return getLabelsFieldBuilder().addBuilder(
org.apache.mesos.Protos.Label.getDefaultInstance());
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public org.apache.mesos.Protos.Label.Builder addLabelsBuilder(
int index) {
return getLabelsFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Label.getDefaultInstance());
}
/**
* <code>repeated .mesos.Label labels = 2;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label.Builder>
getLabelsBuilderList() {
return getLabelsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder>
getLabelsFieldBuilder() {
if (labelsBuilder_ == null) {
labelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder>(
labels_,
((bitField0_ & 0x00000002) == 0x00000002),
getParentForChildren(),
isClean());
labels_ = null;
}
return labelsBuilder_;
}
// optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;
private mesosphere.marathon.Protos.DiscoveryInfo discoveryInfo_ = mesosphere.marathon.Protos.DiscoveryInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.DiscoveryInfo, mesosphere.marathon.Protos.DiscoveryInfo.Builder, mesosphere.marathon.Protos.DiscoveryInfoOrBuilder> discoveryInfoBuilder_;
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public boolean hasDiscoveryInfo() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public mesosphere.marathon.Protos.DiscoveryInfo getDiscoveryInfo() {
if (discoveryInfoBuilder_ == null) {
return discoveryInfo_;
} else {
return discoveryInfoBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public Builder setDiscoveryInfo(mesosphere.marathon.Protos.DiscoveryInfo value) {
if (discoveryInfoBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
discoveryInfo_ = value;
onChanged();
} else {
discoveryInfoBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public Builder setDiscoveryInfo(
mesosphere.marathon.Protos.DiscoveryInfo.Builder builderForValue) {
if (discoveryInfoBuilder_ == null) {
discoveryInfo_ = builderForValue.build();
onChanged();
} else {
discoveryInfoBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public Builder mergeDiscoveryInfo(mesosphere.marathon.Protos.DiscoveryInfo value) {
if (discoveryInfoBuilder_ == null) {
if (((bitField0_ & 0x00000004) == 0x00000004) &&
discoveryInfo_ != mesosphere.marathon.Protos.DiscoveryInfo.getDefaultInstance()) {
discoveryInfo_ =
mesosphere.marathon.Protos.DiscoveryInfo.newBuilder(discoveryInfo_).mergeFrom(value).buildPartial();
} else {
discoveryInfo_ = value;
}
onChanged();
} else {
discoveryInfoBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public Builder clearDiscoveryInfo() {
if (discoveryInfoBuilder_ == null) {
discoveryInfo_ = mesosphere.marathon.Protos.DiscoveryInfo.getDefaultInstance();
onChanged();
} else {
discoveryInfoBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public mesosphere.marathon.Protos.DiscoveryInfo.Builder getDiscoveryInfoBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getDiscoveryInfoFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
public mesosphere.marathon.Protos.DiscoveryInfoOrBuilder getDiscoveryInfoOrBuilder() {
if (discoveryInfoBuilder_ != null) {
return discoveryInfoBuilder_.getMessageOrBuilder();
} else {
return discoveryInfo_;
}
}
/**
* <code>optional .mesosphere.marathon.DiscoveryInfo discoveryInfo = 3;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.DiscoveryInfo, mesosphere.marathon.Protos.DiscoveryInfo.Builder, mesosphere.marathon.Protos.DiscoveryInfoOrBuilder>
getDiscoveryInfoFieldBuilder() {
if (discoveryInfoBuilder_ == null) {
discoveryInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.DiscoveryInfo, mesosphere.marathon.Protos.DiscoveryInfo.Builder, mesosphere.marathon.Protos.DiscoveryInfoOrBuilder>(
discoveryInfo_,
getParentForChildren(),
isClean());
discoveryInfo_ = null;
}
return discoveryInfoBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.IpAddress)
}
static {
defaultInstance = new IpAddress(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.IpAddress)
}
public interface DiscoveryInfoOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated .mesos.Port ports = 1;
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
java.util.List<org.apache.mesos.Protos.Port>
getPortsList();
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
org.apache.mesos.Protos.Port getPorts(int index);
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
int getPortsCount();
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.PortOrBuilder>
getPortsOrBuilderList();
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
org.apache.mesos.Protos.PortOrBuilder getPortsOrBuilder(
int index);
}
/**
* Protobuf type {@code mesosphere.marathon.DiscoveryInfo}
*/
public static final class DiscoveryInfo extends
com.google.protobuf.GeneratedMessage
implements DiscoveryInfoOrBuilder {
// Use DiscoveryInfo.newBuilder() to construct.
private DiscoveryInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private DiscoveryInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final DiscoveryInfo defaultInstance;
public static DiscoveryInfo getDefaultInstance() {
return defaultInstance;
}
public DiscoveryInfo getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DiscoveryInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
ports_ = new java.util.ArrayList<org.apache.mesos.Protos.Port>();
mutable_bitField0_ |= 0x00000001;
}
ports_.add(input.readMessage(org.apache.mesos.Protos.Port.PARSER, extensionRegistry));
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
ports_ = java.util.Collections.unmodifiableList(ports_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DiscoveryInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DiscoveryInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.DiscoveryInfo.class, mesosphere.marathon.Protos.DiscoveryInfo.Builder.class);
}
public static com.google.protobuf.Parser<DiscoveryInfo> PARSER =
new com.google.protobuf.AbstractParser<DiscoveryInfo>() {
public DiscoveryInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DiscoveryInfo(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<DiscoveryInfo> getParserForType() {
return PARSER;
}
// repeated .mesos.Port ports = 1;
public static final int PORTS_FIELD_NUMBER = 1;
private java.util.List<org.apache.mesos.Protos.Port> ports_;
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public java.util.List<org.apache.mesos.Protos.Port> getPortsList() {
return ports_;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.PortOrBuilder>
getPortsOrBuilderList() {
return ports_;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public int getPortsCount() {
return ports_.size();
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public org.apache.mesos.Protos.Port getPorts(int index) {
return ports_.get(index);
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public org.apache.mesos.Protos.PortOrBuilder getPortsOrBuilder(
int index) {
return ports_.get(index);
}
private void initFields() {
ports_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
for (int i = 0; i < getPortsCount(); i++) {
if (!getPorts(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < ports_.size(); i++) {
output.writeMessage(1, ports_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < ports_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, ports_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.DiscoveryInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.DiscoveryInfo prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.DiscoveryInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.DiscoveryInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DiscoveryInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DiscoveryInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.DiscoveryInfo.class, mesosphere.marathon.Protos.DiscoveryInfo.Builder.class);
}
// Construct using mesosphere.marathon.Protos.DiscoveryInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getPortsFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (portsBuilder_ == null) {
ports_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
portsBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DiscoveryInfo_descriptor;
}
public mesosphere.marathon.Protos.DiscoveryInfo getDefaultInstanceForType() {
return mesosphere.marathon.Protos.DiscoveryInfo.getDefaultInstance();
}
public mesosphere.marathon.Protos.DiscoveryInfo build() {
mesosphere.marathon.Protos.DiscoveryInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.DiscoveryInfo buildPartial() {
mesosphere.marathon.Protos.DiscoveryInfo result = new mesosphere.marathon.Protos.DiscoveryInfo(this);
int from_bitField0_ = bitField0_;
if (portsBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
ports_ = java.util.Collections.unmodifiableList(ports_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.ports_ = ports_;
} else {
result.ports_ = portsBuilder_.build();
}
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.DiscoveryInfo) {
return mergeFrom((mesosphere.marathon.Protos.DiscoveryInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.DiscoveryInfo other) {
if (other == mesosphere.marathon.Protos.DiscoveryInfo.getDefaultInstance()) return this;
if (portsBuilder_ == null) {
if (!other.ports_.isEmpty()) {
if (ports_.isEmpty()) {
ports_ = other.ports_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensurePortsIsMutable();
ports_.addAll(other.ports_);
}
onChanged();
}
} else {
if (!other.ports_.isEmpty()) {
if (portsBuilder_.isEmpty()) {
portsBuilder_.dispose();
portsBuilder_ = null;
ports_ = other.ports_;
bitField0_ = (bitField0_ & ~0x00000001);
portsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getPortsFieldBuilder() : null;
} else {
portsBuilder_.addAllMessages(other.ports_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
for (int i = 0; i < getPortsCount(); i++) {
if (!getPorts(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.DiscoveryInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.DiscoveryInfo) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// repeated .mesos.Port ports = 1;
private java.util.List<org.apache.mesos.Protos.Port> ports_ =
java.util.Collections.emptyList();
private void ensurePortsIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
ports_ = new java.util.ArrayList<org.apache.mesos.Protos.Port>(ports_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Port, org.apache.mesos.Protos.Port.Builder, org.apache.mesos.Protos.PortOrBuilder> portsBuilder_;
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public java.util.List<org.apache.mesos.Protos.Port> getPortsList() {
if (portsBuilder_ == null) {
return java.util.Collections.unmodifiableList(ports_);
} else {
return portsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public int getPortsCount() {
if (portsBuilder_ == null) {
return ports_.size();
} else {
return portsBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public org.apache.mesos.Protos.Port getPorts(int index) {
if (portsBuilder_ == null) {
return ports_.get(index);
} else {
return portsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder setPorts(
int index, org.apache.mesos.Protos.Port value) {
if (portsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortsIsMutable();
ports_.set(index, value);
onChanged();
} else {
portsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder setPorts(
int index, org.apache.mesos.Protos.Port.Builder builderForValue) {
if (portsBuilder_ == null) {
ensurePortsIsMutable();
ports_.set(index, builderForValue.build());
onChanged();
} else {
portsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder addPorts(org.apache.mesos.Protos.Port value) {
if (portsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortsIsMutable();
ports_.add(value);
onChanged();
} else {
portsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder addPorts(
int index, org.apache.mesos.Protos.Port value) {
if (portsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortsIsMutable();
ports_.add(index, value);
onChanged();
} else {
portsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder addPorts(
org.apache.mesos.Protos.Port.Builder builderForValue) {
if (portsBuilder_ == null) {
ensurePortsIsMutable();
ports_.add(builderForValue.build());
onChanged();
} else {
portsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder addPorts(
int index, org.apache.mesos.Protos.Port.Builder builderForValue) {
if (portsBuilder_ == null) {
ensurePortsIsMutable();
ports_.add(index, builderForValue.build());
onChanged();
} else {
portsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder addAllPorts(
java.lang.Iterable<? extends org.apache.mesos.Protos.Port> values) {
if (portsBuilder_ == null) {
ensurePortsIsMutable();
super.addAll(values, ports_);
onChanged();
} else {
portsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder clearPorts() {
if (portsBuilder_ == null) {
ports_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
portsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public Builder removePorts(int index) {
if (portsBuilder_ == null) {
ensurePortsIsMutable();
ports_.remove(index);
onChanged();
} else {
portsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public org.apache.mesos.Protos.Port.Builder getPortsBuilder(
int index) {
return getPortsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public org.apache.mesos.Protos.PortOrBuilder getPortsOrBuilder(
int index) {
if (portsBuilder_ == null) {
return ports_.get(index); } else {
return portsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.PortOrBuilder>
getPortsOrBuilderList() {
if (portsBuilder_ != null) {
return portsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(ports_);
}
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public org.apache.mesos.Protos.Port.Builder addPortsBuilder() {
return getPortsFieldBuilder().addBuilder(
org.apache.mesos.Protos.Port.getDefaultInstance());
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public org.apache.mesos.Protos.Port.Builder addPortsBuilder(
int index) {
return getPortsFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Port.getDefaultInstance());
}
/**
* <code>repeated .mesos.Port ports = 1;</code>
*/
public java.util.List<org.apache.mesos.Protos.Port.Builder>
getPortsBuilderList() {
return getPortsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Port, org.apache.mesos.Protos.Port.Builder, org.apache.mesos.Protos.PortOrBuilder>
getPortsFieldBuilder() {
if (portsBuilder_ == null) {
portsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Port, org.apache.mesos.Protos.Port.Builder, org.apache.mesos.Protos.PortOrBuilder>(
ports_,
((bitField0_ & 0x00000001) == 0x00000001),
getParentForChildren(),
isClean());
ports_ = null;
}
return portsBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.DiscoveryInfo)
}
static {
defaultInstance = new DiscoveryInfo(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.DiscoveryInfo)
}
public interface ServiceDefinitionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string id = 1;
/**
* <code>required string id = 1;</code>
*/
boolean hasId();
/**
* <code>required string id = 1;</code>
*/
java.lang.String getId();
/**
* <code>required string id = 1;</code>
*/
com.google.protobuf.ByteString
getIdBytes();
// required .mesos.CommandInfo cmd = 2;
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
boolean hasCmd();
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
org.apache.mesos.Protos.CommandInfo getCmd();
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
org.apache.mesos.Protos.CommandInfoOrBuilder getCmdOrBuilder();
// required uint32 instances = 3;
/**
* <code>required uint32 instances = 3;</code>
*/
boolean hasInstances();
/**
* <code>required uint32 instances = 3;</code>
*/
int getInstances();
// repeated .mesos.Resource resources = 4;
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
java.util.List<org.apache.mesos.Protos.Resource>
getResourcesList();
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
org.apache.mesos.Protos.Resource getResources(int index);
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
int getResourcesCount();
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.ResourceOrBuilder>
getResourcesOrBuilderList();
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
org.apache.mesos.Protos.ResourceOrBuilder getResourcesOrBuilder(
int index);
// optional string description = 5;
/**
* <code>optional string description = 5;</code>
*/
boolean hasDescription();
/**
* <code>optional string description = 5;</code>
*/
java.lang.String getDescription();
/**
* <code>optional string description = 5;</code>
*/
com.google.protobuf.ByteString
getDescriptionBytes();
// repeated uint32 ports = 6;
/**
* <code>repeated uint32 ports = 6;</code>
*/
java.util.List<java.lang.Integer> getPortsList();
/**
* <code>repeated uint32 ports = 6;</code>
*/
int getPortsCount();
/**
* <code>repeated uint32 ports = 6;</code>
*/
int getPorts(int index);
// repeated .mesosphere.marathon.Constraint constraints = 7;
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
java.util.List<mesosphere.marathon.Protos.Constraint>
getConstraintsList();
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
mesosphere.marathon.Protos.Constraint getConstraints(int index);
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
int getConstraintsCount();
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
java.util.List<? extends mesosphere.marathon.Protos.ConstraintOrBuilder>
getConstraintsOrBuilderList();
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
mesosphere.marathon.Protos.ConstraintOrBuilder getConstraintsOrBuilder(
int index);
// required string executor = 8 [default = ""];
/**
* <code>required string executor = 8 [default = ""];</code>
*/
boolean hasExecutor();
/**
* <code>required string executor = 8 [default = ""];</code>
*/
java.lang.String getExecutor();
/**
* <code>required string executor = 8 [default = ""];</code>
*/
com.google.protobuf.ByteString
getExecutorBytes();
// optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
boolean hasOBSOLETEContainer();
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
mesosphere.marathon.Protos.ContainerInfo getOBSOLETEContainer();
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
mesosphere.marathon.Protos.ContainerInfoOrBuilder getOBSOLETEContainerOrBuilder();
// optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
boolean hasVersion();
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
java.lang.String getVersion();
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
com.google.protobuf.ByteString
getVersionBytes();
// repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
java.util.List<mesosphere.marathon.Protos.HealthCheckDefinition>
getHealthChecksList();
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
mesosphere.marathon.Protos.HealthCheckDefinition getHealthChecks(int index);
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
int getHealthChecksCount();
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
java.util.List<? extends mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder>
getHealthChecksOrBuilderList();
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder getHealthChecksOrBuilder(
int index);
// optional int64 backoff = 13 [default = 1000];
/**
* <code>optional int64 backoff = 13 [default = 1000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
boolean hasBackoff();
/**
* <code>optional int64 backoff = 13 [default = 1000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
long getBackoff();
// optional double backoffFactor = 14 [default = 1.15];
/**
* <code>optional double backoffFactor = 14 [default = 1.15];</code>
*/
boolean hasBackoffFactor();
/**
* <code>optional double backoffFactor = 14 [default = 1.15];</code>
*/
double getBackoffFactor();
// optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
boolean hasUpgradeStrategy();
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
mesosphere.marathon.Protos.UpgradeStrategyDefinition getUpgradeStrategy();
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
mesosphere.marathon.Protos.UpgradeStrategyDefinitionOrBuilder getUpgradeStrategyOrBuilder();
// repeated string dependencies = 16;
/**
* <code>repeated string dependencies = 16;</code>
*/
java.util.List<java.lang.String>
getDependenciesList();
/**
* <code>repeated string dependencies = 16;</code>
*/
int getDependenciesCount();
/**
* <code>repeated string dependencies = 16;</code>
*/
java.lang.String getDependencies(int index);
/**
* <code>repeated string dependencies = 16;</code>
*/
com.google.protobuf.ByteString
getDependenciesBytes(int index);
// repeated string storeUrls = 17;
/**
* <code>repeated string storeUrls = 17;</code>
*/
java.util.List<java.lang.String>
getStoreUrlsList();
/**
* <code>repeated string storeUrls = 17;</code>
*/
int getStoreUrlsCount();
/**
* <code>repeated string storeUrls = 17;</code>
*/
java.lang.String getStoreUrls(int index);
/**
* <code>repeated string storeUrls = 17;</code>
*/
com.google.protobuf.ByteString
getStoreUrlsBytes(int index);
// optional bool require_ports = 18 [default = false];
/**
* <code>optional bool require_ports = 18 [default = false];</code>
*/
boolean hasRequirePorts();
/**
* <code>optional bool require_ports = 18 [default = false];</code>
*/
boolean getRequirePorts();
// optional .mesosphere.marathon.ExtendedContainerInfo container = 19;
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
boolean hasContainer();
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
mesosphere.marathon.Protos.ExtendedContainerInfo getContainer();
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
mesosphere.marathon.Protos.ExtendedContainerInfoOrBuilder getContainerOrBuilder();
// repeated .mesos.Parameter labels = 20;
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
java.util.List<org.apache.mesos.Protos.Parameter>
getLabelsList();
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
org.apache.mesos.Protos.Parameter getLabels(int index);
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
int getLabelsCount();
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.ParameterOrBuilder>
getLabelsOrBuilderList();
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
org.apache.mesos.Protos.ParameterOrBuilder getLabelsOrBuilder(
int index);
// optional int64 maxLaunchDelay = 21 [default = 3600000];
/**
* <code>optional int64 maxLaunchDelay = 21 [default = 3600000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
boolean hasMaxLaunchDelay();
/**
* <code>optional int64 maxLaunchDelay = 21 [default = 3600000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
long getMaxLaunchDelay();
// optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
boolean hasAcceptedResourceRoles();
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
mesosphere.marathon.Protos.ResourceRoles getAcceptedResourceRoles();
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
mesosphere.marathon.Protos.ResourceRolesOrBuilder getAcceptedResourceRolesOrBuilder();
// optional int64 last_scaling_at = 23;
/**
* <code>optional int64 last_scaling_at = 23;</code>
*/
boolean hasLastScalingAt();
/**
* <code>optional int64 last_scaling_at = 23;</code>
*/
long getLastScalingAt();
// optional int64 last_config_change_at = 24;
/**
* <code>optional int64 last_config_change_at = 24;</code>
*/
boolean hasLastConfigChangeAt();
/**
* <code>optional int64 last_config_change_at = 24;</code>
*/
long getLastConfigChangeAt();
// optional .mesosphere.marathon.IpAddress ipAddress = 25;
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
boolean hasIpAddress();
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
mesosphere.marathon.Protos.IpAddress getIpAddress();
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
mesosphere.marathon.Protos.IpAddressOrBuilder getIpAddressOrBuilder();
// optional .mesosphere.marathon.ResidencyDefinition residency = 26;
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
boolean hasResidency();
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
mesosphere.marathon.Protos.ResidencyDefinition getResidency();
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
mesosphere.marathon.Protos.ResidencyDefinitionOrBuilder getResidencyOrBuilder();
// repeated .mesos.Port portDefinitions = 27;
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
java.util.List<org.apache.mesos.Protos.Port>
getPortDefinitionsList();
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
org.apache.mesos.Protos.Port getPortDefinitions(int index);
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
int getPortDefinitionsCount();
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.PortOrBuilder>
getPortDefinitionsOrBuilderList();
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
org.apache.mesos.Protos.PortOrBuilder getPortDefinitionsOrBuilder(
int index);
// repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
java.util.List<mesosphere.marathon.Protos.ReadinessCheckDefinition>
getReadinessCheckDefinitionList();
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
mesosphere.marathon.Protos.ReadinessCheckDefinition getReadinessCheckDefinition(int index);
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
int getReadinessCheckDefinitionCount();
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
java.util.List<? extends mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder>
getReadinessCheckDefinitionOrBuilderList();
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder getReadinessCheckDefinitionOrBuilder(
int index);
}
/**
* Protobuf type {@code mesosphere.marathon.ServiceDefinition}
*/
public static final class ServiceDefinition extends
com.google.protobuf.GeneratedMessage
implements ServiceDefinitionOrBuilder {
// Use ServiceDefinition.newBuilder() to construct.
private ServiceDefinition(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ServiceDefinition(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ServiceDefinition defaultInstance;
public static ServiceDefinition getDefaultInstance() {
return defaultInstance;
}
public ServiceDefinition getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ServiceDefinition(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
id_ = input.readBytes();
break;
}
case 18: {
org.apache.mesos.Protos.CommandInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
subBuilder = cmd_.toBuilder();
}
cmd_ = input.readMessage(org.apache.mesos.Protos.CommandInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(cmd_);
cmd_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000002;
break;
}
case 24: {
bitField0_ |= 0x00000004;
instances_ = input.readUInt32();
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
resources_ = new java.util.ArrayList<org.apache.mesos.Protos.Resource>();
mutable_bitField0_ |= 0x00000008;
}
resources_.add(input.readMessage(org.apache.mesos.Protos.Resource.PARSER, extensionRegistry));
break;
}
case 42: {
bitField0_ |= 0x00000008;
description_ = input.readBytes();
break;
}
case 48: {
if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
ports_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000020;
}
ports_.add(input.readUInt32());
break;
}
case 50: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) {
ports_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000020;
}
while (input.getBytesUntilLimit() > 0) {
ports_.add(input.readUInt32());
}
input.popLimit(limit);
break;
}
case 58: {
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
constraints_ = new java.util.ArrayList<mesosphere.marathon.Protos.Constraint>();
mutable_bitField0_ |= 0x00000040;
}
constraints_.add(input.readMessage(mesosphere.marathon.Protos.Constraint.PARSER, extensionRegistry));
break;
}
case 66: {
bitField0_ |= 0x00000010;
executor_ = input.readBytes();
break;
}
case 82: {
mesosphere.marathon.Protos.ContainerInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000020) == 0x00000020)) {
subBuilder = oBSOLETEContainer_.toBuilder();
}
oBSOLETEContainer_ = input.readMessage(mesosphere.marathon.Protos.ContainerInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(oBSOLETEContainer_);
oBSOLETEContainer_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000020;
break;
}
case 90: {
bitField0_ |= 0x00000040;
version_ = input.readBytes();
break;
}
case 98: {
if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
healthChecks_ = new java.util.ArrayList<mesosphere.marathon.Protos.HealthCheckDefinition>();
mutable_bitField0_ |= 0x00000400;
}
healthChecks_.add(input.readMessage(mesosphere.marathon.Protos.HealthCheckDefinition.PARSER, extensionRegistry));
break;
}
case 104: {
bitField0_ |= 0x00000080;
backoff_ = input.readInt64();
break;
}
case 113: {
bitField0_ |= 0x00000100;
backoffFactor_ = input.readDouble();
break;
}
case 122: {
mesosphere.marathon.Protos.UpgradeStrategyDefinition.Builder subBuilder = null;
if (((bitField0_ & 0x00000200) == 0x00000200)) {
subBuilder = upgradeStrategy_.toBuilder();
}
upgradeStrategy_ = input.readMessage(mesosphere.marathon.Protos.UpgradeStrategyDefinition.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(upgradeStrategy_);
upgradeStrategy_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000200;
break;
}
case 130: {
if (!((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
dependencies_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00004000;
}
dependencies_.add(input.readBytes());
break;
}
case 138: {
if (!((mutable_bitField0_ & 0x00008000) == 0x00008000)) {
storeUrls_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00008000;
}
storeUrls_.add(input.readBytes());
break;
}
case 144: {
bitField0_ |= 0x00000400;
requirePorts_ = input.readBool();
break;
}
case 154: {
mesosphere.marathon.Protos.ExtendedContainerInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000800) == 0x00000800)) {
subBuilder = container_.toBuilder();
}
container_ = input.readMessage(mesosphere.marathon.Protos.ExtendedContainerInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(container_);
container_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000800;
break;
}
case 162: {
if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) {
labels_ = new java.util.ArrayList<org.apache.mesos.Protos.Parameter>();
mutable_bitField0_ |= 0x00040000;
}
labels_.add(input.readMessage(org.apache.mesos.Protos.Parameter.PARSER, extensionRegistry));
break;
}
case 168: {
bitField0_ |= 0x00001000;
maxLaunchDelay_ = input.readInt64();
break;
}
case 178: {
mesosphere.marathon.Protos.ResourceRoles.Builder subBuilder = null;
if (((bitField0_ & 0x00002000) == 0x00002000)) {
subBuilder = acceptedResourceRoles_.toBuilder();
}
acceptedResourceRoles_ = input.readMessage(mesosphere.marathon.Protos.ResourceRoles.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(acceptedResourceRoles_);
acceptedResourceRoles_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00002000;
break;
}
case 184: {
bitField0_ |= 0x00004000;
lastScalingAt_ = input.readInt64();
break;
}
case 192: {
bitField0_ |= 0x00008000;
lastConfigChangeAt_ = input.readInt64();
break;
}
case 202: {
mesosphere.marathon.Protos.IpAddress.Builder subBuilder = null;
if (((bitField0_ & 0x00010000) == 0x00010000)) {
subBuilder = ipAddress_.toBuilder();
}
ipAddress_ = input.readMessage(mesosphere.marathon.Protos.IpAddress.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(ipAddress_);
ipAddress_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00010000;
break;
}
case 210: {
mesosphere.marathon.Protos.ResidencyDefinition.Builder subBuilder = null;
if (((bitField0_ & 0x00020000) == 0x00020000)) {
subBuilder = residency_.toBuilder();
}
residency_ = input.readMessage(mesosphere.marathon.Protos.ResidencyDefinition.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(residency_);
residency_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00020000;
break;
}
case 218: {
if (!((mutable_bitField0_ & 0x02000000) == 0x02000000)) {
portDefinitions_ = new java.util.ArrayList<org.apache.mesos.Protos.Port>();
mutable_bitField0_ |= 0x02000000;
}
portDefinitions_.add(input.readMessage(org.apache.mesos.Protos.Port.PARSER, extensionRegistry));
break;
}
case 226: {
if (!((mutable_bitField0_ & 0x04000000) == 0x04000000)) {
readinessCheckDefinition_ = new java.util.ArrayList<mesosphere.marathon.Protos.ReadinessCheckDefinition>();
mutable_bitField0_ |= 0x04000000;
}
readinessCheckDefinition_.add(input.readMessage(mesosphere.marathon.Protos.ReadinessCheckDefinition.PARSER, extensionRegistry));
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
resources_ = java.util.Collections.unmodifiableList(resources_);
}
if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
ports_ = java.util.Collections.unmodifiableList(ports_);
}
if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
constraints_ = java.util.Collections.unmodifiableList(constraints_);
}
if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
healthChecks_ = java.util.Collections.unmodifiableList(healthChecks_);
}
if (((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
dependencies_ = new com.google.protobuf.UnmodifiableLazyStringList(dependencies_);
}
if (((mutable_bitField0_ & 0x00008000) == 0x00008000)) {
storeUrls_ = new com.google.protobuf.UnmodifiableLazyStringList(storeUrls_);
}
if (((mutable_bitField0_ & 0x00040000) == 0x00040000)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
}
if (((mutable_bitField0_ & 0x02000000) == 0x02000000)) {
portDefinitions_ = java.util.Collections.unmodifiableList(portDefinitions_);
}
if (((mutable_bitField0_ & 0x04000000) == 0x04000000)) {
readinessCheckDefinition_ = java.util.Collections.unmodifiableList(readinessCheckDefinition_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ServiceDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ServiceDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ServiceDefinition.class, mesosphere.marathon.Protos.ServiceDefinition.Builder.class);
}
public static com.google.protobuf.Parser<ServiceDefinition> PARSER =
new com.google.protobuf.AbstractParser<ServiceDefinition>() {
public ServiceDefinition parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ServiceDefinition(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ServiceDefinition> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string id = 1;
public static final int ID_FIELD_NUMBER = 1;
private java.lang.Object id_;
/**
* <code>required string id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
id_ = s;
}
return s;
}
}
/**
* <code>required string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required .mesos.CommandInfo cmd = 2;
public static final int CMD_FIELD_NUMBER = 2;
private org.apache.mesos.Protos.CommandInfo cmd_;
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public boolean hasCmd() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public org.apache.mesos.Protos.CommandInfo getCmd() {
return cmd_;
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public org.apache.mesos.Protos.CommandInfoOrBuilder getCmdOrBuilder() {
return cmd_;
}
// required uint32 instances = 3;
public static final int INSTANCES_FIELD_NUMBER = 3;
private int instances_;
/**
* <code>required uint32 instances = 3;</code>
*/
public boolean hasInstances() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required uint32 instances = 3;</code>
*/
public int getInstances() {
return instances_;
}
// repeated .mesos.Resource resources = 4;
public static final int RESOURCES_FIELD_NUMBER = 4;
private java.util.List<org.apache.mesos.Protos.Resource> resources_;
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Resource> getResourcesList() {
return resources_;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.ResourceOrBuilder>
getResourcesOrBuilderList() {
return resources_;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public int getResourcesCount() {
return resources_.size();
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public org.apache.mesos.Protos.Resource getResources(int index) {
return resources_.get(index);
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public org.apache.mesos.Protos.ResourceOrBuilder getResourcesOrBuilder(
int index) {
return resources_.get(index);
}
// optional string description = 5;
public static final int DESCRIPTION_FIELD_NUMBER = 5;
private java.lang.Object description_;
/**
* <code>optional string description = 5;</code>
*/
public boolean hasDescription() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string description = 5;</code>
*/
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
description_ = s;
}
return s;
}
}
/**
* <code>optional string description = 5;</code>
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// repeated uint32 ports = 6;
public static final int PORTS_FIELD_NUMBER = 6;
private java.util.List<java.lang.Integer> ports_;
/**
* <code>repeated uint32 ports = 6;</code>
*/
public java.util.List<java.lang.Integer>
getPortsList() {
return ports_;
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public int getPortsCount() {
return ports_.size();
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public int getPorts(int index) {
return ports_.get(index);
}
// repeated .mesosphere.marathon.Constraint constraints = 7;
public static final int CONSTRAINTS_FIELD_NUMBER = 7;
private java.util.List<mesosphere.marathon.Protos.Constraint> constraints_;
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public java.util.List<mesosphere.marathon.Protos.Constraint> getConstraintsList() {
return constraints_;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.ConstraintOrBuilder>
getConstraintsOrBuilderList() {
return constraints_;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public int getConstraintsCount() {
return constraints_.size();
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public mesosphere.marathon.Protos.Constraint getConstraints(int index) {
return constraints_.get(index);
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public mesosphere.marathon.Protos.ConstraintOrBuilder getConstraintsOrBuilder(
int index) {
return constraints_.get(index);
}
// required string executor = 8 [default = ""];
public static final int EXECUTOR_FIELD_NUMBER = 8;
private java.lang.Object executor_;
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public boolean hasExecutor() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public java.lang.String getExecutor() {
java.lang.Object ref = executor_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
executor_ = s;
}
return s;
}
}
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public com.google.protobuf.ByteString
getExecutorBytes() {
java.lang.Object ref = executor_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
executor_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;
public static final int OBSOLETE_CONTAINER_FIELD_NUMBER = 10;
private mesosphere.marathon.Protos.ContainerInfo oBSOLETEContainer_;
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public boolean hasOBSOLETEContainer() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public mesosphere.marathon.Protos.ContainerInfo getOBSOLETEContainer() {
return oBSOLETEContainer_;
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public mesosphere.marathon.Protos.ContainerInfoOrBuilder getOBSOLETEContainerOrBuilder() {
return oBSOLETEContainer_;
}
// optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];
public static final int VERSION_FIELD_NUMBER = 11;
private java.lang.Object version_;
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
version_ = s;
}
return s;
}
}
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;
public static final int HEALTHCHECKS_FIELD_NUMBER = 12;
private java.util.List<mesosphere.marathon.Protos.HealthCheckDefinition> healthChecks_;
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public java.util.List<mesosphere.marathon.Protos.HealthCheckDefinition> getHealthChecksList() {
return healthChecks_;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder>
getHealthChecksOrBuilderList() {
return healthChecks_;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public int getHealthChecksCount() {
return healthChecks_.size();
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinition getHealthChecks(int index) {
return healthChecks_.get(index);
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder getHealthChecksOrBuilder(
int index) {
return healthChecks_.get(index);
}
// optional int64 backoff = 13 [default = 1000];
public static final int BACKOFF_FIELD_NUMBER = 13;
private long backoff_;
/**
* <code>optional int64 backoff = 13 [default = 1000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public boolean hasBackoff() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional int64 backoff = 13 [default = 1000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public long getBackoff() {
return backoff_;
}
// optional double backoffFactor = 14 [default = 1.15];
public static final int BACKOFFFACTOR_FIELD_NUMBER = 14;
private double backoffFactor_;
/**
* <code>optional double backoffFactor = 14 [default = 1.15];</code>
*/
public boolean hasBackoffFactor() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>optional double backoffFactor = 14 [default = 1.15];</code>
*/
public double getBackoffFactor() {
return backoffFactor_;
}
// optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;
public static final int UPGRADESTRATEGY_FIELD_NUMBER = 15;
private mesosphere.marathon.Protos.UpgradeStrategyDefinition upgradeStrategy_;
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public boolean hasUpgradeStrategy() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public mesosphere.marathon.Protos.UpgradeStrategyDefinition getUpgradeStrategy() {
return upgradeStrategy_;
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public mesosphere.marathon.Protos.UpgradeStrategyDefinitionOrBuilder getUpgradeStrategyOrBuilder() {
return upgradeStrategy_;
}
// repeated string dependencies = 16;
public static final int DEPENDENCIES_FIELD_NUMBER = 16;
private com.google.protobuf.LazyStringList dependencies_;
/**
* <code>repeated string dependencies = 16;</code>
*/
public java.util.List<java.lang.String>
getDependenciesList() {
return dependencies_;
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public int getDependenciesCount() {
return dependencies_.size();
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public java.lang.String getDependencies(int index) {
return dependencies_.get(index);
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public com.google.protobuf.ByteString
getDependenciesBytes(int index) {
return dependencies_.getByteString(index);
}
// repeated string storeUrls = 17;
public static final int STOREURLS_FIELD_NUMBER = 17;
private com.google.protobuf.LazyStringList storeUrls_;
/**
* <code>repeated string storeUrls = 17;</code>
*/
public java.util.List<java.lang.String>
getStoreUrlsList() {
return storeUrls_;
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public int getStoreUrlsCount() {
return storeUrls_.size();
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public java.lang.String getStoreUrls(int index) {
return storeUrls_.get(index);
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public com.google.protobuf.ByteString
getStoreUrlsBytes(int index) {
return storeUrls_.getByteString(index);
}
// optional bool require_ports = 18 [default = false];
public static final int REQUIRE_PORTS_FIELD_NUMBER = 18;
private boolean requirePorts_;
/**
* <code>optional bool require_ports = 18 [default = false];</code>
*/
public boolean hasRequirePorts() {
return ((bitField0_ & 0x00000400) == 0x00000400);
}
/**
* <code>optional bool require_ports = 18 [default = false];</code>
*/
public boolean getRequirePorts() {
return requirePorts_;
}
// optional .mesosphere.marathon.ExtendedContainerInfo container = 19;
public static final int CONTAINER_FIELD_NUMBER = 19;
private mesosphere.marathon.Protos.ExtendedContainerInfo container_;
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public boolean hasContainer() {
return ((bitField0_ & 0x00000800) == 0x00000800);
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo getContainer() {
return container_;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfoOrBuilder getContainerOrBuilder() {
return container_;
}
// repeated .mesos.Parameter labels = 20;
public static final int LABELS_FIELD_NUMBER = 20;
private java.util.List<org.apache.mesos.Protos.Parameter> labels_;
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public java.util.List<org.apache.mesos.Protos.Parameter> getLabelsList() {
return labels_;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.ParameterOrBuilder>
getLabelsOrBuilderList() {
return labels_;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public int getLabelsCount() {
return labels_.size();
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public org.apache.mesos.Protos.Parameter getLabels(int index) {
return labels_.get(index);
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public org.apache.mesos.Protos.ParameterOrBuilder getLabelsOrBuilder(
int index) {
return labels_.get(index);
}
// optional int64 maxLaunchDelay = 21 [default = 3600000];
public static final int MAXLAUNCHDELAY_FIELD_NUMBER = 21;
private long maxLaunchDelay_;
/**
* <code>optional int64 maxLaunchDelay = 21 [default = 3600000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public boolean hasMaxLaunchDelay() {
return ((bitField0_ & 0x00001000) == 0x00001000);
}
/**
* <code>optional int64 maxLaunchDelay = 21 [default = 3600000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public long getMaxLaunchDelay() {
return maxLaunchDelay_;
}
// optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;
public static final int ACCEPTEDRESOURCEROLES_FIELD_NUMBER = 22;
private mesosphere.marathon.Protos.ResourceRoles acceptedResourceRoles_;
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public boolean hasAcceptedResourceRoles() {
return ((bitField0_ & 0x00002000) == 0x00002000);
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public mesosphere.marathon.Protos.ResourceRoles getAcceptedResourceRoles() {
return acceptedResourceRoles_;
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public mesosphere.marathon.Protos.ResourceRolesOrBuilder getAcceptedResourceRolesOrBuilder() {
return acceptedResourceRoles_;
}
// optional int64 last_scaling_at = 23;
public static final int LAST_SCALING_AT_FIELD_NUMBER = 23;
private long lastScalingAt_;
/**
* <code>optional int64 last_scaling_at = 23;</code>
*/
public boolean hasLastScalingAt() {
return ((bitField0_ & 0x00004000) == 0x00004000);
}
/**
* <code>optional int64 last_scaling_at = 23;</code>
*/
public long getLastScalingAt() {
return lastScalingAt_;
}
// optional int64 last_config_change_at = 24;
public static final int LAST_CONFIG_CHANGE_AT_FIELD_NUMBER = 24;
private long lastConfigChangeAt_;
/**
* <code>optional int64 last_config_change_at = 24;</code>
*/
public boolean hasLastConfigChangeAt() {
return ((bitField0_ & 0x00008000) == 0x00008000);
}
/**
* <code>optional int64 last_config_change_at = 24;</code>
*/
public long getLastConfigChangeAt() {
return lastConfigChangeAt_;
}
// optional .mesosphere.marathon.IpAddress ipAddress = 25;
public static final int IPADDRESS_FIELD_NUMBER = 25;
private mesosphere.marathon.Protos.IpAddress ipAddress_;
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public boolean hasIpAddress() {
return ((bitField0_ & 0x00010000) == 0x00010000);
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public mesosphere.marathon.Protos.IpAddress getIpAddress() {
return ipAddress_;
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public mesosphere.marathon.Protos.IpAddressOrBuilder getIpAddressOrBuilder() {
return ipAddress_;
}
// optional .mesosphere.marathon.ResidencyDefinition residency = 26;
public static final int RESIDENCY_FIELD_NUMBER = 26;
private mesosphere.marathon.Protos.ResidencyDefinition residency_;
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public boolean hasResidency() {
return ((bitField0_ & 0x00020000) == 0x00020000);
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public mesosphere.marathon.Protos.ResidencyDefinition getResidency() {
return residency_;
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public mesosphere.marathon.Protos.ResidencyDefinitionOrBuilder getResidencyOrBuilder() {
return residency_;
}
// repeated .mesos.Port portDefinitions = 27;
public static final int PORTDEFINITIONS_FIELD_NUMBER = 27;
private java.util.List<org.apache.mesos.Protos.Port> portDefinitions_;
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public java.util.List<org.apache.mesos.Protos.Port> getPortDefinitionsList() {
return portDefinitions_;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.PortOrBuilder>
getPortDefinitionsOrBuilderList() {
return portDefinitions_;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public int getPortDefinitionsCount() {
return portDefinitions_.size();
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public org.apache.mesos.Protos.Port getPortDefinitions(int index) {
return portDefinitions_.get(index);
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public org.apache.mesos.Protos.PortOrBuilder getPortDefinitionsOrBuilder(
int index) {
return portDefinitions_.get(index);
}
// repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;
public static final int READINESSCHECKDEFINITION_FIELD_NUMBER = 28;
private java.util.List<mesosphere.marathon.Protos.ReadinessCheckDefinition> readinessCheckDefinition_;
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ReadinessCheckDefinition> getReadinessCheckDefinitionList() {
return readinessCheckDefinition_;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder>
getReadinessCheckDefinitionOrBuilderList() {
return readinessCheckDefinition_;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public int getReadinessCheckDefinitionCount() {
return readinessCheckDefinition_.size();
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinition getReadinessCheckDefinition(int index) {
return readinessCheckDefinition_.get(index);
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder getReadinessCheckDefinitionOrBuilder(
int index) {
return readinessCheckDefinition_.get(index);
}
private void initFields() {
id_ = "";
cmd_ = org.apache.mesos.Protos.CommandInfo.getDefaultInstance();
instances_ = 0;
resources_ = java.util.Collections.emptyList();
description_ = "";
ports_ = java.util.Collections.emptyList();
constraints_ = java.util.Collections.emptyList();
executor_ = "";
oBSOLETEContainer_ = mesosphere.marathon.Protos.ContainerInfo.getDefaultInstance();
version_ = "1970-01-01T00:00:00.000Z";
healthChecks_ = java.util.Collections.emptyList();
backoff_ = 1000L;
backoffFactor_ = 1.15D;
upgradeStrategy_ = mesosphere.marathon.Protos.UpgradeStrategyDefinition.getDefaultInstance();
dependencies_ = com.google.protobuf.LazyStringArrayList.EMPTY;
storeUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
requirePorts_ = false;
container_ = mesosphere.marathon.Protos.ExtendedContainerInfo.getDefaultInstance();
labels_ = java.util.Collections.emptyList();
maxLaunchDelay_ = 3600000L;
acceptedResourceRoles_ = mesosphere.marathon.Protos.ResourceRoles.getDefaultInstance();
lastScalingAt_ = 0L;
lastConfigChangeAt_ = 0L;
ipAddress_ = mesosphere.marathon.Protos.IpAddress.getDefaultInstance();
residency_ = mesosphere.marathon.Protos.ResidencyDefinition.getDefaultInstance();
portDefinitions_ = java.util.Collections.emptyList();
readinessCheckDefinition_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasId()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasCmd()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasInstances()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasExecutor()) {
memoizedIsInitialized = 0;
return false;
}
if (!getCmd().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
for (int i = 0; i < getResourcesCount(); i++) {
if (!getResources(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getConstraintsCount(); i++) {
if (!getConstraints(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasOBSOLETEContainer()) {
if (!getOBSOLETEContainer().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getHealthChecksCount(); i++) {
if (!getHealthChecks(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasUpgradeStrategy()) {
if (!getUpgradeStrategy().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasContainer()) {
if (!getContainer().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getLabelsCount(); i++) {
if (!getLabels(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasIpAddress()) {
if (!getIpAddress().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getPortDefinitionsCount(); i++) {
if (!getPortDefinitions(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeMessage(2, cmd_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeUInt32(3, instances_);
}
for (int i = 0; i < resources_.size(); i++) {
output.writeMessage(4, resources_.get(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(5, getDescriptionBytes());
}
for (int i = 0; i < ports_.size(); i++) {
output.writeUInt32(6, ports_.get(i));
}
for (int i = 0; i < constraints_.size(); i++) {
output.writeMessage(7, constraints_.get(i));
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeBytes(8, getExecutorBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeMessage(10, oBSOLETEContainer_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBytes(11, getVersionBytes());
}
for (int i = 0; i < healthChecks_.size(); i++) {
output.writeMessage(12, healthChecks_.get(i));
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeInt64(13, backoff_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
output.writeDouble(14, backoffFactor_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
output.writeMessage(15, upgradeStrategy_);
}
for (int i = 0; i < dependencies_.size(); i++) {
output.writeBytes(16, dependencies_.getByteString(i));
}
for (int i = 0; i < storeUrls_.size(); i++) {
output.writeBytes(17, storeUrls_.getByteString(i));
}
if (((bitField0_ & 0x00000400) == 0x00000400)) {
output.writeBool(18, requirePorts_);
}
if (((bitField0_ & 0x00000800) == 0x00000800)) {
output.writeMessage(19, container_);
}
for (int i = 0; i < labels_.size(); i++) {
output.writeMessage(20, labels_.get(i));
}
if (((bitField0_ & 0x00001000) == 0x00001000)) {
output.writeInt64(21, maxLaunchDelay_);
}
if (((bitField0_ & 0x00002000) == 0x00002000)) {
output.writeMessage(22, acceptedResourceRoles_);
}
if (((bitField0_ & 0x00004000) == 0x00004000)) {
output.writeInt64(23, lastScalingAt_);
}
if (((bitField0_ & 0x00008000) == 0x00008000)) {
output.writeInt64(24, lastConfigChangeAt_);
}
if (((bitField0_ & 0x00010000) == 0x00010000)) {
output.writeMessage(25, ipAddress_);
}
if (((bitField0_ & 0x00020000) == 0x00020000)) {
output.writeMessage(26, residency_);
}
for (int i = 0; i < portDefinitions_.size(); i++) {
output.writeMessage(27, portDefinitions_.get(i));
}
for (int i = 0; i < readinessCheckDefinition_.size(); i++) {
output.writeMessage(28, readinessCheckDefinition_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, cmd_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, instances_);
}
for (int i = 0; i < resources_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, resources_.get(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, getDescriptionBytes());
}
{
int dataSize = 0;
for (int i = 0; i < ports_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeUInt32SizeNoTag(ports_.get(i));
}
size += dataSize;
size += 1 * getPortsList().size();
}
for (int i = 0; i < constraints_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(7, constraints_.get(i));
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(8, getExecutorBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(10, oBSOLETEContainer_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(11, getVersionBytes());
}
for (int i = 0; i < healthChecks_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(12, healthChecks_.get(i));
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(13, backoff_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(14, backoffFactor_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(15, upgradeStrategy_);
}
{
int dataSize = 0;
for (int i = 0; i < dependencies_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(dependencies_.getByteString(i));
}
size += dataSize;
size += 2 * getDependenciesList().size();
}
{
int dataSize = 0;
for (int i = 0; i < storeUrls_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(storeUrls_.getByteString(i));
}
size += dataSize;
size += 2 * getStoreUrlsList().size();
}
if (((bitField0_ & 0x00000400) == 0x00000400)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(18, requirePorts_);
}
if (((bitField0_ & 0x00000800) == 0x00000800)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(19, container_);
}
for (int i = 0; i < labels_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(20, labels_.get(i));
}
if (((bitField0_ & 0x00001000) == 0x00001000)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(21, maxLaunchDelay_);
}
if (((bitField0_ & 0x00002000) == 0x00002000)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(22, acceptedResourceRoles_);
}
if (((bitField0_ & 0x00004000) == 0x00004000)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(23, lastScalingAt_);
}
if (((bitField0_ & 0x00008000) == 0x00008000)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(24, lastConfigChangeAt_);
}
if (((bitField0_ & 0x00010000) == 0x00010000)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(25, ipAddress_);
}
if (((bitField0_ & 0x00020000) == 0x00020000)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(26, residency_);
}
for (int i = 0; i < portDefinitions_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(27, portDefinitions_.get(i));
}
for (int i = 0; i < readinessCheckDefinition_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(28, readinessCheckDefinition_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ServiceDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ServiceDefinition parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ServiceDefinition prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ServiceDefinition}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ServiceDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ServiceDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ServiceDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ServiceDefinition.class, mesosphere.marathon.Protos.ServiceDefinition.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ServiceDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getCmdFieldBuilder();
getResourcesFieldBuilder();
getConstraintsFieldBuilder();
getOBSOLETEContainerFieldBuilder();
getHealthChecksFieldBuilder();
getUpgradeStrategyFieldBuilder();
getContainerFieldBuilder();
getLabelsFieldBuilder();
getAcceptedResourceRolesFieldBuilder();
getIpAddressFieldBuilder();
getResidencyFieldBuilder();
getPortDefinitionsFieldBuilder();
getReadinessCheckDefinitionFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
id_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
if (cmdBuilder_ == null) {
cmd_ = org.apache.mesos.Protos.CommandInfo.getDefaultInstance();
} else {
cmdBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
instances_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
if (resourcesBuilder_ == null) {
resources_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
} else {
resourcesBuilder_.clear();
}
description_ = "";
bitField0_ = (bitField0_ & ~0x00000010);
ports_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000020);
if (constraintsBuilder_ == null) {
constraints_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
} else {
constraintsBuilder_.clear();
}
executor_ = "";
bitField0_ = (bitField0_ & ~0x00000080);
if (oBSOLETEContainerBuilder_ == null) {
oBSOLETEContainer_ = mesosphere.marathon.Protos.ContainerInfo.getDefaultInstance();
} else {
oBSOLETEContainerBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000100);
version_ = "1970-01-01T00:00:00.000Z";
bitField0_ = (bitField0_ & ~0x00000200);
if (healthChecksBuilder_ == null) {
healthChecks_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000400);
} else {
healthChecksBuilder_.clear();
}
backoff_ = 1000L;
bitField0_ = (bitField0_ & ~0x00000800);
backoffFactor_ = 1.15D;
bitField0_ = (bitField0_ & ~0x00001000);
if (upgradeStrategyBuilder_ == null) {
upgradeStrategy_ = mesosphere.marathon.Protos.UpgradeStrategyDefinition.getDefaultInstance();
} else {
upgradeStrategyBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00002000);
dependencies_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00004000);
storeUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00008000);
requirePorts_ = false;
bitField0_ = (bitField0_ & ~0x00010000);
if (containerBuilder_ == null) {
container_ = mesosphere.marathon.Protos.ExtendedContainerInfo.getDefaultInstance();
} else {
containerBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00020000);
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00040000);
} else {
labelsBuilder_.clear();
}
maxLaunchDelay_ = 3600000L;
bitField0_ = (bitField0_ & ~0x00080000);
if (acceptedResourceRolesBuilder_ == null) {
acceptedResourceRoles_ = mesosphere.marathon.Protos.ResourceRoles.getDefaultInstance();
} else {
acceptedResourceRolesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00100000);
lastScalingAt_ = 0L;
bitField0_ = (bitField0_ & ~0x00200000);
lastConfigChangeAt_ = 0L;
bitField0_ = (bitField0_ & ~0x00400000);
if (ipAddressBuilder_ == null) {
ipAddress_ = mesosphere.marathon.Protos.IpAddress.getDefaultInstance();
} else {
ipAddressBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00800000);
if (residencyBuilder_ == null) {
residency_ = mesosphere.marathon.Protos.ResidencyDefinition.getDefaultInstance();
} else {
residencyBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x01000000);
if (portDefinitionsBuilder_ == null) {
portDefinitions_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x02000000);
} else {
portDefinitionsBuilder_.clear();
}
if (readinessCheckDefinitionBuilder_ == null) {
readinessCheckDefinition_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x04000000);
} else {
readinessCheckDefinitionBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ServiceDefinition_descriptor;
}
public mesosphere.marathon.Protos.ServiceDefinition getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ServiceDefinition.getDefaultInstance();
}
public mesosphere.marathon.Protos.ServiceDefinition build() {
mesosphere.marathon.Protos.ServiceDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ServiceDefinition buildPartial() {
mesosphere.marathon.Protos.ServiceDefinition result = new mesosphere.marathon.Protos.ServiceDefinition(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.id_ = id_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
if (cmdBuilder_ == null) {
result.cmd_ = cmd_;
} else {
result.cmd_ = cmdBuilder_.build();
}
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.instances_ = instances_;
if (resourcesBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008)) {
resources_ = java.util.Collections.unmodifiableList(resources_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.resources_ = resources_;
} else {
result.resources_ = resourcesBuilder_.build();
}
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000008;
}
result.description_ = description_;
if (((bitField0_ & 0x00000020) == 0x00000020)) {
ports_ = java.util.Collections.unmodifiableList(ports_);
bitField0_ = (bitField0_ & ~0x00000020);
}
result.ports_ = ports_;
if (constraintsBuilder_ == null) {
if (((bitField0_ & 0x00000040) == 0x00000040)) {
constraints_ = java.util.Collections.unmodifiableList(constraints_);
bitField0_ = (bitField0_ & ~0x00000040);
}
result.constraints_ = constraints_;
} else {
result.constraints_ = constraintsBuilder_.build();
}
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000010;
}
result.executor_ = executor_;
if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
to_bitField0_ |= 0x00000020;
}
if (oBSOLETEContainerBuilder_ == null) {
result.oBSOLETEContainer_ = oBSOLETEContainer_;
} else {
result.oBSOLETEContainer_ = oBSOLETEContainerBuilder_.build();
}
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000040;
}
result.version_ = version_;
if (healthChecksBuilder_ == null) {
if (((bitField0_ & 0x00000400) == 0x00000400)) {
healthChecks_ = java.util.Collections.unmodifiableList(healthChecks_);
bitField0_ = (bitField0_ & ~0x00000400);
}
result.healthChecks_ = healthChecks_;
} else {
result.healthChecks_ = healthChecksBuilder_.build();
}
if (((from_bitField0_ & 0x00000800) == 0x00000800)) {
to_bitField0_ |= 0x00000080;
}
result.backoff_ = backoff_;
if (((from_bitField0_ & 0x00001000) == 0x00001000)) {
to_bitField0_ |= 0x00000100;
}
result.backoffFactor_ = backoffFactor_;
if (((from_bitField0_ & 0x00002000) == 0x00002000)) {
to_bitField0_ |= 0x00000200;
}
if (upgradeStrategyBuilder_ == null) {
result.upgradeStrategy_ = upgradeStrategy_;
} else {
result.upgradeStrategy_ = upgradeStrategyBuilder_.build();
}
if (((bitField0_ & 0x00004000) == 0x00004000)) {
dependencies_ = new com.google.protobuf.UnmodifiableLazyStringList(
dependencies_);
bitField0_ = (bitField0_ & ~0x00004000);
}
result.dependencies_ = dependencies_;
if (((bitField0_ & 0x00008000) == 0x00008000)) {
storeUrls_ = new com.google.protobuf.UnmodifiableLazyStringList(
storeUrls_);
bitField0_ = (bitField0_ & ~0x00008000);
}
result.storeUrls_ = storeUrls_;
if (((from_bitField0_ & 0x00010000) == 0x00010000)) {
to_bitField0_ |= 0x00000400;
}
result.requirePorts_ = requirePorts_;
if (((from_bitField0_ & 0x00020000) == 0x00020000)) {
to_bitField0_ |= 0x00000800;
}
if (containerBuilder_ == null) {
result.container_ = container_;
} else {
result.container_ = containerBuilder_.build();
}
if (labelsBuilder_ == null) {
if (((bitField0_ & 0x00040000) == 0x00040000)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
bitField0_ = (bitField0_ & ~0x00040000);
}
result.labels_ = labels_;
} else {
result.labels_ = labelsBuilder_.build();
}
if (((from_bitField0_ & 0x00080000) == 0x00080000)) {
to_bitField0_ |= 0x00001000;
}
result.maxLaunchDelay_ = maxLaunchDelay_;
if (((from_bitField0_ & 0x00100000) == 0x00100000)) {
to_bitField0_ |= 0x00002000;
}
if (acceptedResourceRolesBuilder_ == null) {
result.acceptedResourceRoles_ = acceptedResourceRoles_;
} else {
result.acceptedResourceRoles_ = acceptedResourceRolesBuilder_.build();
}
if (((from_bitField0_ & 0x00200000) == 0x00200000)) {
to_bitField0_ |= 0x00004000;
}
result.lastScalingAt_ = lastScalingAt_;
if (((from_bitField0_ & 0x00400000) == 0x00400000)) {
to_bitField0_ |= 0x00008000;
}
result.lastConfigChangeAt_ = lastConfigChangeAt_;
if (((from_bitField0_ & 0x00800000) == 0x00800000)) {
to_bitField0_ |= 0x00010000;
}
if (ipAddressBuilder_ == null) {
result.ipAddress_ = ipAddress_;
} else {
result.ipAddress_ = ipAddressBuilder_.build();
}
if (((from_bitField0_ & 0x01000000) == 0x01000000)) {
to_bitField0_ |= 0x00020000;
}
if (residencyBuilder_ == null) {
result.residency_ = residency_;
} else {
result.residency_ = residencyBuilder_.build();
}
if (portDefinitionsBuilder_ == null) {
if (((bitField0_ & 0x02000000) == 0x02000000)) {
portDefinitions_ = java.util.Collections.unmodifiableList(portDefinitions_);
bitField0_ = (bitField0_ & ~0x02000000);
}
result.portDefinitions_ = portDefinitions_;
} else {
result.portDefinitions_ = portDefinitionsBuilder_.build();
}
if (readinessCheckDefinitionBuilder_ == null) {
if (((bitField0_ & 0x04000000) == 0x04000000)) {
readinessCheckDefinition_ = java.util.Collections.unmodifiableList(readinessCheckDefinition_);
bitField0_ = (bitField0_ & ~0x04000000);
}
result.readinessCheckDefinition_ = readinessCheckDefinition_;
} else {
result.readinessCheckDefinition_ = readinessCheckDefinitionBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ServiceDefinition) {
return mergeFrom((mesosphere.marathon.Protos.ServiceDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ServiceDefinition other) {
if (other == mesosphere.marathon.Protos.ServiceDefinition.getDefaultInstance()) return this;
if (other.hasId()) {
bitField0_ |= 0x00000001;
id_ = other.id_;
onChanged();
}
if (other.hasCmd()) {
mergeCmd(other.getCmd());
}
if (other.hasInstances()) {
setInstances(other.getInstances());
}
if (resourcesBuilder_ == null) {
if (!other.resources_.isEmpty()) {
if (resources_.isEmpty()) {
resources_ = other.resources_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureResourcesIsMutable();
resources_.addAll(other.resources_);
}
onChanged();
}
} else {
if (!other.resources_.isEmpty()) {
if (resourcesBuilder_.isEmpty()) {
resourcesBuilder_.dispose();
resourcesBuilder_ = null;
resources_ = other.resources_;
bitField0_ = (bitField0_ & ~0x00000008);
resourcesBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getResourcesFieldBuilder() : null;
} else {
resourcesBuilder_.addAllMessages(other.resources_);
}
}
}
if (other.hasDescription()) {
bitField0_ |= 0x00000010;
description_ = other.description_;
onChanged();
}
if (!other.ports_.isEmpty()) {
if (ports_.isEmpty()) {
ports_ = other.ports_;
bitField0_ = (bitField0_ & ~0x00000020);
} else {
ensurePortsIsMutable();
ports_.addAll(other.ports_);
}
onChanged();
}
if (constraintsBuilder_ == null) {
if (!other.constraints_.isEmpty()) {
if (constraints_.isEmpty()) {
constraints_ = other.constraints_;
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureConstraintsIsMutable();
constraints_.addAll(other.constraints_);
}
onChanged();
}
} else {
if (!other.constraints_.isEmpty()) {
if (constraintsBuilder_.isEmpty()) {
constraintsBuilder_.dispose();
constraintsBuilder_ = null;
constraints_ = other.constraints_;
bitField0_ = (bitField0_ & ~0x00000040);
constraintsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getConstraintsFieldBuilder() : null;
} else {
constraintsBuilder_.addAllMessages(other.constraints_);
}
}
}
if (other.hasExecutor()) {
bitField0_ |= 0x00000080;
executor_ = other.executor_;
onChanged();
}
if (other.hasOBSOLETEContainer()) {
mergeOBSOLETEContainer(other.getOBSOLETEContainer());
}
if (other.hasVersion()) {
bitField0_ |= 0x00000200;
version_ = other.version_;
onChanged();
}
if (healthChecksBuilder_ == null) {
if (!other.healthChecks_.isEmpty()) {
if (healthChecks_.isEmpty()) {
healthChecks_ = other.healthChecks_;
bitField0_ = (bitField0_ & ~0x00000400);
} else {
ensureHealthChecksIsMutable();
healthChecks_.addAll(other.healthChecks_);
}
onChanged();
}
} else {
if (!other.healthChecks_.isEmpty()) {
if (healthChecksBuilder_.isEmpty()) {
healthChecksBuilder_.dispose();
healthChecksBuilder_ = null;
healthChecks_ = other.healthChecks_;
bitField0_ = (bitField0_ & ~0x00000400);
healthChecksBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getHealthChecksFieldBuilder() : null;
} else {
healthChecksBuilder_.addAllMessages(other.healthChecks_);
}
}
}
if (other.hasBackoff()) {
setBackoff(other.getBackoff());
}
if (other.hasBackoffFactor()) {
setBackoffFactor(other.getBackoffFactor());
}
if (other.hasUpgradeStrategy()) {
mergeUpgradeStrategy(other.getUpgradeStrategy());
}
if (!other.dependencies_.isEmpty()) {
if (dependencies_.isEmpty()) {
dependencies_ = other.dependencies_;
bitField0_ = (bitField0_ & ~0x00004000);
} else {
ensureDependenciesIsMutable();
dependencies_.addAll(other.dependencies_);
}
onChanged();
}
if (!other.storeUrls_.isEmpty()) {
if (storeUrls_.isEmpty()) {
storeUrls_ = other.storeUrls_;
bitField0_ = (bitField0_ & ~0x00008000);
} else {
ensureStoreUrlsIsMutable();
storeUrls_.addAll(other.storeUrls_);
}
onChanged();
}
if (other.hasRequirePorts()) {
setRequirePorts(other.getRequirePorts());
}
if (other.hasContainer()) {
mergeContainer(other.getContainer());
}
if (labelsBuilder_ == null) {
if (!other.labels_.isEmpty()) {
if (labels_.isEmpty()) {
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00040000);
} else {
ensureLabelsIsMutable();
labels_.addAll(other.labels_);
}
onChanged();
}
} else {
if (!other.labels_.isEmpty()) {
if (labelsBuilder_.isEmpty()) {
labelsBuilder_.dispose();
labelsBuilder_ = null;
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00040000);
labelsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getLabelsFieldBuilder() : null;
} else {
labelsBuilder_.addAllMessages(other.labels_);
}
}
}
if (other.hasMaxLaunchDelay()) {
setMaxLaunchDelay(other.getMaxLaunchDelay());
}
if (other.hasAcceptedResourceRoles()) {
mergeAcceptedResourceRoles(other.getAcceptedResourceRoles());
}
if (other.hasLastScalingAt()) {
setLastScalingAt(other.getLastScalingAt());
}
if (other.hasLastConfigChangeAt()) {
setLastConfigChangeAt(other.getLastConfigChangeAt());
}
if (other.hasIpAddress()) {
mergeIpAddress(other.getIpAddress());
}
if (other.hasResidency()) {
mergeResidency(other.getResidency());
}
if (portDefinitionsBuilder_ == null) {
if (!other.portDefinitions_.isEmpty()) {
if (portDefinitions_.isEmpty()) {
portDefinitions_ = other.portDefinitions_;
bitField0_ = (bitField0_ & ~0x02000000);
} else {
ensurePortDefinitionsIsMutable();
portDefinitions_.addAll(other.portDefinitions_);
}
onChanged();
}
} else {
if (!other.portDefinitions_.isEmpty()) {
if (portDefinitionsBuilder_.isEmpty()) {
portDefinitionsBuilder_.dispose();
portDefinitionsBuilder_ = null;
portDefinitions_ = other.portDefinitions_;
bitField0_ = (bitField0_ & ~0x02000000);
portDefinitionsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getPortDefinitionsFieldBuilder() : null;
} else {
portDefinitionsBuilder_.addAllMessages(other.portDefinitions_);
}
}
}
if (readinessCheckDefinitionBuilder_ == null) {
if (!other.readinessCheckDefinition_.isEmpty()) {
if (readinessCheckDefinition_.isEmpty()) {
readinessCheckDefinition_ = other.readinessCheckDefinition_;
bitField0_ = (bitField0_ & ~0x04000000);
} else {
ensureReadinessCheckDefinitionIsMutable();
readinessCheckDefinition_.addAll(other.readinessCheckDefinition_);
}
onChanged();
}
} else {
if (!other.readinessCheckDefinition_.isEmpty()) {
if (readinessCheckDefinitionBuilder_.isEmpty()) {
readinessCheckDefinitionBuilder_.dispose();
readinessCheckDefinitionBuilder_ = null;
readinessCheckDefinition_ = other.readinessCheckDefinition_;
bitField0_ = (bitField0_ & ~0x04000000);
readinessCheckDefinitionBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getReadinessCheckDefinitionFieldBuilder() : null;
} else {
readinessCheckDefinitionBuilder_.addAllMessages(other.readinessCheckDefinition_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasId()) {
return false;
}
if (!hasCmd()) {
return false;
}
if (!hasInstances()) {
return false;
}
if (!hasExecutor()) {
return false;
}
if (!getCmd().isInitialized()) {
return false;
}
for (int i = 0; i < getResourcesCount(); i++) {
if (!getResources(i).isInitialized()) {
return false;
}
}
for (int i = 0; i < getConstraintsCount(); i++) {
if (!getConstraints(i).isInitialized()) {
return false;
}
}
if (hasOBSOLETEContainer()) {
if (!getOBSOLETEContainer().isInitialized()) {
return false;
}
}
for (int i = 0; i < getHealthChecksCount(); i++) {
if (!getHealthChecks(i).isInitialized()) {
return false;
}
}
if (hasUpgradeStrategy()) {
if (!getUpgradeStrategy().isInitialized()) {
return false;
}
}
if (hasContainer()) {
if (!getContainer().isInitialized()) {
return false;
}
}
for (int i = 0; i < getLabelsCount(); i++) {
if (!getLabels(i).isInitialized()) {
return false;
}
}
if (hasIpAddress()) {
if (!getIpAddress().isInitialized()) {
return false;
}
}
for (int i = 0; i < getPortDefinitionsCount(); i++) {
if (!getPortDefinitions(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ServiceDefinition parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ServiceDefinition) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string id = 1;
private java.lang.Object id_ = "";
/**
* <code>required string id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string id = 1;</code>
*/
public Builder setId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
/**
* <code>required string id = 1;</code>
*/
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000001);
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
* <code>required string id = 1;</code>
*/
public Builder setIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
// required .mesos.CommandInfo cmd = 2;
private org.apache.mesos.Protos.CommandInfo cmd_ = org.apache.mesos.Protos.CommandInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.CommandInfo, org.apache.mesos.Protos.CommandInfo.Builder, org.apache.mesos.Protos.CommandInfoOrBuilder> cmdBuilder_;
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public boolean hasCmd() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public org.apache.mesos.Protos.CommandInfo getCmd() {
if (cmdBuilder_ == null) {
return cmd_;
} else {
return cmdBuilder_.getMessage();
}
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public Builder setCmd(org.apache.mesos.Protos.CommandInfo value) {
if (cmdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
cmd_ = value;
onChanged();
} else {
cmdBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public Builder setCmd(
org.apache.mesos.Protos.CommandInfo.Builder builderForValue) {
if (cmdBuilder_ == null) {
cmd_ = builderForValue.build();
onChanged();
} else {
cmdBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public Builder mergeCmd(org.apache.mesos.Protos.CommandInfo value) {
if (cmdBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002) &&
cmd_ != org.apache.mesos.Protos.CommandInfo.getDefaultInstance()) {
cmd_ =
org.apache.mesos.Protos.CommandInfo.newBuilder(cmd_).mergeFrom(value).buildPartial();
} else {
cmd_ = value;
}
onChanged();
} else {
cmdBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public Builder clearCmd() {
if (cmdBuilder_ == null) {
cmd_ = org.apache.mesos.Protos.CommandInfo.getDefaultInstance();
onChanged();
} else {
cmdBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public org.apache.mesos.Protos.CommandInfo.Builder getCmdBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getCmdFieldBuilder().getBuilder();
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
public org.apache.mesos.Protos.CommandInfoOrBuilder getCmdOrBuilder() {
if (cmdBuilder_ != null) {
return cmdBuilder_.getMessageOrBuilder();
} else {
return cmd_;
}
}
/**
* <code>required .mesos.CommandInfo cmd = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.CommandInfo, org.apache.mesos.Protos.CommandInfo.Builder, org.apache.mesos.Protos.CommandInfoOrBuilder>
getCmdFieldBuilder() {
if (cmdBuilder_ == null) {
cmdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.CommandInfo, org.apache.mesos.Protos.CommandInfo.Builder, org.apache.mesos.Protos.CommandInfoOrBuilder>(
cmd_,
getParentForChildren(),
isClean());
cmd_ = null;
}
return cmdBuilder_;
}
// required uint32 instances = 3;
private int instances_ ;
/**
* <code>required uint32 instances = 3;</code>
*/
public boolean hasInstances() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required uint32 instances = 3;</code>
*/
public int getInstances() {
return instances_;
}
/**
* <code>required uint32 instances = 3;</code>
*/
public Builder setInstances(int value) {
bitField0_ |= 0x00000004;
instances_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 instances = 3;</code>
*/
public Builder clearInstances() {
bitField0_ = (bitField0_ & ~0x00000004);
instances_ = 0;
onChanged();
return this;
}
// repeated .mesos.Resource resources = 4;
private java.util.List<org.apache.mesos.Protos.Resource> resources_ =
java.util.Collections.emptyList();
private void ensureResourcesIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
resources_ = new java.util.ArrayList<org.apache.mesos.Protos.Resource>(resources_);
bitField0_ |= 0x00000008;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Resource, org.apache.mesos.Protos.Resource.Builder, org.apache.mesos.Protos.ResourceOrBuilder> resourcesBuilder_;
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Resource> getResourcesList() {
if (resourcesBuilder_ == null) {
return java.util.Collections.unmodifiableList(resources_);
} else {
return resourcesBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public int getResourcesCount() {
if (resourcesBuilder_ == null) {
return resources_.size();
} else {
return resourcesBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public org.apache.mesos.Protos.Resource getResources(int index) {
if (resourcesBuilder_ == null) {
return resources_.get(index);
} else {
return resourcesBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder setResources(
int index, org.apache.mesos.Protos.Resource value) {
if (resourcesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureResourcesIsMutable();
resources_.set(index, value);
onChanged();
} else {
resourcesBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder setResources(
int index, org.apache.mesos.Protos.Resource.Builder builderForValue) {
if (resourcesBuilder_ == null) {
ensureResourcesIsMutable();
resources_.set(index, builderForValue.build());
onChanged();
} else {
resourcesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder addResources(org.apache.mesos.Protos.Resource value) {
if (resourcesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureResourcesIsMutable();
resources_.add(value);
onChanged();
} else {
resourcesBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder addResources(
int index, org.apache.mesos.Protos.Resource value) {
if (resourcesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureResourcesIsMutable();
resources_.add(index, value);
onChanged();
} else {
resourcesBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder addResources(
org.apache.mesos.Protos.Resource.Builder builderForValue) {
if (resourcesBuilder_ == null) {
ensureResourcesIsMutable();
resources_.add(builderForValue.build());
onChanged();
} else {
resourcesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder addResources(
int index, org.apache.mesos.Protos.Resource.Builder builderForValue) {
if (resourcesBuilder_ == null) {
ensureResourcesIsMutable();
resources_.add(index, builderForValue.build());
onChanged();
} else {
resourcesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder addAllResources(
java.lang.Iterable<? extends org.apache.mesos.Protos.Resource> values) {
if (resourcesBuilder_ == null) {
ensureResourcesIsMutable();
super.addAll(values, resources_);
onChanged();
} else {
resourcesBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder clearResources() {
if (resourcesBuilder_ == null) {
resources_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
} else {
resourcesBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public Builder removeResources(int index) {
if (resourcesBuilder_ == null) {
ensureResourcesIsMutable();
resources_.remove(index);
onChanged();
} else {
resourcesBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public org.apache.mesos.Protos.Resource.Builder getResourcesBuilder(
int index) {
return getResourcesFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public org.apache.mesos.Protos.ResourceOrBuilder getResourcesOrBuilder(
int index) {
if (resourcesBuilder_ == null) {
return resources_.get(index); } else {
return resourcesBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.ResourceOrBuilder>
getResourcesOrBuilderList() {
if (resourcesBuilder_ != null) {
return resourcesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(resources_);
}
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public org.apache.mesos.Protos.Resource.Builder addResourcesBuilder() {
return getResourcesFieldBuilder().addBuilder(
org.apache.mesos.Protos.Resource.getDefaultInstance());
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public org.apache.mesos.Protos.Resource.Builder addResourcesBuilder(
int index) {
return getResourcesFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Resource.getDefaultInstance());
}
/**
* <code>repeated .mesos.Resource resources = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Resource.Builder>
getResourcesBuilderList() {
return getResourcesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Resource, org.apache.mesos.Protos.Resource.Builder, org.apache.mesos.Protos.ResourceOrBuilder>
getResourcesFieldBuilder() {
if (resourcesBuilder_ == null) {
resourcesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Resource, org.apache.mesos.Protos.Resource.Builder, org.apache.mesos.Protos.ResourceOrBuilder>(
resources_,
((bitField0_ & 0x00000008) == 0x00000008),
getParentForChildren(),
isClean());
resources_ = null;
}
return resourcesBuilder_;
}
// optional string description = 5;
private java.lang.Object description_ = "";
/**
* <code>optional string description = 5;</code>
*/
public boolean hasDescription() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional string description = 5;</code>
*/
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
description_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string description = 5;</code>
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string description = 5;</code>
*/
public Builder setDescription(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
description_ = value;
onChanged();
return this;
}
/**
* <code>optional string description = 5;</code>
*/
public Builder clearDescription() {
bitField0_ = (bitField0_ & ~0x00000010);
description_ = getDefaultInstance().getDescription();
onChanged();
return this;
}
/**
* <code>optional string description = 5;</code>
*/
public Builder setDescriptionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
description_ = value;
onChanged();
return this;
}
// repeated uint32 ports = 6;
private java.util.List<java.lang.Integer> ports_ = java.util.Collections.emptyList();
private void ensurePortsIsMutable() {
if (!((bitField0_ & 0x00000020) == 0x00000020)) {
ports_ = new java.util.ArrayList<java.lang.Integer>(ports_);
bitField0_ |= 0x00000020;
}
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public java.util.List<java.lang.Integer>
getPortsList() {
return java.util.Collections.unmodifiableList(ports_);
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public int getPortsCount() {
return ports_.size();
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public int getPorts(int index) {
return ports_.get(index);
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public Builder setPorts(
int index, int value) {
ensurePortsIsMutable();
ports_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public Builder addPorts(int value) {
ensurePortsIsMutable();
ports_.add(value);
onChanged();
return this;
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public Builder addAllPorts(
java.lang.Iterable<? extends java.lang.Integer> values) {
ensurePortsIsMutable();
super.addAll(values, ports_);
onChanged();
return this;
}
/**
* <code>repeated uint32 ports = 6;</code>
*/
public Builder clearPorts() {
ports_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000020);
onChanged();
return this;
}
// repeated .mesosphere.marathon.Constraint constraints = 7;
private java.util.List<mesosphere.marathon.Protos.Constraint> constraints_ =
java.util.Collections.emptyList();
private void ensureConstraintsIsMutable() {
if (!((bitField0_ & 0x00000040) == 0x00000040)) {
constraints_ = new java.util.ArrayList<mesosphere.marathon.Protos.Constraint>(constraints_);
bitField0_ |= 0x00000040;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.Constraint, mesosphere.marathon.Protos.Constraint.Builder, mesosphere.marathon.Protos.ConstraintOrBuilder> constraintsBuilder_;
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public java.util.List<mesosphere.marathon.Protos.Constraint> getConstraintsList() {
if (constraintsBuilder_ == null) {
return java.util.Collections.unmodifiableList(constraints_);
} else {
return constraintsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public int getConstraintsCount() {
if (constraintsBuilder_ == null) {
return constraints_.size();
} else {
return constraintsBuilder_.getCount();
}
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public mesosphere.marathon.Protos.Constraint getConstraints(int index) {
if (constraintsBuilder_ == null) {
return constraints_.get(index);
} else {
return constraintsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder setConstraints(
int index, mesosphere.marathon.Protos.Constraint value) {
if (constraintsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConstraintsIsMutable();
constraints_.set(index, value);
onChanged();
} else {
constraintsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder setConstraints(
int index, mesosphere.marathon.Protos.Constraint.Builder builderForValue) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
constraints_.set(index, builderForValue.build());
onChanged();
} else {
constraintsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder addConstraints(mesosphere.marathon.Protos.Constraint value) {
if (constraintsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConstraintsIsMutable();
constraints_.add(value);
onChanged();
} else {
constraintsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder addConstraints(
int index, mesosphere.marathon.Protos.Constraint value) {
if (constraintsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConstraintsIsMutable();
constraints_.add(index, value);
onChanged();
} else {
constraintsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder addConstraints(
mesosphere.marathon.Protos.Constraint.Builder builderForValue) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
constraints_.add(builderForValue.build());
onChanged();
} else {
constraintsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder addConstraints(
int index, mesosphere.marathon.Protos.Constraint.Builder builderForValue) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
constraints_.add(index, builderForValue.build());
onChanged();
} else {
constraintsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder addAllConstraints(
java.lang.Iterable<? extends mesosphere.marathon.Protos.Constraint> values) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
super.addAll(values, constraints_);
onChanged();
} else {
constraintsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder clearConstraints() {
if (constraintsBuilder_ == null) {
constraints_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
} else {
constraintsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public Builder removeConstraints(int index) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
constraints_.remove(index);
onChanged();
} else {
constraintsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public mesosphere.marathon.Protos.Constraint.Builder getConstraintsBuilder(
int index) {
return getConstraintsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public mesosphere.marathon.Protos.ConstraintOrBuilder getConstraintsOrBuilder(
int index) {
if (constraintsBuilder_ == null) {
return constraints_.get(index); } else {
return constraintsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.ConstraintOrBuilder>
getConstraintsOrBuilderList() {
if (constraintsBuilder_ != null) {
return constraintsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(constraints_);
}
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public mesosphere.marathon.Protos.Constraint.Builder addConstraintsBuilder() {
return getConstraintsFieldBuilder().addBuilder(
mesosphere.marathon.Protos.Constraint.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public mesosphere.marathon.Protos.Constraint.Builder addConstraintsBuilder(
int index) {
return getConstraintsFieldBuilder().addBuilder(
index, mesosphere.marathon.Protos.Constraint.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.Constraint constraints = 7;</code>
*/
public java.util.List<mesosphere.marathon.Protos.Constraint.Builder>
getConstraintsBuilderList() {
return getConstraintsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.Constraint, mesosphere.marathon.Protos.Constraint.Builder, mesosphere.marathon.Protos.ConstraintOrBuilder>
getConstraintsFieldBuilder() {
if (constraintsBuilder_ == null) {
constraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.Constraint, mesosphere.marathon.Protos.Constraint.Builder, mesosphere.marathon.Protos.ConstraintOrBuilder>(
constraints_,
((bitField0_ & 0x00000040) == 0x00000040),
getParentForChildren(),
isClean());
constraints_ = null;
}
return constraintsBuilder_;
}
// required string executor = 8 [default = ""];
private java.lang.Object executor_ = "";
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public boolean hasExecutor() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public java.lang.String getExecutor() {
java.lang.Object ref = executor_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
executor_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public com.google.protobuf.ByteString
getExecutorBytes() {
java.lang.Object ref = executor_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
executor_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public Builder setExecutor(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
executor_ = value;
onChanged();
return this;
}
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public Builder clearExecutor() {
bitField0_ = (bitField0_ & ~0x00000080);
executor_ = getDefaultInstance().getExecutor();
onChanged();
return this;
}
/**
* <code>required string executor = 8 [default = ""];</code>
*/
public Builder setExecutorBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
executor_ = value;
onChanged();
return this;
}
// optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;
private mesosphere.marathon.Protos.ContainerInfo oBSOLETEContainer_ = mesosphere.marathon.Protos.ContainerInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ContainerInfo, mesosphere.marathon.Protos.ContainerInfo.Builder, mesosphere.marathon.Protos.ContainerInfoOrBuilder> oBSOLETEContainerBuilder_;
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public boolean hasOBSOLETEContainer() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public mesosphere.marathon.Protos.ContainerInfo getOBSOLETEContainer() {
if (oBSOLETEContainerBuilder_ == null) {
return oBSOLETEContainer_;
} else {
return oBSOLETEContainerBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public Builder setOBSOLETEContainer(mesosphere.marathon.Protos.ContainerInfo value) {
if (oBSOLETEContainerBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
oBSOLETEContainer_ = value;
onChanged();
} else {
oBSOLETEContainerBuilder_.setMessage(value);
}
bitField0_ |= 0x00000100;
return this;
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public Builder setOBSOLETEContainer(
mesosphere.marathon.Protos.ContainerInfo.Builder builderForValue) {
if (oBSOLETEContainerBuilder_ == null) {
oBSOLETEContainer_ = builderForValue.build();
onChanged();
} else {
oBSOLETEContainerBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000100;
return this;
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public Builder mergeOBSOLETEContainer(mesosphere.marathon.Protos.ContainerInfo value) {
if (oBSOLETEContainerBuilder_ == null) {
if (((bitField0_ & 0x00000100) == 0x00000100) &&
oBSOLETEContainer_ != mesosphere.marathon.Protos.ContainerInfo.getDefaultInstance()) {
oBSOLETEContainer_ =
mesosphere.marathon.Protos.ContainerInfo.newBuilder(oBSOLETEContainer_).mergeFrom(value).buildPartial();
} else {
oBSOLETEContainer_ = value;
}
onChanged();
} else {
oBSOLETEContainerBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000100;
return this;
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public Builder clearOBSOLETEContainer() {
if (oBSOLETEContainerBuilder_ == null) {
oBSOLETEContainer_ = mesosphere.marathon.Protos.ContainerInfo.getDefaultInstance();
onChanged();
} else {
oBSOLETEContainerBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000100);
return this;
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public mesosphere.marathon.Protos.ContainerInfo.Builder getOBSOLETEContainerBuilder() {
bitField0_ |= 0x00000100;
onChanged();
return getOBSOLETEContainerFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
public mesosphere.marathon.Protos.ContainerInfoOrBuilder getOBSOLETEContainerOrBuilder() {
if (oBSOLETEContainerBuilder_ != null) {
return oBSOLETEContainerBuilder_.getMessageOrBuilder();
} else {
return oBSOLETEContainer_;
}
}
/**
* <code>optional .mesosphere.marathon.ContainerInfo OBSOLETE_container = 10;</code>
*
* <pre>
* optional double taskRateLimit = 9 [default = 1];
* </pre>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ContainerInfo, mesosphere.marathon.Protos.ContainerInfo.Builder, mesosphere.marathon.Protos.ContainerInfoOrBuilder>
getOBSOLETEContainerFieldBuilder() {
if (oBSOLETEContainerBuilder_ == null) {
oBSOLETEContainerBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ContainerInfo, mesosphere.marathon.Protos.ContainerInfo.Builder, mesosphere.marathon.Protos.ContainerInfoOrBuilder>(
oBSOLETEContainer_,
getParentForChildren(),
isClean());
oBSOLETEContainer_ = null;
}
return oBSOLETEContainerBuilder_;
}
// optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];
private java.lang.Object version_ = "1970-01-01T00:00:00.000Z";
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
version_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public Builder setVersion(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000200;
version_ = value;
onChanged();
return this;
}
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public Builder clearVersion() {
bitField0_ = (bitField0_ & ~0x00000200);
version_ = getDefaultInstance().getVersion();
onChanged();
return this;
}
/**
* <code>optional string version = 11 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
*a version is required since version 0.5
* </pre>
*/
public Builder setVersionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000200;
version_ = value;
onChanged();
return this;
}
// repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;
private java.util.List<mesosphere.marathon.Protos.HealthCheckDefinition> healthChecks_ =
java.util.Collections.emptyList();
private void ensureHealthChecksIsMutable() {
if (!((bitField0_ & 0x00000400) == 0x00000400)) {
healthChecks_ = new java.util.ArrayList<mesosphere.marathon.Protos.HealthCheckDefinition>(healthChecks_);
bitField0_ |= 0x00000400;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.HealthCheckDefinition, mesosphere.marathon.Protos.HealthCheckDefinition.Builder, mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder> healthChecksBuilder_;
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public java.util.List<mesosphere.marathon.Protos.HealthCheckDefinition> getHealthChecksList() {
if (healthChecksBuilder_ == null) {
return java.util.Collections.unmodifiableList(healthChecks_);
} else {
return healthChecksBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public int getHealthChecksCount() {
if (healthChecksBuilder_ == null) {
return healthChecks_.size();
} else {
return healthChecksBuilder_.getCount();
}
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinition getHealthChecks(int index) {
if (healthChecksBuilder_ == null) {
return healthChecks_.get(index);
} else {
return healthChecksBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder setHealthChecks(
int index, mesosphere.marathon.Protos.HealthCheckDefinition value) {
if (healthChecksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHealthChecksIsMutable();
healthChecks_.set(index, value);
onChanged();
} else {
healthChecksBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder setHealthChecks(
int index, mesosphere.marathon.Protos.HealthCheckDefinition.Builder builderForValue) {
if (healthChecksBuilder_ == null) {
ensureHealthChecksIsMutable();
healthChecks_.set(index, builderForValue.build());
onChanged();
} else {
healthChecksBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder addHealthChecks(mesosphere.marathon.Protos.HealthCheckDefinition value) {
if (healthChecksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHealthChecksIsMutable();
healthChecks_.add(value);
onChanged();
} else {
healthChecksBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder addHealthChecks(
int index, mesosphere.marathon.Protos.HealthCheckDefinition value) {
if (healthChecksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHealthChecksIsMutable();
healthChecks_.add(index, value);
onChanged();
} else {
healthChecksBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder addHealthChecks(
mesosphere.marathon.Protos.HealthCheckDefinition.Builder builderForValue) {
if (healthChecksBuilder_ == null) {
ensureHealthChecksIsMutable();
healthChecks_.add(builderForValue.build());
onChanged();
} else {
healthChecksBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder addHealthChecks(
int index, mesosphere.marathon.Protos.HealthCheckDefinition.Builder builderForValue) {
if (healthChecksBuilder_ == null) {
ensureHealthChecksIsMutable();
healthChecks_.add(index, builderForValue.build());
onChanged();
} else {
healthChecksBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder addAllHealthChecks(
java.lang.Iterable<? extends mesosphere.marathon.Protos.HealthCheckDefinition> values) {
if (healthChecksBuilder_ == null) {
ensureHealthChecksIsMutable();
super.addAll(values, healthChecks_);
onChanged();
} else {
healthChecksBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder clearHealthChecks() {
if (healthChecksBuilder_ == null) {
healthChecks_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000400);
onChanged();
} else {
healthChecksBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public Builder removeHealthChecks(int index) {
if (healthChecksBuilder_ == null) {
ensureHealthChecksIsMutable();
healthChecks_.remove(index);
onChanged();
} else {
healthChecksBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinition.Builder getHealthChecksBuilder(
int index) {
return getHealthChecksFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder getHealthChecksOrBuilder(
int index) {
if (healthChecksBuilder_ == null) {
return healthChecks_.get(index); } else {
return healthChecksBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder>
getHealthChecksOrBuilderList() {
if (healthChecksBuilder_ != null) {
return healthChecksBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(healthChecks_);
}
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinition.Builder addHealthChecksBuilder() {
return getHealthChecksFieldBuilder().addBuilder(
mesosphere.marathon.Protos.HealthCheckDefinition.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public mesosphere.marathon.Protos.HealthCheckDefinition.Builder addHealthChecksBuilder(
int index) {
return getHealthChecksFieldBuilder().addBuilder(
index, mesosphere.marathon.Protos.HealthCheckDefinition.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.HealthCheckDefinition healthChecks = 12;</code>
*/
public java.util.List<mesosphere.marathon.Protos.HealthCheckDefinition.Builder>
getHealthChecksBuilderList() {
return getHealthChecksFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.HealthCheckDefinition, mesosphere.marathon.Protos.HealthCheckDefinition.Builder, mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder>
getHealthChecksFieldBuilder() {
if (healthChecksBuilder_ == null) {
healthChecksBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.HealthCheckDefinition, mesosphere.marathon.Protos.HealthCheckDefinition.Builder, mesosphere.marathon.Protos.HealthCheckDefinitionOrBuilder>(
healthChecks_,
((bitField0_ & 0x00000400) == 0x00000400),
getParentForChildren(),
isClean());
healthChecks_ = null;
}
return healthChecksBuilder_;
}
// optional int64 backoff = 13 [default = 1000];
private long backoff_ = 1000L;
/**
* <code>optional int64 backoff = 13 [default = 1000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public boolean hasBackoff() {
return ((bitField0_ & 0x00000800) == 0x00000800);
}
/**
* <code>optional int64 backoff = 13 [default = 1000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public long getBackoff() {
return backoff_;
}
/**
* <code>optional int64 backoff = 13 [default = 1000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public Builder setBackoff(long value) {
bitField0_ |= 0x00000800;
backoff_ = value;
onChanged();
return this;
}
/**
* <code>optional int64 backoff = 13 [default = 1000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public Builder clearBackoff() {
bitField0_ = (bitField0_ & ~0x00000800);
backoff_ = 1000L;
onChanged();
return this;
}
// optional double backoffFactor = 14 [default = 1.15];
private double backoffFactor_ = 1.15D;
/**
* <code>optional double backoffFactor = 14 [default = 1.15];</code>
*/
public boolean hasBackoffFactor() {
return ((bitField0_ & 0x00001000) == 0x00001000);
}
/**
* <code>optional double backoffFactor = 14 [default = 1.15];</code>
*/
public double getBackoffFactor() {
return backoffFactor_;
}
/**
* <code>optional double backoffFactor = 14 [default = 1.15];</code>
*/
public Builder setBackoffFactor(double value) {
bitField0_ |= 0x00001000;
backoffFactor_ = value;
onChanged();
return this;
}
/**
* <code>optional double backoffFactor = 14 [default = 1.15];</code>
*/
public Builder clearBackoffFactor() {
bitField0_ = (bitField0_ & ~0x00001000);
backoffFactor_ = 1.15D;
onChanged();
return this;
}
// optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;
private mesosphere.marathon.Protos.UpgradeStrategyDefinition upgradeStrategy_ = mesosphere.marathon.Protos.UpgradeStrategyDefinition.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.UpgradeStrategyDefinition, mesosphere.marathon.Protos.UpgradeStrategyDefinition.Builder, mesosphere.marathon.Protos.UpgradeStrategyDefinitionOrBuilder> upgradeStrategyBuilder_;
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public boolean hasUpgradeStrategy() {
return ((bitField0_ & 0x00002000) == 0x00002000);
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public mesosphere.marathon.Protos.UpgradeStrategyDefinition getUpgradeStrategy() {
if (upgradeStrategyBuilder_ == null) {
return upgradeStrategy_;
} else {
return upgradeStrategyBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public Builder setUpgradeStrategy(mesosphere.marathon.Protos.UpgradeStrategyDefinition value) {
if (upgradeStrategyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
upgradeStrategy_ = value;
onChanged();
} else {
upgradeStrategyBuilder_.setMessage(value);
}
bitField0_ |= 0x00002000;
return this;
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public Builder setUpgradeStrategy(
mesosphere.marathon.Protos.UpgradeStrategyDefinition.Builder builderForValue) {
if (upgradeStrategyBuilder_ == null) {
upgradeStrategy_ = builderForValue.build();
onChanged();
} else {
upgradeStrategyBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00002000;
return this;
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public Builder mergeUpgradeStrategy(mesosphere.marathon.Protos.UpgradeStrategyDefinition value) {
if (upgradeStrategyBuilder_ == null) {
if (((bitField0_ & 0x00002000) == 0x00002000) &&
upgradeStrategy_ != mesosphere.marathon.Protos.UpgradeStrategyDefinition.getDefaultInstance()) {
upgradeStrategy_ =
mesosphere.marathon.Protos.UpgradeStrategyDefinition.newBuilder(upgradeStrategy_).mergeFrom(value).buildPartial();
} else {
upgradeStrategy_ = value;
}
onChanged();
} else {
upgradeStrategyBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00002000;
return this;
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public Builder clearUpgradeStrategy() {
if (upgradeStrategyBuilder_ == null) {
upgradeStrategy_ = mesosphere.marathon.Protos.UpgradeStrategyDefinition.getDefaultInstance();
onChanged();
} else {
upgradeStrategyBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00002000);
return this;
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public mesosphere.marathon.Protos.UpgradeStrategyDefinition.Builder getUpgradeStrategyBuilder() {
bitField0_ |= 0x00002000;
onChanged();
return getUpgradeStrategyFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
public mesosphere.marathon.Protos.UpgradeStrategyDefinitionOrBuilder getUpgradeStrategyOrBuilder() {
if (upgradeStrategyBuilder_ != null) {
return upgradeStrategyBuilder_.getMessageOrBuilder();
} else {
return upgradeStrategy_;
}
}
/**
* <code>optional .mesosphere.marathon.UpgradeStrategyDefinition upgradeStrategy = 15;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.UpgradeStrategyDefinition, mesosphere.marathon.Protos.UpgradeStrategyDefinition.Builder, mesosphere.marathon.Protos.UpgradeStrategyDefinitionOrBuilder>
getUpgradeStrategyFieldBuilder() {
if (upgradeStrategyBuilder_ == null) {
upgradeStrategyBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.UpgradeStrategyDefinition, mesosphere.marathon.Protos.UpgradeStrategyDefinition.Builder, mesosphere.marathon.Protos.UpgradeStrategyDefinitionOrBuilder>(
upgradeStrategy_,
getParentForChildren(),
isClean());
upgradeStrategy_ = null;
}
return upgradeStrategyBuilder_;
}
// repeated string dependencies = 16;
private com.google.protobuf.LazyStringList dependencies_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureDependenciesIsMutable() {
if (!((bitField0_ & 0x00004000) == 0x00004000)) {
dependencies_ = new com.google.protobuf.LazyStringArrayList(dependencies_);
bitField0_ |= 0x00004000;
}
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public java.util.List<java.lang.String>
getDependenciesList() {
return java.util.Collections.unmodifiableList(dependencies_);
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public int getDependenciesCount() {
return dependencies_.size();
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public java.lang.String getDependencies(int index) {
return dependencies_.get(index);
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public com.google.protobuf.ByteString
getDependenciesBytes(int index) {
return dependencies_.getByteString(index);
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public Builder setDependencies(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureDependenciesIsMutable();
dependencies_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public Builder addDependencies(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureDependenciesIsMutable();
dependencies_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public Builder addAllDependencies(
java.lang.Iterable<java.lang.String> values) {
ensureDependenciesIsMutable();
super.addAll(values, dependencies_);
onChanged();
return this;
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public Builder clearDependencies() {
dependencies_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00004000);
onChanged();
return this;
}
/**
* <code>repeated string dependencies = 16;</code>
*/
public Builder addDependenciesBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureDependenciesIsMutable();
dependencies_.add(value);
onChanged();
return this;
}
// repeated string storeUrls = 17;
private com.google.protobuf.LazyStringList storeUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureStoreUrlsIsMutable() {
if (!((bitField0_ & 0x00008000) == 0x00008000)) {
storeUrls_ = new com.google.protobuf.LazyStringArrayList(storeUrls_);
bitField0_ |= 0x00008000;
}
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public java.util.List<java.lang.String>
getStoreUrlsList() {
return java.util.Collections.unmodifiableList(storeUrls_);
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public int getStoreUrlsCount() {
return storeUrls_.size();
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public java.lang.String getStoreUrls(int index) {
return storeUrls_.get(index);
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public com.google.protobuf.ByteString
getStoreUrlsBytes(int index) {
return storeUrls_.getByteString(index);
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public Builder setStoreUrls(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureStoreUrlsIsMutable();
storeUrls_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public Builder addStoreUrls(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureStoreUrlsIsMutable();
storeUrls_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public Builder addAllStoreUrls(
java.lang.Iterable<java.lang.String> values) {
ensureStoreUrlsIsMutable();
super.addAll(values, storeUrls_);
onChanged();
return this;
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public Builder clearStoreUrls() {
storeUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00008000);
onChanged();
return this;
}
/**
* <code>repeated string storeUrls = 17;</code>
*/
public Builder addStoreUrlsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureStoreUrlsIsMutable();
storeUrls_.add(value);
onChanged();
return this;
}
// optional bool require_ports = 18 [default = false];
private boolean requirePorts_ ;
/**
* <code>optional bool require_ports = 18 [default = false];</code>
*/
public boolean hasRequirePorts() {
return ((bitField0_ & 0x00010000) == 0x00010000);
}
/**
* <code>optional bool require_ports = 18 [default = false];</code>
*/
public boolean getRequirePorts() {
return requirePorts_;
}
/**
* <code>optional bool require_ports = 18 [default = false];</code>
*/
public Builder setRequirePorts(boolean value) {
bitField0_ |= 0x00010000;
requirePorts_ = value;
onChanged();
return this;
}
/**
* <code>optional bool require_ports = 18 [default = false];</code>
*/
public Builder clearRequirePorts() {
bitField0_ = (bitField0_ & ~0x00010000);
requirePorts_ = false;
onChanged();
return this;
}
// optional .mesosphere.marathon.ExtendedContainerInfo container = 19;
private mesosphere.marathon.Protos.ExtendedContainerInfo container_ = mesosphere.marathon.Protos.ExtendedContainerInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo, mesosphere.marathon.Protos.ExtendedContainerInfo.Builder, mesosphere.marathon.Protos.ExtendedContainerInfoOrBuilder> containerBuilder_;
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public boolean hasContainer() {
return ((bitField0_ & 0x00020000) == 0x00020000);
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo getContainer() {
if (containerBuilder_ == null) {
return container_;
} else {
return containerBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public Builder setContainer(mesosphere.marathon.Protos.ExtendedContainerInfo value) {
if (containerBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
container_ = value;
onChanged();
} else {
containerBuilder_.setMessage(value);
}
bitField0_ |= 0x00020000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public Builder setContainer(
mesosphere.marathon.Protos.ExtendedContainerInfo.Builder builderForValue) {
if (containerBuilder_ == null) {
container_ = builderForValue.build();
onChanged();
} else {
containerBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00020000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public Builder mergeContainer(mesosphere.marathon.Protos.ExtendedContainerInfo value) {
if (containerBuilder_ == null) {
if (((bitField0_ & 0x00020000) == 0x00020000) &&
container_ != mesosphere.marathon.Protos.ExtendedContainerInfo.getDefaultInstance()) {
container_ =
mesosphere.marathon.Protos.ExtendedContainerInfo.newBuilder(container_).mergeFrom(value).buildPartial();
} else {
container_ = value;
}
onChanged();
} else {
containerBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00020000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public Builder clearContainer() {
if (containerBuilder_ == null) {
container_ = mesosphere.marathon.Protos.ExtendedContainerInfo.getDefaultInstance();
onChanged();
} else {
containerBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00020000);
return this;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.Builder getContainerBuilder() {
bitField0_ |= 0x00020000;
onChanged();
return getContainerFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfoOrBuilder getContainerOrBuilder() {
if (containerBuilder_ != null) {
return containerBuilder_.getMessageOrBuilder();
} else {
return container_;
}
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo container = 19;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo, mesosphere.marathon.Protos.ExtendedContainerInfo.Builder, mesosphere.marathon.Protos.ExtendedContainerInfoOrBuilder>
getContainerFieldBuilder() {
if (containerBuilder_ == null) {
containerBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo, mesosphere.marathon.Protos.ExtendedContainerInfo.Builder, mesosphere.marathon.Protos.ExtendedContainerInfoOrBuilder>(
container_,
getParentForChildren(),
isClean());
container_ = null;
}
return containerBuilder_;
}
// repeated .mesos.Parameter labels = 20;
private java.util.List<org.apache.mesos.Protos.Parameter> labels_ =
java.util.Collections.emptyList();
private void ensureLabelsIsMutable() {
if (!((bitField0_ & 0x00040000) == 0x00040000)) {
labels_ = new java.util.ArrayList<org.apache.mesos.Protos.Parameter>(labels_);
bitField0_ |= 0x00040000;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Parameter, org.apache.mesos.Protos.Parameter.Builder, org.apache.mesos.Protos.ParameterOrBuilder> labelsBuilder_;
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public java.util.List<org.apache.mesos.Protos.Parameter> getLabelsList() {
if (labelsBuilder_ == null) {
return java.util.Collections.unmodifiableList(labels_);
} else {
return labelsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public int getLabelsCount() {
if (labelsBuilder_ == null) {
return labels_.size();
} else {
return labelsBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public org.apache.mesos.Protos.Parameter getLabels(int index) {
if (labelsBuilder_ == null) {
return labels_.get(index);
} else {
return labelsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder setLabels(
int index, org.apache.mesos.Protos.Parameter value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.set(index, value);
onChanged();
} else {
labelsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder setLabels(
int index, org.apache.mesos.Protos.Parameter.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.set(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder addLabels(org.apache.mesos.Protos.Parameter value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(value);
onChanged();
} else {
labelsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder addLabels(
int index, org.apache.mesos.Protos.Parameter value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(index, value);
onChanged();
} else {
labelsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder addLabels(
org.apache.mesos.Protos.Parameter.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder addLabels(
int index, org.apache.mesos.Protos.Parameter.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder addAllLabels(
java.lang.Iterable<? extends org.apache.mesos.Protos.Parameter> values) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
super.addAll(values, labels_);
onChanged();
} else {
labelsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder clearLabels() {
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00040000);
onChanged();
} else {
labelsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public Builder removeLabels(int index) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.remove(index);
onChanged();
} else {
labelsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public org.apache.mesos.Protos.Parameter.Builder getLabelsBuilder(
int index) {
return getLabelsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public org.apache.mesos.Protos.ParameterOrBuilder getLabelsOrBuilder(
int index) {
if (labelsBuilder_ == null) {
return labels_.get(index); } else {
return labelsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.ParameterOrBuilder>
getLabelsOrBuilderList() {
if (labelsBuilder_ != null) {
return labelsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(labels_);
}
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public org.apache.mesos.Protos.Parameter.Builder addLabelsBuilder() {
return getLabelsFieldBuilder().addBuilder(
org.apache.mesos.Protos.Parameter.getDefaultInstance());
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public org.apache.mesos.Protos.Parameter.Builder addLabelsBuilder(
int index) {
return getLabelsFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Parameter.getDefaultInstance());
}
/**
* <code>repeated .mesos.Parameter labels = 20;</code>
*/
public java.util.List<org.apache.mesos.Protos.Parameter.Builder>
getLabelsBuilderList() {
return getLabelsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Parameter, org.apache.mesos.Protos.Parameter.Builder, org.apache.mesos.Protos.ParameterOrBuilder>
getLabelsFieldBuilder() {
if (labelsBuilder_ == null) {
labelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Parameter, org.apache.mesos.Protos.Parameter.Builder, org.apache.mesos.Protos.ParameterOrBuilder>(
labels_,
((bitField0_ & 0x00040000) == 0x00040000),
getParentForChildren(),
isClean());
labels_ = null;
}
return labelsBuilder_;
}
// optional int64 maxLaunchDelay = 21 [default = 3600000];
private long maxLaunchDelay_ = 3600000L;
/**
* <code>optional int64 maxLaunchDelay = 21 [default = 3600000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public boolean hasMaxLaunchDelay() {
return ((bitField0_ & 0x00080000) == 0x00080000);
}
/**
* <code>optional int64 maxLaunchDelay = 21 [default = 3600000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public long getMaxLaunchDelay() {
return maxLaunchDelay_;
}
/**
* <code>optional int64 maxLaunchDelay = 21 [default = 3600000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public Builder setMaxLaunchDelay(long value) {
bitField0_ |= 0x00080000;
maxLaunchDelay_ = value;
onChanged();
return this;
}
/**
* <code>optional int64 maxLaunchDelay = 21 [default = 3600000];</code>
*
* <pre>
* stored as Millis
* </pre>
*/
public Builder clearMaxLaunchDelay() {
bitField0_ = (bitField0_ & ~0x00080000);
maxLaunchDelay_ = 3600000L;
onChanged();
return this;
}
// optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;
private mesosphere.marathon.Protos.ResourceRoles acceptedResourceRoles_ = mesosphere.marathon.Protos.ResourceRoles.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ResourceRoles, mesosphere.marathon.Protos.ResourceRoles.Builder, mesosphere.marathon.Protos.ResourceRolesOrBuilder> acceptedResourceRolesBuilder_;
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public boolean hasAcceptedResourceRoles() {
return ((bitField0_ & 0x00100000) == 0x00100000);
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public mesosphere.marathon.Protos.ResourceRoles getAcceptedResourceRoles() {
if (acceptedResourceRolesBuilder_ == null) {
return acceptedResourceRoles_;
} else {
return acceptedResourceRolesBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public Builder setAcceptedResourceRoles(mesosphere.marathon.Protos.ResourceRoles value) {
if (acceptedResourceRolesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
acceptedResourceRoles_ = value;
onChanged();
} else {
acceptedResourceRolesBuilder_.setMessage(value);
}
bitField0_ |= 0x00100000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public Builder setAcceptedResourceRoles(
mesosphere.marathon.Protos.ResourceRoles.Builder builderForValue) {
if (acceptedResourceRolesBuilder_ == null) {
acceptedResourceRoles_ = builderForValue.build();
onChanged();
} else {
acceptedResourceRolesBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00100000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public Builder mergeAcceptedResourceRoles(mesosphere.marathon.Protos.ResourceRoles value) {
if (acceptedResourceRolesBuilder_ == null) {
if (((bitField0_ & 0x00100000) == 0x00100000) &&
acceptedResourceRoles_ != mesosphere.marathon.Protos.ResourceRoles.getDefaultInstance()) {
acceptedResourceRoles_ =
mesosphere.marathon.Protos.ResourceRoles.newBuilder(acceptedResourceRoles_).mergeFrom(value).buildPartial();
} else {
acceptedResourceRoles_ = value;
}
onChanged();
} else {
acceptedResourceRolesBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00100000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public Builder clearAcceptedResourceRoles() {
if (acceptedResourceRolesBuilder_ == null) {
acceptedResourceRoles_ = mesosphere.marathon.Protos.ResourceRoles.getDefaultInstance();
onChanged();
} else {
acceptedResourceRolesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00100000);
return this;
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public mesosphere.marathon.Protos.ResourceRoles.Builder getAcceptedResourceRolesBuilder() {
bitField0_ |= 0x00100000;
onChanged();
return getAcceptedResourceRolesFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
public mesosphere.marathon.Protos.ResourceRolesOrBuilder getAcceptedResourceRolesOrBuilder() {
if (acceptedResourceRolesBuilder_ != null) {
return acceptedResourceRolesBuilder_.getMessageOrBuilder();
} else {
return acceptedResourceRoles_;
}
}
/**
* <code>optional .mesosphere.marathon.ResourceRoles acceptedResourceRoles = 22;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ResourceRoles, mesosphere.marathon.Protos.ResourceRoles.Builder, mesosphere.marathon.Protos.ResourceRolesOrBuilder>
getAcceptedResourceRolesFieldBuilder() {
if (acceptedResourceRolesBuilder_ == null) {
acceptedResourceRolesBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ResourceRoles, mesosphere.marathon.Protos.ResourceRoles.Builder, mesosphere.marathon.Protos.ResourceRolesOrBuilder>(
acceptedResourceRoles_,
getParentForChildren(),
isClean());
acceptedResourceRoles_ = null;
}
return acceptedResourceRolesBuilder_;
}
// optional int64 last_scaling_at = 23;
private long lastScalingAt_ ;
/**
* <code>optional int64 last_scaling_at = 23;</code>
*/
public boolean hasLastScalingAt() {
return ((bitField0_ & 0x00200000) == 0x00200000);
}
/**
* <code>optional int64 last_scaling_at = 23;</code>
*/
public long getLastScalingAt() {
return lastScalingAt_;
}
/**
* <code>optional int64 last_scaling_at = 23;</code>
*/
public Builder setLastScalingAt(long value) {
bitField0_ |= 0x00200000;
lastScalingAt_ = value;
onChanged();
return this;
}
/**
* <code>optional int64 last_scaling_at = 23;</code>
*/
public Builder clearLastScalingAt() {
bitField0_ = (bitField0_ & ~0x00200000);
lastScalingAt_ = 0L;
onChanged();
return this;
}
// optional int64 last_config_change_at = 24;
private long lastConfigChangeAt_ ;
/**
* <code>optional int64 last_config_change_at = 24;</code>
*/
public boolean hasLastConfigChangeAt() {
return ((bitField0_ & 0x00400000) == 0x00400000);
}
/**
* <code>optional int64 last_config_change_at = 24;</code>
*/
public long getLastConfigChangeAt() {
return lastConfigChangeAt_;
}
/**
* <code>optional int64 last_config_change_at = 24;</code>
*/
public Builder setLastConfigChangeAt(long value) {
bitField0_ |= 0x00400000;
lastConfigChangeAt_ = value;
onChanged();
return this;
}
/**
* <code>optional int64 last_config_change_at = 24;</code>
*/
public Builder clearLastConfigChangeAt() {
bitField0_ = (bitField0_ & ~0x00400000);
lastConfigChangeAt_ = 0L;
onChanged();
return this;
}
// optional .mesosphere.marathon.IpAddress ipAddress = 25;
private mesosphere.marathon.Protos.IpAddress ipAddress_ = mesosphere.marathon.Protos.IpAddress.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.IpAddress, mesosphere.marathon.Protos.IpAddress.Builder, mesosphere.marathon.Protos.IpAddressOrBuilder> ipAddressBuilder_;
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public boolean hasIpAddress() {
return ((bitField0_ & 0x00800000) == 0x00800000);
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public mesosphere.marathon.Protos.IpAddress getIpAddress() {
if (ipAddressBuilder_ == null) {
return ipAddress_;
} else {
return ipAddressBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public Builder setIpAddress(mesosphere.marathon.Protos.IpAddress value) {
if (ipAddressBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ipAddress_ = value;
onChanged();
} else {
ipAddressBuilder_.setMessage(value);
}
bitField0_ |= 0x00800000;
return this;
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public Builder setIpAddress(
mesosphere.marathon.Protos.IpAddress.Builder builderForValue) {
if (ipAddressBuilder_ == null) {
ipAddress_ = builderForValue.build();
onChanged();
} else {
ipAddressBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00800000;
return this;
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public Builder mergeIpAddress(mesosphere.marathon.Protos.IpAddress value) {
if (ipAddressBuilder_ == null) {
if (((bitField0_ & 0x00800000) == 0x00800000) &&
ipAddress_ != mesosphere.marathon.Protos.IpAddress.getDefaultInstance()) {
ipAddress_ =
mesosphere.marathon.Protos.IpAddress.newBuilder(ipAddress_).mergeFrom(value).buildPartial();
} else {
ipAddress_ = value;
}
onChanged();
} else {
ipAddressBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00800000;
return this;
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public Builder clearIpAddress() {
if (ipAddressBuilder_ == null) {
ipAddress_ = mesosphere.marathon.Protos.IpAddress.getDefaultInstance();
onChanged();
} else {
ipAddressBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00800000);
return this;
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public mesosphere.marathon.Protos.IpAddress.Builder getIpAddressBuilder() {
bitField0_ |= 0x00800000;
onChanged();
return getIpAddressFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
public mesosphere.marathon.Protos.IpAddressOrBuilder getIpAddressOrBuilder() {
if (ipAddressBuilder_ != null) {
return ipAddressBuilder_.getMessageOrBuilder();
} else {
return ipAddress_;
}
}
/**
* <code>optional .mesosphere.marathon.IpAddress ipAddress = 25;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.IpAddress, mesosphere.marathon.Protos.IpAddress.Builder, mesosphere.marathon.Protos.IpAddressOrBuilder>
getIpAddressFieldBuilder() {
if (ipAddressBuilder_ == null) {
ipAddressBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.IpAddress, mesosphere.marathon.Protos.IpAddress.Builder, mesosphere.marathon.Protos.IpAddressOrBuilder>(
ipAddress_,
getParentForChildren(),
isClean());
ipAddress_ = null;
}
return ipAddressBuilder_;
}
// optional .mesosphere.marathon.ResidencyDefinition residency = 26;
private mesosphere.marathon.Protos.ResidencyDefinition residency_ = mesosphere.marathon.Protos.ResidencyDefinition.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ResidencyDefinition, mesosphere.marathon.Protos.ResidencyDefinition.Builder, mesosphere.marathon.Protos.ResidencyDefinitionOrBuilder> residencyBuilder_;
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public boolean hasResidency() {
return ((bitField0_ & 0x01000000) == 0x01000000);
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public mesosphere.marathon.Protos.ResidencyDefinition getResidency() {
if (residencyBuilder_ == null) {
return residency_;
} else {
return residencyBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public Builder setResidency(mesosphere.marathon.Protos.ResidencyDefinition value) {
if (residencyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
residency_ = value;
onChanged();
} else {
residencyBuilder_.setMessage(value);
}
bitField0_ |= 0x01000000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public Builder setResidency(
mesosphere.marathon.Protos.ResidencyDefinition.Builder builderForValue) {
if (residencyBuilder_ == null) {
residency_ = builderForValue.build();
onChanged();
} else {
residencyBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x01000000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public Builder mergeResidency(mesosphere.marathon.Protos.ResidencyDefinition value) {
if (residencyBuilder_ == null) {
if (((bitField0_ & 0x01000000) == 0x01000000) &&
residency_ != mesosphere.marathon.Protos.ResidencyDefinition.getDefaultInstance()) {
residency_ =
mesosphere.marathon.Protos.ResidencyDefinition.newBuilder(residency_).mergeFrom(value).buildPartial();
} else {
residency_ = value;
}
onChanged();
} else {
residencyBuilder_.mergeFrom(value);
}
bitField0_ |= 0x01000000;
return this;
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public Builder clearResidency() {
if (residencyBuilder_ == null) {
residency_ = mesosphere.marathon.Protos.ResidencyDefinition.getDefaultInstance();
onChanged();
} else {
residencyBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x01000000);
return this;
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public mesosphere.marathon.Protos.ResidencyDefinition.Builder getResidencyBuilder() {
bitField0_ |= 0x01000000;
onChanged();
return getResidencyFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
public mesosphere.marathon.Protos.ResidencyDefinitionOrBuilder getResidencyOrBuilder() {
if (residencyBuilder_ != null) {
return residencyBuilder_.getMessageOrBuilder();
} else {
return residency_;
}
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition residency = 26;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ResidencyDefinition, mesosphere.marathon.Protos.ResidencyDefinition.Builder, mesosphere.marathon.Protos.ResidencyDefinitionOrBuilder>
getResidencyFieldBuilder() {
if (residencyBuilder_ == null) {
residencyBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ResidencyDefinition, mesosphere.marathon.Protos.ResidencyDefinition.Builder, mesosphere.marathon.Protos.ResidencyDefinitionOrBuilder>(
residency_,
getParentForChildren(),
isClean());
residency_ = null;
}
return residencyBuilder_;
}
// repeated .mesos.Port portDefinitions = 27;
private java.util.List<org.apache.mesos.Protos.Port> portDefinitions_ =
java.util.Collections.emptyList();
private void ensurePortDefinitionsIsMutable() {
if (!((bitField0_ & 0x02000000) == 0x02000000)) {
portDefinitions_ = new java.util.ArrayList<org.apache.mesos.Protos.Port>(portDefinitions_);
bitField0_ |= 0x02000000;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Port, org.apache.mesos.Protos.Port.Builder, org.apache.mesos.Protos.PortOrBuilder> portDefinitionsBuilder_;
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public java.util.List<org.apache.mesos.Protos.Port> getPortDefinitionsList() {
if (portDefinitionsBuilder_ == null) {
return java.util.Collections.unmodifiableList(portDefinitions_);
} else {
return portDefinitionsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public int getPortDefinitionsCount() {
if (portDefinitionsBuilder_ == null) {
return portDefinitions_.size();
} else {
return portDefinitionsBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public org.apache.mesos.Protos.Port getPortDefinitions(int index) {
if (portDefinitionsBuilder_ == null) {
return portDefinitions_.get(index);
} else {
return portDefinitionsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder setPortDefinitions(
int index, org.apache.mesos.Protos.Port value) {
if (portDefinitionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortDefinitionsIsMutable();
portDefinitions_.set(index, value);
onChanged();
} else {
portDefinitionsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder setPortDefinitions(
int index, org.apache.mesos.Protos.Port.Builder builderForValue) {
if (portDefinitionsBuilder_ == null) {
ensurePortDefinitionsIsMutable();
portDefinitions_.set(index, builderForValue.build());
onChanged();
} else {
portDefinitionsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder addPortDefinitions(org.apache.mesos.Protos.Port value) {
if (portDefinitionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortDefinitionsIsMutable();
portDefinitions_.add(value);
onChanged();
} else {
portDefinitionsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder addPortDefinitions(
int index, org.apache.mesos.Protos.Port value) {
if (portDefinitionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortDefinitionsIsMutable();
portDefinitions_.add(index, value);
onChanged();
} else {
portDefinitionsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder addPortDefinitions(
org.apache.mesos.Protos.Port.Builder builderForValue) {
if (portDefinitionsBuilder_ == null) {
ensurePortDefinitionsIsMutable();
portDefinitions_.add(builderForValue.build());
onChanged();
} else {
portDefinitionsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder addPortDefinitions(
int index, org.apache.mesos.Protos.Port.Builder builderForValue) {
if (portDefinitionsBuilder_ == null) {
ensurePortDefinitionsIsMutable();
portDefinitions_.add(index, builderForValue.build());
onChanged();
} else {
portDefinitionsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder addAllPortDefinitions(
java.lang.Iterable<? extends org.apache.mesos.Protos.Port> values) {
if (portDefinitionsBuilder_ == null) {
ensurePortDefinitionsIsMutable();
super.addAll(values, portDefinitions_);
onChanged();
} else {
portDefinitionsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder clearPortDefinitions() {
if (portDefinitionsBuilder_ == null) {
portDefinitions_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x02000000);
onChanged();
} else {
portDefinitionsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public Builder removePortDefinitions(int index) {
if (portDefinitionsBuilder_ == null) {
ensurePortDefinitionsIsMutable();
portDefinitions_.remove(index);
onChanged();
} else {
portDefinitionsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public org.apache.mesos.Protos.Port.Builder getPortDefinitionsBuilder(
int index) {
return getPortDefinitionsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public org.apache.mesos.Protos.PortOrBuilder getPortDefinitionsOrBuilder(
int index) {
if (portDefinitionsBuilder_ == null) {
return portDefinitions_.get(index); } else {
return portDefinitionsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.PortOrBuilder>
getPortDefinitionsOrBuilderList() {
if (portDefinitionsBuilder_ != null) {
return portDefinitionsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(portDefinitions_);
}
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public org.apache.mesos.Protos.Port.Builder addPortDefinitionsBuilder() {
return getPortDefinitionsFieldBuilder().addBuilder(
org.apache.mesos.Protos.Port.getDefaultInstance());
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public org.apache.mesos.Protos.Port.Builder addPortDefinitionsBuilder(
int index) {
return getPortDefinitionsFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Port.getDefaultInstance());
}
/**
* <code>repeated .mesos.Port portDefinitions = 27;</code>
*/
public java.util.List<org.apache.mesos.Protos.Port.Builder>
getPortDefinitionsBuilderList() {
return getPortDefinitionsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Port, org.apache.mesos.Protos.Port.Builder, org.apache.mesos.Protos.PortOrBuilder>
getPortDefinitionsFieldBuilder() {
if (portDefinitionsBuilder_ == null) {
portDefinitionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Port, org.apache.mesos.Protos.Port.Builder, org.apache.mesos.Protos.PortOrBuilder>(
portDefinitions_,
((bitField0_ & 0x02000000) == 0x02000000),
getParentForChildren(),
isClean());
portDefinitions_ = null;
}
return portDefinitionsBuilder_;
}
// repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;
private java.util.List<mesosphere.marathon.Protos.ReadinessCheckDefinition> readinessCheckDefinition_ =
java.util.Collections.emptyList();
private void ensureReadinessCheckDefinitionIsMutable() {
if (!((bitField0_ & 0x04000000) == 0x04000000)) {
readinessCheckDefinition_ = new java.util.ArrayList<mesosphere.marathon.Protos.ReadinessCheckDefinition>(readinessCheckDefinition_);
bitField0_ |= 0x04000000;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ReadinessCheckDefinition, mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder, mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder> readinessCheckDefinitionBuilder_;
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ReadinessCheckDefinition> getReadinessCheckDefinitionList() {
if (readinessCheckDefinitionBuilder_ == null) {
return java.util.Collections.unmodifiableList(readinessCheckDefinition_);
} else {
return readinessCheckDefinitionBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public int getReadinessCheckDefinitionCount() {
if (readinessCheckDefinitionBuilder_ == null) {
return readinessCheckDefinition_.size();
} else {
return readinessCheckDefinitionBuilder_.getCount();
}
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinition getReadinessCheckDefinition(int index) {
if (readinessCheckDefinitionBuilder_ == null) {
return readinessCheckDefinition_.get(index);
} else {
return readinessCheckDefinitionBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder setReadinessCheckDefinition(
int index, mesosphere.marathon.Protos.ReadinessCheckDefinition value) {
if (readinessCheckDefinitionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureReadinessCheckDefinitionIsMutable();
readinessCheckDefinition_.set(index, value);
onChanged();
} else {
readinessCheckDefinitionBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder setReadinessCheckDefinition(
int index, mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder builderForValue) {
if (readinessCheckDefinitionBuilder_ == null) {
ensureReadinessCheckDefinitionIsMutable();
readinessCheckDefinition_.set(index, builderForValue.build());
onChanged();
} else {
readinessCheckDefinitionBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder addReadinessCheckDefinition(mesosphere.marathon.Protos.ReadinessCheckDefinition value) {
if (readinessCheckDefinitionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureReadinessCheckDefinitionIsMutable();
readinessCheckDefinition_.add(value);
onChanged();
} else {
readinessCheckDefinitionBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder addReadinessCheckDefinition(
int index, mesosphere.marathon.Protos.ReadinessCheckDefinition value) {
if (readinessCheckDefinitionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureReadinessCheckDefinitionIsMutable();
readinessCheckDefinition_.add(index, value);
onChanged();
} else {
readinessCheckDefinitionBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder addReadinessCheckDefinition(
mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder builderForValue) {
if (readinessCheckDefinitionBuilder_ == null) {
ensureReadinessCheckDefinitionIsMutable();
readinessCheckDefinition_.add(builderForValue.build());
onChanged();
} else {
readinessCheckDefinitionBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder addReadinessCheckDefinition(
int index, mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder builderForValue) {
if (readinessCheckDefinitionBuilder_ == null) {
ensureReadinessCheckDefinitionIsMutable();
readinessCheckDefinition_.add(index, builderForValue.build());
onChanged();
} else {
readinessCheckDefinitionBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder addAllReadinessCheckDefinition(
java.lang.Iterable<? extends mesosphere.marathon.Protos.ReadinessCheckDefinition> values) {
if (readinessCheckDefinitionBuilder_ == null) {
ensureReadinessCheckDefinitionIsMutable();
super.addAll(values, readinessCheckDefinition_);
onChanged();
} else {
readinessCheckDefinitionBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder clearReadinessCheckDefinition() {
if (readinessCheckDefinitionBuilder_ == null) {
readinessCheckDefinition_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x04000000);
onChanged();
} else {
readinessCheckDefinitionBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public Builder removeReadinessCheckDefinition(int index) {
if (readinessCheckDefinitionBuilder_ == null) {
ensureReadinessCheckDefinitionIsMutable();
readinessCheckDefinition_.remove(index);
onChanged();
} else {
readinessCheckDefinitionBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder getReadinessCheckDefinitionBuilder(
int index) {
return getReadinessCheckDefinitionFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder getReadinessCheckDefinitionOrBuilder(
int index) {
if (readinessCheckDefinitionBuilder_ == null) {
return readinessCheckDefinition_.get(index); } else {
return readinessCheckDefinitionBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder>
getReadinessCheckDefinitionOrBuilderList() {
if (readinessCheckDefinitionBuilder_ != null) {
return readinessCheckDefinitionBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(readinessCheckDefinition_);
}
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder addReadinessCheckDefinitionBuilder() {
return getReadinessCheckDefinitionFieldBuilder().addBuilder(
mesosphere.marathon.Protos.ReadinessCheckDefinition.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder addReadinessCheckDefinitionBuilder(
int index) {
return getReadinessCheckDefinitionFieldBuilder().addBuilder(
index, mesosphere.marathon.Protos.ReadinessCheckDefinition.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.ReadinessCheckDefinition readinessCheckDefinition = 28;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder>
getReadinessCheckDefinitionBuilderList() {
return getReadinessCheckDefinitionFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ReadinessCheckDefinition, mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder, mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder>
getReadinessCheckDefinitionFieldBuilder() {
if (readinessCheckDefinitionBuilder_ == null) {
readinessCheckDefinitionBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ReadinessCheckDefinition, mesosphere.marathon.Protos.ReadinessCheckDefinition.Builder, mesosphere.marathon.Protos.ReadinessCheckDefinitionOrBuilder>(
readinessCheckDefinition_,
((bitField0_ & 0x04000000) == 0x04000000),
getParentForChildren(),
isClean());
readinessCheckDefinition_ = null;
}
return readinessCheckDefinitionBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ServiceDefinition)
}
static {
defaultInstance = new ServiceDefinition(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ServiceDefinition)
}
public interface ResourceRolesOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated string role = 1;
/**
* <code>repeated string role = 1;</code>
*/
java.util.List<java.lang.String>
getRoleList();
/**
* <code>repeated string role = 1;</code>
*/
int getRoleCount();
/**
* <code>repeated string role = 1;</code>
*/
java.lang.String getRole(int index);
/**
* <code>repeated string role = 1;</code>
*/
com.google.protobuf.ByteString
getRoleBytes(int index);
}
/**
* Protobuf type {@code mesosphere.marathon.ResourceRoles}
*/
public static final class ResourceRoles extends
com.google.protobuf.GeneratedMessage
implements ResourceRolesOrBuilder {
// Use ResourceRoles.newBuilder() to construct.
private ResourceRoles(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ResourceRoles(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ResourceRoles defaultInstance;
public static ResourceRoles getDefaultInstance() {
return defaultInstance;
}
public ResourceRoles getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ResourceRoles(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
role_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
role_.add(input.readBytes());
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
role_ = new com.google.protobuf.UnmodifiableLazyStringList(role_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResourceRoles_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResourceRoles_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ResourceRoles.class, mesosphere.marathon.Protos.ResourceRoles.Builder.class);
}
public static com.google.protobuf.Parser<ResourceRoles> PARSER =
new com.google.protobuf.AbstractParser<ResourceRoles>() {
public ResourceRoles parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ResourceRoles(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ResourceRoles> getParserForType() {
return PARSER;
}
// repeated string role = 1;
public static final int ROLE_FIELD_NUMBER = 1;
private com.google.protobuf.LazyStringList role_;
/**
* <code>repeated string role = 1;</code>
*/
public java.util.List<java.lang.String>
getRoleList() {
return role_;
}
/**
* <code>repeated string role = 1;</code>
*/
public int getRoleCount() {
return role_.size();
}
/**
* <code>repeated string role = 1;</code>
*/
public java.lang.String getRole(int index) {
return role_.get(index);
}
/**
* <code>repeated string role = 1;</code>
*/
public com.google.protobuf.ByteString
getRoleBytes(int index) {
return role_.getByteString(index);
}
private void initFields() {
role_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < role_.size(); i++) {
output.writeBytes(1, role_.getByteString(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < role_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(role_.getByteString(i));
}
size += dataSize;
size += 1 * getRoleList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ResourceRoles parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ResourceRoles parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ResourceRoles parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ResourceRoles parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ResourceRoles parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ResourceRoles parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ResourceRoles parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ResourceRoles parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ResourceRoles parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ResourceRoles parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ResourceRoles prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ResourceRoles}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ResourceRolesOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResourceRoles_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResourceRoles_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ResourceRoles.class, mesosphere.marathon.Protos.ResourceRoles.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ResourceRoles.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
role_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResourceRoles_descriptor;
}
public mesosphere.marathon.Protos.ResourceRoles getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ResourceRoles.getDefaultInstance();
}
public mesosphere.marathon.Protos.ResourceRoles build() {
mesosphere.marathon.Protos.ResourceRoles result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ResourceRoles buildPartial() {
mesosphere.marathon.Protos.ResourceRoles result = new mesosphere.marathon.Protos.ResourceRoles(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
role_ = new com.google.protobuf.UnmodifiableLazyStringList(
role_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.role_ = role_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ResourceRoles) {
return mergeFrom((mesosphere.marathon.Protos.ResourceRoles)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ResourceRoles other) {
if (other == mesosphere.marathon.Protos.ResourceRoles.getDefaultInstance()) return this;
if (!other.role_.isEmpty()) {
if (role_.isEmpty()) {
role_ = other.role_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureRoleIsMutable();
role_.addAll(other.role_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ResourceRoles parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ResourceRoles) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// repeated string role = 1;
private com.google.protobuf.LazyStringList role_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureRoleIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
role_ = new com.google.protobuf.LazyStringArrayList(role_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated string role = 1;</code>
*/
public java.util.List<java.lang.String>
getRoleList() {
return java.util.Collections.unmodifiableList(role_);
}
/**
* <code>repeated string role = 1;</code>
*/
public int getRoleCount() {
return role_.size();
}
/**
* <code>repeated string role = 1;</code>
*/
public java.lang.String getRole(int index) {
return role_.get(index);
}
/**
* <code>repeated string role = 1;</code>
*/
public com.google.protobuf.ByteString
getRoleBytes(int index) {
return role_.getByteString(index);
}
/**
* <code>repeated string role = 1;</code>
*/
public Builder setRole(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureRoleIsMutable();
role_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string role = 1;</code>
*/
public Builder addRole(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureRoleIsMutable();
role_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string role = 1;</code>
*/
public Builder addAllRole(
java.lang.Iterable<java.lang.String> values) {
ensureRoleIsMutable();
super.addAll(values, role_);
onChanged();
return this;
}
/**
* <code>repeated string role = 1;</code>
*/
public Builder clearRole() {
role_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>repeated string role = 1;</code>
*/
public Builder addRoleBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureRoleIsMutable();
role_.add(value);
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ResourceRoles)
}
static {
defaultInstance = new ResourceRoles(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ResourceRoles)
}
public interface MarathonTaskOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string id = 1;
/**
* <code>required string id = 1;</code>
*/
boolean hasId();
/**
* <code>required string id = 1;</code>
*/
java.lang.String getId();
/**
* <code>required string id = 1;</code>
*/
com.google.protobuf.ByteString
getIdBytes();
// optional string host = 2;
/**
* <code>optional string host = 2;</code>
*/
boolean hasHost();
/**
* <code>optional string host = 2;</code>
*/
java.lang.String getHost();
/**
* <code>optional string host = 2;</code>
*/
com.google.protobuf.ByteString
getHostBytes();
// repeated uint32 ports = 3;
/**
* <code>repeated uint32 ports = 3;</code>
*/
java.util.List<java.lang.Integer> getPortsList();
/**
* <code>repeated uint32 ports = 3;</code>
*/
int getPortsCount();
/**
* <code>repeated uint32 ports = 3;</code>
*/
int getPorts(int index);
// repeated .mesos.Attribute attributes = 4;
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
java.util.List<org.apache.mesos.Protos.Attribute>
getAttributesList();
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
org.apache.mesos.Protos.Attribute getAttributes(int index);
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
int getAttributesCount();
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.AttributeOrBuilder>
getAttributesOrBuilderList();
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
org.apache.mesos.Protos.AttributeOrBuilder getAttributesOrBuilder(
int index);
// optional int64 staged_at = 5;
/**
* <code>optional int64 staged_at = 5;</code>
*/
boolean hasStagedAt();
/**
* <code>optional int64 staged_at = 5;</code>
*/
long getStagedAt();
// optional int64 started_at = 6;
/**
* <code>optional int64 started_at = 6;</code>
*/
boolean hasStartedAt();
/**
* <code>optional int64 started_at = 6;</code>
*/
long getStartedAt();
// repeated .mesos.TaskStatus OBSOLETE_statuses = 7;
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
java.util.List<org.apache.mesos.Protos.TaskStatus>
getOBSOLETEStatusesList();
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
org.apache.mesos.Protos.TaskStatus getOBSOLETEStatuses(int index);
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
int getOBSOLETEStatusesCount();
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.TaskStatusOrBuilder>
getOBSOLETEStatusesOrBuilderList();
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
org.apache.mesos.Protos.TaskStatusOrBuilder getOBSOLETEStatusesOrBuilder(
int index);
// optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
boolean hasVersion();
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
java.lang.String getVersion();
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
com.google.protobuf.ByteString
getVersionBytes();
// optional .mesos.TaskStatus status = 9;
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
boolean hasStatus();
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
org.apache.mesos.Protos.TaskStatus getStatus();
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
org.apache.mesos.Protos.TaskStatusOrBuilder getStatusOrBuilder();
// optional .mesos.SlaveID slaveId = 10;
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
boolean hasSlaveId();
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
org.apache.mesos.Protos.SlaveID getSlaveId();
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
org.apache.mesos.Protos.SlaveIDOrBuilder getSlaveIdOrBuilder();
// repeated .mesos.NetworkInfo OBSOLETE_networks = 11;
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
java.util.List<org.apache.mesos.Protos.NetworkInfo>
getOBSOLETENetworksList();
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
org.apache.mesos.Protos.NetworkInfo getOBSOLETENetworks(int index);
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
int getOBSOLETENetworksCount();
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
java.util.List<? extends org.apache.mesos.Protos.NetworkInfoOrBuilder>
getOBSOLETENetworksOrBuilderList();
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
org.apache.mesos.Protos.NetworkInfoOrBuilder getOBSOLETENetworksOrBuilder(
int index);
// optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
boolean hasReservation();
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
mesosphere.marathon.Protos.MarathonTask.Reservation getReservation();
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
mesosphere.marathon.Protos.MarathonTask.ReservationOrBuilder getReservationOrBuilder();
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonTask}
*/
public static final class MarathonTask extends
com.google.protobuf.GeneratedMessage
implements MarathonTaskOrBuilder {
// Use MarathonTask.newBuilder() to construct.
private MarathonTask(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private MarathonTask(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final MarathonTask defaultInstance;
public static MarathonTask getDefaultInstance() {
return defaultInstance;
}
public MarathonTask getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MarathonTask(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
id_ = input.readBytes();
break;
}
case 18: {
bitField0_ |= 0x00000002;
host_ = input.readBytes();
break;
}
case 24: {
if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
ports_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000004;
}
ports_.add(input.readUInt32());
break;
}
case 26: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
ports_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000004;
}
while (input.getBytesUntilLimit() > 0) {
ports_.add(input.readUInt32());
}
input.popLimit(limit);
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
attributes_ = new java.util.ArrayList<org.apache.mesos.Protos.Attribute>();
mutable_bitField0_ |= 0x00000008;
}
attributes_.add(input.readMessage(org.apache.mesos.Protos.Attribute.PARSER, extensionRegistry));
break;
}
case 40: {
bitField0_ |= 0x00000004;
stagedAt_ = input.readInt64();
break;
}
case 48: {
bitField0_ |= 0x00000008;
startedAt_ = input.readInt64();
break;
}
case 58: {
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
oBSOLETEStatuses_ = new java.util.ArrayList<org.apache.mesos.Protos.TaskStatus>();
mutable_bitField0_ |= 0x00000040;
}
oBSOLETEStatuses_.add(input.readMessage(org.apache.mesos.Protos.TaskStatus.PARSER, extensionRegistry));
break;
}
case 66: {
bitField0_ |= 0x00000010;
version_ = input.readBytes();
break;
}
case 74: {
org.apache.mesos.Protos.TaskStatus.Builder subBuilder = null;
if (((bitField0_ & 0x00000020) == 0x00000020)) {
subBuilder = status_.toBuilder();
}
status_ = input.readMessage(org.apache.mesos.Protos.TaskStatus.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(status_);
status_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000020;
break;
}
case 82: {
org.apache.mesos.Protos.SlaveID.Builder subBuilder = null;
if (((bitField0_ & 0x00000040) == 0x00000040)) {
subBuilder = slaveId_.toBuilder();
}
slaveId_ = input.readMessage(org.apache.mesos.Protos.SlaveID.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(slaveId_);
slaveId_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000040;
break;
}
case 90: {
if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
oBSOLETENetworks_ = new java.util.ArrayList<org.apache.mesos.Protos.NetworkInfo>();
mutable_bitField0_ |= 0x00000400;
}
oBSOLETENetworks_.add(input.readMessage(org.apache.mesos.Protos.NetworkInfo.PARSER, extensionRegistry));
break;
}
case 98: {
mesosphere.marathon.Protos.MarathonTask.Reservation.Builder subBuilder = null;
if (((bitField0_ & 0x00000080) == 0x00000080)) {
subBuilder = reservation_.toBuilder();
}
reservation_ = input.readMessage(mesosphere.marathon.Protos.MarathonTask.Reservation.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(reservation_);
reservation_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000080;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
ports_ = java.util.Collections.unmodifiableList(ports_);
}
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
attributes_ = java.util.Collections.unmodifiableList(attributes_);
}
if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
oBSOLETEStatuses_ = java.util.Collections.unmodifiableList(oBSOLETEStatuses_);
}
if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
oBSOLETENetworks_ = java.util.Collections.unmodifiableList(oBSOLETENetworks_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonTask.class, mesosphere.marathon.Protos.MarathonTask.Builder.class);
}
public static com.google.protobuf.Parser<MarathonTask> PARSER =
new com.google.protobuf.AbstractParser<MarathonTask>() {
public MarathonTask parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MarathonTask(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<MarathonTask> getParserForType() {
return PARSER;
}
public interface ReservationOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated string local_volume_ids = 1;
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
java.util.List<java.lang.String>
getLocalVolumeIdsList();
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
int getLocalVolumeIdsCount();
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
java.lang.String getLocalVolumeIds(int index);
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
com.google.protobuf.ByteString
getLocalVolumeIdsBytes(int index);
// required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
boolean hasState();
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
mesosphere.marathon.Protos.MarathonTask.Reservation.State getState();
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
mesosphere.marathon.Protos.MarathonTask.Reservation.StateOrBuilder getStateOrBuilder();
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonTask.Reservation}
*/
public static final class Reservation extends
com.google.protobuf.GeneratedMessage
implements ReservationOrBuilder {
// Use Reservation.newBuilder() to construct.
private Reservation(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Reservation(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Reservation defaultInstance;
public static Reservation getDefaultInstance() {
return defaultInstance;
}
public Reservation getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Reservation(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
localVolumeIds_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
localVolumeIds_.add(input.readBytes());
break;
}
case 18: {
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Builder subBuilder = null;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
subBuilder = state_.toBuilder();
}
state_ = input.readMessage(mesosphere.marathon.Protos.MarathonTask.Reservation.State.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(state_);
state_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000001;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
localVolumeIds_ = new com.google.protobuf.UnmodifiableLazyStringList(localVolumeIds_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonTask.Reservation.class, mesosphere.marathon.Protos.MarathonTask.Reservation.Builder.class);
}
public static com.google.protobuf.Parser<Reservation> PARSER =
new com.google.protobuf.AbstractParser<Reservation>() {
public Reservation parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Reservation(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Reservation> getParserForType() {
return PARSER;
}
public interface StateOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;</code>
*/
boolean hasType();
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;</code>
*/
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type getType();
// optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
boolean hasTimeout();
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout getTimeout();
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
mesosphere.marathon.Protos.MarathonTask.Reservation.State.TimeoutOrBuilder getTimeoutOrBuilder();
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonTask.Reservation.State}
*/
public static final class State extends
com.google.protobuf.GeneratedMessage
implements StateOrBuilder {
// Use State.newBuilder() to construct.
private State(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private State(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final State defaultInstance;
public static State getDefaultInstance() {
return defaultInstance;
}
public State getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private State(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
int rawValue = input.readEnum();
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type value = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(1, rawValue);
} else {
bitField0_ |= 0x00000001;
type_ = value;
}
break;
}
case 18: {
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Builder subBuilder = null;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
subBuilder = timeout_.toBuilder();
}
timeout_ = input.readMessage(mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(timeout_);
timeout_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000002;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonTask.Reservation.State.class, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Builder.class);
}
public static com.google.protobuf.Parser<State> PARSER =
new com.google.protobuf.AbstractParser<State>() {
public State parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new State(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<State> getParserForType() {
return PARSER;
}
/**
* Protobuf enum {@code mesosphere.marathon.MarathonTask.Reservation.State.Type}
*/
public enum Type
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>New = 1;</code>
*/
New(0, 1),
/**
* <code>Launched = 2;</code>
*/
Launched(1, 2),
/**
* <code>Suspended = 3;</code>
*/
Suspended(2, 3),
/**
* <code>Garbage = 4;</code>
*/
Garbage(3, 4),
/**
* <code>Unknown = 5;</code>
*/
Unknown(4, 5),
;
/**
* <code>New = 1;</code>
*/
public static final int New_VALUE = 1;
/**
* <code>Launched = 2;</code>
*/
public static final int Launched_VALUE = 2;
/**
* <code>Suspended = 3;</code>
*/
public static final int Suspended_VALUE = 3;
/**
* <code>Garbage = 4;</code>
*/
public static final int Garbage_VALUE = 4;
/**
* <code>Unknown = 5;</code>
*/
public static final int Unknown_VALUE = 5;
public final int getNumber() { return value; }
public static Type valueOf(int value) {
switch (value) {
case 1: return New;
case 2: return Launched;
case 3: return Suspended;
case 4: return Garbage;
case 5: return Unknown;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<Type>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<Type>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Type>() {
public Type findValueByNumber(int number) {
return Type.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return mesosphere.marathon.Protos.MarathonTask.Reservation.State.getDescriptor().getEnumTypes().get(0);
}
private static final Type[] VALUES = values();
public static Type valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private Type(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:mesosphere.marathon.MarathonTask.Reservation.State.Type)
}
public interface TimeoutOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required int64 initiated = 1;
/**
* <code>required int64 initiated = 1;</code>
*/
boolean hasInitiated();
/**
* <code>required int64 initiated = 1;</code>
*/
long getInitiated();
// required int64 deadline = 2;
/**
* <code>required int64 deadline = 2;</code>
*/
boolean hasDeadline();
/**
* <code>required int64 deadline = 2;</code>
*/
long getDeadline();
// required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;</code>
*/
boolean hasReason();
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;</code>
*/
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason getReason();
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonTask.Reservation.State.Timeout}
*/
public static final class Timeout extends
com.google.protobuf.GeneratedMessage
implements TimeoutOrBuilder {
// Use Timeout.newBuilder() to construct.
private Timeout(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Timeout(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Timeout defaultInstance;
public static Timeout getDefaultInstance() {
return defaultInstance;
}
public Timeout getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Timeout(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
initiated_ = input.readInt64();
break;
}
case 16: {
bitField0_ |= 0x00000002;
deadline_ = input.readInt64();
break;
}
case 24: {
int rawValue = input.readEnum();
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason value = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(3, rawValue);
} else {
bitField0_ |= 0x00000004;
reason_ = value;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.class, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Builder.class);
}
public static com.google.protobuf.Parser<Timeout> PARSER =
new com.google.protobuf.AbstractParser<Timeout>() {
public Timeout parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Timeout(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Timeout> getParserForType() {
return PARSER;
}
/**
* Protobuf enum {@code mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason}
*/
public enum Reason
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>RelaunchEscalationTimeout = 1;</code>
*/
RelaunchEscalationTimeout(0, 1),
/**
* <code>ReservationTimeout = 2;</code>
*/
ReservationTimeout(1, 2),
;
/**
* <code>RelaunchEscalationTimeout = 1;</code>
*/
public static final int RelaunchEscalationTimeout_VALUE = 1;
/**
* <code>ReservationTimeout = 2;</code>
*/
public static final int ReservationTimeout_VALUE = 2;
public final int getNumber() { return value; }
public static Reason valueOf(int value) {
switch (value) {
case 1: return RelaunchEscalationTimeout;
case 2: return ReservationTimeout;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<Reason>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<Reason>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Reason>() {
public Reason findValueByNumber(int number) {
return Reason.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.getDescriptor().getEnumTypes().get(0);
}
private static final Reason[] VALUES = values();
public static Reason valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private Reason(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason)
}
private int bitField0_;
// required int64 initiated = 1;
public static final int INITIATED_FIELD_NUMBER = 1;
private long initiated_;
/**
* <code>required int64 initiated = 1;</code>
*/
public boolean hasInitiated() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required int64 initiated = 1;</code>
*/
public long getInitiated() {
return initiated_;
}
// required int64 deadline = 2;
public static final int DEADLINE_FIELD_NUMBER = 2;
private long deadline_;
/**
* <code>required int64 deadline = 2;</code>
*/
public boolean hasDeadline() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int64 deadline = 2;</code>
*/
public long getDeadline() {
return deadline_;
}
// required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;
public static final int REASON_FIELD_NUMBER = 3;
private mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason reason_;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;</code>
*/
public boolean hasReason() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason getReason() {
return reason_;
}
private void initFields() {
initiated_ = 0L;
deadline_ = 0L;
reason_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason.RelaunchEscalationTimeout;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasInitiated()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasDeadline()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasReason()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeInt64(1, initiated_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt64(2, deadline_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeEnum(3, reason_.getNumber());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(1, initiated_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(2, deadline_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, reason_.getNumber());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonTask.Reservation.State.Timeout}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.MarathonTask.Reservation.State.TimeoutOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.class, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Builder.class);
}
// Construct using mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
initiated_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
deadline_ = 0L;
bitField0_ = (bitField0_ & ~0x00000002);
reason_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason.RelaunchEscalationTimeout;
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_descriptor;
}
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout getDefaultInstanceForType() {
return mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.getDefaultInstance();
}
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout build() {
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout buildPartial() {
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout result = new mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.initiated_ = initiated_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.deadline_ = deadline_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.reason_ = reason_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout) {
return mergeFrom((mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout other) {
if (other == mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.getDefaultInstance()) return this;
if (other.hasInitiated()) {
setInitiated(other.getInitiated());
}
if (other.hasDeadline()) {
setDeadline(other.getDeadline());
}
if (other.hasReason()) {
setReason(other.getReason());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasInitiated()) {
return false;
}
if (!hasDeadline()) {
return false;
}
if (!hasReason()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required int64 initiated = 1;
private long initiated_ ;
/**
* <code>required int64 initiated = 1;</code>
*/
public boolean hasInitiated() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required int64 initiated = 1;</code>
*/
public long getInitiated() {
return initiated_;
}
/**
* <code>required int64 initiated = 1;</code>
*/
public Builder setInitiated(long value) {
bitField0_ |= 0x00000001;
initiated_ = value;
onChanged();
return this;
}
/**
* <code>required int64 initiated = 1;</code>
*/
public Builder clearInitiated() {
bitField0_ = (bitField0_ & ~0x00000001);
initiated_ = 0L;
onChanged();
return this;
}
// required int64 deadline = 2;
private long deadline_ ;
/**
* <code>required int64 deadline = 2;</code>
*/
public boolean hasDeadline() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int64 deadline = 2;</code>
*/
public long getDeadline() {
return deadline_;
}
/**
* <code>required int64 deadline = 2;</code>
*/
public Builder setDeadline(long value) {
bitField0_ |= 0x00000002;
deadline_ = value;
onChanged();
return this;
}
/**
* <code>required int64 deadline = 2;</code>
*/
public Builder clearDeadline() {
bitField0_ = (bitField0_ & ~0x00000002);
deadline_ = 0L;
onChanged();
return this;
}
// required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;
private mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason reason_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason.RelaunchEscalationTimeout;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;</code>
*/
public boolean hasReason() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason getReason() {
return reason_;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;</code>
*/
public Builder setReason(mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
reason_ = value;
onChanged();
return this;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Timeout.Reason reason = 3;</code>
*/
public Builder clearReason() {
bitField0_ = (bitField0_ & ~0x00000004);
reason_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Reason.RelaunchEscalationTimeout;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.MarathonTask.Reservation.State.Timeout)
}
static {
defaultInstance = new Timeout(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.MarathonTask.Reservation.State.Timeout)
}
private int bitField0_;
// required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;
public static final int TYPE_FIELD_NUMBER = 1;
private mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type type_;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;</code>
*/
public boolean hasType() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type getType() {
return type_;
}
// optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;
public static final int TIMEOUT_FIELD_NUMBER = 2;
private mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout timeout_;
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public boolean hasTimeout() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout getTimeout() {
return timeout_;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.TimeoutOrBuilder getTimeoutOrBuilder() {
return timeout_;
}
private void initFields() {
type_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type.New;
timeout_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasType()) {
memoizedIsInitialized = 0;
return false;
}
if (hasTimeout()) {
if (!getTimeout().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeEnum(1, type_.getNumber());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeMessage(2, timeout_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, type_.getNumber());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, timeout_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation.State parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.MarathonTask.Reservation.State prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonTask.Reservation.State}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.MarathonTask.Reservation.StateOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonTask.Reservation.State.class, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Builder.class);
}
// Construct using mesosphere.marathon.Protos.MarathonTask.Reservation.State.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getTimeoutFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
type_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type.New;
bitField0_ = (bitField0_ & ~0x00000001);
if (timeoutBuilder_ == null) {
timeout_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.getDefaultInstance();
} else {
timeoutBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_State_descriptor;
}
public mesosphere.marathon.Protos.MarathonTask.Reservation.State getDefaultInstanceForType() {
return mesosphere.marathon.Protos.MarathonTask.Reservation.State.getDefaultInstance();
}
public mesosphere.marathon.Protos.MarathonTask.Reservation.State build() {
mesosphere.marathon.Protos.MarathonTask.Reservation.State result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.MarathonTask.Reservation.State buildPartial() {
mesosphere.marathon.Protos.MarathonTask.Reservation.State result = new mesosphere.marathon.Protos.MarathonTask.Reservation.State(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.type_ = type_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
if (timeoutBuilder_ == null) {
result.timeout_ = timeout_;
} else {
result.timeout_ = timeoutBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.MarathonTask.Reservation.State) {
return mergeFrom((mesosphere.marathon.Protos.MarathonTask.Reservation.State)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.MarathonTask.Reservation.State other) {
if (other == mesosphere.marathon.Protos.MarathonTask.Reservation.State.getDefaultInstance()) return this;
if (other.hasType()) {
setType(other.getType());
}
if (other.hasTimeout()) {
mergeTimeout(other.getTimeout());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasType()) {
return false;
}
if (hasTimeout()) {
if (!getTimeout().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.MarathonTask.Reservation.State parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.MarathonTask.Reservation.State) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;
private mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type type_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type.New;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;</code>
*/
public boolean hasType() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type getType() {
return type_;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;</code>
*/
public Builder setType(mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
type_ = value;
onChanged();
return this;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State.Type type = 1;</code>
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000001);
type_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Type.New;
onChanged();
return this;
}
// optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;
private mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout timeout_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Builder, mesosphere.marathon.Protos.MarathonTask.Reservation.State.TimeoutOrBuilder> timeoutBuilder_;
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public boolean hasTimeout() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout getTimeout() {
if (timeoutBuilder_ == null) {
return timeout_;
} else {
return timeoutBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public Builder setTimeout(mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout value) {
if (timeoutBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
timeout_ = value;
onChanged();
} else {
timeoutBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public Builder setTimeout(
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Builder builderForValue) {
if (timeoutBuilder_ == null) {
timeout_ = builderForValue.build();
onChanged();
} else {
timeoutBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public Builder mergeTimeout(mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout value) {
if (timeoutBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002) &&
timeout_ != mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.getDefaultInstance()) {
timeout_ =
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.newBuilder(timeout_).mergeFrom(value).buildPartial();
} else {
timeout_ = value;
}
onChanged();
} else {
timeoutBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public Builder clearTimeout() {
if (timeoutBuilder_ == null) {
timeout_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.getDefaultInstance();
onChanged();
} else {
timeoutBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Builder getTimeoutBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getTimeoutFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.TimeoutOrBuilder getTimeoutOrBuilder() {
if (timeoutBuilder_ != null) {
return timeoutBuilder_.getMessageOrBuilder();
} else {
return timeout_;
}
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation.State.Timeout timeout = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Builder, mesosphere.marathon.Protos.MarathonTask.Reservation.State.TimeoutOrBuilder>
getTimeoutFieldBuilder() {
if (timeoutBuilder_ == null) {
timeoutBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Timeout.Builder, mesosphere.marathon.Protos.MarathonTask.Reservation.State.TimeoutOrBuilder>(
timeout_,
getParentForChildren(),
isClean());
timeout_ = null;
}
return timeoutBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.MarathonTask.Reservation.State)
}
static {
defaultInstance = new State(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.MarathonTask.Reservation.State)
}
private int bitField0_;
// repeated string local_volume_ids = 1;
public static final int LOCAL_VOLUME_IDS_FIELD_NUMBER = 1;
private com.google.protobuf.LazyStringList localVolumeIds_;
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public java.util.List<java.lang.String>
getLocalVolumeIdsList() {
return localVolumeIds_;
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public int getLocalVolumeIdsCount() {
return localVolumeIds_.size();
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public java.lang.String getLocalVolumeIds(int index) {
return localVolumeIds_.get(index);
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public com.google.protobuf.ByteString
getLocalVolumeIdsBytes(int index) {
return localVolumeIds_.getByteString(index);
}
// required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;
public static final int STATE_FIELD_NUMBER = 2;
private mesosphere.marathon.Protos.MarathonTask.Reservation.State state_;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public boolean hasState() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State getState() {
return state_;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.StateOrBuilder getStateOrBuilder() {
return state_;
}
private void initFields() {
localVolumeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
state_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasState()) {
memoizedIsInitialized = 0;
return false;
}
if (!getState().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < localVolumeIds_.size(); i++) {
output.writeBytes(1, localVolumeIds_.getByteString(i));
}
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeMessage(2, state_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < localVolumeIds_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(localVolumeIds_.getByteString(i));
}
size += dataSize;
size += 1 * getLocalVolumeIdsList().size();
}
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, state_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask.Reservation parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.MarathonTask.Reservation prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonTask.Reservation}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.MarathonTask.ReservationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonTask.Reservation.class, mesosphere.marathon.Protos.MarathonTask.Reservation.Builder.class);
}
// Construct using mesosphere.marathon.Protos.MarathonTask.Reservation.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getStateFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
localVolumeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
if (stateBuilder_ == null) {
state_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.getDefaultInstance();
} else {
stateBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_Reservation_descriptor;
}
public mesosphere.marathon.Protos.MarathonTask.Reservation getDefaultInstanceForType() {
return mesosphere.marathon.Protos.MarathonTask.Reservation.getDefaultInstance();
}
public mesosphere.marathon.Protos.MarathonTask.Reservation build() {
mesosphere.marathon.Protos.MarathonTask.Reservation result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.MarathonTask.Reservation buildPartial() {
mesosphere.marathon.Protos.MarathonTask.Reservation result = new mesosphere.marathon.Protos.MarathonTask.Reservation(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
localVolumeIds_ = new com.google.protobuf.UnmodifiableLazyStringList(
localVolumeIds_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.localVolumeIds_ = localVolumeIds_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000001;
}
if (stateBuilder_ == null) {
result.state_ = state_;
} else {
result.state_ = stateBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.MarathonTask.Reservation) {
return mergeFrom((mesosphere.marathon.Protos.MarathonTask.Reservation)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.MarathonTask.Reservation other) {
if (other == mesosphere.marathon.Protos.MarathonTask.Reservation.getDefaultInstance()) return this;
if (!other.localVolumeIds_.isEmpty()) {
if (localVolumeIds_.isEmpty()) {
localVolumeIds_ = other.localVolumeIds_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureLocalVolumeIdsIsMutable();
localVolumeIds_.addAll(other.localVolumeIds_);
}
onChanged();
}
if (other.hasState()) {
mergeState(other.getState());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasState()) {
return false;
}
if (!getState().isInitialized()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.MarathonTask.Reservation parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.MarathonTask.Reservation) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// repeated string local_volume_ids = 1;
private com.google.protobuf.LazyStringList localVolumeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureLocalVolumeIdsIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
localVolumeIds_ = new com.google.protobuf.LazyStringArrayList(localVolumeIds_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public java.util.List<java.lang.String>
getLocalVolumeIdsList() {
return java.util.Collections.unmodifiableList(localVolumeIds_);
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public int getLocalVolumeIdsCount() {
return localVolumeIds_.size();
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public java.lang.String getLocalVolumeIds(int index) {
return localVolumeIds_.get(index);
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public com.google.protobuf.ByteString
getLocalVolumeIdsBytes(int index) {
return localVolumeIds_.getByteString(index);
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public Builder setLocalVolumeIds(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureLocalVolumeIdsIsMutable();
localVolumeIds_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public Builder addLocalVolumeIds(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureLocalVolumeIdsIsMutable();
localVolumeIds_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public Builder addAllLocalVolumeIds(
java.lang.Iterable<java.lang.String> values) {
ensureLocalVolumeIdsIsMutable();
super.addAll(values, localVolumeIds_);
onChanged();
return this;
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public Builder clearLocalVolumeIds() {
localVolumeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>repeated string local_volume_ids = 1;</code>
*/
public Builder addLocalVolumeIdsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureLocalVolumeIdsIsMutable();
localVolumeIds_.add(value);
onChanged();
return this;
}
// required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;
private mesosphere.marathon.Protos.MarathonTask.Reservation.State state_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation.State, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Builder, mesosphere.marathon.Protos.MarathonTask.Reservation.StateOrBuilder> stateBuilder_;
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public boolean hasState() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State getState() {
if (stateBuilder_ == null) {
return state_;
} else {
return stateBuilder_.getMessage();
}
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public Builder setState(mesosphere.marathon.Protos.MarathonTask.Reservation.State value) {
if (stateBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
state_ = value;
onChanged();
} else {
stateBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public Builder setState(
mesosphere.marathon.Protos.MarathonTask.Reservation.State.Builder builderForValue) {
if (stateBuilder_ == null) {
state_ = builderForValue.build();
onChanged();
} else {
stateBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public Builder mergeState(mesosphere.marathon.Protos.MarathonTask.Reservation.State value) {
if (stateBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002) &&
state_ != mesosphere.marathon.Protos.MarathonTask.Reservation.State.getDefaultInstance()) {
state_ =
mesosphere.marathon.Protos.MarathonTask.Reservation.State.newBuilder(state_).mergeFrom(value).buildPartial();
} else {
state_ = value;
}
onChanged();
} else {
stateBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public Builder clearState() {
if (stateBuilder_ == null) {
state_ = mesosphere.marathon.Protos.MarathonTask.Reservation.State.getDefaultInstance();
onChanged();
} else {
stateBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.State.Builder getStateBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getStateFieldBuilder().getBuilder();
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.StateOrBuilder getStateOrBuilder() {
if (stateBuilder_ != null) {
return stateBuilder_.getMessageOrBuilder();
} else {
return state_;
}
}
/**
* <code>required .mesosphere.marathon.MarathonTask.Reservation.State state = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation.State, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Builder, mesosphere.marathon.Protos.MarathonTask.Reservation.StateOrBuilder>
getStateFieldBuilder() {
if (stateBuilder_ == null) {
stateBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation.State, mesosphere.marathon.Protos.MarathonTask.Reservation.State.Builder, mesosphere.marathon.Protos.MarathonTask.Reservation.StateOrBuilder>(
state_,
getParentForChildren(),
isClean());
state_ = null;
}
return stateBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.MarathonTask.Reservation)
}
static {
defaultInstance = new Reservation(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.MarathonTask.Reservation)
}
private int bitField0_;
// required string id = 1;
public static final int ID_FIELD_NUMBER = 1;
private java.lang.Object id_;
/**
* <code>required string id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
id_ = s;
}
return s;
}
}
/**
* <code>required string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional string host = 2;
public static final int HOST_FIELD_NUMBER = 2;
private java.lang.Object host_;
/**
* <code>optional string host = 2;</code>
*/
public boolean hasHost() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional string host = 2;</code>
*/
public java.lang.String getHost() {
java.lang.Object ref = host_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
host_ = s;
}
return s;
}
}
/**
* <code>optional string host = 2;</code>
*/
public com.google.protobuf.ByteString
getHostBytes() {
java.lang.Object ref = host_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
host_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// repeated uint32 ports = 3;
public static final int PORTS_FIELD_NUMBER = 3;
private java.util.List<java.lang.Integer> ports_;
/**
* <code>repeated uint32 ports = 3;</code>
*/
public java.util.List<java.lang.Integer>
getPortsList() {
return ports_;
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public int getPortsCount() {
return ports_.size();
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public int getPorts(int index) {
return ports_.get(index);
}
// repeated .mesos.Attribute attributes = 4;
public static final int ATTRIBUTES_FIELD_NUMBER = 4;
private java.util.List<org.apache.mesos.Protos.Attribute> attributes_;
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Attribute> getAttributesList() {
return attributes_;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.AttributeOrBuilder>
getAttributesOrBuilderList() {
return attributes_;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public int getAttributesCount() {
return attributes_.size();
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public org.apache.mesos.Protos.Attribute getAttributes(int index) {
return attributes_.get(index);
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public org.apache.mesos.Protos.AttributeOrBuilder getAttributesOrBuilder(
int index) {
return attributes_.get(index);
}
// optional int64 staged_at = 5;
public static final int STAGED_AT_FIELD_NUMBER = 5;
private long stagedAt_;
/**
* <code>optional int64 staged_at = 5;</code>
*/
public boolean hasStagedAt() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional int64 staged_at = 5;</code>
*/
public long getStagedAt() {
return stagedAt_;
}
// optional int64 started_at = 6;
public static final int STARTED_AT_FIELD_NUMBER = 6;
private long startedAt_;
/**
* <code>optional int64 started_at = 6;</code>
*/
public boolean hasStartedAt() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional int64 started_at = 6;</code>
*/
public long getStartedAt() {
return startedAt_;
}
// repeated .mesos.TaskStatus OBSOLETE_statuses = 7;
public static final int OBSOLETE_STATUSES_FIELD_NUMBER = 7;
private java.util.List<org.apache.mesos.Protos.TaskStatus> oBSOLETEStatuses_;
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public java.util.List<org.apache.mesos.Protos.TaskStatus> getOBSOLETEStatusesList() {
return oBSOLETEStatuses_;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.TaskStatusOrBuilder>
getOBSOLETEStatusesOrBuilderList() {
return oBSOLETEStatuses_;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public int getOBSOLETEStatusesCount() {
return oBSOLETEStatuses_.size();
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public org.apache.mesos.Protos.TaskStatus getOBSOLETEStatuses(int index) {
return oBSOLETEStatuses_.get(index);
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public org.apache.mesos.Protos.TaskStatusOrBuilder getOBSOLETEStatusesOrBuilder(
int index) {
return oBSOLETEStatuses_.get(index);
}
// optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];
public static final int VERSION_FIELD_NUMBER = 8;
private java.lang.Object version_;
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
version_ = s;
}
return s;
}
}
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .mesos.TaskStatus status = 9;
public static final int STATUS_FIELD_NUMBER = 9;
private org.apache.mesos.Protos.TaskStatus status_;
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public boolean hasStatus() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public org.apache.mesos.Protos.TaskStatus getStatus() {
return status_;
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public org.apache.mesos.Protos.TaskStatusOrBuilder getStatusOrBuilder() {
return status_;
}
// optional .mesos.SlaveID slaveId = 10;
public static final int SLAVEID_FIELD_NUMBER = 10;
private org.apache.mesos.Protos.SlaveID slaveId_;
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public boolean hasSlaveId() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public org.apache.mesos.Protos.SlaveID getSlaveId() {
return slaveId_;
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public org.apache.mesos.Protos.SlaveIDOrBuilder getSlaveIdOrBuilder() {
return slaveId_;
}
// repeated .mesos.NetworkInfo OBSOLETE_networks = 11;
public static final int OBSOLETE_NETWORKS_FIELD_NUMBER = 11;
private java.util.List<org.apache.mesos.Protos.NetworkInfo> oBSOLETENetworks_;
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public java.util.List<org.apache.mesos.Protos.NetworkInfo> getOBSOLETENetworksList() {
return oBSOLETENetworks_;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public java.util.List<? extends org.apache.mesos.Protos.NetworkInfoOrBuilder>
getOBSOLETENetworksOrBuilderList() {
return oBSOLETENetworks_;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public int getOBSOLETENetworksCount() {
return oBSOLETENetworks_.size();
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public org.apache.mesos.Protos.NetworkInfo getOBSOLETENetworks(int index) {
return oBSOLETENetworks_.get(index);
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public org.apache.mesos.Protos.NetworkInfoOrBuilder getOBSOLETENetworksOrBuilder(
int index) {
return oBSOLETENetworks_.get(index);
}
// optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;
public static final int RESERVATION_FIELD_NUMBER = 12;
private mesosphere.marathon.Protos.MarathonTask.Reservation reservation_;
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public boolean hasReservation() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation getReservation() {
return reservation_;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public mesosphere.marathon.Protos.MarathonTask.ReservationOrBuilder getReservationOrBuilder() {
return reservation_;
}
private void initFields() {
id_ = "";
host_ = "";
ports_ = java.util.Collections.emptyList();
attributes_ = java.util.Collections.emptyList();
stagedAt_ = 0L;
startedAt_ = 0L;
oBSOLETEStatuses_ = java.util.Collections.emptyList();
version_ = "1970-01-01T00:00:00.000Z";
status_ = org.apache.mesos.Protos.TaskStatus.getDefaultInstance();
slaveId_ = org.apache.mesos.Protos.SlaveID.getDefaultInstance();
oBSOLETENetworks_ = java.util.Collections.emptyList();
reservation_ = mesosphere.marathon.Protos.MarathonTask.Reservation.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasId()) {
memoizedIsInitialized = 0;
return false;
}
for (int i = 0; i < getAttributesCount(); i++) {
if (!getAttributes(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getOBSOLETEStatusesCount(); i++) {
if (!getOBSOLETEStatuses(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasStatus()) {
if (!getStatus().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasSlaveId()) {
if (!getSlaveId().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getOBSOLETENetworksCount(); i++) {
if (!getOBSOLETENetworks(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasReservation()) {
if (!getReservation().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getHostBytes());
}
for (int i = 0; i < ports_.size(); i++) {
output.writeUInt32(3, ports_.get(i));
}
for (int i = 0; i < attributes_.size(); i++) {
output.writeMessage(4, attributes_.get(i));
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeInt64(5, stagedAt_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeInt64(6, startedAt_);
}
for (int i = 0; i < oBSOLETEStatuses_.size(); i++) {
output.writeMessage(7, oBSOLETEStatuses_.get(i));
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeBytes(8, getVersionBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeMessage(9, status_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeMessage(10, slaveId_);
}
for (int i = 0; i < oBSOLETENetworks_.size(); i++) {
output.writeMessage(11, oBSOLETENetworks_.get(i));
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeMessage(12, reservation_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getHostBytes());
}
{
int dataSize = 0;
for (int i = 0; i < ports_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeUInt32SizeNoTag(ports_.get(i));
}
size += dataSize;
size += 1 * getPortsList().size();
}
for (int i = 0; i < attributes_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, attributes_.get(i));
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(5, stagedAt_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(6, startedAt_);
}
for (int i = 0; i < oBSOLETEStatuses_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(7, oBSOLETEStatuses_.get(i));
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(8, getVersionBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(9, status_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(10, slaveId_);
}
for (int i = 0; i < oBSOLETENetworks_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(11, oBSOLETENetworks_.get(i));
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(12, reservation_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.MarathonTask parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonTask parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonTask parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonTask parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonTask parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.MarathonTask prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonTask}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.MarathonTaskOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonTask.class, mesosphere.marathon.Protos.MarathonTask.Builder.class);
}
// Construct using mesosphere.marathon.Protos.MarathonTask.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getAttributesFieldBuilder();
getOBSOLETEStatusesFieldBuilder();
getStatusFieldBuilder();
getSlaveIdFieldBuilder();
getOBSOLETENetworksFieldBuilder();
getReservationFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
id_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
host_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
ports_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
if (attributesBuilder_ == null) {
attributes_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
} else {
attributesBuilder_.clear();
}
stagedAt_ = 0L;
bitField0_ = (bitField0_ & ~0x00000010);
startedAt_ = 0L;
bitField0_ = (bitField0_ & ~0x00000020);
if (oBSOLETEStatusesBuilder_ == null) {
oBSOLETEStatuses_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
} else {
oBSOLETEStatusesBuilder_.clear();
}
version_ = "1970-01-01T00:00:00.000Z";
bitField0_ = (bitField0_ & ~0x00000080);
if (statusBuilder_ == null) {
status_ = org.apache.mesos.Protos.TaskStatus.getDefaultInstance();
} else {
statusBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000100);
if (slaveIdBuilder_ == null) {
slaveId_ = org.apache.mesos.Protos.SlaveID.getDefaultInstance();
} else {
slaveIdBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000200);
if (oBSOLETENetworksBuilder_ == null) {
oBSOLETENetworks_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000400);
} else {
oBSOLETENetworksBuilder_.clear();
}
if (reservationBuilder_ == null) {
reservation_ = mesosphere.marathon.Protos.MarathonTask.Reservation.getDefaultInstance();
} else {
reservationBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000800);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonTask_descriptor;
}
public mesosphere.marathon.Protos.MarathonTask getDefaultInstanceForType() {
return mesosphere.marathon.Protos.MarathonTask.getDefaultInstance();
}
public mesosphere.marathon.Protos.MarathonTask build() {
mesosphere.marathon.Protos.MarathonTask result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.MarathonTask buildPartial() {
mesosphere.marathon.Protos.MarathonTask result = new mesosphere.marathon.Protos.MarathonTask(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.id_ = id_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.host_ = host_;
if (((bitField0_ & 0x00000004) == 0x00000004)) {
ports_ = java.util.Collections.unmodifiableList(ports_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.ports_ = ports_;
if (attributesBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008)) {
attributes_ = java.util.Collections.unmodifiableList(attributes_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.attributes_ = attributes_;
} else {
result.attributes_ = attributesBuilder_.build();
}
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000004;
}
result.stagedAt_ = stagedAt_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000008;
}
result.startedAt_ = startedAt_;
if (oBSOLETEStatusesBuilder_ == null) {
if (((bitField0_ & 0x00000040) == 0x00000040)) {
oBSOLETEStatuses_ = java.util.Collections.unmodifiableList(oBSOLETEStatuses_);
bitField0_ = (bitField0_ & ~0x00000040);
}
result.oBSOLETEStatuses_ = oBSOLETEStatuses_;
} else {
result.oBSOLETEStatuses_ = oBSOLETEStatusesBuilder_.build();
}
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000010;
}
result.version_ = version_;
if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
to_bitField0_ |= 0x00000020;
}
if (statusBuilder_ == null) {
result.status_ = status_;
} else {
result.status_ = statusBuilder_.build();
}
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000040;
}
if (slaveIdBuilder_ == null) {
result.slaveId_ = slaveId_;
} else {
result.slaveId_ = slaveIdBuilder_.build();
}
if (oBSOLETENetworksBuilder_ == null) {
if (((bitField0_ & 0x00000400) == 0x00000400)) {
oBSOLETENetworks_ = java.util.Collections.unmodifiableList(oBSOLETENetworks_);
bitField0_ = (bitField0_ & ~0x00000400);
}
result.oBSOLETENetworks_ = oBSOLETENetworks_;
} else {
result.oBSOLETENetworks_ = oBSOLETENetworksBuilder_.build();
}
if (((from_bitField0_ & 0x00000800) == 0x00000800)) {
to_bitField0_ |= 0x00000080;
}
if (reservationBuilder_ == null) {
result.reservation_ = reservation_;
} else {
result.reservation_ = reservationBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.MarathonTask) {
return mergeFrom((mesosphere.marathon.Protos.MarathonTask)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.MarathonTask other) {
if (other == mesosphere.marathon.Protos.MarathonTask.getDefaultInstance()) return this;
if (other.hasId()) {
bitField0_ |= 0x00000001;
id_ = other.id_;
onChanged();
}
if (other.hasHost()) {
bitField0_ |= 0x00000002;
host_ = other.host_;
onChanged();
}
if (!other.ports_.isEmpty()) {
if (ports_.isEmpty()) {
ports_ = other.ports_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensurePortsIsMutable();
ports_.addAll(other.ports_);
}
onChanged();
}
if (attributesBuilder_ == null) {
if (!other.attributes_.isEmpty()) {
if (attributes_.isEmpty()) {
attributes_ = other.attributes_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureAttributesIsMutable();
attributes_.addAll(other.attributes_);
}
onChanged();
}
} else {
if (!other.attributes_.isEmpty()) {
if (attributesBuilder_.isEmpty()) {
attributesBuilder_.dispose();
attributesBuilder_ = null;
attributes_ = other.attributes_;
bitField0_ = (bitField0_ & ~0x00000008);
attributesBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getAttributesFieldBuilder() : null;
} else {
attributesBuilder_.addAllMessages(other.attributes_);
}
}
}
if (other.hasStagedAt()) {
setStagedAt(other.getStagedAt());
}
if (other.hasStartedAt()) {
setStartedAt(other.getStartedAt());
}
if (oBSOLETEStatusesBuilder_ == null) {
if (!other.oBSOLETEStatuses_.isEmpty()) {
if (oBSOLETEStatuses_.isEmpty()) {
oBSOLETEStatuses_ = other.oBSOLETEStatuses_;
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureOBSOLETEStatusesIsMutable();
oBSOLETEStatuses_.addAll(other.oBSOLETEStatuses_);
}
onChanged();
}
} else {
if (!other.oBSOLETEStatuses_.isEmpty()) {
if (oBSOLETEStatusesBuilder_.isEmpty()) {
oBSOLETEStatusesBuilder_.dispose();
oBSOLETEStatusesBuilder_ = null;
oBSOLETEStatuses_ = other.oBSOLETEStatuses_;
bitField0_ = (bitField0_ & ~0x00000040);
oBSOLETEStatusesBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getOBSOLETEStatusesFieldBuilder() : null;
} else {
oBSOLETEStatusesBuilder_.addAllMessages(other.oBSOLETEStatuses_);
}
}
}
if (other.hasVersion()) {
bitField0_ |= 0x00000080;
version_ = other.version_;
onChanged();
}
if (other.hasStatus()) {
mergeStatus(other.getStatus());
}
if (other.hasSlaveId()) {
mergeSlaveId(other.getSlaveId());
}
if (oBSOLETENetworksBuilder_ == null) {
if (!other.oBSOLETENetworks_.isEmpty()) {
if (oBSOLETENetworks_.isEmpty()) {
oBSOLETENetworks_ = other.oBSOLETENetworks_;
bitField0_ = (bitField0_ & ~0x00000400);
} else {
ensureOBSOLETENetworksIsMutable();
oBSOLETENetworks_.addAll(other.oBSOLETENetworks_);
}
onChanged();
}
} else {
if (!other.oBSOLETENetworks_.isEmpty()) {
if (oBSOLETENetworksBuilder_.isEmpty()) {
oBSOLETENetworksBuilder_.dispose();
oBSOLETENetworksBuilder_ = null;
oBSOLETENetworks_ = other.oBSOLETENetworks_;
bitField0_ = (bitField0_ & ~0x00000400);
oBSOLETENetworksBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getOBSOLETENetworksFieldBuilder() : null;
} else {
oBSOLETENetworksBuilder_.addAllMessages(other.oBSOLETENetworks_);
}
}
}
if (other.hasReservation()) {
mergeReservation(other.getReservation());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasId()) {
return false;
}
for (int i = 0; i < getAttributesCount(); i++) {
if (!getAttributes(i).isInitialized()) {
return false;
}
}
for (int i = 0; i < getOBSOLETEStatusesCount(); i++) {
if (!getOBSOLETEStatuses(i).isInitialized()) {
return false;
}
}
if (hasStatus()) {
if (!getStatus().isInitialized()) {
return false;
}
}
if (hasSlaveId()) {
if (!getSlaveId().isInitialized()) {
return false;
}
}
for (int i = 0; i < getOBSOLETENetworksCount(); i++) {
if (!getOBSOLETENetworks(i).isInitialized()) {
return false;
}
}
if (hasReservation()) {
if (!getReservation().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.MarathonTask parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.MarathonTask) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string id = 1;
private java.lang.Object id_ = "";
/**
* <code>required string id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string id = 1;</code>
*/
public Builder setId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
/**
* <code>required string id = 1;</code>
*/
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000001);
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
* <code>required string id = 1;</code>
*/
public Builder setIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
// optional string host = 2;
private java.lang.Object host_ = "";
/**
* <code>optional string host = 2;</code>
*/
public boolean hasHost() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional string host = 2;</code>
*/
public java.lang.String getHost() {
java.lang.Object ref = host_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
host_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string host = 2;</code>
*/
public com.google.protobuf.ByteString
getHostBytes() {
java.lang.Object ref = host_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
host_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string host = 2;</code>
*/
public Builder setHost(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
host_ = value;
onChanged();
return this;
}
/**
* <code>optional string host = 2;</code>
*/
public Builder clearHost() {
bitField0_ = (bitField0_ & ~0x00000002);
host_ = getDefaultInstance().getHost();
onChanged();
return this;
}
/**
* <code>optional string host = 2;</code>
*/
public Builder setHostBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
host_ = value;
onChanged();
return this;
}
// repeated uint32 ports = 3;
private java.util.List<java.lang.Integer> ports_ = java.util.Collections.emptyList();
private void ensurePortsIsMutable() {
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
ports_ = new java.util.ArrayList<java.lang.Integer>(ports_);
bitField0_ |= 0x00000004;
}
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public java.util.List<java.lang.Integer>
getPortsList() {
return java.util.Collections.unmodifiableList(ports_);
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public int getPortsCount() {
return ports_.size();
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public int getPorts(int index) {
return ports_.get(index);
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public Builder setPorts(
int index, int value) {
ensurePortsIsMutable();
ports_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public Builder addPorts(int value) {
ensurePortsIsMutable();
ports_.add(value);
onChanged();
return this;
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public Builder addAllPorts(
java.lang.Iterable<? extends java.lang.Integer> values) {
ensurePortsIsMutable();
super.addAll(values, ports_);
onChanged();
return this;
}
/**
* <code>repeated uint32 ports = 3;</code>
*/
public Builder clearPorts() {
ports_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
// repeated .mesos.Attribute attributes = 4;
private java.util.List<org.apache.mesos.Protos.Attribute> attributes_ =
java.util.Collections.emptyList();
private void ensureAttributesIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
attributes_ = new java.util.ArrayList<org.apache.mesos.Protos.Attribute>(attributes_);
bitField0_ |= 0x00000008;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Attribute, org.apache.mesos.Protos.Attribute.Builder, org.apache.mesos.Protos.AttributeOrBuilder> attributesBuilder_;
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Attribute> getAttributesList() {
if (attributesBuilder_ == null) {
return java.util.Collections.unmodifiableList(attributes_);
} else {
return attributesBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public int getAttributesCount() {
if (attributesBuilder_ == null) {
return attributes_.size();
} else {
return attributesBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public org.apache.mesos.Protos.Attribute getAttributes(int index) {
if (attributesBuilder_ == null) {
return attributes_.get(index);
} else {
return attributesBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder setAttributes(
int index, org.apache.mesos.Protos.Attribute value) {
if (attributesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAttributesIsMutable();
attributes_.set(index, value);
onChanged();
} else {
attributesBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder setAttributes(
int index, org.apache.mesos.Protos.Attribute.Builder builderForValue) {
if (attributesBuilder_ == null) {
ensureAttributesIsMutable();
attributes_.set(index, builderForValue.build());
onChanged();
} else {
attributesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder addAttributes(org.apache.mesos.Protos.Attribute value) {
if (attributesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAttributesIsMutable();
attributes_.add(value);
onChanged();
} else {
attributesBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder addAttributes(
int index, org.apache.mesos.Protos.Attribute value) {
if (attributesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAttributesIsMutable();
attributes_.add(index, value);
onChanged();
} else {
attributesBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder addAttributes(
org.apache.mesos.Protos.Attribute.Builder builderForValue) {
if (attributesBuilder_ == null) {
ensureAttributesIsMutable();
attributes_.add(builderForValue.build());
onChanged();
} else {
attributesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder addAttributes(
int index, org.apache.mesos.Protos.Attribute.Builder builderForValue) {
if (attributesBuilder_ == null) {
ensureAttributesIsMutable();
attributes_.add(index, builderForValue.build());
onChanged();
} else {
attributesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder addAllAttributes(
java.lang.Iterable<? extends org.apache.mesos.Protos.Attribute> values) {
if (attributesBuilder_ == null) {
ensureAttributesIsMutable();
super.addAll(values, attributes_);
onChanged();
} else {
attributesBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder clearAttributes() {
if (attributesBuilder_ == null) {
attributes_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
} else {
attributesBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public Builder removeAttributes(int index) {
if (attributesBuilder_ == null) {
ensureAttributesIsMutable();
attributes_.remove(index);
onChanged();
} else {
attributesBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public org.apache.mesos.Protos.Attribute.Builder getAttributesBuilder(
int index) {
return getAttributesFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public org.apache.mesos.Protos.AttributeOrBuilder getAttributesOrBuilder(
int index) {
if (attributesBuilder_ == null) {
return attributes_.get(index); } else {
return attributesBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.AttributeOrBuilder>
getAttributesOrBuilderList() {
if (attributesBuilder_ != null) {
return attributesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(attributes_);
}
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public org.apache.mesos.Protos.Attribute.Builder addAttributesBuilder() {
return getAttributesFieldBuilder().addBuilder(
org.apache.mesos.Protos.Attribute.getDefaultInstance());
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public org.apache.mesos.Protos.Attribute.Builder addAttributesBuilder(
int index) {
return getAttributesFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Attribute.getDefaultInstance());
}
/**
* <code>repeated .mesos.Attribute attributes = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Attribute.Builder>
getAttributesBuilderList() {
return getAttributesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Attribute, org.apache.mesos.Protos.Attribute.Builder, org.apache.mesos.Protos.AttributeOrBuilder>
getAttributesFieldBuilder() {
if (attributesBuilder_ == null) {
attributesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Attribute, org.apache.mesos.Protos.Attribute.Builder, org.apache.mesos.Protos.AttributeOrBuilder>(
attributes_,
((bitField0_ & 0x00000008) == 0x00000008),
getParentForChildren(),
isClean());
attributes_ = null;
}
return attributesBuilder_;
}
// optional int64 staged_at = 5;
private long stagedAt_ ;
/**
* <code>optional int64 staged_at = 5;</code>
*/
public boolean hasStagedAt() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional int64 staged_at = 5;</code>
*/
public long getStagedAt() {
return stagedAt_;
}
/**
* <code>optional int64 staged_at = 5;</code>
*/
public Builder setStagedAt(long value) {
bitField0_ |= 0x00000010;
stagedAt_ = value;
onChanged();
return this;
}
/**
* <code>optional int64 staged_at = 5;</code>
*/
public Builder clearStagedAt() {
bitField0_ = (bitField0_ & ~0x00000010);
stagedAt_ = 0L;
onChanged();
return this;
}
// optional int64 started_at = 6;
private long startedAt_ ;
/**
* <code>optional int64 started_at = 6;</code>
*/
public boolean hasStartedAt() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional int64 started_at = 6;</code>
*/
public long getStartedAt() {
return startedAt_;
}
/**
* <code>optional int64 started_at = 6;</code>
*/
public Builder setStartedAt(long value) {
bitField0_ |= 0x00000020;
startedAt_ = value;
onChanged();
return this;
}
/**
* <code>optional int64 started_at = 6;</code>
*/
public Builder clearStartedAt() {
bitField0_ = (bitField0_ & ~0x00000020);
startedAt_ = 0L;
onChanged();
return this;
}
// repeated .mesos.TaskStatus OBSOLETE_statuses = 7;
private java.util.List<org.apache.mesos.Protos.TaskStatus> oBSOLETEStatuses_ =
java.util.Collections.emptyList();
private void ensureOBSOLETEStatusesIsMutable() {
if (!((bitField0_ & 0x00000040) == 0x00000040)) {
oBSOLETEStatuses_ = new java.util.ArrayList<org.apache.mesos.Protos.TaskStatus>(oBSOLETEStatuses_);
bitField0_ |= 0x00000040;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.TaskStatus, org.apache.mesos.Protos.TaskStatus.Builder, org.apache.mesos.Protos.TaskStatusOrBuilder> oBSOLETEStatusesBuilder_;
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public java.util.List<org.apache.mesos.Protos.TaskStatus> getOBSOLETEStatusesList() {
if (oBSOLETEStatusesBuilder_ == null) {
return java.util.Collections.unmodifiableList(oBSOLETEStatuses_);
} else {
return oBSOLETEStatusesBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public int getOBSOLETEStatusesCount() {
if (oBSOLETEStatusesBuilder_ == null) {
return oBSOLETEStatuses_.size();
} else {
return oBSOLETEStatusesBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public org.apache.mesos.Protos.TaskStatus getOBSOLETEStatuses(int index) {
if (oBSOLETEStatusesBuilder_ == null) {
return oBSOLETEStatuses_.get(index);
} else {
return oBSOLETEStatusesBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder setOBSOLETEStatuses(
int index, org.apache.mesos.Protos.TaskStatus value) {
if (oBSOLETEStatusesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOBSOLETEStatusesIsMutable();
oBSOLETEStatuses_.set(index, value);
onChanged();
} else {
oBSOLETEStatusesBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder setOBSOLETEStatuses(
int index, org.apache.mesos.Protos.TaskStatus.Builder builderForValue) {
if (oBSOLETEStatusesBuilder_ == null) {
ensureOBSOLETEStatusesIsMutable();
oBSOLETEStatuses_.set(index, builderForValue.build());
onChanged();
} else {
oBSOLETEStatusesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder addOBSOLETEStatuses(org.apache.mesos.Protos.TaskStatus value) {
if (oBSOLETEStatusesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOBSOLETEStatusesIsMutable();
oBSOLETEStatuses_.add(value);
onChanged();
} else {
oBSOLETEStatusesBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder addOBSOLETEStatuses(
int index, org.apache.mesos.Protos.TaskStatus value) {
if (oBSOLETEStatusesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOBSOLETEStatusesIsMutable();
oBSOLETEStatuses_.add(index, value);
onChanged();
} else {
oBSOLETEStatusesBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder addOBSOLETEStatuses(
org.apache.mesos.Protos.TaskStatus.Builder builderForValue) {
if (oBSOLETEStatusesBuilder_ == null) {
ensureOBSOLETEStatusesIsMutable();
oBSOLETEStatuses_.add(builderForValue.build());
onChanged();
} else {
oBSOLETEStatusesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder addOBSOLETEStatuses(
int index, org.apache.mesos.Protos.TaskStatus.Builder builderForValue) {
if (oBSOLETEStatusesBuilder_ == null) {
ensureOBSOLETEStatusesIsMutable();
oBSOLETEStatuses_.add(index, builderForValue.build());
onChanged();
} else {
oBSOLETEStatusesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder addAllOBSOLETEStatuses(
java.lang.Iterable<? extends org.apache.mesos.Protos.TaskStatus> values) {
if (oBSOLETEStatusesBuilder_ == null) {
ensureOBSOLETEStatusesIsMutable();
super.addAll(values, oBSOLETEStatuses_);
onChanged();
} else {
oBSOLETEStatusesBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder clearOBSOLETEStatuses() {
if (oBSOLETEStatusesBuilder_ == null) {
oBSOLETEStatuses_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
} else {
oBSOLETEStatusesBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public Builder removeOBSOLETEStatuses(int index) {
if (oBSOLETEStatusesBuilder_ == null) {
ensureOBSOLETEStatusesIsMutable();
oBSOLETEStatuses_.remove(index);
onChanged();
} else {
oBSOLETEStatusesBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public org.apache.mesos.Protos.TaskStatus.Builder getOBSOLETEStatusesBuilder(
int index) {
return getOBSOLETEStatusesFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public org.apache.mesos.Protos.TaskStatusOrBuilder getOBSOLETEStatusesOrBuilder(
int index) {
if (oBSOLETEStatusesBuilder_ == null) {
return oBSOLETEStatuses_.get(index); } else {
return oBSOLETEStatusesBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.TaskStatusOrBuilder>
getOBSOLETEStatusesOrBuilderList() {
if (oBSOLETEStatusesBuilder_ != null) {
return oBSOLETEStatusesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(oBSOLETEStatuses_);
}
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public org.apache.mesos.Protos.TaskStatus.Builder addOBSOLETEStatusesBuilder() {
return getOBSOLETEStatusesFieldBuilder().addBuilder(
org.apache.mesos.Protos.TaskStatus.getDefaultInstance());
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public org.apache.mesos.Protos.TaskStatus.Builder addOBSOLETEStatusesBuilder(
int index) {
return getOBSOLETEStatusesFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.TaskStatus.getDefaultInstance());
}
/**
* <code>repeated .mesos.TaskStatus OBSOLETE_statuses = 7;</code>
*/
public java.util.List<org.apache.mesos.Protos.TaskStatus.Builder>
getOBSOLETEStatusesBuilderList() {
return getOBSOLETEStatusesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.TaskStatus, org.apache.mesos.Protos.TaskStatus.Builder, org.apache.mesos.Protos.TaskStatusOrBuilder>
getOBSOLETEStatusesFieldBuilder() {
if (oBSOLETEStatusesBuilder_ == null) {
oBSOLETEStatusesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.TaskStatus, org.apache.mesos.Protos.TaskStatus.Builder, org.apache.mesos.Protos.TaskStatusOrBuilder>(
oBSOLETEStatuses_,
((bitField0_ & 0x00000040) == 0x00000040),
getParentForChildren(),
isClean());
oBSOLETEStatuses_ = null;
}
return oBSOLETEStatusesBuilder_;
}
// optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];
private java.lang.Object version_ = "1970-01-01T00:00:00.000Z";
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
version_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public Builder setVersion(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
version_ = value;
onChanged();
return this;
}
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public Builder clearVersion() {
bitField0_ = (bitField0_ & ~0x00000080);
version_ = getDefaultInstance().getVersion();
onChanged();
return this;
}
/**
* <code>optional string version = 8 [default = "1970-01-01T00:00:00.000Z"];</code>
*
* <pre>
* since 0.7.0
* </pre>
*/
public Builder setVersionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
version_ = value;
onChanged();
return this;
}
// optional .mesos.TaskStatus status = 9;
private org.apache.mesos.Protos.TaskStatus status_ = org.apache.mesos.Protos.TaskStatus.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.TaskStatus, org.apache.mesos.Protos.TaskStatus.Builder, org.apache.mesos.Protos.TaskStatusOrBuilder> statusBuilder_;
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public boolean hasStatus() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public org.apache.mesos.Protos.TaskStatus getStatus() {
if (statusBuilder_ == null) {
return status_;
} else {
return statusBuilder_.getMessage();
}
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public Builder setStatus(org.apache.mesos.Protos.TaskStatus value) {
if (statusBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
status_ = value;
onChanged();
} else {
statusBuilder_.setMessage(value);
}
bitField0_ |= 0x00000100;
return this;
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public Builder setStatus(
org.apache.mesos.Protos.TaskStatus.Builder builderForValue) {
if (statusBuilder_ == null) {
status_ = builderForValue.build();
onChanged();
} else {
statusBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000100;
return this;
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public Builder mergeStatus(org.apache.mesos.Protos.TaskStatus value) {
if (statusBuilder_ == null) {
if (((bitField0_ & 0x00000100) == 0x00000100) &&
status_ != org.apache.mesos.Protos.TaskStatus.getDefaultInstance()) {
status_ =
org.apache.mesos.Protos.TaskStatus.newBuilder(status_).mergeFrom(value).buildPartial();
} else {
status_ = value;
}
onChanged();
} else {
statusBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000100;
return this;
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public Builder clearStatus() {
if (statusBuilder_ == null) {
status_ = org.apache.mesos.Protos.TaskStatus.getDefaultInstance();
onChanged();
} else {
statusBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000100);
return this;
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public org.apache.mesos.Protos.TaskStatus.Builder getStatusBuilder() {
bitField0_ |= 0x00000100;
onChanged();
return getStatusFieldBuilder().getBuilder();
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
public org.apache.mesos.Protos.TaskStatusOrBuilder getStatusOrBuilder() {
if (statusBuilder_ != null) {
return statusBuilder_.getMessageOrBuilder();
} else {
return status_;
}
}
/**
* <code>optional .mesos.TaskStatus status = 9;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.TaskStatus, org.apache.mesos.Protos.TaskStatus.Builder, org.apache.mesos.Protos.TaskStatusOrBuilder>
getStatusFieldBuilder() {
if (statusBuilder_ == null) {
statusBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.TaskStatus, org.apache.mesos.Protos.TaskStatus.Builder, org.apache.mesos.Protos.TaskStatusOrBuilder>(
status_,
getParentForChildren(),
isClean());
status_ = null;
}
return statusBuilder_;
}
// optional .mesos.SlaveID slaveId = 10;
private org.apache.mesos.Protos.SlaveID slaveId_ = org.apache.mesos.Protos.SlaveID.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.SlaveID, org.apache.mesos.Protos.SlaveID.Builder, org.apache.mesos.Protos.SlaveIDOrBuilder> slaveIdBuilder_;
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public boolean hasSlaveId() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public org.apache.mesos.Protos.SlaveID getSlaveId() {
if (slaveIdBuilder_ == null) {
return slaveId_;
} else {
return slaveIdBuilder_.getMessage();
}
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public Builder setSlaveId(org.apache.mesos.Protos.SlaveID value) {
if (slaveIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
slaveId_ = value;
onChanged();
} else {
slaveIdBuilder_.setMessage(value);
}
bitField0_ |= 0x00000200;
return this;
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public Builder setSlaveId(
org.apache.mesos.Protos.SlaveID.Builder builderForValue) {
if (slaveIdBuilder_ == null) {
slaveId_ = builderForValue.build();
onChanged();
} else {
slaveIdBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000200;
return this;
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public Builder mergeSlaveId(org.apache.mesos.Protos.SlaveID value) {
if (slaveIdBuilder_ == null) {
if (((bitField0_ & 0x00000200) == 0x00000200) &&
slaveId_ != org.apache.mesos.Protos.SlaveID.getDefaultInstance()) {
slaveId_ =
org.apache.mesos.Protos.SlaveID.newBuilder(slaveId_).mergeFrom(value).buildPartial();
} else {
slaveId_ = value;
}
onChanged();
} else {
slaveIdBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000200;
return this;
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public Builder clearSlaveId() {
if (slaveIdBuilder_ == null) {
slaveId_ = org.apache.mesos.Protos.SlaveID.getDefaultInstance();
onChanged();
} else {
slaveIdBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000200);
return this;
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public org.apache.mesos.Protos.SlaveID.Builder getSlaveIdBuilder() {
bitField0_ |= 0x00000200;
onChanged();
return getSlaveIdFieldBuilder().getBuilder();
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
public org.apache.mesos.Protos.SlaveIDOrBuilder getSlaveIdOrBuilder() {
if (slaveIdBuilder_ != null) {
return slaveIdBuilder_.getMessageOrBuilder();
} else {
return slaveId_;
}
}
/**
* <code>optional .mesos.SlaveID slaveId = 10;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.SlaveID, org.apache.mesos.Protos.SlaveID.Builder, org.apache.mesos.Protos.SlaveIDOrBuilder>
getSlaveIdFieldBuilder() {
if (slaveIdBuilder_ == null) {
slaveIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.SlaveID, org.apache.mesos.Protos.SlaveID.Builder, org.apache.mesos.Protos.SlaveIDOrBuilder>(
slaveId_,
getParentForChildren(),
isClean());
slaveId_ = null;
}
return slaveIdBuilder_;
}
// repeated .mesos.NetworkInfo OBSOLETE_networks = 11;
private java.util.List<org.apache.mesos.Protos.NetworkInfo> oBSOLETENetworks_ =
java.util.Collections.emptyList();
private void ensureOBSOLETENetworksIsMutable() {
if (!((bitField0_ & 0x00000400) == 0x00000400)) {
oBSOLETENetworks_ = new java.util.ArrayList<org.apache.mesos.Protos.NetworkInfo>(oBSOLETENetworks_);
bitField0_ |= 0x00000400;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.NetworkInfo, org.apache.mesos.Protos.NetworkInfo.Builder, org.apache.mesos.Protos.NetworkInfoOrBuilder> oBSOLETENetworksBuilder_;
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public java.util.List<org.apache.mesos.Protos.NetworkInfo> getOBSOLETENetworksList() {
if (oBSOLETENetworksBuilder_ == null) {
return java.util.Collections.unmodifiableList(oBSOLETENetworks_);
} else {
return oBSOLETENetworksBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public int getOBSOLETENetworksCount() {
if (oBSOLETENetworksBuilder_ == null) {
return oBSOLETENetworks_.size();
} else {
return oBSOLETENetworksBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public org.apache.mesos.Protos.NetworkInfo getOBSOLETENetworks(int index) {
if (oBSOLETENetworksBuilder_ == null) {
return oBSOLETENetworks_.get(index);
} else {
return oBSOLETENetworksBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder setOBSOLETENetworks(
int index, org.apache.mesos.Protos.NetworkInfo value) {
if (oBSOLETENetworksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOBSOLETENetworksIsMutable();
oBSOLETENetworks_.set(index, value);
onChanged();
} else {
oBSOLETENetworksBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder setOBSOLETENetworks(
int index, org.apache.mesos.Protos.NetworkInfo.Builder builderForValue) {
if (oBSOLETENetworksBuilder_ == null) {
ensureOBSOLETENetworksIsMutable();
oBSOLETENetworks_.set(index, builderForValue.build());
onChanged();
} else {
oBSOLETENetworksBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder addOBSOLETENetworks(org.apache.mesos.Protos.NetworkInfo value) {
if (oBSOLETENetworksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOBSOLETENetworksIsMutable();
oBSOLETENetworks_.add(value);
onChanged();
} else {
oBSOLETENetworksBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder addOBSOLETENetworks(
int index, org.apache.mesos.Protos.NetworkInfo value) {
if (oBSOLETENetworksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOBSOLETENetworksIsMutable();
oBSOLETENetworks_.add(index, value);
onChanged();
} else {
oBSOLETENetworksBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder addOBSOLETENetworks(
org.apache.mesos.Protos.NetworkInfo.Builder builderForValue) {
if (oBSOLETENetworksBuilder_ == null) {
ensureOBSOLETENetworksIsMutable();
oBSOLETENetworks_.add(builderForValue.build());
onChanged();
} else {
oBSOLETENetworksBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder addOBSOLETENetworks(
int index, org.apache.mesos.Protos.NetworkInfo.Builder builderForValue) {
if (oBSOLETENetworksBuilder_ == null) {
ensureOBSOLETENetworksIsMutable();
oBSOLETENetworks_.add(index, builderForValue.build());
onChanged();
} else {
oBSOLETENetworksBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder addAllOBSOLETENetworks(
java.lang.Iterable<? extends org.apache.mesos.Protos.NetworkInfo> values) {
if (oBSOLETENetworksBuilder_ == null) {
ensureOBSOLETENetworksIsMutable();
super.addAll(values, oBSOLETENetworks_);
onChanged();
} else {
oBSOLETENetworksBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder clearOBSOLETENetworks() {
if (oBSOLETENetworksBuilder_ == null) {
oBSOLETENetworks_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000400);
onChanged();
} else {
oBSOLETENetworksBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public Builder removeOBSOLETENetworks(int index) {
if (oBSOLETENetworksBuilder_ == null) {
ensureOBSOLETENetworksIsMutable();
oBSOLETENetworks_.remove(index);
onChanged();
} else {
oBSOLETENetworksBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public org.apache.mesos.Protos.NetworkInfo.Builder getOBSOLETENetworksBuilder(
int index) {
return getOBSOLETENetworksFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public org.apache.mesos.Protos.NetworkInfoOrBuilder getOBSOLETENetworksOrBuilder(
int index) {
if (oBSOLETENetworksBuilder_ == null) {
return oBSOLETENetworks_.get(index); } else {
return oBSOLETENetworksBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public java.util.List<? extends org.apache.mesos.Protos.NetworkInfoOrBuilder>
getOBSOLETENetworksOrBuilderList() {
if (oBSOLETENetworksBuilder_ != null) {
return oBSOLETENetworksBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(oBSOLETENetworks_);
}
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public org.apache.mesos.Protos.NetworkInfo.Builder addOBSOLETENetworksBuilder() {
return getOBSOLETENetworksFieldBuilder().addBuilder(
org.apache.mesos.Protos.NetworkInfo.getDefaultInstance());
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public org.apache.mesos.Protos.NetworkInfo.Builder addOBSOLETENetworksBuilder(
int index) {
return getOBSOLETENetworksFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.NetworkInfo.getDefaultInstance());
}
/**
* <code>repeated .mesos.NetworkInfo OBSOLETE_networks = 11;</code>
*
* <pre>
* status already contained this, so this field was redundant
* </pre>
*/
public java.util.List<org.apache.mesos.Protos.NetworkInfo.Builder>
getOBSOLETENetworksBuilderList() {
return getOBSOLETENetworksFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.NetworkInfo, org.apache.mesos.Protos.NetworkInfo.Builder, org.apache.mesos.Protos.NetworkInfoOrBuilder>
getOBSOLETENetworksFieldBuilder() {
if (oBSOLETENetworksBuilder_ == null) {
oBSOLETENetworksBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.NetworkInfo, org.apache.mesos.Protos.NetworkInfo.Builder, org.apache.mesos.Protos.NetworkInfoOrBuilder>(
oBSOLETENetworks_,
((bitField0_ & 0x00000400) == 0x00000400),
getParentForChildren(),
isClean());
oBSOLETENetworks_ = null;
}
return oBSOLETENetworksBuilder_;
}
// optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;
private mesosphere.marathon.Protos.MarathonTask.Reservation reservation_ = mesosphere.marathon.Protos.MarathonTask.Reservation.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation, mesosphere.marathon.Protos.MarathonTask.Reservation.Builder, mesosphere.marathon.Protos.MarathonTask.ReservationOrBuilder> reservationBuilder_;
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public boolean hasReservation() {
return ((bitField0_ & 0x00000800) == 0x00000800);
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation getReservation() {
if (reservationBuilder_ == null) {
return reservation_;
} else {
return reservationBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public Builder setReservation(mesosphere.marathon.Protos.MarathonTask.Reservation value) {
if (reservationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
reservation_ = value;
onChanged();
} else {
reservationBuilder_.setMessage(value);
}
bitField0_ |= 0x00000800;
return this;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public Builder setReservation(
mesosphere.marathon.Protos.MarathonTask.Reservation.Builder builderForValue) {
if (reservationBuilder_ == null) {
reservation_ = builderForValue.build();
onChanged();
} else {
reservationBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000800;
return this;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public Builder mergeReservation(mesosphere.marathon.Protos.MarathonTask.Reservation value) {
if (reservationBuilder_ == null) {
if (((bitField0_ & 0x00000800) == 0x00000800) &&
reservation_ != mesosphere.marathon.Protos.MarathonTask.Reservation.getDefaultInstance()) {
reservation_ =
mesosphere.marathon.Protos.MarathonTask.Reservation.newBuilder(reservation_).mergeFrom(value).buildPartial();
} else {
reservation_ = value;
}
onChanged();
} else {
reservationBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000800;
return this;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public Builder clearReservation() {
if (reservationBuilder_ == null) {
reservation_ = mesosphere.marathon.Protos.MarathonTask.Reservation.getDefaultInstance();
onChanged();
} else {
reservationBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000800);
return this;
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public mesosphere.marathon.Protos.MarathonTask.Reservation.Builder getReservationBuilder() {
bitField0_ |= 0x00000800;
onChanged();
return getReservationFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
public mesosphere.marathon.Protos.MarathonTask.ReservationOrBuilder getReservationOrBuilder() {
if (reservationBuilder_ != null) {
return reservationBuilder_.getMessageOrBuilder();
} else {
return reservation_;
}
}
/**
* <code>optional .mesosphere.marathon.MarathonTask.Reservation reservation = 12;</code>
*
* <pre>
* since 0.16, a list of volumes can be associated with the task ID
* </pre>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation, mesosphere.marathon.Protos.MarathonTask.Reservation.Builder, mesosphere.marathon.Protos.MarathonTask.ReservationOrBuilder>
getReservationFieldBuilder() {
if (reservationBuilder_ == null) {
reservationBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.MarathonTask.Reservation, mesosphere.marathon.Protos.MarathonTask.Reservation.Builder, mesosphere.marathon.Protos.MarathonTask.ReservationOrBuilder>(
reservation_,
getParentForChildren(),
isClean());
reservation_ = null;
}
return reservationBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.MarathonTask)
}
static {
defaultInstance = new MarathonTask(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.MarathonTask)
}
public interface MarathonAppOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional string name = 1;
/**
* <code>optional string name = 1;</code>
*/
boolean hasName();
/**
* <code>optional string name = 1;</code>
*/
java.lang.String getName();
/**
* <code>optional string name = 1;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
// repeated .mesosphere.marathon.MarathonTask tasks = 2;
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
java.util.List<mesosphere.marathon.Protos.MarathonTask>
getTasksList();
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
mesosphere.marathon.Protos.MarathonTask getTasks(int index);
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
int getTasksCount();
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
java.util.List<? extends mesosphere.marathon.Protos.MarathonTaskOrBuilder>
getTasksOrBuilderList();
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
mesosphere.marathon.Protos.MarathonTaskOrBuilder getTasksOrBuilder(
int index);
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonApp}
*/
public static final class MarathonApp extends
com.google.protobuf.GeneratedMessage
implements MarathonAppOrBuilder {
// Use MarathonApp.newBuilder() to construct.
private MarathonApp(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private MarathonApp(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final MarathonApp defaultInstance;
public static MarathonApp getDefaultInstance() {
return defaultInstance;
}
public MarathonApp getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MarathonApp(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
name_ = input.readBytes();
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
tasks_ = new java.util.ArrayList<mesosphere.marathon.Protos.MarathonTask>();
mutable_bitField0_ |= 0x00000002;
}
tasks_.add(input.readMessage(mesosphere.marathon.Protos.MarathonTask.PARSER, extensionRegistry));
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
tasks_ = java.util.Collections.unmodifiableList(tasks_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonApp_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonApp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonApp.class, mesosphere.marathon.Protos.MarathonApp.Builder.class);
}
public static com.google.protobuf.Parser<MarathonApp> PARSER =
new com.google.protobuf.AbstractParser<MarathonApp>() {
public MarathonApp parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MarathonApp(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<MarathonApp> getParserForType() {
return PARSER;
}
private int bitField0_;
// optional string name = 1;
public static final int NAME_FIELD_NUMBER = 1;
private java.lang.Object name_;
/**
* <code>optional string name = 1;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
name_ = s;
}
return s;
}
}
/**
* <code>optional string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// repeated .mesosphere.marathon.MarathonTask tasks = 2;
public static final int TASKS_FIELD_NUMBER = 2;
private java.util.List<mesosphere.marathon.Protos.MarathonTask> tasks_;
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public java.util.List<mesosphere.marathon.Protos.MarathonTask> getTasksList() {
return tasks_;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.MarathonTaskOrBuilder>
getTasksOrBuilderList() {
return tasks_;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public int getTasksCount() {
return tasks_.size();
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask getTasks(int index) {
return tasks_.get(index);
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTaskOrBuilder getTasksOrBuilder(
int index) {
return tasks_.get(index);
}
private void initFields() {
name_ = "";
tasks_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
for (int i = 0; i < getTasksCount(); i++) {
if (!getTasks(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getNameBytes());
}
for (int i = 0; i < tasks_.size(); i++) {
output.writeMessage(2, tasks_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getNameBytes());
}
for (int i = 0; i < tasks_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, tasks_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.MarathonApp parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonApp parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonApp parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.MarathonApp parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonApp parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonApp parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonApp parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.MarathonApp parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.MarathonApp parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.MarathonApp parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.MarathonApp prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.MarathonApp}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.MarathonAppOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonApp_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonApp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.MarathonApp.class, mesosphere.marathon.Protos.MarathonApp.Builder.class);
}
// Construct using mesosphere.marathon.Protos.MarathonApp.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getTasksFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
name_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
if (tasksBuilder_ == null) {
tasks_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
tasksBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_MarathonApp_descriptor;
}
public mesosphere.marathon.Protos.MarathonApp getDefaultInstanceForType() {
return mesosphere.marathon.Protos.MarathonApp.getDefaultInstance();
}
public mesosphere.marathon.Protos.MarathonApp build() {
mesosphere.marathon.Protos.MarathonApp result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.MarathonApp buildPartial() {
mesosphere.marathon.Protos.MarathonApp result = new mesosphere.marathon.Protos.MarathonApp(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.name_ = name_;
if (tasksBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
tasks_ = java.util.Collections.unmodifiableList(tasks_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.tasks_ = tasks_;
} else {
result.tasks_ = tasksBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.MarathonApp) {
return mergeFrom((mesosphere.marathon.Protos.MarathonApp)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.MarathonApp other) {
if (other == mesosphere.marathon.Protos.MarathonApp.getDefaultInstance()) return this;
if (other.hasName()) {
bitField0_ |= 0x00000001;
name_ = other.name_;
onChanged();
}
if (tasksBuilder_ == null) {
if (!other.tasks_.isEmpty()) {
if (tasks_.isEmpty()) {
tasks_ = other.tasks_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureTasksIsMutable();
tasks_.addAll(other.tasks_);
}
onChanged();
}
} else {
if (!other.tasks_.isEmpty()) {
if (tasksBuilder_.isEmpty()) {
tasksBuilder_.dispose();
tasksBuilder_ = null;
tasks_ = other.tasks_;
bitField0_ = (bitField0_ & ~0x00000002);
tasksBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getTasksFieldBuilder() : null;
} else {
tasksBuilder_.addAllMessages(other.tasks_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
for (int i = 0; i < getTasksCount(); i++) {
if (!getTasks(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.MarathonApp parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.MarathonApp) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// optional string name = 1;
private java.lang.Object name_ = "";
/**
* <code>optional string name = 1;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string name = 1;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
name_ = value;
onChanged();
return this;
}
/**
* <code>optional string name = 1;</code>
*/
public Builder clearName() {
bitField0_ = (bitField0_ & ~0x00000001);
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>optional string name = 1;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
name_ = value;
onChanged();
return this;
}
// repeated .mesosphere.marathon.MarathonTask tasks = 2;
private java.util.List<mesosphere.marathon.Protos.MarathonTask> tasks_ =
java.util.Collections.emptyList();
private void ensureTasksIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
tasks_ = new java.util.ArrayList<mesosphere.marathon.Protos.MarathonTask>(tasks_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.MarathonTask, mesosphere.marathon.Protos.MarathonTask.Builder, mesosphere.marathon.Protos.MarathonTaskOrBuilder> tasksBuilder_;
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public java.util.List<mesosphere.marathon.Protos.MarathonTask> getTasksList() {
if (tasksBuilder_ == null) {
return java.util.Collections.unmodifiableList(tasks_);
} else {
return tasksBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public int getTasksCount() {
if (tasksBuilder_ == null) {
return tasks_.size();
} else {
return tasksBuilder_.getCount();
}
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask getTasks(int index) {
if (tasksBuilder_ == null) {
return tasks_.get(index);
} else {
return tasksBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder setTasks(
int index, mesosphere.marathon.Protos.MarathonTask value) {
if (tasksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTasksIsMutable();
tasks_.set(index, value);
onChanged();
} else {
tasksBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder setTasks(
int index, mesosphere.marathon.Protos.MarathonTask.Builder builderForValue) {
if (tasksBuilder_ == null) {
ensureTasksIsMutable();
tasks_.set(index, builderForValue.build());
onChanged();
} else {
tasksBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder addTasks(mesosphere.marathon.Protos.MarathonTask value) {
if (tasksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTasksIsMutable();
tasks_.add(value);
onChanged();
} else {
tasksBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder addTasks(
int index, mesosphere.marathon.Protos.MarathonTask value) {
if (tasksBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTasksIsMutable();
tasks_.add(index, value);
onChanged();
} else {
tasksBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder addTasks(
mesosphere.marathon.Protos.MarathonTask.Builder builderForValue) {
if (tasksBuilder_ == null) {
ensureTasksIsMutable();
tasks_.add(builderForValue.build());
onChanged();
} else {
tasksBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder addTasks(
int index, mesosphere.marathon.Protos.MarathonTask.Builder builderForValue) {
if (tasksBuilder_ == null) {
ensureTasksIsMutable();
tasks_.add(index, builderForValue.build());
onChanged();
} else {
tasksBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder addAllTasks(
java.lang.Iterable<? extends mesosphere.marathon.Protos.MarathonTask> values) {
if (tasksBuilder_ == null) {
ensureTasksIsMutable();
super.addAll(values, tasks_);
onChanged();
} else {
tasksBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder clearTasks() {
if (tasksBuilder_ == null) {
tasks_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
tasksBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public Builder removeTasks(int index) {
if (tasksBuilder_ == null) {
ensureTasksIsMutable();
tasks_.remove(index);
onChanged();
} else {
tasksBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Builder getTasksBuilder(
int index) {
return getTasksFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTaskOrBuilder getTasksOrBuilder(
int index) {
if (tasksBuilder_ == null) {
return tasks_.get(index); } else {
return tasksBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.MarathonTaskOrBuilder>
getTasksOrBuilderList() {
if (tasksBuilder_ != null) {
return tasksBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(tasks_);
}
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Builder addTasksBuilder() {
return getTasksFieldBuilder().addBuilder(
mesosphere.marathon.Protos.MarathonTask.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public mesosphere.marathon.Protos.MarathonTask.Builder addTasksBuilder(
int index) {
return getTasksFieldBuilder().addBuilder(
index, mesosphere.marathon.Protos.MarathonTask.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.MarathonTask tasks = 2;</code>
*/
public java.util.List<mesosphere.marathon.Protos.MarathonTask.Builder>
getTasksBuilderList() {
return getTasksFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.MarathonTask, mesosphere.marathon.Protos.MarathonTask.Builder, mesosphere.marathon.Protos.MarathonTaskOrBuilder>
getTasksFieldBuilder() {
if (tasksBuilder_ == null) {
tasksBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.MarathonTask, mesosphere.marathon.Protos.MarathonTask.Builder, mesosphere.marathon.Protos.MarathonTaskOrBuilder>(
tasks_,
((bitField0_ & 0x00000002) == 0x00000002),
getParentForChildren(),
isClean());
tasks_ = null;
}
return tasksBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.MarathonApp)
}
static {
defaultInstance = new MarathonApp(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.MarathonApp)
}
public interface ContainerInfoOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required bytes image = 1 [default = ""];
/**
* <code>required bytes image = 1 [default = ""];</code>
*/
boolean hasImage();
/**
* <code>required bytes image = 1 [default = ""];</code>
*/
com.google.protobuf.ByteString getImage();
// repeated bytes options = 2;
/**
* <code>repeated bytes options = 2;</code>
*/
java.util.List<com.google.protobuf.ByteString> getOptionsList();
/**
* <code>repeated bytes options = 2;</code>
*/
int getOptionsCount();
/**
* <code>repeated bytes options = 2;</code>
*/
com.google.protobuf.ByteString getOptions(int index);
}
/**
* Protobuf type {@code mesosphere.marathon.ContainerInfo}
*/
public static final class ContainerInfo extends
com.google.protobuf.GeneratedMessage
implements ContainerInfoOrBuilder {
// Use ContainerInfo.newBuilder() to construct.
private ContainerInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ContainerInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ContainerInfo defaultInstance;
public static ContainerInfo getDefaultInstance() {
return defaultInstance;
}
public ContainerInfo getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ContainerInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
image_ = input.readBytes();
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
options_ = new java.util.ArrayList<com.google.protobuf.ByteString>();
mutable_bitField0_ |= 0x00000002;
}
options_.add(input.readBytes());
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
options_ = java.util.Collections.unmodifiableList(options_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ContainerInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ContainerInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ContainerInfo.class, mesosphere.marathon.Protos.ContainerInfo.Builder.class);
}
public static com.google.protobuf.Parser<ContainerInfo> PARSER =
new com.google.protobuf.AbstractParser<ContainerInfo>() {
public ContainerInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ContainerInfo(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ContainerInfo> getParserForType() {
return PARSER;
}
private int bitField0_;
// required bytes image = 1 [default = ""];
public static final int IMAGE_FIELD_NUMBER = 1;
private com.google.protobuf.ByteString image_;
/**
* <code>required bytes image = 1 [default = ""];</code>
*/
public boolean hasImage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required bytes image = 1 [default = ""];</code>
*/
public com.google.protobuf.ByteString getImage() {
return image_;
}
// repeated bytes options = 2;
public static final int OPTIONS_FIELD_NUMBER = 2;
private java.util.List<com.google.protobuf.ByteString> options_;
/**
* <code>repeated bytes options = 2;</code>
*/
public java.util.List<com.google.protobuf.ByteString>
getOptionsList() {
return options_;
}
/**
* <code>repeated bytes options = 2;</code>
*/
public int getOptionsCount() {
return options_.size();
}
/**
* <code>repeated bytes options = 2;</code>
*/
public com.google.protobuf.ByteString getOptions(int index) {
return options_.get(index);
}
private void initFields() {
image_ = com.google.protobuf.Internal.bytesDefaultValue("");
options_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasImage()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, image_);
}
for (int i = 0; i < options_.size(); i++) {
output.writeBytes(2, options_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, image_);
}
{
int dataSize = 0;
for (int i = 0; i < options_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(options_.get(i));
}
size += dataSize;
size += 1 * getOptionsList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ContainerInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ContainerInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ContainerInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ContainerInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ContainerInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ContainerInfo parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ContainerInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ContainerInfo parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ContainerInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ContainerInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ContainerInfo prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ContainerInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ContainerInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ContainerInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ContainerInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ContainerInfo.class, mesosphere.marathon.Protos.ContainerInfo.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ContainerInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
image_ = com.google.protobuf.Internal.bytesDefaultValue("");
bitField0_ = (bitField0_ & ~0x00000001);
options_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ContainerInfo_descriptor;
}
public mesosphere.marathon.Protos.ContainerInfo getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ContainerInfo.getDefaultInstance();
}
public mesosphere.marathon.Protos.ContainerInfo build() {
mesosphere.marathon.Protos.ContainerInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ContainerInfo buildPartial() {
mesosphere.marathon.Protos.ContainerInfo result = new mesosphere.marathon.Protos.ContainerInfo(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.image_ = image_;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
options_ = java.util.Collections.unmodifiableList(options_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.options_ = options_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ContainerInfo) {
return mergeFrom((mesosphere.marathon.Protos.ContainerInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ContainerInfo other) {
if (other == mesosphere.marathon.Protos.ContainerInfo.getDefaultInstance()) return this;
if (other.hasImage()) {
setImage(other.getImage());
}
if (!other.options_.isEmpty()) {
if (options_.isEmpty()) {
options_ = other.options_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureOptionsIsMutable();
options_.addAll(other.options_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasImage()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ContainerInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ContainerInfo) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required bytes image = 1 [default = ""];
private com.google.protobuf.ByteString image_ = com.google.protobuf.Internal.bytesDefaultValue("");
/**
* <code>required bytes image = 1 [default = ""];</code>
*/
public boolean hasImage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required bytes image = 1 [default = ""];</code>
*/
public com.google.protobuf.ByteString getImage() {
return image_;
}
/**
* <code>required bytes image = 1 [default = ""];</code>
*/
public Builder setImage(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
image_ = value;
onChanged();
return this;
}
/**
* <code>required bytes image = 1 [default = ""];</code>
*/
public Builder clearImage() {
bitField0_ = (bitField0_ & ~0x00000001);
image_ = getDefaultInstance().getImage();
onChanged();
return this;
}
// repeated bytes options = 2;
private java.util.List<com.google.protobuf.ByteString> options_ = java.util.Collections.emptyList();
private void ensureOptionsIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
options_ = new java.util.ArrayList<com.google.protobuf.ByteString>(options_);
bitField0_ |= 0x00000002;
}
}
/**
* <code>repeated bytes options = 2;</code>
*/
public java.util.List<com.google.protobuf.ByteString>
getOptionsList() {
return java.util.Collections.unmodifiableList(options_);
}
/**
* <code>repeated bytes options = 2;</code>
*/
public int getOptionsCount() {
return options_.size();
}
/**
* <code>repeated bytes options = 2;</code>
*/
public com.google.protobuf.ByteString getOptions(int index) {
return options_.get(index);
}
/**
* <code>repeated bytes options = 2;</code>
*/
public Builder setOptions(
int index, com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionsIsMutable();
options_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated bytes options = 2;</code>
*/
public Builder addOptions(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionsIsMutable();
options_.add(value);
onChanged();
return this;
}
/**
* <code>repeated bytes options = 2;</code>
*/
public Builder addAllOptions(
java.lang.Iterable<? extends com.google.protobuf.ByteString> values) {
ensureOptionsIsMutable();
super.addAll(values, options_);
onChanged();
return this;
}
/**
* <code>repeated bytes options = 2;</code>
*/
public Builder clearOptions() {
options_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ContainerInfo)
}
static {
defaultInstance = new ContainerInfo(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ContainerInfo)
}
public interface ExtendedContainerInfoOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required .mesos.ContainerInfo.Type type = 1;
/**
* <code>required .mesos.ContainerInfo.Type type = 1;</code>
*/
boolean hasType();
/**
* <code>required .mesos.ContainerInfo.Type type = 1;</code>
*/
org.apache.mesos.Protos.ContainerInfo.Type getType();
// repeated .mesosphere.marathon.Volume volumes = 2;
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
java.util.List<mesosphere.marathon.Protos.Volume>
getVolumesList();
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
mesosphere.marathon.Protos.Volume getVolumes(int index);
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
int getVolumesCount();
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
java.util.List<? extends mesosphere.marathon.Protos.VolumeOrBuilder>
getVolumesOrBuilderList();
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
mesosphere.marathon.Protos.VolumeOrBuilder getVolumesOrBuilder(
int index);
// optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
boolean hasDocker();
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo getDocker();
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfoOrBuilder getDockerOrBuilder();
}
/**
* Protobuf type {@code mesosphere.marathon.ExtendedContainerInfo}
*
* <pre>
* Copied from mesos.proto and adjusted to meet the needs for persistent volumes
* Extends DockerInfo.PortMapping to include `service_port`.
* </pre>
*/
public static final class ExtendedContainerInfo extends
com.google.protobuf.GeneratedMessage
implements ExtendedContainerInfoOrBuilder {
// Use ExtendedContainerInfo.newBuilder() to construct.
private ExtendedContainerInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ExtendedContainerInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ExtendedContainerInfo defaultInstance;
public static ExtendedContainerInfo getDefaultInstance() {
return defaultInstance;
}
public ExtendedContainerInfo getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ExtendedContainerInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
int rawValue = input.readEnum();
org.apache.mesos.Protos.ContainerInfo.Type value = org.apache.mesos.Protos.ContainerInfo.Type.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(1, rawValue);
} else {
bitField0_ |= 0x00000001;
type_ = value;
}
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
volumes_ = new java.util.ArrayList<mesosphere.marathon.Protos.Volume>();
mutable_bitField0_ |= 0x00000002;
}
volumes_.add(input.readMessage(mesosphere.marathon.Protos.Volume.PARSER, extensionRegistry));
break;
}
case 26: {
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
subBuilder = docker_.toBuilder();
}
docker_ = input.readMessage(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(docker_);
docker_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000002;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
volumes_ = java.util.Collections.unmodifiableList(volumes_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ExtendedContainerInfo.class, mesosphere.marathon.Protos.ExtendedContainerInfo.Builder.class);
}
public static com.google.protobuf.Parser<ExtendedContainerInfo> PARSER =
new com.google.protobuf.AbstractParser<ExtendedContainerInfo>() {
public ExtendedContainerInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ExtendedContainerInfo(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ExtendedContainerInfo> getParserForType() {
return PARSER;
}
public interface DockerInfoOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string image = 1;
/**
* <code>required string image = 1;</code>
*/
boolean hasImage();
/**
* <code>required string image = 1;</code>
*/
java.lang.String getImage();
/**
* <code>required string image = 1;</code>
*/
com.google.protobuf.ByteString
getImageBytes();
// optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];
/**
* <code>optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];</code>
*/
boolean hasNetwork();
/**
* <code>optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];</code>
*/
org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network getNetwork();
// repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
java.util.List<mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping>
getPortMappingsList();
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping getPortMappings(int index);
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
int getPortMappingsCount();
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
java.util.List<? extends mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder>
getPortMappingsOrBuilderList();
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder getPortMappingsOrBuilder(
int index);
// optional bool privileged = 4 [default = false];
/**
* <code>optional bool privileged = 4 [default = false];</code>
*/
boolean hasPrivileged();
/**
* <code>optional bool privileged = 4 [default = false];</code>
*/
boolean getPrivileged();
// repeated .mesos.Parameter parameters = 5;
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
java.util.List<org.apache.mesos.Protos.Parameter>
getParametersList();
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
org.apache.mesos.Protos.Parameter getParameters(int index);
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
int getParametersCount();
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
java.util.List<? extends org.apache.mesos.Protos.ParameterOrBuilder>
getParametersOrBuilderList();
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
org.apache.mesos.Protos.ParameterOrBuilder getParametersOrBuilder(
int index);
// optional bool force_pull_image = 6;
/**
* <code>optional bool force_pull_image = 6;</code>
*
* <pre>
* With this flag set to true, the docker containerizer will
* pull the docker image from the registry even if the image
* is already downloaded on the slave.
* </pre>
*/
boolean hasForcePullImage();
/**
* <code>optional bool force_pull_image = 6;</code>
*
* <pre>
* With this flag set to true, the docker containerizer will
* pull the docker image from the registry even if the image
* is already downloaded on the slave.
* </pre>
*/
boolean getForcePullImage();
}
/**
* Protobuf type {@code mesosphere.marathon.ExtendedContainerInfo.DockerInfo}
*/
public static final class DockerInfo extends
com.google.protobuf.GeneratedMessage
implements DockerInfoOrBuilder {
// Use DockerInfo.newBuilder() to construct.
private DockerInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private DockerInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final DockerInfo defaultInstance;
public static DockerInfo getDefaultInstance() {
return defaultInstance;
}
public DockerInfo getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DockerInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
image_ = input.readBytes();
break;
}
case 16: {
int rawValue = input.readEnum();
org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network value = org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(2, rawValue);
} else {
bitField0_ |= 0x00000002;
network_ = value;
}
break;
}
case 26: {
if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
portMappings_ = new java.util.ArrayList<mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping>();
mutable_bitField0_ |= 0x00000004;
}
portMappings_.add(input.readMessage(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.PARSER, extensionRegistry));
break;
}
case 32: {
bitField0_ |= 0x00000004;
privileged_ = input.readBool();
break;
}
case 42: {
if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
parameters_ = new java.util.ArrayList<org.apache.mesos.Protos.Parameter>();
mutable_bitField0_ |= 0x00000010;
}
parameters_.add(input.readMessage(org.apache.mesos.Protos.Parameter.PARSER, extensionRegistry));
break;
}
case 48: {
bitField0_ |= 0x00000008;
forcePullImage_ = input.readBool();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
portMappings_ = java.util.Collections.unmodifiableList(portMappings_);
}
if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
parameters_ = java.util.Collections.unmodifiableList(parameters_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.class, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.Builder.class);
}
public static com.google.protobuf.Parser<DockerInfo> PARSER =
new com.google.protobuf.AbstractParser<DockerInfo>() {
public DockerInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DockerInfo(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<DockerInfo> getParserForType() {
return PARSER;
}
public interface PortMappingOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required uint32 host_port = 1;
/**
* <code>required uint32 host_port = 1;</code>
*/
boolean hasHostPort();
/**
* <code>required uint32 host_port = 1;</code>
*/
int getHostPort();
// required uint32 container_port = 2;
/**
* <code>required uint32 container_port = 2;</code>
*/
boolean hasContainerPort();
/**
* <code>required uint32 container_port = 2;</code>
*/
int getContainerPort();
// optional string protocol = 3;
/**
* <code>optional string protocol = 3;</code>
*/
boolean hasProtocol();
/**
* <code>optional string protocol = 3;</code>
*/
java.lang.String getProtocol();
/**
* <code>optional string protocol = 3;</code>
*/
com.google.protobuf.ByteString
getProtocolBytes();
// optional string name = 4;
/**
* <code>optional string name = 4;</code>
*/
boolean hasName();
/**
* <code>optional string name = 4;</code>
*/
java.lang.String getName();
/**
* <code>optional string name = 4;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
// repeated .mesos.Label labels = 5;
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
java.util.List<org.apache.mesos.Protos.Label>
getLabelsList();
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
org.apache.mesos.Protos.Label getLabels(int index);
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
int getLabelsCount();
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getLabelsOrBuilderList();
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
org.apache.mesos.Protos.LabelOrBuilder getLabelsOrBuilder(
int index);
// optional uint32 service_port = 100 [default = 0];
/**
* <code>optional uint32 service_port = 100 [default = 0];</code>
*/
boolean hasServicePort();
/**
* <code>optional uint32 service_port = 100 [default = 0];</code>
*/
int getServicePort();
}
/**
* Protobuf type {@code mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping}
*/
public static final class PortMapping extends
com.google.protobuf.GeneratedMessage
implements PortMappingOrBuilder {
// Use PortMapping.newBuilder() to construct.
private PortMapping(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private PortMapping(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final PortMapping defaultInstance;
public static PortMapping getDefaultInstance() {
return defaultInstance;
}
public PortMapping getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private PortMapping(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
hostPort_ = input.readUInt32();
break;
}
case 16: {
bitField0_ |= 0x00000002;
containerPort_ = input.readUInt32();
break;
}
case 26: {
bitField0_ |= 0x00000004;
protocol_ = input.readBytes();
break;
}
case 34: {
bitField0_ |= 0x00000008;
name_ = input.readBytes();
break;
}
case 42: {
if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
labels_ = new java.util.ArrayList<org.apache.mesos.Protos.Label>();
mutable_bitField0_ |= 0x00000010;
}
labels_.add(input.readMessage(org.apache.mesos.Protos.Label.PARSER, extensionRegistry));
break;
}
case 800: {
bitField0_ |= 0x00000010;
servicePort_ = input.readUInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.class, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder.class);
}
public static com.google.protobuf.Parser<PortMapping> PARSER =
new com.google.protobuf.AbstractParser<PortMapping>() {
public PortMapping parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new PortMapping(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<PortMapping> getParserForType() {
return PARSER;
}
private int bitField0_;
// required uint32 host_port = 1;
public static final int HOST_PORT_FIELD_NUMBER = 1;
private int hostPort_;
/**
* <code>required uint32 host_port = 1;</code>
*/
public boolean hasHostPort() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint32 host_port = 1;</code>
*/
public int getHostPort() {
return hostPort_;
}
// required uint32 container_port = 2;
public static final int CONTAINER_PORT_FIELD_NUMBER = 2;
private int containerPort_;
/**
* <code>required uint32 container_port = 2;</code>
*/
public boolean hasContainerPort() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required uint32 container_port = 2;</code>
*/
public int getContainerPort() {
return containerPort_;
}
// optional string protocol = 3;
public static final int PROTOCOL_FIELD_NUMBER = 3;
private java.lang.Object protocol_;
/**
* <code>optional string protocol = 3;</code>
*/
public boolean hasProtocol() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string protocol = 3;</code>
*/
public java.lang.String getProtocol() {
java.lang.Object ref = protocol_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
protocol_ = s;
}
return s;
}
}
/**
* <code>optional string protocol = 3;</code>
*/
public com.google.protobuf.ByteString
getProtocolBytes() {
java.lang.Object ref = protocol_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
protocol_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional string name = 4;
public static final int NAME_FIELD_NUMBER = 4;
private java.lang.Object name_;
/**
* <code>optional string name = 4;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string name = 4;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
name_ = s;
}
return s;
}
}
/**
* <code>optional string name = 4;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// repeated .mesos.Label labels = 5;
public static final int LABELS_FIELD_NUMBER = 5;
private java.util.List<org.apache.mesos.Protos.Label> labels_;
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label> getLabelsList() {
return labels_;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getLabelsOrBuilderList() {
return labels_;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public int getLabelsCount() {
return labels_.size();
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public org.apache.mesos.Protos.Label getLabels(int index) {
return labels_.get(index);
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public org.apache.mesos.Protos.LabelOrBuilder getLabelsOrBuilder(
int index) {
return labels_.get(index);
}
// optional uint32 service_port = 100 [default = 0];
public static final int SERVICE_PORT_FIELD_NUMBER = 100;
private int servicePort_;
/**
* <code>optional uint32 service_port = 100 [default = 0];</code>
*/
public boolean hasServicePort() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional uint32 service_port = 100 [default = 0];</code>
*/
public int getServicePort() {
return servicePort_;
}
private void initFields() {
hostPort_ = 0;
containerPort_ = 0;
protocol_ = "";
name_ = "";
labels_ = java.util.Collections.emptyList();
servicePort_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasHostPort()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasContainerPort()) {
memoizedIsInitialized = 0;
return false;
}
for (int i = 0; i < getLabelsCount(); i++) {
if (!getLabels(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt32(1, hostPort_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeUInt32(2, containerPort_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, getProtocolBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(4, getNameBytes());
}
for (int i = 0; i < labels_.size(); i++) {
output.writeMessage(5, labels_.get(i));
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeUInt32(100, servicePort_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, hostPort_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, containerPort_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, getProtocolBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, getNameBytes());
}
for (int i = 0; i < labels_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, labels_.get(i));
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(100, servicePort_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.class, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getLabelsFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
hostPort_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
containerPort_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
protocol_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
name_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
} else {
labelsBuilder_.clear();
}
servicePort_ = 0;
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_descriptor;
}
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.getDefaultInstance();
}
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping build() {
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping buildPartial() {
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping result = new mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.hostPort_ = hostPort_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.containerPort_ = containerPort_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.protocol_ = protocol_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.name_ = name_;
if (labelsBuilder_ == null) {
if (((bitField0_ & 0x00000010) == 0x00000010)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
bitField0_ = (bitField0_ & ~0x00000010);
}
result.labels_ = labels_;
} else {
result.labels_ = labelsBuilder_.build();
}
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000010;
}
result.servicePort_ = servicePort_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping) {
return mergeFrom((mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping other) {
if (other == mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.getDefaultInstance()) return this;
if (other.hasHostPort()) {
setHostPort(other.getHostPort());
}
if (other.hasContainerPort()) {
setContainerPort(other.getContainerPort());
}
if (other.hasProtocol()) {
bitField0_ |= 0x00000004;
protocol_ = other.protocol_;
onChanged();
}
if (other.hasName()) {
bitField0_ |= 0x00000008;
name_ = other.name_;
onChanged();
}
if (labelsBuilder_ == null) {
if (!other.labels_.isEmpty()) {
if (labels_.isEmpty()) {
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureLabelsIsMutable();
labels_.addAll(other.labels_);
}
onChanged();
}
} else {
if (!other.labels_.isEmpty()) {
if (labelsBuilder_.isEmpty()) {
labelsBuilder_.dispose();
labelsBuilder_ = null;
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00000010);
labelsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getLabelsFieldBuilder() : null;
} else {
labelsBuilder_.addAllMessages(other.labels_);
}
}
}
if (other.hasServicePort()) {
setServicePort(other.getServicePort());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasHostPort()) {
return false;
}
if (!hasContainerPort()) {
return false;
}
for (int i = 0; i < getLabelsCount(); i++) {
if (!getLabels(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required uint32 host_port = 1;
private int hostPort_ ;
/**
* <code>required uint32 host_port = 1;</code>
*/
public boolean hasHostPort() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint32 host_port = 1;</code>
*/
public int getHostPort() {
return hostPort_;
}
/**
* <code>required uint32 host_port = 1;</code>
*/
public Builder setHostPort(int value) {
bitField0_ |= 0x00000001;
hostPort_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 host_port = 1;</code>
*/
public Builder clearHostPort() {
bitField0_ = (bitField0_ & ~0x00000001);
hostPort_ = 0;
onChanged();
return this;
}
// required uint32 container_port = 2;
private int containerPort_ ;
/**
* <code>required uint32 container_port = 2;</code>
*/
public boolean hasContainerPort() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required uint32 container_port = 2;</code>
*/
public int getContainerPort() {
return containerPort_;
}
/**
* <code>required uint32 container_port = 2;</code>
*/
public Builder setContainerPort(int value) {
bitField0_ |= 0x00000002;
containerPort_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 container_port = 2;</code>
*/
public Builder clearContainerPort() {
bitField0_ = (bitField0_ & ~0x00000002);
containerPort_ = 0;
onChanged();
return this;
}
// optional string protocol = 3;
private java.lang.Object protocol_ = "";
/**
* <code>optional string protocol = 3;</code>
*/
public boolean hasProtocol() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string protocol = 3;</code>
*/
public java.lang.String getProtocol() {
java.lang.Object ref = protocol_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
protocol_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string protocol = 3;</code>
*/
public com.google.protobuf.ByteString
getProtocolBytes() {
java.lang.Object ref = protocol_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
protocol_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string protocol = 3;</code>
*/
public Builder setProtocol(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
protocol_ = value;
onChanged();
return this;
}
/**
* <code>optional string protocol = 3;</code>
*/
public Builder clearProtocol() {
bitField0_ = (bitField0_ & ~0x00000004);
protocol_ = getDefaultInstance().getProtocol();
onChanged();
return this;
}
/**
* <code>optional string protocol = 3;</code>
*/
public Builder setProtocolBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
protocol_ = value;
onChanged();
return this;
}
// optional string name = 4;
private java.lang.Object name_ = "";
/**
* <code>optional string name = 4;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string name = 4;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string name = 4;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string name = 4;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
name_ = value;
onChanged();
return this;
}
/**
* <code>optional string name = 4;</code>
*/
public Builder clearName() {
bitField0_ = (bitField0_ & ~0x00000008);
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>optional string name = 4;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
name_ = value;
onChanged();
return this;
}
// repeated .mesos.Label labels = 5;
private java.util.List<org.apache.mesos.Protos.Label> labels_ =
java.util.Collections.emptyList();
private void ensureLabelsIsMutable() {
if (!((bitField0_ & 0x00000010) == 0x00000010)) {
labels_ = new java.util.ArrayList<org.apache.mesos.Protos.Label>(labels_);
bitField0_ |= 0x00000010;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder> labelsBuilder_;
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label> getLabelsList() {
if (labelsBuilder_ == null) {
return java.util.Collections.unmodifiableList(labels_);
} else {
return labelsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public int getLabelsCount() {
if (labelsBuilder_ == null) {
return labels_.size();
} else {
return labelsBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public org.apache.mesos.Protos.Label getLabels(int index) {
if (labelsBuilder_ == null) {
return labels_.get(index);
} else {
return labelsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder setLabels(
int index, org.apache.mesos.Protos.Label value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.set(index, value);
onChanged();
} else {
labelsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder setLabels(
int index, org.apache.mesos.Protos.Label.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.set(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder addLabels(org.apache.mesos.Protos.Label value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(value);
onChanged();
} else {
labelsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder addLabels(
int index, org.apache.mesos.Protos.Label value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(index, value);
onChanged();
} else {
labelsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder addLabels(
org.apache.mesos.Protos.Label.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder addLabels(
int index, org.apache.mesos.Protos.Label.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder addAllLabels(
java.lang.Iterable<? extends org.apache.mesos.Protos.Label> values) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
super.addAll(values, labels_);
onChanged();
} else {
labelsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder clearLabels() {
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
} else {
labelsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public Builder removeLabels(int index) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.remove(index);
onChanged();
} else {
labelsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public org.apache.mesos.Protos.Label.Builder getLabelsBuilder(
int index) {
return getLabelsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public org.apache.mesos.Protos.LabelOrBuilder getLabelsOrBuilder(
int index) {
if (labelsBuilder_ == null) {
return labels_.get(index); } else {
return labelsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getLabelsOrBuilderList() {
if (labelsBuilder_ != null) {
return labelsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(labels_);
}
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public org.apache.mesos.Protos.Label.Builder addLabelsBuilder() {
return getLabelsFieldBuilder().addBuilder(
org.apache.mesos.Protos.Label.getDefaultInstance());
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public org.apache.mesos.Protos.Label.Builder addLabelsBuilder(
int index) {
return getLabelsFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Label.getDefaultInstance());
}
/**
* <code>repeated .mesos.Label labels = 5;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label.Builder>
getLabelsBuilderList() {
return getLabelsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder>
getLabelsFieldBuilder() {
if (labelsBuilder_ == null) {
labelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder>(
labels_,
((bitField0_ & 0x00000010) == 0x00000010),
getParentForChildren(),
isClean());
labels_ = null;
}
return labelsBuilder_;
}
// optional uint32 service_port = 100 [default = 0];
private int servicePort_ ;
/**
* <code>optional uint32 service_port = 100 [default = 0];</code>
*/
public boolean hasServicePort() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional uint32 service_port = 100 [default = 0];</code>
*/
public int getServicePort() {
return servicePort_;
}
/**
* <code>optional uint32 service_port = 100 [default = 0];</code>
*/
public Builder setServicePort(int value) {
bitField0_ |= 0x00000020;
servicePort_ = value;
onChanged();
return this;
}
/**
* <code>optional uint32 service_port = 100 [default = 0];</code>
*/
public Builder clearServicePort() {
bitField0_ = (bitField0_ & ~0x00000020);
servicePort_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping)
}
static {
defaultInstance = new PortMapping(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping)
}
private int bitField0_;
// required string image = 1;
public static final int IMAGE_FIELD_NUMBER = 1;
private java.lang.Object image_;
/**
* <code>required string image = 1;</code>
*/
public boolean hasImage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string image = 1;</code>
*/
public java.lang.String getImage() {
java.lang.Object ref = image_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
image_ = s;
}
return s;
}
}
/**
* <code>required string image = 1;</code>
*/
public com.google.protobuf.ByteString
getImageBytes() {
java.lang.Object ref = image_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
image_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];
public static final int NETWORK_FIELD_NUMBER = 2;
private org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network network_;
/**
* <code>optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];</code>
*/
public boolean hasNetwork() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];</code>
*/
public org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network getNetwork() {
return network_;
}
// repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;
public static final int PORT_MAPPINGS_FIELD_NUMBER = 3;
private java.util.List<mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping> portMappings_;
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping> getPortMappingsList() {
return portMappings_;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder>
getPortMappingsOrBuilderList() {
return portMappings_;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public int getPortMappingsCount() {
return portMappings_.size();
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping getPortMappings(int index) {
return portMappings_.get(index);
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder getPortMappingsOrBuilder(
int index) {
return portMappings_.get(index);
}
// optional bool privileged = 4 [default = false];
public static final int PRIVILEGED_FIELD_NUMBER = 4;
private boolean privileged_;
/**
* <code>optional bool privileged = 4 [default = false];</code>
*/
public boolean hasPrivileged() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional bool privileged = 4 [default = false];</code>
*/
public boolean getPrivileged() {
return privileged_;
}
// repeated .mesos.Parameter parameters = 5;
public static final int PARAMETERS_FIELD_NUMBER = 5;
private java.util.List<org.apache.mesos.Protos.Parameter> parameters_;
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public java.util.List<org.apache.mesos.Protos.Parameter> getParametersList() {
return parameters_;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public java.util.List<? extends org.apache.mesos.Protos.ParameterOrBuilder>
getParametersOrBuilderList() {
return parameters_;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public int getParametersCount() {
return parameters_.size();
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public org.apache.mesos.Protos.Parameter getParameters(int index) {
return parameters_.get(index);
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public org.apache.mesos.Protos.ParameterOrBuilder getParametersOrBuilder(
int index) {
return parameters_.get(index);
}
// optional bool force_pull_image = 6;
public static final int FORCE_PULL_IMAGE_FIELD_NUMBER = 6;
private boolean forcePullImage_;
/**
* <code>optional bool force_pull_image = 6;</code>
*
* <pre>
* With this flag set to true, the docker containerizer will
* pull the docker image from the registry even if the image
* is already downloaded on the slave.
* </pre>
*/
public boolean hasForcePullImage() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional bool force_pull_image = 6;</code>
*
* <pre>
* With this flag set to true, the docker containerizer will
* pull the docker image from the registry even if the image
* is already downloaded on the slave.
* </pre>
*/
public boolean getForcePullImage() {
return forcePullImage_;
}
private void initFields() {
image_ = "";
network_ = org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network.HOST;
portMappings_ = java.util.Collections.emptyList();
privileged_ = false;
parameters_ = java.util.Collections.emptyList();
forcePullImage_ = false;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasImage()) {
memoizedIsInitialized = 0;
return false;
}
for (int i = 0; i < getPortMappingsCount(); i++) {
if (!getPortMappings(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getParametersCount(); i++) {
if (!getParameters(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getImageBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeEnum(2, network_.getNumber());
}
for (int i = 0; i < portMappings_.size(); i++) {
output.writeMessage(3, portMappings_.get(i));
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBool(4, privileged_);
}
for (int i = 0; i < parameters_.size(); i++) {
output.writeMessage(5, parameters_.get(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBool(6, forcePullImage_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getImageBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, network_.getNumber());
}
for (int i = 0; i < portMappings_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, portMappings_.get(i));
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(4, privileged_);
}
for (int i = 0; i < parameters_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, parameters_.get(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(6, forcePullImage_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ExtendedContainerInfo.DockerInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.class, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getPortMappingsFieldBuilder();
getParametersFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
image_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
network_ = org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network.HOST;
bitField0_ = (bitField0_ & ~0x00000002);
if (portMappingsBuilder_ == null) {
portMappings_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
} else {
portMappingsBuilder_.clear();
}
privileged_ = false;
bitField0_ = (bitField0_ & ~0x00000008);
if (parametersBuilder_ == null) {
parameters_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
} else {
parametersBuilder_.clear();
}
forcePullImage_ = false;
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_descriptor;
}
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.getDefaultInstance();
}
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo build() {
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo buildPartial() {
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo result = new mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.image_ = image_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.network_ = network_;
if (portMappingsBuilder_ == null) {
if (((bitField0_ & 0x00000004) == 0x00000004)) {
portMappings_ = java.util.Collections.unmodifiableList(portMappings_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.portMappings_ = portMappings_;
} else {
result.portMappings_ = portMappingsBuilder_.build();
}
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000004;
}
result.privileged_ = privileged_;
if (parametersBuilder_ == null) {
if (((bitField0_ & 0x00000010) == 0x00000010)) {
parameters_ = java.util.Collections.unmodifiableList(parameters_);
bitField0_ = (bitField0_ & ~0x00000010);
}
result.parameters_ = parameters_;
} else {
result.parameters_ = parametersBuilder_.build();
}
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000008;
}
result.forcePullImage_ = forcePullImage_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo) {
return mergeFrom((mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo other) {
if (other == mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.getDefaultInstance()) return this;
if (other.hasImage()) {
bitField0_ |= 0x00000001;
image_ = other.image_;
onChanged();
}
if (other.hasNetwork()) {
setNetwork(other.getNetwork());
}
if (portMappingsBuilder_ == null) {
if (!other.portMappings_.isEmpty()) {
if (portMappings_.isEmpty()) {
portMappings_ = other.portMappings_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensurePortMappingsIsMutable();
portMappings_.addAll(other.portMappings_);
}
onChanged();
}
} else {
if (!other.portMappings_.isEmpty()) {
if (portMappingsBuilder_.isEmpty()) {
portMappingsBuilder_.dispose();
portMappingsBuilder_ = null;
portMappings_ = other.portMappings_;
bitField0_ = (bitField0_ & ~0x00000004);
portMappingsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getPortMappingsFieldBuilder() : null;
} else {
portMappingsBuilder_.addAllMessages(other.portMappings_);
}
}
}
if (other.hasPrivileged()) {
setPrivileged(other.getPrivileged());
}
if (parametersBuilder_ == null) {
if (!other.parameters_.isEmpty()) {
if (parameters_.isEmpty()) {
parameters_ = other.parameters_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureParametersIsMutable();
parameters_.addAll(other.parameters_);
}
onChanged();
}
} else {
if (!other.parameters_.isEmpty()) {
if (parametersBuilder_.isEmpty()) {
parametersBuilder_.dispose();
parametersBuilder_ = null;
parameters_ = other.parameters_;
bitField0_ = (bitField0_ & ~0x00000010);
parametersBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getParametersFieldBuilder() : null;
} else {
parametersBuilder_.addAllMessages(other.parameters_);
}
}
}
if (other.hasForcePullImage()) {
setForcePullImage(other.getForcePullImage());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasImage()) {
return false;
}
for (int i = 0; i < getPortMappingsCount(); i++) {
if (!getPortMappings(i).isInitialized()) {
return false;
}
}
for (int i = 0; i < getParametersCount(); i++) {
if (!getParameters(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string image = 1;
private java.lang.Object image_ = "";
/**
* <code>required string image = 1;</code>
*/
public boolean hasImage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string image = 1;</code>
*/
public java.lang.String getImage() {
java.lang.Object ref = image_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
image_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string image = 1;</code>
*/
public com.google.protobuf.ByteString
getImageBytes() {
java.lang.Object ref = image_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
image_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string image = 1;</code>
*/
public Builder setImage(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
image_ = value;
onChanged();
return this;
}
/**
* <code>required string image = 1;</code>
*/
public Builder clearImage() {
bitField0_ = (bitField0_ & ~0x00000001);
image_ = getDefaultInstance().getImage();
onChanged();
return this;
}
/**
* <code>required string image = 1;</code>
*/
public Builder setImageBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
image_ = value;
onChanged();
return this;
}
// optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];
private org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network network_ = org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network.HOST;
/**
* <code>optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];</code>
*/
public boolean hasNetwork() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];</code>
*/
public org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network getNetwork() {
return network_;
}
/**
* <code>optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];</code>
*/
public Builder setNetwork(org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
network_ = value;
onChanged();
return this;
}
/**
* <code>optional .mesos.ContainerInfo.DockerInfo.Network network = 2 [default = HOST];</code>
*/
public Builder clearNetwork() {
bitField0_ = (bitField0_ & ~0x00000002);
network_ = org.apache.mesos.Protos.ContainerInfo.DockerInfo.Network.HOST;
onChanged();
return this;
}
// repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;
private java.util.List<mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping> portMappings_ =
java.util.Collections.emptyList();
private void ensurePortMappingsIsMutable() {
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
portMappings_ = new java.util.ArrayList<mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping>(portMappings_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder> portMappingsBuilder_;
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping> getPortMappingsList() {
if (portMappingsBuilder_ == null) {
return java.util.Collections.unmodifiableList(portMappings_);
} else {
return portMappingsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public int getPortMappingsCount() {
if (portMappingsBuilder_ == null) {
return portMappings_.size();
} else {
return portMappingsBuilder_.getCount();
}
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping getPortMappings(int index) {
if (portMappingsBuilder_ == null) {
return portMappings_.get(index);
} else {
return portMappingsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder setPortMappings(
int index, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping value) {
if (portMappingsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortMappingsIsMutable();
portMappings_.set(index, value);
onChanged();
} else {
portMappingsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder setPortMappings(
int index, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder builderForValue) {
if (portMappingsBuilder_ == null) {
ensurePortMappingsIsMutable();
portMappings_.set(index, builderForValue.build());
onChanged();
} else {
portMappingsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder addPortMappings(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping value) {
if (portMappingsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortMappingsIsMutable();
portMappings_.add(value);
onChanged();
} else {
portMappingsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder addPortMappings(
int index, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping value) {
if (portMappingsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePortMappingsIsMutable();
portMappings_.add(index, value);
onChanged();
} else {
portMappingsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder addPortMappings(
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder builderForValue) {
if (portMappingsBuilder_ == null) {
ensurePortMappingsIsMutable();
portMappings_.add(builderForValue.build());
onChanged();
} else {
portMappingsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder addPortMappings(
int index, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder builderForValue) {
if (portMappingsBuilder_ == null) {
ensurePortMappingsIsMutable();
portMappings_.add(index, builderForValue.build());
onChanged();
} else {
portMappingsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder addAllPortMappings(
java.lang.Iterable<? extends mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping> values) {
if (portMappingsBuilder_ == null) {
ensurePortMappingsIsMutable();
super.addAll(values, portMappings_);
onChanged();
} else {
portMappingsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder clearPortMappings() {
if (portMappingsBuilder_ == null) {
portMappings_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
portMappingsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public Builder removePortMappings(int index) {
if (portMappingsBuilder_ == null) {
ensurePortMappingsIsMutable();
portMappings_.remove(index);
onChanged();
} else {
portMappingsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder getPortMappingsBuilder(
int index) {
return getPortMappingsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder getPortMappingsOrBuilder(
int index) {
if (portMappingsBuilder_ == null) {
return portMappings_.get(index); } else {
return portMappingsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder>
getPortMappingsOrBuilderList() {
if (portMappingsBuilder_ != null) {
return portMappingsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(portMappings_);
}
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder addPortMappingsBuilder() {
return getPortMappingsFieldBuilder().addBuilder(
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder addPortMappingsBuilder(
int index) {
return getPortMappingsFieldBuilder().addBuilder(
index, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.ExtendedContainerInfo.DockerInfo.PortMapping port_mappings = 3;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder>
getPortMappingsBuilderList() {
return getPortMappingsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder>
getPortMappingsFieldBuilder() {
if (portMappingsBuilder_ == null) {
portMappingsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMapping.Builder, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.PortMappingOrBuilder>(
portMappings_,
((bitField0_ & 0x00000004) == 0x00000004),
getParentForChildren(),
isClean());
portMappings_ = null;
}
return portMappingsBuilder_;
}
// optional bool privileged = 4 [default = false];
private boolean privileged_ ;
/**
* <code>optional bool privileged = 4 [default = false];</code>
*/
public boolean hasPrivileged() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional bool privileged = 4 [default = false];</code>
*/
public boolean getPrivileged() {
return privileged_;
}
/**
* <code>optional bool privileged = 4 [default = false];</code>
*/
public Builder setPrivileged(boolean value) {
bitField0_ |= 0x00000008;
privileged_ = value;
onChanged();
return this;
}
/**
* <code>optional bool privileged = 4 [default = false];</code>
*/
public Builder clearPrivileged() {
bitField0_ = (bitField0_ & ~0x00000008);
privileged_ = false;
onChanged();
return this;
}
// repeated .mesos.Parameter parameters = 5;
private java.util.List<org.apache.mesos.Protos.Parameter> parameters_ =
java.util.Collections.emptyList();
private void ensureParametersIsMutable() {
if (!((bitField0_ & 0x00000010) == 0x00000010)) {
parameters_ = new java.util.ArrayList<org.apache.mesos.Protos.Parameter>(parameters_);
bitField0_ |= 0x00000010;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Parameter, org.apache.mesos.Protos.Parameter.Builder, org.apache.mesos.Protos.ParameterOrBuilder> parametersBuilder_;
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public java.util.List<org.apache.mesos.Protos.Parameter> getParametersList() {
if (parametersBuilder_ == null) {
return java.util.Collections.unmodifiableList(parameters_);
} else {
return parametersBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public int getParametersCount() {
if (parametersBuilder_ == null) {
return parameters_.size();
} else {
return parametersBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public org.apache.mesos.Protos.Parameter getParameters(int index) {
if (parametersBuilder_ == null) {
return parameters_.get(index);
} else {
return parametersBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder setParameters(
int index, org.apache.mesos.Protos.Parameter value) {
if (parametersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureParametersIsMutable();
parameters_.set(index, value);
onChanged();
} else {
parametersBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder setParameters(
int index, org.apache.mesos.Protos.Parameter.Builder builderForValue) {
if (parametersBuilder_ == null) {
ensureParametersIsMutable();
parameters_.set(index, builderForValue.build());
onChanged();
} else {
parametersBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder addParameters(org.apache.mesos.Protos.Parameter value) {
if (parametersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureParametersIsMutable();
parameters_.add(value);
onChanged();
} else {
parametersBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder addParameters(
int index, org.apache.mesos.Protos.Parameter value) {
if (parametersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureParametersIsMutable();
parameters_.add(index, value);
onChanged();
} else {
parametersBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder addParameters(
org.apache.mesos.Protos.Parameter.Builder builderForValue) {
if (parametersBuilder_ == null) {
ensureParametersIsMutable();
parameters_.add(builderForValue.build());
onChanged();
} else {
parametersBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder addParameters(
int index, org.apache.mesos.Protos.Parameter.Builder builderForValue) {
if (parametersBuilder_ == null) {
ensureParametersIsMutable();
parameters_.add(index, builderForValue.build());
onChanged();
} else {
parametersBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder addAllParameters(
java.lang.Iterable<? extends org.apache.mesos.Protos.Parameter> values) {
if (parametersBuilder_ == null) {
ensureParametersIsMutable();
super.addAll(values, parameters_);
onChanged();
} else {
parametersBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder clearParameters() {
if (parametersBuilder_ == null) {
parameters_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
} else {
parametersBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public Builder removeParameters(int index) {
if (parametersBuilder_ == null) {
ensureParametersIsMutable();
parameters_.remove(index);
onChanged();
} else {
parametersBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public org.apache.mesos.Protos.Parameter.Builder getParametersBuilder(
int index) {
return getParametersFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public org.apache.mesos.Protos.ParameterOrBuilder getParametersOrBuilder(
int index) {
if (parametersBuilder_ == null) {
return parameters_.get(index); } else {
return parametersBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public java.util.List<? extends org.apache.mesos.Protos.ParameterOrBuilder>
getParametersOrBuilderList() {
if (parametersBuilder_ != null) {
return parametersBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(parameters_);
}
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public org.apache.mesos.Protos.Parameter.Builder addParametersBuilder() {
return getParametersFieldBuilder().addBuilder(
org.apache.mesos.Protos.Parameter.getDefaultInstance());
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public org.apache.mesos.Protos.Parameter.Builder addParametersBuilder(
int index) {
return getParametersFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Parameter.getDefaultInstance());
}
/**
* <code>repeated .mesos.Parameter parameters = 5;</code>
*
* <pre>
* Allowing arbitrary parameters to be passed to docker CLI.
* Note that anything passed to this field is not guaranteed
* to be supported moving forward, as we might move away from
* the docker CLI.
* </pre>
*/
public java.util.List<org.apache.mesos.Protos.Parameter.Builder>
getParametersBuilderList() {
return getParametersFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Parameter, org.apache.mesos.Protos.Parameter.Builder, org.apache.mesos.Protos.ParameterOrBuilder>
getParametersFieldBuilder() {
if (parametersBuilder_ == null) {
parametersBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Parameter, org.apache.mesos.Protos.Parameter.Builder, org.apache.mesos.Protos.ParameterOrBuilder>(
parameters_,
((bitField0_ & 0x00000010) == 0x00000010),
getParentForChildren(),
isClean());
parameters_ = null;
}
return parametersBuilder_;
}
// optional bool force_pull_image = 6;
private boolean forcePullImage_ ;
/**
* <code>optional bool force_pull_image = 6;</code>
*
* <pre>
* With this flag set to true, the docker containerizer will
* pull the docker image from the registry even if the image
* is already downloaded on the slave.
* </pre>
*/
public boolean hasForcePullImage() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional bool force_pull_image = 6;</code>
*
* <pre>
* With this flag set to true, the docker containerizer will
* pull the docker image from the registry even if the image
* is already downloaded on the slave.
* </pre>
*/
public boolean getForcePullImage() {
return forcePullImage_;
}
/**
* <code>optional bool force_pull_image = 6;</code>
*
* <pre>
* With this flag set to true, the docker containerizer will
* pull the docker image from the registry even if the image
* is already downloaded on the slave.
* </pre>
*/
public Builder setForcePullImage(boolean value) {
bitField0_ |= 0x00000020;
forcePullImage_ = value;
onChanged();
return this;
}
/**
* <code>optional bool force_pull_image = 6;</code>
*
* <pre>
* With this flag set to true, the docker containerizer will
* pull the docker image from the registry even if the image
* is already downloaded on the slave.
* </pre>
*/
public Builder clearForcePullImage() {
bitField0_ = (bitField0_ & ~0x00000020);
forcePullImage_ = false;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ExtendedContainerInfo.DockerInfo)
}
static {
defaultInstance = new DockerInfo(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ExtendedContainerInfo.DockerInfo)
}
private int bitField0_;
// required .mesos.ContainerInfo.Type type = 1;
public static final int TYPE_FIELD_NUMBER = 1;
private org.apache.mesos.Protos.ContainerInfo.Type type_;
/**
* <code>required .mesos.ContainerInfo.Type type = 1;</code>
*/
public boolean hasType() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesos.ContainerInfo.Type type = 1;</code>
*/
public org.apache.mesos.Protos.ContainerInfo.Type getType() {
return type_;
}
// repeated .mesosphere.marathon.Volume volumes = 2;
public static final int VOLUMES_FIELD_NUMBER = 2;
private java.util.List<mesosphere.marathon.Protos.Volume> volumes_;
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public java.util.List<mesosphere.marathon.Protos.Volume> getVolumesList() {
return volumes_;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.VolumeOrBuilder>
getVolumesOrBuilderList() {
return volumes_;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public int getVolumesCount() {
return volumes_.size();
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public mesosphere.marathon.Protos.Volume getVolumes(int index) {
return volumes_.get(index);
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public mesosphere.marathon.Protos.VolumeOrBuilder getVolumesOrBuilder(
int index) {
return volumes_.get(index);
}
// optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;
public static final int DOCKER_FIELD_NUMBER = 3;
private mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo docker_;
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public boolean hasDocker() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo getDocker() {
return docker_;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfoOrBuilder getDockerOrBuilder() {
return docker_;
}
private void initFields() {
type_ = org.apache.mesos.Protos.ContainerInfo.Type.DOCKER;
volumes_ = java.util.Collections.emptyList();
docker_ = mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasType()) {
memoizedIsInitialized = 0;
return false;
}
for (int i = 0; i < getVolumesCount(); i++) {
if (!getVolumes(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasDocker()) {
if (!getDocker().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeEnum(1, type_.getNumber());
}
for (int i = 0; i < volumes_.size(); i++) {
output.writeMessage(2, volumes_.get(i));
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeMessage(3, docker_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, type_.getNumber());
}
for (int i = 0; i < volumes_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, volumes_.get(i));
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, docker_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ExtendedContainerInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ExtendedContainerInfo prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ExtendedContainerInfo}
*
* <pre>
* Copied from mesos.proto and adjusted to meet the needs for persistent volumes
* Extends DockerInfo.PortMapping to include `service_port`.
* </pre>
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ExtendedContainerInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ExtendedContainerInfo.class, mesosphere.marathon.Protos.ExtendedContainerInfo.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ExtendedContainerInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getVolumesFieldBuilder();
getDockerFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
type_ = org.apache.mesos.Protos.ContainerInfo.Type.DOCKER;
bitField0_ = (bitField0_ & ~0x00000001);
if (volumesBuilder_ == null) {
volumes_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
volumesBuilder_.clear();
}
if (dockerBuilder_ == null) {
docker_ = mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.getDefaultInstance();
} else {
dockerBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ExtendedContainerInfo_descriptor;
}
public mesosphere.marathon.Protos.ExtendedContainerInfo getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ExtendedContainerInfo.getDefaultInstance();
}
public mesosphere.marathon.Protos.ExtendedContainerInfo build() {
mesosphere.marathon.Protos.ExtendedContainerInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ExtendedContainerInfo buildPartial() {
mesosphere.marathon.Protos.ExtendedContainerInfo result = new mesosphere.marathon.Protos.ExtendedContainerInfo(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.type_ = type_;
if (volumesBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
volumes_ = java.util.Collections.unmodifiableList(volumes_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.volumes_ = volumes_;
} else {
result.volumes_ = volumesBuilder_.build();
}
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000002;
}
if (dockerBuilder_ == null) {
result.docker_ = docker_;
} else {
result.docker_ = dockerBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ExtendedContainerInfo) {
return mergeFrom((mesosphere.marathon.Protos.ExtendedContainerInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ExtendedContainerInfo other) {
if (other == mesosphere.marathon.Protos.ExtendedContainerInfo.getDefaultInstance()) return this;
if (other.hasType()) {
setType(other.getType());
}
if (volumesBuilder_ == null) {
if (!other.volumes_.isEmpty()) {
if (volumes_.isEmpty()) {
volumes_ = other.volumes_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureVolumesIsMutable();
volumes_.addAll(other.volumes_);
}
onChanged();
}
} else {
if (!other.volumes_.isEmpty()) {
if (volumesBuilder_.isEmpty()) {
volumesBuilder_.dispose();
volumesBuilder_ = null;
volumes_ = other.volumes_;
bitField0_ = (bitField0_ & ~0x00000002);
volumesBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getVolumesFieldBuilder() : null;
} else {
volumesBuilder_.addAllMessages(other.volumes_);
}
}
}
if (other.hasDocker()) {
mergeDocker(other.getDocker());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasType()) {
return false;
}
for (int i = 0; i < getVolumesCount(); i++) {
if (!getVolumes(i).isInitialized()) {
return false;
}
}
if (hasDocker()) {
if (!getDocker().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ExtendedContainerInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ExtendedContainerInfo) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required .mesos.ContainerInfo.Type type = 1;
private org.apache.mesos.Protos.ContainerInfo.Type type_ = org.apache.mesos.Protos.ContainerInfo.Type.DOCKER;
/**
* <code>required .mesos.ContainerInfo.Type type = 1;</code>
*/
public boolean hasType() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesos.ContainerInfo.Type type = 1;</code>
*/
public org.apache.mesos.Protos.ContainerInfo.Type getType() {
return type_;
}
/**
* <code>required .mesos.ContainerInfo.Type type = 1;</code>
*/
public Builder setType(org.apache.mesos.Protos.ContainerInfo.Type value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
type_ = value;
onChanged();
return this;
}
/**
* <code>required .mesos.ContainerInfo.Type type = 1;</code>
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000001);
type_ = org.apache.mesos.Protos.ContainerInfo.Type.DOCKER;
onChanged();
return this;
}
// repeated .mesosphere.marathon.Volume volumes = 2;
private java.util.List<mesosphere.marathon.Protos.Volume> volumes_ =
java.util.Collections.emptyList();
private void ensureVolumesIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
volumes_ = new java.util.ArrayList<mesosphere.marathon.Protos.Volume>(volumes_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.Volume, mesosphere.marathon.Protos.Volume.Builder, mesosphere.marathon.Protos.VolumeOrBuilder> volumesBuilder_;
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public java.util.List<mesosphere.marathon.Protos.Volume> getVolumesList() {
if (volumesBuilder_ == null) {
return java.util.Collections.unmodifiableList(volumes_);
} else {
return volumesBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public int getVolumesCount() {
if (volumesBuilder_ == null) {
return volumes_.size();
} else {
return volumesBuilder_.getCount();
}
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public mesosphere.marathon.Protos.Volume getVolumes(int index) {
if (volumesBuilder_ == null) {
return volumes_.get(index);
} else {
return volumesBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder setVolumes(
int index, mesosphere.marathon.Protos.Volume value) {
if (volumesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVolumesIsMutable();
volumes_.set(index, value);
onChanged();
} else {
volumesBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder setVolumes(
int index, mesosphere.marathon.Protos.Volume.Builder builderForValue) {
if (volumesBuilder_ == null) {
ensureVolumesIsMutable();
volumes_.set(index, builderForValue.build());
onChanged();
} else {
volumesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder addVolumes(mesosphere.marathon.Protos.Volume value) {
if (volumesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVolumesIsMutable();
volumes_.add(value);
onChanged();
} else {
volumesBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder addVolumes(
int index, mesosphere.marathon.Protos.Volume value) {
if (volumesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVolumesIsMutable();
volumes_.add(index, value);
onChanged();
} else {
volumesBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder addVolumes(
mesosphere.marathon.Protos.Volume.Builder builderForValue) {
if (volumesBuilder_ == null) {
ensureVolumesIsMutable();
volumes_.add(builderForValue.build());
onChanged();
} else {
volumesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder addVolumes(
int index, mesosphere.marathon.Protos.Volume.Builder builderForValue) {
if (volumesBuilder_ == null) {
ensureVolumesIsMutable();
volumes_.add(index, builderForValue.build());
onChanged();
} else {
volumesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder addAllVolumes(
java.lang.Iterable<? extends mesosphere.marathon.Protos.Volume> values) {
if (volumesBuilder_ == null) {
ensureVolumesIsMutable();
super.addAll(values, volumes_);
onChanged();
} else {
volumesBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder clearVolumes() {
if (volumesBuilder_ == null) {
volumes_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
volumesBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public Builder removeVolumes(int index) {
if (volumesBuilder_ == null) {
ensureVolumesIsMutable();
volumes_.remove(index);
onChanged();
} else {
volumesBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public mesosphere.marathon.Protos.Volume.Builder getVolumesBuilder(
int index) {
return getVolumesFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public mesosphere.marathon.Protos.VolumeOrBuilder getVolumesOrBuilder(
int index) {
if (volumesBuilder_ == null) {
return volumes_.get(index); } else {
return volumesBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.VolumeOrBuilder>
getVolumesOrBuilderList() {
if (volumesBuilder_ != null) {
return volumesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(volumes_);
}
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public mesosphere.marathon.Protos.Volume.Builder addVolumesBuilder() {
return getVolumesFieldBuilder().addBuilder(
mesosphere.marathon.Protos.Volume.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public mesosphere.marathon.Protos.Volume.Builder addVolumesBuilder(
int index) {
return getVolumesFieldBuilder().addBuilder(
index, mesosphere.marathon.Protos.Volume.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.Volume volumes = 2;</code>
*/
public java.util.List<mesosphere.marathon.Protos.Volume.Builder>
getVolumesBuilderList() {
return getVolumesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.Volume, mesosphere.marathon.Protos.Volume.Builder, mesosphere.marathon.Protos.VolumeOrBuilder>
getVolumesFieldBuilder() {
if (volumesBuilder_ == null) {
volumesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.Volume, mesosphere.marathon.Protos.Volume.Builder, mesosphere.marathon.Protos.VolumeOrBuilder>(
volumes_,
((bitField0_ & 0x00000002) == 0x00000002),
getParentForChildren(),
isClean());
volumes_ = null;
}
return volumesBuilder_;
}
// optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;
private mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo docker_ = mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.Builder, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfoOrBuilder> dockerBuilder_;
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public boolean hasDocker() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo getDocker() {
if (dockerBuilder_ == null) {
return docker_;
} else {
return dockerBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public Builder setDocker(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo value) {
if (dockerBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
docker_ = value;
onChanged();
} else {
dockerBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public Builder setDocker(
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.Builder builderForValue) {
if (dockerBuilder_ == null) {
docker_ = builderForValue.build();
onChanged();
} else {
dockerBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public Builder mergeDocker(mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo value) {
if (dockerBuilder_ == null) {
if (((bitField0_ & 0x00000004) == 0x00000004) &&
docker_ != mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.getDefaultInstance()) {
docker_ =
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.newBuilder(docker_).mergeFrom(value).buildPartial();
} else {
docker_ = value;
}
onChanged();
} else {
dockerBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public Builder clearDocker() {
if (dockerBuilder_ == null) {
docker_ = mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.getDefaultInstance();
onChanged();
} else {
dockerBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.Builder getDockerBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getDockerFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
public mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfoOrBuilder getDockerOrBuilder() {
if (dockerBuilder_ != null) {
return dockerBuilder_.getMessageOrBuilder();
} else {
return docker_;
}
}
/**
* <code>optional .mesosphere.marathon.ExtendedContainerInfo.DockerInfo docker = 3;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.Builder, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfoOrBuilder>
getDockerFieldBuilder() {
if (dockerBuilder_ == null) {
dockerBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfo.Builder, mesosphere.marathon.Protos.ExtendedContainerInfo.DockerInfoOrBuilder>(
docker_,
getParentForChildren(),
isClean());
docker_ = null;
}
return dockerBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ExtendedContainerInfo)
}
static {
defaultInstance = new ExtendedContainerInfo(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ExtendedContainerInfo)
}
public interface VolumeOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required .mesos.Volume.Mode mode = 3;
/**
* <code>required .mesos.Volume.Mode mode = 3;</code>
*/
boolean hasMode();
/**
* <code>required .mesos.Volume.Mode mode = 3;</code>
*/
org.apache.mesos.Protos.Volume.Mode getMode();
// required string container_path = 1;
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
boolean hasContainerPath();
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
java.lang.String getContainerPath();
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
com.google.protobuf.ByteString
getContainerPathBytes();
// optional string host_path = 2;
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
boolean hasHostPath();
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
java.lang.String getHostPath();
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
com.google.protobuf.ByteString
getHostPathBytes();
// optional .mesos.Image image = 4;
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
boolean hasImage();
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
org.apache.mesos.Protos.Image getImage();
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
org.apache.mesos.Protos.ImageOrBuilder getImageOrBuilder();
// optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
boolean hasPersistent();
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo getPersistent();
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
mesosphere.marathon.Protos.Volume.PersistentVolumeInfoOrBuilder getPersistentOrBuilder();
// optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
boolean hasExternal();
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo getExternal();
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
mesosphere.marathon.Protos.Volume.ExternalVolumeInfoOrBuilder getExternalOrBuilder();
}
/**
* Protobuf type {@code mesosphere.marathon.Volume}
*
* <pre>
* Copied from mesos.proto and adjusted to meet the needs of persistent volumes
* Describes a volume mapping either from host to container or vice
* versa. Both paths can either refer to a directory or a file.
* </pre>
*/
public static final class Volume extends
com.google.protobuf.GeneratedMessage
implements VolumeOrBuilder {
// Use Volume.newBuilder() to construct.
private Volume(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Volume(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Volume defaultInstance;
public static Volume getDefaultInstance() {
return defaultInstance;
}
public Volume getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Volume(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000002;
containerPath_ = input.readBytes();
break;
}
case 18: {
bitField0_ |= 0x00000004;
hostPath_ = input.readBytes();
break;
}
case 24: {
int rawValue = input.readEnum();
org.apache.mesos.Protos.Volume.Mode value = org.apache.mesos.Protos.Volume.Mode.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(3, rawValue);
} else {
bitField0_ |= 0x00000001;
mode_ = value;
}
break;
}
case 34: {
org.apache.mesos.Protos.Image.Builder subBuilder = null;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
subBuilder = image_.toBuilder();
}
image_ = input.readMessage(org.apache.mesos.Protos.Image.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(image_);
image_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000008;
break;
}
case 42: {
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000010) == 0x00000010)) {
subBuilder = persistent_.toBuilder();
}
persistent_ = input.readMessage(mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(persistent_);
persistent_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000010;
break;
}
case 50: {
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000020) == 0x00000020)) {
subBuilder = external_.toBuilder();
}
external_ = input.readMessage(mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(external_);
external_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000020;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.Volume.class, mesosphere.marathon.Protos.Volume.Builder.class);
}
public static com.google.protobuf.Parser<Volume> PARSER =
new com.google.protobuf.AbstractParser<Volume>() {
public Volume parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Volume(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Volume> getParserForType() {
return PARSER;
}
public interface PersistentVolumeInfoOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required uint64 size = 1;
/**
* <code>required uint64 size = 1;</code>
*/
boolean hasSize();
/**
* <code>required uint64 size = 1;</code>
*/
long getSize();
}
/**
* Protobuf type {@code mesosphere.marathon.Volume.PersistentVolumeInfo}
*
* <pre>
* Defining properties of persistent volumes
* </pre>
*/
public static final class PersistentVolumeInfo extends
com.google.protobuf.GeneratedMessage
implements PersistentVolumeInfoOrBuilder {
// Use PersistentVolumeInfo.newBuilder() to construct.
private PersistentVolumeInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private PersistentVolumeInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final PersistentVolumeInfo defaultInstance;
public static PersistentVolumeInfo getDefaultInstance() {
return defaultInstance;
}
public PersistentVolumeInfo getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private PersistentVolumeInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
size_ = input.readUInt64();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.class, mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.Builder.class);
}
public static com.google.protobuf.Parser<PersistentVolumeInfo> PARSER =
new com.google.protobuf.AbstractParser<PersistentVolumeInfo>() {
public PersistentVolumeInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new PersistentVolumeInfo(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<PersistentVolumeInfo> getParserForType() {
return PARSER;
}
private int bitField0_;
// required uint64 size = 1;
public static final int SIZE_FIELD_NUMBER = 1;
private long size_;
/**
* <code>required uint64 size = 1;</code>
*/
public boolean hasSize() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint64 size = 1;</code>
*/
public long getSize() {
return size_;
}
private void initFields() {
size_ = 0L;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasSize()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt64(1, size_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, size_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.Volume.PersistentVolumeInfo prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.Volume.PersistentVolumeInfo}
*
* <pre>
* Defining properties of persistent volumes
* </pre>
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.Volume.PersistentVolumeInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.class, mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.Builder.class);
}
// Construct using mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
size_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_descriptor;
}
public mesosphere.marathon.Protos.Volume.PersistentVolumeInfo getDefaultInstanceForType() {
return mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.getDefaultInstance();
}
public mesosphere.marathon.Protos.Volume.PersistentVolumeInfo build() {
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.Volume.PersistentVolumeInfo buildPartial() {
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo result = new mesosphere.marathon.Protos.Volume.PersistentVolumeInfo(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.size_ = size_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.Volume.PersistentVolumeInfo) {
return mergeFrom((mesosphere.marathon.Protos.Volume.PersistentVolumeInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.Volume.PersistentVolumeInfo other) {
if (other == mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.getDefaultInstance()) return this;
if (other.hasSize()) {
setSize(other.getSize());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasSize()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.Volume.PersistentVolumeInfo) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required uint64 size = 1;
private long size_ ;
/**
* <code>required uint64 size = 1;</code>
*/
public boolean hasSize() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint64 size = 1;</code>
*/
public long getSize() {
return size_;
}
/**
* <code>required uint64 size = 1;</code>
*/
public Builder setSize(long value) {
bitField0_ |= 0x00000001;
size_ = value;
onChanged();
return this;
}
/**
* <code>required uint64 size = 1;</code>
*/
public Builder clearSize() {
bitField0_ = (bitField0_ & ~0x00000001);
size_ = 0L;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.Volume.PersistentVolumeInfo)
}
static {
defaultInstance = new PersistentVolumeInfo(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.Volume.PersistentVolumeInfo)
}
public interface ExternalVolumeInfoOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional uint64 size = 1;
/**
* <code>optional uint64 size = 1;</code>
*/
boolean hasSize();
/**
* <code>optional uint64 size = 1;</code>
*/
long getSize();
// required string name = 2;
/**
* <code>required string name = 2;</code>
*/
boolean hasName();
/**
* <code>required string name = 2;</code>
*/
java.lang.String getName();
/**
* <code>required string name = 2;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
// required string provider = 3;
/**
* <code>required string provider = 3;</code>
*/
boolean hasProvider();
/**
* <code>required string provider = 3;</code>
*/
java.lang.String getProvider();
/**
* <code>required string provider = 3;</code>
*/
com.google.protobuf.ByteString
getProviderBytes();
// repeated .mesos.Label options = 4;
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
java.util.List<org.apache.mesos.Protos.Label>
getOptionsList();
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
org.apache.mesos.Protos.Label getOptions(int index);
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
int getOptionsCount();
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getOptionsOrBuilderList();
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
org.apache.mesos.Protos.LabelOrBuilder getOptionsOrBuilder(
int index);
}
/**
* Protobuf type {@code mesosphere.marathon.Volume.ExternalVolumeInfo}
*
* <pre>
* Defining properties of external volumes
* </pre>
*/
public static final class ExternalVolumeInfo extends
com.google.protobuf.GeneratedMessage
implements ExternalVolumeInfoOrBuilder {
// Use ExternalVolumeInfo.newBuilder() to construct.
private ExternalVolumeInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ExternalVolumeInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ExternalVolumeInfo defaultInstance;
public static ExternalVolumeInfo getDefaultInstance() {
return defaultInstance;
}
public ExternalVolumeInfo getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ExternalVolumeInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
size_ = input.readUInt64();
break;
}
case 18: {
bitField0_ |= 0x00000002;
name_ = input.readBytes();
break;
}
case 26: {
bitField0_ |= 0x00000004;
provider_ = input.readBytes();
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
options_ = new java.util.ArrayList<org.apache.mesos.Protos.Label>();
mutable_bitField0_ |= 0x00000008;
}
options_.add(input.readMessage(org.apache.mesos.Protos.Label.PARSER, extensionRegistry));
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
options_ = java.util.Collections.unmodifiableList(options_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.class, mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.Builder.class);
}
public static com.google.protobuf.Parser<ExternalVolumeInfo> PARSER =
new com.google.protobuf.AbstractParser<ExternalVolumeInfo>() {
public ExternalVolumeInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ExternalVolumeInfo(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ExternalVolumeInfo> getParserForType() {
return PARSER;
}
private int bitField0_;
// optional uint64 size = 1;
public static final int SIZE_FIELD_NUMBER = 1;
private long size_;
/**
* <code>optional uint64 size = 1;</code>
*/
public boolean hasSize() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional uint64 size = 1;</code>
*/
public long getSize() {
return size_;
}
// required string name = 2;
public static final int NAME_FIELD_NUMBER = 2;
private java.lang.Object name_;
/**
* <code>required string name = 2;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string name = 2;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
name_ = s;
}
return s;
}
}
/**
* <code>required string name = 2;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required string provider = 3;
public static final int PROVIDER_FIELD_NUMBER = 3;
private java.lang.Object provider_;
/**
* <code>required string provider = 3;</code>
*/
public boolean hasProvider() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required string provider = 3;</code>
*/
public java.lang.String getProvider() {
java.lang.Object ref = provider_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
provider_ = s;
}
return s;
}
}
/**
* <code>required string provider = 3;</code>
*/
public com.google.protobuf.ByteString
getProviderBytes() {
java.lang.Object ref = provider_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
provider_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// repeated .mesos.Label options = 4;
public static final int OPTIONS_FIELD_NUMBER = 4;
private java.util.List<org.apache.mesos.Protos.Label> options_;
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label> getOptionsList() {
return options_;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getOptionsOrBuilderList() {
return options_;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public int getOptionsCount() {
return options_.size();
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public org.apache.mesos.Protos.Label getOptions(int index) {
return options_.get(index);
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public org.apache.mesos.Protos.LabelOrBuilder getOptionsOrBuilder(
int index) {
return options_.get(index);
}
private void initFields() {
size_ = 0L;
name_ = "";
provider_ = "";
options_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasName()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasProvider()) {
memoizedIsInitialized = 0;
return false;
}
for (int i = 0; i < getOptionsCount(); i++) {
if (!getOptions(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt64(1, size_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getNameBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, getProviderBytes());
}
for (int i = 0; i < options_.size(); i++) {
output.writeMessage(4, options_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, size_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getNameBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, getProviderBytes());
}
for (int i = 0; i < options_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, options_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.Volume.ExternalVolumeInfo prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.Volume.ExternalVolumeInfo}
*
* <pre>
* Defining properties of external volumes
* </pre>
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.Volume.ExternalVolumeInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.class, mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.Builder.class);
}
// Construct using mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getOptionsFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
size_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
name_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
provider_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
if (optionsBuilder_ == null) {
options_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
} else {
optionsBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_descriptor;
}
public mesosphere.marathon.Protos.Volume.ExternalVolumeInfo getDefaultInstanceForType() {
return mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.getDefaultInstance();
}
public mesosphere.marathon.Protos.Volume.ExternalVolumeInfo build() {
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.Volume.ExternalVolumeInfo buildPartial() {
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo result = new mesosphere.marathon.Protos.Volume.ExternalVolumeInfo(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.size_ = size_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.name_ = name_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.provider_ = provider_;
if (optionsBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008)) {
options_ = java.util.Collections.unmodifiableList(options_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.options_ = options_;
} else {
result.options_ = optionsBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.Volume.ExternalVolumeInfo) {
return mergeFrom((mesosphere.marathon.Protos.Volume.ExternalVolumeInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.Volume.ExternalVolumeInfo other) {
if (other == mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.getDefaultInstance()) return this;
if (other.hasSize()) {
setSize(other.getSize());
}
if (other.hasName()) {
bitField0_ |= 0x00000002;
name_ = other.name_;
onChanged();
}
if (other.hasProvider()) {
bitField0_ |= 0x00000004;
provider_ = other.provider_;
onChanged();
}
if (optionsBuilder_ == null) {
if (!other.options_.isEmpty()) {
if (options_.isEmpty()) {
options_ = other.options_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureOptionsIsMutable();
options_.addAll(other.options_);
}
onChanged();
}
} else {
if (!other.options_.isEmpty()) {
if (optionsBuilder_.isEmpty()) {
optionsBuilder_.dispose();
optionsBuilder_ = null;
options_ = other.options_;
bitField0_ = (bitField0_ & ~0x00000008);
optionsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getOptionsFieldBuilder() : null;
} else {
optionsBuilder_.addAllMessages(other.options_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasName()) {
return false;
}
if (!hasProvider()) {
return false;
}
for (int i = 0; i < getOptionsCount(); i++) {
if (!getOptions(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.Volume.ExternalVolumeInfo) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// optional uint64 size = 1;
private long size_ ;
/**
* <code>optional uint64 size = 1;</code>
*/
public boolean hasSize() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional uint64 size = 1;</code>
*/
public long getSize() {
return size_;
}
/**
* <code>optional uint64 size = 1;</code>
*/
public Builder setSize(long value) {
bitField0_ |= 0x00000001;
size_ = value;
onChanged();
return this;
}
/**
* <code>optional uint64 size = 1;</code>
*/
public Builder clearSize() {
bitField0_ = (bitField0_ & ~0x00000001);
size_ = 0L;
onChanged();
return this;
}
// required string name = 2;
private java.lang.Object name_ = "";
/**
* <code>required string name = 2;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string name = 2;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string name = 2;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string name = 2;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
name_ = value;
onChanged();
return this;
}
/**
* <code>required string name = 2;</code>
*/
public Builder clearName() {
bitField0_ = (bitField0_ & ~0x00000002);
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>required string name = 2;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
name_ = value;
onChanged();
return this;
}
// required string provider = 3;
private java.lang.Object provider_ = "";
/**
* <code>required string provider = 3;</code>
*/
public boolean hasProvider() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required string provider = 3;</code>
*/
public java.lang.String getProvider() {
java.lang.Object ref = provider_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
provider_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string provider = 3;</code>
*/
public com.google.protobuf.ByteString
getProviderBytes() {
java.lang.Object ref = provider_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
provider_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string provider = 3;</code>
*/
public Builder setProvider(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
provider_ = value;
onChanged();
return this;
}
/**
* <code>required string provider = 3;</code>
*/
public Builder clearProvider() {
bitField0_ = (bitField0_ & ~0x00000004);
provider_ = getDefaultInstance().getProvider();
onChanged();
return this;
}
/**
* <code>required string provider = 3;</code>
*/
public Builder setProviderBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
provider_ = value;
onChanged();
return this;
}
// repeated .mesos.Label options = 4;
private java.util.List<org.apache.mesos.Protos.Label> options_ =
java.util.Collections.emptyList();
private void ensureOptionsIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
options_ = new java.util.ArrayList<org.apache.mesos.Protos.Label>(options_);
bitField0_ |= 0x00000008;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder> optionsBuilder_;
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label> getOptionsList() {
if (optionsBuilder_ == null) {
return java.util.Collections.unmodifiableList(options_);
} else {
return optionsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public int getOptionsCount() {
if (optionsBuilder_ == null) {
return options_.size();
} else {
return optionsBuilder_.getCount();
}
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public org.apache.mesos.Protos.Label getOptions(int index) {
if (optionsBuilder_ == null) {
return options_.get(index);
} else {
return optionsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder setOptions(
int index, org.apache.mesos.Protos.Label value) {
if (optionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionsIsMutable();
options_.set(index, value);
onChanged();
} else {
optionsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder setOptions(
int index, org.apache.mesos.Protos.Label.Builder builderForValue) {
if (optionsBuilder_ == null) {
ensureOptionsIsMutable();
options_.set(index, builderForValue.build());
onChanged();
} else {
optionsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder addOptions(org.apache.mesos.Protos.Label value) {
if (optionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionsIsMutable();
options_.add(value);
onChanged();
} else {
optionsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder addOptions(
int index, org.apache.mesos.Protos.Label value) {
if (optionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionsIsMutable();
options_.add(index, value);
onChanged();
} else {
optionsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder addOptions(
org.apache.mesos.Protos.Label.Builder builderForValue) {
if (optionsBuilder_ == null) {
ensureOptionsIsMutable();
options_.add(builderForValue.build());
onChanged();
} else {
optionsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder addOptions(
int index, org.apache.mesos.Protos.Label.Builder builderForValue) {
if (optionsBuilder_ == null) {
ensureOptionsIsMutable();
options_.add(index, builderForValue.build());
onChanged();
} else {
optionsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder addAllOptions(
java.lang.Iterable<? extends org.apache.mesos.Protos.Label> values) {
if (optionsBuilder_ == null) {
ensureOptionsIsMutable();
super.addAll(values, options_);
onChanged();
} else {
optionsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder clearOptions() {
if (optionsBuilder_ == null) {
options_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
} else {
optionsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public Builder removeOptions(int index) {
if (optionsBuilder_ == null) {
ensureOptionsIsMutable();
options_.remove(index);
onChanged();
} else {
optionsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public org.apache.mesos.Protos.Label.Builder getOptionsBuilder(
int index) {
return getOptionsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public org.apache.mesos.Protos.LabelOrBuilder getOptionsOrBuilder(
int index) {
if (optionsBuilder_ == null) {
return options_.get(index); } else {
return optionsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public java.util.List<? extends org.apache.mesos.Protos.LabelOrBuilder>
getOptionsOrBuilderList() {
if (optionsBuilder_ != null) {
return optionsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(options_);
}
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public org.apache.mesos.Protos.Label.Builder addOptionsBuilder() {
return getOptionsFieldBuilder().addBuilder(
org.apache.mesos.Protos.Label.getDefaultInstance());
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public org.apache.mesos.Protos.Label.Builder addOptionsBuilder(
int index) {
return getOptionsFieldBuilder().addBuilder(
index, org.apache.mesos.Protos.Label.getDefaultInstance());
}
/**
* <code>repeated .mesos.Label options = 4;</code>
*/
public java.util.List<org.apache.mesos.Protos.Label.Builder>
getOptionsBuilderList() {
return getOptionsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder>
getOptionsFieldBuilder() {
if (optionsBuilder_ == null) {
optionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.apache.mesos.Protos.Label, org.apache.mesos.Protos.Label.Builder, org.apache.mesos.Protos.LabelOrBuilder>(
options_,
((bitField0_ & 0x00000008) == 0x00000008),
getParentForChildren(),
isClean());
options_ = null;
}
return optionsBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.Volume.ExternalVolumeInfo)
}
static {
defaultInstance = new ExternalVolumeInfo(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.Volume.ExternalVolumeInfo)
}
private int bitField0_;
// required .mesos.Volume.Mode mode = 3;
public static final int MODE_FIELD_NUMBER = 3;
private org.apache.mesos.Protos.Volume.Mode mode_;
/**
* <code>required .mesos.Volume.Mode mode = 3;</code>
*/
public boolean hasMode() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesos.Volume.Mode mode = 3;</code>
*/
public org.apache.mesos.Protos.Volume.Mode getMode() {
return mode_;
}
// required string container_path = 1;
public static final int CONTAINER_PATH_FIELD_NUMBER = 1;
private java.lang.Object containerPath_;
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public boolean hasContainerPath() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public java.lang.String getContainerPath() {
java.lang.Object ref = containerPath_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
containerPath_ = s;
}
return s;
}
}
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public com.google.protobuf.ByteString
getContainerPathBytes() {
java.lang.Object ref = containerPath_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
containerPath_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional string host_path = 2;
public static final int HOST_PATH_FIELD_NUMBER = 2;
private java.lang.Object hostPath_;
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public boolean hasHostPath() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public java.lang.String getHostPath() {
java.lang.Object ref = hostPath_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
hostPath_ = s;
}
return s;
}
}
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public com.google.protobuf.ByteString
getHostPathBytes() {
java.lang.Object ref = hostPath_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
hostPath_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .mesos.Image image = 4;
public static final int IMAGE_FIELD_NUMBER = 4;
private org.apache.mesos.Protos.Image image_;
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public boolean hasImage() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public org.apache.mesos.Protos.Image getImage() {
return image_;
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public org.apache.mesos.Protos.ImageOrBuilder getImageOrBuilder() {
return image_;
}
// optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;
public static final int PERSISTENT_FIELD_NUMBER = 5;
private mesosphere.marathon.Protos.Volume.PersistentVolumeInfo persistent_;
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public boolean hasPersistent() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.PersistentVolumeInfo getPersistent() {
return persistent_;
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.PersistentVolumeInfoOrBuilder getPersistentOrBuilder() {
return persistent_;
}
// optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;
public static final int EXTERNAL_FIELD_NUMBER = 6;
private mesosphere.marathon.Protos.Volume.ExternalVolumeInfo external_;
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public boolean hasExternal() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.ExternalVolumeInfo getExternal() {
return external_;
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.ExternalVolumeInfoOrBuilder getExternalOrBuilder() {
return external_;
}
private void initFields() {
mode_ = org.apache.mesos.Protos.Volume.Mode.RW;
containerPath_ = "";
hostPath_ = "";
image_ = org.apache.mesos.Protos.Image.getDefaultInstance();
persistent_ = mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.getDefaultInstance();
external_ = mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasMode()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasContainerPath()) {
memoizedIsInitialized = 0;
return false;
}
if (hasImage()) {
if (!getImage().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasPersistent()) {
if (!getPersistent().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasExternal()) {
if (!getExternal().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(1, getContainerPathBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(2, getHostPathBytes());
}
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeEnum(3, mode_.getNumber());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeMessage(4, image_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeMessage(5, persistent_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeMessage(6, external_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getContainerPathBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getHostPathBytes());
}
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, mode_.getNumber());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, image_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, persistent_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, external_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.Volume parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.Volume parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.Volume parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.Volume parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.Volume parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.Volume parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.Volume parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.Volume prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.Volume}
*
* <pre>
* Copied from mesos.proto and adjusted to meet the needs of persistent volumes
* Describes a volume mapping either from host to container or vice
* versa. Both paths can either refer to a directory or a file.
* </pre>
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.VolumeOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.Volume.class, mesosphere.marathon.Protos.Volume.Builder.class);
}
// Construct using mesosphere.marathon.Protos.Volume.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getImageFieldBuilder();
getPersistentFieldBuilder();
getExternalFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
mode_ = org.apache.mesos.Protos.Volume.Mode.RW;
bitField0_ = (bitField0_ & ~0x00000001);
containerPath_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
hostPath_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
if (imageBuilder_ == null) {
image_ = org.apache.mesos.Protos.Image.getDefaultInstance();
} else {
imageBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
if (persistentBuilder_ == null) {
persistent_ = mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.getDefaultInstance();
} else {
persistentBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000010);
if (externalBuilder_ == null) {
external_ = mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.getDefaultInstance();
} else {
externalBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_Volume_descriptor;
}
public mesosphere.marathon.Protos.Volume getDefaultInstanceForType() {
return mesosphere.marathon.Protos.Volume.getDefaultInstance();
}
public mesosphere.marathon.Protos.Volume build() {
mesosphere.marathon.Protos.Volume result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.Volume buildPartial() {
mesosphere.marathon.Protos.Volume result = new mesosphere.marathon.Protos.Volume(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.mode_ = mode_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.containerPath_ = containerPath_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.hostPath_ = hostPath_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
if (imageBuilder_ == null) {
result.image_ = image_;
} else {
result.image_ = imageBuilder_.build();
}
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
if (persistentBuilder_ == null) {
result.persistent_ = persistent_;
} else {
result.persistent_ = persistentBuilder_.build();
}
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
if (externalBuilder_ == null) {
result.external_ = external_;
} else {
result.external_ = externalBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.Volume) {
return mergeFrom((mesosphere.marathon.Protos.Volume)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.Volume other) {
if (other == mesosphere.marathon.Protos.Volume.getDefaultInstance()) return this;
if (other.hasMode()) {
setMode(other.getMode());
}
if (other.hasContainerPath()) {
bitField0_ |= 0x00000002;
containerPath_ = other.containerPath_;
onChanged();
}
if (other.hasHostPath()) {
bitField0_ |= 0x00000004;
hostPath_ = other.hostPath_;
onChanged();
}
if (other.hasImage()) {
mergeImage(other.getImage());
}
if (other.hasPersistent()) {
mergePersistent(other.getPersistent());
}
if (other.hasExternal()) {
mergeExternal(other.getExternal());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasMode()) {
return false;
}
if (!hasContainerPath()) {
return false;
}
if (hasImage()) {
if (!getImage().isInitialized()) {
return false;
}
}
if (hasPersistent()) {
if (!getPersistent().isInitialized()) {
return false;
}
}
if (hasExternal()) {
if (!getExternal().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.Volume parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.Volume) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required .mesos.Volume.Mode mode = 3;
private org.apache.mesos.Protos.Volume.Mode mode_ = org.apache.mesos.Protos.Volume.Mode.RW;
/**
* <code>required .mesos.Volume.Mode mode = 3;</code>
*/
public boolean hasMode() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .mesos.Volume.Mode mode = 3;</code>
*/
public org.apache.mesos.Protos.Volume.Mode getMode() {
return mode_;
}
/**
* <code>required .mesos.Volume.Mode mode = 3;</code>
*/
public Builder setMode(org.apache.mesos.Protos.Volume.Mode value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
mode_ = value;
onChanged();
return this;
}
/**
* <code>required .mesos.Volume.Mode mode = 3;</code>
*/
public Builder clearMode() {
bitField0_ = (bitField0_ & ~0x00000001);
mode_ = org.apache.mesos.Protos.Volume.Mode.RW;
onChanged();
return this;
}
// required string container_path = 1;
private java.lang.Object containerPath_ = "";
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public boolean hasContainerPath() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public java.lang.String getContainerPath() {
java.lang.Object ref = containerPath_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
containerPath_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public com.google.protobuf.ByteString
getContainerPathBytes() {
java.lang.Object ref = containerPath_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
containerPath_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public Builder setContainerPath(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
containerPath_ = value;
onChanged();
return this;
}
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public Builder clearContainerPath() {
bitField0_ = (bitField0_ & ~0x00000002);
containerPath_ = getDefaultInstance().getContainerPath();
onChanged();
return this;
}
/**
* <code>required string container_path = 1;</code>
*
* <pre>
* Path pointing to a directory or file in the container. If the
* path is a relative path, it is relative to the container work
* directory. If the path is an absolute path, that path must
* already exist.
* </pre>
*/
public Builder setContainerPathBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
containerPath_ = value;
onChanged();
return this;
}
// optional string host_path = 2;
private java.lang.Object hostPath_ = "";
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public boolean hasHostPath() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public java.lang.String getHostPath() {
java.lang.Object ref = hostPath_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
hostPath_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public com.google.protobuf.ByteString
getHostPathBytes() {
java.lang.Object ref = hostPath_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
hostPath_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public Builder setHostPath(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
hostPath_ = value;
onChanged();
return this;
}
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public Builder clearHostPath() {
bitField0_ = (bitField0_ & ~0x00000004);
hostPath_ = getDefaultInstance().getHostPath();
onChanged();
return this;
}
/**
* <code>optional string host_path = 2;</code>
*
* <pre>
* Absolute path pointing to a directory or file on the host or a
* path relative to the container work directory.
* </pre>
*/
public Builder setHostPathBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
hostPath_ = value;
onChanged();
return this;
}
// optional .mesos.Image image = 4;
private org.apache.mesos.Protos.Image image_ = org.apache.mesos.Protos.Image.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.Image, org.apache.mesos.Protos.Image.Builder, org.apache.mesos.Protos.ImageOrBuilder> imageBuilder_;
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public boolean hasImage() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public org.apache.mesos.Protos.Image getImage() {
if (imageBuilder_ == null) {
return image_;
} else {
return imageBuilder_.getMessage();
}
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public Builder setImage(org.apache.mesos.Protos.Image value) {
if (imageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
image_ = value;
onChanged();
} else {
imageBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public Builder setImage(
org.apache.mesos.Protos.Image.Builder builderForValue) {
if (imageBuilder_ == null) {
image_ = builderForValue.build();
onChanged();
} else {
imageBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public Builder mergeImage(org.apache.mesos.Protos.Image value) {
if (imageBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008) &&
image_ != org.apache.mesos.Protos.Image.getDefaultInstance()) {
image_ =
org.apache.mesos.Protos.Image.newBuilder(image_).mergeFrom(value).buildPartial();
} else {
image_ = value;
}
onChanged();
} else {
imageBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public Builder clearImage() {
if (imageBuilder_ == null) {
image_ = org.apache.mesos.Protos.Image.getDefaultInstance();
onChanged();
} else {
imageBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public org.apache.mesos.Protos.Image.Builder getImageBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getImageFieldBuilder().getBuilder();
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
public org.apache.mesos.Protos.ImageOrBuilder getImageOrBuilder() {
if (imageBuilder_ != null) {
return imageBuilder_.getMessageOrBuilder();
} else {
return image_;
}
}
/**
* <code>optional .mesos.Image image = 4;</code>
*
* <pre>
* The source of the volume is an Image which describes a root
* filesystem which will be provisioned by Mesos.
* </pre>
*/
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.Image, org.apache.mesos.Protos.Image.Builder, org.apache.mesos.Protos.ImageOrBuilder>
getImageFieldBuilder() {
if (imageBuilder_ == null) {
imageBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.Image, org.apache.mesos.Protos.Image.Builder, org.apache.mesos.Protos.ImageOrBuilder>(
image_,
getParentForChildren(),
isClean());
image_ = null;
}
return imageBuilder_;
}
// optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;
private mesosphere.marathon.Protos.Volume.PersistentVolumeInfo persistent_ = mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo, mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.Builder, mesosphere.marathon.Protos.Volume.PersistentVolumeInfoOrBuilder> persistentBuilder_;
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public boolean hasPersistent() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.PersistentVolumeInfo getPersistent() {
if (persistentBuilder_ == null) {
return persistent_;
} else {
return persistentBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public Builder setPersistent(mesosphere.marathon.Protos.Volume.PersistentVolumeInfo value) {
if (persistentBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
persistent_ = value;
onChanged();
} else {
persistentBuilder_.setMessage(value);
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public Builder setPersistent(
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.Builder builderForValue) {
if (persistentBuilder_ == null) {
persistent_ = builderForValue.build();
onChanged();
} else {
persistentBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public Builder mergePersistent(mesosphere.marathon.Protos.Volume.PersistentVolumeInfo value) {
if (persistentBuilder_ == null) {
if (((bitField0_ & 0x00000010) == 0x00000010) &&
persistent_ != mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.getDefaultInstance()) {
persistent_ =
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.newBuilder(persistent_).mergeFrom(value).buildPartial();
} else {
persistent_ = value;
}
onChanged();
} else {
persistentBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public Builder clearPersistent() {
if (persistentBuilder_ == null) {
persistent_ = mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.getDefaultInstance();
onChanged();
} else {
persistentBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.Builder getPersistentBuilder() {
bitField0_ |= 0x00000010;
onChanged();
return getPersistentFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.PersistentVolumeInfoOrBuilder getPersistentOrBuilder() {
if (persistentBuilder_ != null) {
return persistentBuilder_.getMessageOrBuilder();
} else {
return persistent_;
}
}
/**
* <code>optional .mesosphere.marathon.Volume.PersistentVolumeInfo persistent = 5;</code>
*
* <pre>
* Defines a Persistent Volume; implies no hostPath or external.
* </pre>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo, mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.Builder, mesosphere.marathon.Protos.Volume.PersistentVolumeInfoOrBuilder>
getPersistentFieldBuilder() {
if (persistentBuilder_ == null) {
persistentBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.Volume.PersistentVolumeInfo, mesosphere.marathon.Protos.Volume.PersistentVolumeInfo.Builder, mesosphere.marathon.Protos.Volume.PersistentVolumeInfoOrBuilder>(
persistent_,
getParentForChildren(),
isClean());
persistent_ = null;
}
return persistentBuilder_;
}
// optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;
private mesosphere.marathon.Protos.Volume.ExternalVolumeInfo external_ = mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo, mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.Builder, mesosphere.marathon.Protos.Volume.ExternalVolumeInfoOrBuilder> externalBuilder_;
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public boolean hasExternal() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.ExternalVolumeInfo getExternal() {
if (externalBuilder_ == null) {
return external_;
} else {
return externalBuilder_.getMessage();
}
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public Builder setExternal(mesosphere.marathon.Protos.Volume.ExternalVolumeInfo value) {
if (externalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
external_ = value;
onChanged();
} else {
externalBuilder_.setMessage(value);
}
bitField0_ |= 0x00000020;
return this;
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public Builder setExternal(
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.Builder builderForValue) {
if (externalBuilder_ == null) {
external_ = builderForValue.build();
onChanged();
} else {
externalBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000020;
return this;
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public Builder mergeExternal(mesosphere.marathon.Protos.Volume.ExternalVolumeInfo value) {
if (externalBuilder_ == null) {
if (((bitField0_ & 0x00000020) == 0x00000020) &&
external_ != mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.getDefaultInstance()) {
external_ =
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.newBuilder(external_).mergeFrom(value).buildPartial();
} else {
external_ = value;
}
onChanged();
} else {
externalBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000020;
return this;
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public Builder clearExternal() {
if (externalBuilder_ == null) {
external_ = mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.getDefaultInstance();
onChanged();
} else {
externalBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.Builder getExternalBuilder() {
bitField0_ |= 0x00000020;
onChanged();
return getExternalFieldBuilder().getBuilder();
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
public mesosphere.marathon.Protos.Volume.ExternalVolumeInfoOrBuilder getExternalOrBuilder() {
if (externalBuilder_ != null) {
return externalBuilder_.getMessageOrBuilder();
} else {
return external_;
}
}
/**
* <code>optional .mesosphere.marathon.Volume.ExternalVolumeInfo external = 6;</code>
*
* <pre>
* Defines an External Volume; implies no hostPath or persistent.
* </pre>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo, mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.Builder, mesosphere.marathon.Protos.Volume.ExternalVolumeInfoOrBuilder>
getExternalFieldBuilder() {
if (externalBuilder_ == null) {
externalBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.Volume.ExternalVolumeInfo, mesosphere.marathon.Protos.Volume.ExternalVolumeInfo.Builder, mesosphere.marathon.Protos.Volume.ExternalVolumeInfoOrBuilder>(
external_,
getParentForChildren(),
isClean());
external_ = null;
}
return externalBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.Volume)
}
static {
defaultInstance = new Volume(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.Volume)
}
public interface EventSubscribersOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated string callback_urls = 1;
/**
* <code>repeated string callback_urls = 1;</code>
*/
java.util.List<java.lang.String>
getCallbackUrlsList();
/**
* <code>repeated string callback_urls = 1;</code>
*/
int getCallbackUrlsCount();
/**
* <code>repeated string callback_urls = 1;</code>
*/
java.lang.String getCallbackUrls(int index);
/**
* <code>repeated string callback_urls = 1;</code>
*/
com.google.protobuf.ByteString
getCallbackUrlsBytes(int index);
}
/**
* Protobuf type {@code mesosphere.marathon.EventSubscribers}
*/
public static final class EventSubscribers extends
com.google.protobuf.GeneratedMessage
implements EventSubscribersOrBuilder {
// Use EventSubscribers.newBuilder() to construct.
private EventSubscribers(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private EventSubscribers(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final EventSubscribers defaultInstance;
public static EventSubscribers getDefaultInstance() {
return defaultInstance;
}
public EventSubscribers getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private EventSubscribers(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
callbackUrls_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
callbackUrls_.add(input.readBytes());
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
callbackUrls_ = new com.google.protobuf.UnmodifiableLazyStringList(callbackUrls_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_EventSubscribers_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_EventSubscribers_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.EventSubscribers.class, mesosphere.marathon.Protos.EventSubscribers.Builder.class);
}
public static com.google.protobuf.Parser<EventSubscribers> PARSER =
new com.google.protobuf.AbstractParser<EventSubscribers>() {
public EventSubscribers parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new EventSubscribers(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<EventSubscribers> getParserForType() {
return PARSER;
}
// repeated string callback_urls = 1;
public static final int CALLBACK_URLS_FIELD_NUMBER = 1;
private com.google.protobuf.LazyStringList callbackUrls_;
/**
* <code>repeated string callback_urls = 1;</code>
*/
public java.util.List<java.lang.String>
getCallbackUrlsList() {
return callbackUrls_;
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public int getCallbackUrlsCount() {
return callbackUrls_.size();
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public java.lang.String getCallbackUrls(int index) {
return callbackUrls_.get(index);
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public com.google.protobuf.ByteString
getCallbackUrlsBytes(int index) {
return callbackUrls_.getByteString(index);
}
private void initFields() {
callbackUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < callbackUrls_.size(); i++) {
output.writeBytes(1, callbackUrls_.getByteString(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < callbackUrls_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(callbackUrls_.getByteString(i));
}
size += dataSize;
size += 1 * getCallbackUrlsList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.EventSubscribers parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.EventSubscribers parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.EventSubscribers parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.EventSubscribers parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.EventSubscribers parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.EventSubscribers parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.EventSubscribers parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.EventSubscribers parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.EventSubscribers parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.EventSubscribers parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.EventSubscribers prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.EventSubscribers}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.EventSubscribersOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_EventSubscribers_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_EventSubscribers_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.EventSubscribers.class, mesosphere.marathon.Protos.EventSubscribers.Builder.class);
}
// Construct using mesosphere.marathon.Protos.EventSubscribers.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
callbackUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_EventSubscribers_descriptor;
}
public mesosphere.marathon.Protos.EventSubscribers getDefaultInstanceForType() {
return mesosphere.marathon.Protos.EventSubscribers.getDefaultInstance();
}
public mesosphere.marathon.Protos.EventSubscribers build() {
mesosphere.marathon.Protos.EventSubscribers result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.EventSubscribers buildPartial() {
mesosphere.marathon.Protos.EventSubscribers result = new mesosphere.marathon.Protos.EventSubscribers(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
callbackUrls_ = new com.google.protobuf.UnmodifiableLazyStringList(
callbackUrls_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.callbackUrls_ = callbackUrls_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.EventSubscribers) {
return mergeFrom((mesosphere.marathon.Protos.EventSubscribers)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.EventSubscribers other) {
if (other == mesosphere.marathon.Protos.EventSubscribers.getDefaultInstance()) return this;
if (!other.callbackUrls_.isEmpty()) {
if (callbackUrls_.isEmpty()) {
callbackUrls_ = other.callbackUrls_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureCallbackUrlsIsMutable();
callbackUrls_.addAll(other.callbackUrls_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.EventSubscribers parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.EventSubscribers) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// repeated string callback_urls = 1;
private com.google.protobuf.LazyStringList callbackUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureCallbackUrlsIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
callbackUrls_ = new com.google.protobuf.LazyStringArrayList(callbackUrls_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public java.util.List<java.lang.String>
getCallbackUrlsList() {
return java.util.Collections.unmodifiableList(callbackUrls_);
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public int getCallbackUrlsCount() {
return callbackUrls_.size();
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public java.lang.String getCallbackUrls(int index) {
return callbackUrls_.get(index);
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public com.google.protobuf.ByteString
getCallbackUrlsBytes(int index) {
return callbackUrls_.getByteString(index);
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public Builder setCallbackUrls(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureCallbackUrlsIsMutable();
callbackUrls_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public Builder addCallbackUrls(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureCallbackUrlsIsMutable();
callbackUrls_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public Builder addAllCallbackUrls(
java.lang.Iterable<java.lang.String> values) {
ensureCallbackUrlsIsMutable();
super.addAll(values, callbackUrls_);
onChanged();
return this;
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public Builder clearCallbackUrls() {
callbackUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>repeated string callback_urls = 1;</code>
*/
public Builder addCallbackUrlsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureCallbackUrlsIsMutable();
callbackUrls_.add(value);
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.EventSubscribers)
}
static {
defaultInstance = new EventSubscribers(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.EventSubscribers)
}
public interface StorageVersionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required uint32 major = 1;
/**
* <code>required uint32 major = 1;</code>
*/
boolean hasMajor();
/**
* <code>required uint32 major = 1;</code>
*/
int getMajor();
// required uint32 minor = 2;
/**
* <code>required uint32 minor = 2;</code>
*/
boolean hasMinor();
/**
* <code>required uint32 minor = 2;</code>
*/
int getMinor();
// required uint32 patch = 3;
/**
* <code>required uint32 patch = 3;</code>
*/
boolean hasPatch();
/**
* <code>required uint32 patch = 3;</code>
*/
int getPatch();
}
/**
* Protobuf type {@code mesosphere.marathon.StorageVersion}
*/
public static final class StorageVersion extends
com.google.protobuf.GeneratedMessage
implements StorageVersionOrBuilder {
// Use StorageVersion.newBuilder() to construct.
private StorageVersion(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private StorageVersion(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final StorageVersion defaultInstance;
public static StorageVersion getDefaultInstance() {
return defaultInstance;
}
public StorageVersion getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private StorageVersion(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
major_ = input.readUInt32();
break;
}
case 16: {
bitField0_ |= 0x00000002;
minor_ = input.readUInt32();
break;
}
case 24: {
bitField0_ |= 0x00000004;
patch_ = input.readUInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_StorageVersion_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_StorageVersion_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.StorageVersion.class, mesosphere.marathon.Protos.StorageVersion.Builder.class);
}
public static com.google.protobuf.Parser<StorageVersion> PARSER =
new com.google.protobuf.AbstractParser<StorageVersion>() {
public StorageVersion parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new StorageVersion(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<StorageVersion> getParserForType() {
return PARSER;
}
private int bitField0_;
// required uint32 major = 1;
public static final int MAJOR_FIELD_NUMBER = 1;
private int major_;
/**
* <code>required uint32 major = 1;</code>
*/
public boolean hasMajor() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint32 major = 1;</code>
*/
public int getMajor() {
return major_;
}
// required uint32 minor = 2;
public static final int MINOR_FIELD_NUMBER = 2;
private int minor_;
/**
* <code>required uint32 minor = 2;</code>
*/
public boolean hasMinor() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required uint32 minor = 2;</code>
*/
public int getMinor() {
return minor_;
}
// required uint32 patch = 3;
public static final int PATCH_FIELD_NUMBER = 3;
private int patch_;
/**
* <code>required uint32 patch = 3;</code>
*/
public boolean hasPatch() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required uint32 patch = 3;</code>
*/
public int getPatch() {
return patch_;
}
private void initFields() {
major_ = 0;
minor_ = 0;
patch_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasMajor()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasMinor()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasPatch()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt32(1, major_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeUInt32(2, minor_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeUInt32(3, patch_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, major_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, minor_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, patch_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.StorageVersion parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.StorageVersion parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.StorageVersion parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.StorageVersion parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.StorageVersion parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.StorageVersion parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.StorageVersion parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.StorageVersion parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.StorageVersion parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.StorageVersion parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.StorageVersion prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.StorageVersion}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.StorageVersionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_StorageVersion_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_StorageVersion_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.StorageVersion.class, mesosphere.marathon.Protos.StorageVersion.Builder.class);
}
// Construct using mesosphere.marathon.Protos.StorageVersion.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
major_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
minor_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
patch_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_StorageVersion_descriptor;
}
public mesosphere.marathon.Protos.StorageVersion getDefaultInstanceForType() {
return mesosphere.marathon.Protos.StorageVersion.getDefaultInstance();
}
public mesosphere.marathon.Protos.StorageVersion build() {
mesosphere.marathon.Protos.StorageVersion result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.StorageVersion buildPartial() {
mesosphere.marathon.Protos.StorageVersion result = new mesosphere.marathon.Protos.StorageVersion(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.major_ = major_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.minor_ = minor_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.patch_ = patch_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.StorageVersion) {
return mergeFrom((mesosphere.marathon.Protos.StorageVersion)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.StorageVersion other) {
if (other == mesosphere.marathon.Protos.StorageVersion.getDefaultInstance()) return this;
if (other.hasMajor()) {
setMajor(other.getMajor());
}
if (other.hasMinor()) {
setMinor(other.getMinor());
}
if (other.hasPatch()) {
setPatch(other.getPatch());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasMajor()) {
return false;
}
if (!hasMinor()) {
return false;
}
if (!hasPatch()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.StorageVersion parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.StorageVersion) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required uint32 major = 1;
private int major_ ;
/**
* <code>required uint32 major = 1;</code>
*/
public boolean hasMajor() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required uint32 major = 1;</code>
*/
public int getMajor() {
return major_;
}
/**
* <code>required uint32 major = 1;</code>
*/
public Builder setMajor(int value) {
bitField0_ |= 0x00000001;
major_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 major = 1;</code>
*/
public Builder clearMajor() {
bitField0_ = (bitField0_ & ~0x00000001);
major_ = 0;
onChanged();
return this;
}
// required uint32 minor = 2;
private int minor_ ;
/**
* <code>required uint32 minor = 2;</code>
*/
public boolean hasMinor() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required uint32 minor = 2;</code>
*/
public int getMinor() {
return minor_;
}
/**
* <code>required uint32 minor = 2;</code>
*/
public Builder setMinor(int value) {
bitField0_ |= 0x00000002;
minor_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 minor = 2;</code>
*/
public Builder clearMinor() {
bitField0_ = (bitField0_ & ~0x00000002);
minor_ = 0;
onChanged();
return this;
}
// required uint32 patch = 3;
private int patch_ ;
/**
* <code>required uint32 patch = 3;</code>
*/
public boolean hasPatch() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required uint32 patch = 3;</code>
*/
public int getPatch() {
return patch_;
}
/**
* <code>required uint32 patch = 3;</code>
*/
public Builder setPatch(int value) {
bitField0_ |= 0x00000004;
patch_ = value;
onChanged();
return this;
}
/**
* <code>required uint32 patch = 3;</code>
*/
public Builder clearPatch() {
bitField0_ = (bitField0_ & ~0x00000004);
patch_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.StorageVersion)
}
static {
defaultInstance = new StorageVersion(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.StorageVersion)
}
public interface UpgradeStrategyDefinitionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required double minimumHealthCapacity = 1;
/**
* <code>required double minimumHealthCapacity = 1;</code>
*/
boolean hasMinimumHealthCapacity();
/**
* <code>required double minimumHealthCapacity = 1;</code>
*/
double getMinimumHealthCapacity();
// optional double maximumOverCapacity = 2 [default = 1];
/**
* <code>optional double maximumOverCapacity = 2 [default = 1];</code>
*/
boolean hasMaximumOverCapacity();
/**
* <code>optional double maximumOverCapacity = 2 [default = 1];</code>
*/
double getMaximumOverCapacity();
}
/**
* Protobuf type {@code mesosphere.marathon.UpgradeStrategyDefinition}
*/
public static final class UpgradeStrategyDefinition extends
com.google.protobuf.GeneratedMessage
implements UpgradeStrategyDefinitionOrBuilder {
// Use UpgradeStrategyDefinition.newBuilder() to construct.
private UpgradeStrategyDefinition(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private UpgradeStrategyDefinition(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final UpgradeStrategyDefinition defaultInstance;
public static UpgradeStrategyDefinition getDefaultInstance() {
return defaultInstance;
}
public UpgradeStrategyDefinition getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private UpgradeStrategyDefinition(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 9: {
bitField0_ |= 0x00000001;
minimumHealthCapacity_ = input.readDouble();
break;
}
case 17: {
bitField0_ |= 0x00000002;
maximumOverCapacity_ = input.readDouble();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_UpgradeStrategyDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_UpgradeStrategyDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.UpgradeStrategyDefinition.class, mesosphere.marathon.Protos.UpgradeStrategyDefinition.Builder.class);
}
public static com.google.protobuf.Parser<UpgradeStrategyDefinition> PARSER =
new com.google.protobuf.AbstractParser<UpgradeStrategyDefinition>() {
public UpgradeStrategyDefinition parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new UpgradeStrategyDefinition(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<UpgradeStrategyDefinition> getParserForType() {
return PARSER;
}
private int bitField0_;
// required double minimumHealthCapacity = 1;
public static final int MINIMUMHEALTHCAPACITY_FIELD_NUMBER = 1;
private double minimumHealthCapacity_;
/**
* <code>required double minimumHealthCapacity = 1;</code>
*/
public boolean hasMinimumHealthCapacity() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required double minimumHealthCapacity = 1;</code>
*/
public double getMinimumHealthCapacity() {
return minimumHealthCapacity_;
}
// optional double maximumOverCapacity = 2 [default = 1];
public static final int MAXIMUMOVERCAPACITY_FIELD_NUMBER = 2;
private double maximumOverCapacity_;
/**
* <code>optional double maximumOverCapacity = 2 [default = 1];</code>
*/
public boolean hasMaximumOverCapacity() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional double maximumOverCapacity = 2 [default = 1];</code>
*/
public double getMaximumOverCapacity() {
return maximumOverCapacity_;
}
private void initFields() {
minimumHealthCapacity_ = 0D;
maximumOverCapacity_ = 1D;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasMinimumHealthCapacity()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeDouble(1, minimumHealthCapacity_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeDouble(2, maximumOverCapacity_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(1, minimumHealthCapacity_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(2, maximumOverCapacity_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.UpgradeStrategyDefinition parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.UpgradeStrategyDefinition prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.UpgradeStrategyDefinition}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.UpgradeStrategyDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_UpgradeStrategyDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_UpgradeStrategyDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.UpgradeStrategyDefinition.class, mesosphere.marathon.Protos.UpgradeStrategyDefinition.Builder.class);
}
// Construct using mesosphere.marathon.Protos.UpgradeStrategyDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
minimumHealthCapacity_ = 0D;
bitField0_ = (bitField0_ & ~0x00000001);
maximumOverCapacity_ = 1D;
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_UpgradeStrategyDefinition_descriptor;
}
public mesosphere.marathon.Protos.UpgradeStrategyDefinition getDefaultInstanceForType() {
return mesosphere.marathon.Protos.UpgradeStrategyDefinition.getDefaultInstance();
}
public mesosphere.marathon.Protos.UpgradeStrategyDefinition build() {
mesosphere.marathon.Protos.UpgradeStrategyDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.UpgradeStrategyDefinition buildPartial() {
mesosphere.marathon.Protos.UpgradeStrategyDefinition result = new mesosphere.marathon.Protos.UpgradeStrategyDefinition(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.minimumHealthCapacity_ = minimumHealthCapacity_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.maximumOverCapacity_ = maximumOverCapacity_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.UpgradeStrategyDefinition) {
return mergeFrom((mesosphere.marathon.Protos.UpgradeStrategyDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.UpgradeStrategyDefinition other) {
if (other == mesosphere.marathon.Protos.UpgradeStrategyDefinition.getDefaultInstance()) return this;
if (other.hasMinimumHealthCapacity()) {
setMinimumHealthCapacity(other.getMinimumHealthCapacity());
}
if (other.hasMaximumOverCapacity()) {
setMaximumOverCapacity(other.getMaximumOverCapacity());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasMinimumHealthCapacity()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.UpgradeStrategyDefinition parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.UpgradeStrategyDefinition) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required double minimumHealthCapacity = 1;
private double minimumHealthCapacity_ ;
/**
* <code>required double minimumHealthCapacity = 1;</code>
*/
public boolean hasMinimumHealthCapacity() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required double minimumHealthCapacity = 1;</code>
*/
public double getMinimumHealthCapacity() {
return minimumHealthCapacity_;
}
/**
* <code>required double minimumHealthCapacity = 1;</code>
*/
public Builder setMinimumHealthCapacity(double value) {
bitField0_ |= 0x00000001;
minimumHealthCapacity_ = value;
onChanged();
return this;
}
/**
* <code>required double minimumHealthCapacity = 1;</code>
*/
public Builder clearMinimumHealthCapacity() {
bitField0_ = (bitField0_ & ~0x00000001);
minimumHealthCapacity_ = 0D;
onChanged();
return this;
}
// optional double maximumOverCapacity = 2 [default = 1];
private double maximumOverCapacity_ = 1D;
/**
* <code>optional double maximumOverCapacity = 2 [default = 1];</code>
*/
public boolean hasMaximumOverCapacity() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional double maximumOverCapacity = 2 [default = 1];</code>
*/
public double getMaximumOverCapacity() {
return maximumOverCapacity_;
}
/**
* <code>optional double maximumOverCapacity = 2 [default = 1];</code>
*/
public Builder setMaximumOverCapacity(double value) {
bitField0_ |= 0x00000002;
maximumOverCapacity_ = value;
onChanged();
return this;
}
/**
* <code>optional double maximumOverCapacity = 2 [default = 1];</code>
*/
public Builder clearMaximumOverCapacity() {
bitField0_ = (bitField0_ & ~0x00000002);
maximumOverCapacity_ = 1D;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.UpgradeStrategyDefinition)
}
static {
defaultInstance = new UpgradeStrategyDefinition(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.UpgradeStrategyDefinition)
}
public interface GroupDefinitionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string id = 1;
/**
* <code>required string id = 1;</code>
*/
boolean hasId();
/**
* <code>required string id = 1;</code>
*/
java.lang.String getId();
/**
* <code>required string id = 1;</code>
*/
com.google.protobuf.ByteString
getIdBytes();
// required string version = 2;
/**
* <code>required string version = 2;</code>
*/
boolean hasVersion();
/**
* <code>required string version = 2;</code>
*/
java.lang.String getVersion();
/**
* <code>required string version = 2;</code>
*/
com.google.protobuf.ByteString
getVersionBytes();
// repeated .mesosphere.marathon.ServiceDefinition apps = 3;
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
java.util.List<mesosphere.marathon.Protos.ServiceDefinition>
getAppsList();
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
mesosphere.marathon.Protos.ServiceDefinition getApps(int index);
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
int getAppsCount();
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
java.util.List<? extends mesosphere.marathon.Protos.ServiceDefinitionOrBuilder>
getAppsOrBuilderList();
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
mesosphere.marathon.Protos.ServiceDefinitionOrBuilder getAppsOrBuilder(
int index);
// repeated .mesosphere.marathon.GroupDefinition groups = 4;
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
java.util.List<mesosphere.marathon.Protos.GroupDefinition>
getGroupsList();
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
mesosphere.marathon.Protos.GroupDefinition getGroups(int index);
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
int getGroupsCount();
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
java.util.List<? extends mesosphere.marathon.Protos.GroupDefinitionOrBuilder>
getGroupsOrBuilderList();
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
mesosphere.marathon.Protos.GroupDefinitionOrBuilder getGroupsOrBuilder(
int index);
// repeated string dependencies = 5;
/**
* <code>repeated string dependencies = 5;</code>
*/
java.util.List<java.lang.String>
getDependenciesList();
/**
* <code>repeated string dependencies = 5;</code>
*/
int getDependenciesCount();
/**
* <code>repeated string dependencies = 5;</code>
*/
java.lang.String getDependencies(int index);
/**
* <code>repeated string dependencies = 5;</code>
*/
com.google.protobuf.ByteString
getDependenciesBytes(int index);
}
/**
* Protobuf type {@code mesosphere.marathon.GroupDefinition}
*/
public static final class GroupDefinition extends
com.google.protobuf.GeneratedMessage
implements GroupDefinitionOrBuilder {
// Use GroupDefinition.newBuilder() to construct.
private GroupDefinition(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private GroupDefinition(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final GroupDefinition defaultInstance;
public static GroupDefinition getDefaultInstance() {
return defaultInstance;
}
public GroupDefinition getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private GroupDefinition(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
id_ = input.readBytes();
break;
}
case 18: {
bitField0_ |= 0x00000002;
version_ = input.readBytes();
break;
}
case 26: {
if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
apps_ = new java.util.ArrayList<mesosphere.marathon.Protos.ServiceDefinition>();
mutable_bitField0_ |= 0x00000004;
}
apps_.add(input.readMessage(mesosphere.marathon.Protos.ServiceDefinition.PARSER, extensionRegistry));
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
groups_ = new java.util.ArrayList<mesosphere.marathon.Protos.GroupDefinition>();
mutable_bitField0_ |= 0x00000008;
}
groups_.add(input.readMessage(mesosphere.marathon.Protos.GroupDefinition.PARSER, extensionRegistry));
break;
}
case 42: {
if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
dependencies_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000010;
}
dependencies_.add(input.readBytes());
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
apps_ = java.util.Collections.unmodifiableList(apps_);
}
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
groups_ = java.util.Collections.unmodifiableList(groups_);
}
if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
dependencies_ = new com.google.protobuf.UnmodifiableLazyStringList(dependencies_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_GroupDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_GroupDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.GroupDefinition.class, mesosphere.marathon.Protos.GroupDefinition.Builder.class);
}
public static com.google.protobuf.Parser<GroupDefinition> PARSER =
new com.google.protobuf.AbstractParser<GroupDefinition>() {
public GroupDefinition parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new GroupDefinition(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<GroupDefinition> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string id = 1;
public static final int ID_FIELD_NUMBER = 1;
private java.lang.Object id_;
/**
* <code>required string id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
id_ = s;
}
return s;
}
}
/**
* <code>required string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required string version = 2;
public static final int VERSION_FIELD_NUMBER = 2;
private java.lang.Object version_;
/**
* <code>required string version = 2;</code>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string version = 2;</code>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
version_ = s;
}
return s;
}
}
/**
* <code>required string version = 2;</code>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// repeated .mesosphere.marathon.ServiceDefinition apps = 3;
public static final int APPS_FIELD_NUMBER = 3;
private java.util.List<mesosphere.marathon.Protos.ServiceDefinition> apps_;
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ServiceDefinition> getAppsList() {
return apps_;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.ServiceDefinitionOrBuilder>
getAppsOrBuilderList() {
return apps_;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public int getAppsCount() {
return apps_.size();
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public mesosphere.marathon.Protos.ServiceDefinition getApps(int index) {
return apps_.get(index);
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public mesosphere.marathon.Protos.ServiceDefinitionOrBuilder getAppsOrBuilder(
int index) {
return apps_.get(index);
}
// repeated .mesosphere.marathon.GroupDefinition groups = 4;
public static final int GROUPS_FIELD_NUMBER = 4;
private java.util.List<mesosphere.marathon.Protos.GroupDefinition> groups_;
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public java.util.List<mesosphere.marathon.Protos.GroupDefinition> getGroupsList() {
return groups_;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.GroupDefinitionOrBuilder>
getGroupsOrBuilderList() {
return groups_;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public int getGroupsCount() {
return groups_.size();
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition getGroups(int index) {
return groups_.get(index);
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinitionOrBuilder getGroupsOrBuilder(
int index) {
return groups_.get(index);
}
// repeated string dependencies = 5;
public static final int DEPENDENCIES_FIELD_NUMBER = 5;
private com.google.protobuf.LazyStringList dependencies_;
/**
* <code>repeated string dependencies = 5;</code>
*/
public java.util.List<java.lang.String>
getDependenciesList() {
return dependencies_;
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public int getDependenciesCount() {
return dependencies_.size();
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public java.lang.String getDependencies(int index) {
return dependencies_.get(index);
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public com.google.protobuf.ByteString
getDependenciesBytes(int index) {
return dependencies_.getByteString(index);
}
private void initFields() {
id_ = "";
version_ = "";
apps_ = java.util.Collections.emptyList();
groups_ = java.util.Collections.emptyList();
dependencies_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasId()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasVersion()) {
memoizedIsInitialized = 0;
return false;
}
for (int i = 0; i < getAppsCount(); i++) {
if (!getApps(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getGroupsCount(); i++) {
if (!getGroups(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getVersionBytes());
}
for (int i = 0; i < apps_.size(); i++) {
output.writeMessage(3, apps_.get(i));
}
for (int i = 0; i < groups_.size(); i++) {
output.writeMessage(4, groups_.get(i));
}
for (int i = 0; i < dependencies_.size(); i++) {
output.writeBytes(5, dependencies_.getByteString(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getVersionBytes());
}
for (int i = 0; i < apps_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, apps_.get(i));
}
for (int i = 0; i < groups_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, groups_.get(i));
}
{
int dataSize = 0;
for (int i = 0; i < dependencies_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(dependencies_.getByteString(i));
}
size += dataSize;
size += 1 * getDependenciesList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.GroupDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.GroupDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.GroupDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.GroupDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.GroupDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.GroupDefinition parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.GroupDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.GroupDefinition parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.GroupDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.GroupDefinition parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.GroupDefinition prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.GroupDefinition}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.GroupDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_GroupDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_GroupDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.GroupDefinition.class, mesosphere.marathon.Protos.GroupDefinition.Builder.class);
}
// Construct using mesosphere.marathon.Protos.GroupDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getAppsFieldBuilder();
getGroupsFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
id_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
version_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
if (appsBuilder_ == null) {
apps_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
} else {
appsBuilder_.clear();
}
if (groupsBuilder_ == null) {
groups_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
} else {
groupsBuilder_.clear();
}
dependencies_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_GroupDefinition_descriptor;
}
public mesosphere.marathon.Protos.GroupDefinition getDefaultInstanceForType() {
return mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
}
public mesosphere.marathon.Protos.GroupDefinition build() {
mesosphere.marathon.Protos.GroupDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.GroupDefinition buildPartial() {
mesosphere.marathon.Protos.GroupDefinition result = new mesosphere.marathon.Protos.GroupDefinition(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.id_ = id_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.version_ = version_;
if (appsBuilder_ == null) {
if (((bitField0_ & 0x00000004) == 0x00000004)) {
apps_ = java.util.Collections.unmodifiableList(apps_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.apps_ = apps_;
} else {
result.apps_ = appsBuilder_.build();
}
if (groupsBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008)) {
groups_ = java.util.Collections.unmodifiableList(groups_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.groups_ = groups_;
} else {
result.groups_ = groupsBuilder_.build();
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
dependencies_ = new com.google.protobuf.UnmodifiableLazyStringList(
dependencies_);
bitField0_ = (bitField0_ & ~0x00000010);
}
result.dependencies_ = dependencies_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.GroupDefinition) {
return mergeFrom((mesosphere.marathon.Protos.GroupDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.GroupDefinition other) {
if (other == mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance()) return this;
if (other.hasId()) {
bitField0_ |= 0x00000001;
id_ = other.id_;
onChanged();
}
if (other.hasVersion()) {
bitField0_ |= 0x00000002;
version_ = other.version_;
onChanged();
}
if (appsBuilder_ == null) {
if (!other.apps_.isEmpty()) {
if (apps_.isEmpty()) {
apps_ = other.apps_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureAppsIsMutable();
apps_.addAll(other.apps_);
}
onChanged();
}
} else {
if (!other.apps_.isEmpty()) {
if (appsBuilder_.isEmpty()) {
appsBuilder_.dispose();
appsBuilder_ = null;
apps_ = other.apps_;
bitField0_ = (bitField0_ & ~0x00000004);
appsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getAppsFieldBuilder() : null;
} else {
appsBuilder_.addAllMessages(other.apps_);
}
}
}
if (groupsBuilder_ == null) {
if (!other.groups_.isEmpty()) {
if (groups_.isEmpty()) {
groups_ = other.groups_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureGroupsIsMutable();
groups_.addAll(other.groups_);
}
onChanged();
}
} else {
if (!other.groups_.isEmpty()) {
if (groupsBuilder_.isEmpty()) {
groupsBuilder_.dispose();
groupsBuilder_ = null;
groups_ = other.groups_;
bitField0_ = (bitField0_ & ~0x00000008);
groupsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getGroupsFieldBuilder() : null;
} else {
groupsBuilder_.addAllMessages(other.groups_);
}
}
}
if (!other.dependencies_.isEmpty()) {
if (dependencies_.isEmpty()) {
dependencies_ = other.dependencies_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureDependenciesIsMutable();
dependencies_.addAll(other.dependencies_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasId()) {
return false;
}
if (!hasVersion()) {
return false;
}
for (int i = 0; i < getAppsCount(); i++) {
if (!getApps(i).isInitialized()) {
return false;
}
}
for (int i = 0; i < getGroupsCount(); i++) {
if (!getGroups(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.GroupDefinition parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.GroupDefinition) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string id = 1;
private java.lang.Object id_ = "";
/**
* <code>required string id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string id = 1;</code>
*/
public Builder setId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
/**
* <code>required string id = 1;</code>
*/
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000001);
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
* <code>required string id = 1;</code>
*/
public Builder setIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
// required string version = 2;
private java.lang.Object version_ = "";
/**
* <code>required string version = 2;</code>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string version = 2;</code>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
version_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string version = 2;</code>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string version = 2;</code>
*/
public Builder setVersion(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
version_ = value;
onChanged();
return this;
}
/**
* <code>required string version = 2;</code>
*/
public Builder clearVersion() {
bitField0_ = (bitField0_ & ~0x00000002);
version_ = getDefaultInstance().getVersion();
onChanged();
return this;
}
/**
* <code>required string version = 2;</code>
*/
public Builder setVersionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
version_ = value;
onChanged();
return this;
}
// repeated .mesosphere.marathon.ServiceDefinition apps = 3;
private java.util.List<mesosphere.marathon.Protos.ServiceDefinition> apps_ =
java.util.Collections.emptyList();
private void ensureAppsIsMutable() {
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
apps_ = new java.util.ArrayList<mesosphere.marathon.Protos.ServiceDefinition>(apps_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ServiceDefinition, mesosphere.marathon.Protos.ServiceDefinition.Builder, mesosphere.marathon.Protos.ServiceDefinitionOrBuilder> appsBuilder_;
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ServiceDefinition> getAppsList() {
if (appsBuilder_ == null) {
return java.util.Collections.unmodifiableList(apps_);
} else {
return appsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public int getAppsCount() {
if (appsBuilder_ == null) {
return apps_.size();
} else {
return appsBuilder_.getCount();
}
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public mesosphere.marathon.Protos.ServiceDefinition getApps(int index) {
if (appsBuilder_ == null) {
return apps_.get(index);
} else {
return appsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder setApps(
int index, mesosphere.marathon.Protos.ServiceDefinition value) {
if (appsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAppsIsMutable();
apps_.set(index, value);
onChanged();
} else {
appsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder setApps(
int index, mesosphere.marathon.Protos.ServiceDefinition.Builder builderForValue) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
apps_.set(index, builderForValue.build());
onChanged();
} else {
appsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder addApps(mesosphere.marathon.Protos.ServiceDefinition value) {
if (appsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAppsIsMutable();
apps_.add(value);
onChanged();
} else {
appsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder addApps(
int index, mesosphere.marathon.Protos.ServiceDefinition value) {
if (appsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAppsIsMutable();
apps_.add(index, value);
onChanged();
} else {
appsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder addApps(
mesosphere.marathon.Protos.ServiceDefinition.Builder builderForValue) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
apps_.add(builderForValue.build());
onChanged();
} else {
appsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder addApps(
int index, mesosphere.marathon.Protos.ServiceDefinition.Builder builderForValue) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
apps_.add(index, builderForValue.build());
onChanged();
} else {
appsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder addAllApps(
java.lang.Iterable<? extends mesosphere.marathon.Protos.ServiceDefinition> values) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
super.addAll(values, apps_);
onChanged();
} else {
appsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder clearApps() {
if (appsBuilder_ == null) {
apps_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
appsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public Builder removeApps(int index) {
if (appsBuilder_ == null) {
ensureAppsIsMutable();
apps_.remove(index);
onChanged();
} else {
appsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public mesosphere.marathon.Protos.ServiceDefinition.Builder getAppsBuilder(
int index) {
return getAppsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public mesosphere.marathon.Protos.ServiceDefinitionOrBuilder getAppsOrBuilder(
int index) {
if (appsBuilder_ == null) {
return apps_.get(index); } else {
return appsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.ServiceDefinitionOrBuilder>
getAppsOrBuilderList() {
if (appsBuilder_ != null) {
return appsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(apps_);
}
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public mesosphere.marathon.Protos.ServiceDefinition.Builder addAppsBuilder() {
return getAppsFieldBuilder().addBuilder(
mesosphere.marathon.Protos.ServiceDefinition.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public mesosphere.marathon.Protos.ServiceDefinition.Builder addAppsBuilder(
int index) {
return getAppsFieldBuilder().addBuilder(
index, mesosphere.marathon.Protos.ServiceDefinition.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.ServiceDefinition apps = 3;</code>
*/
public java.util.List<mesosphere.marathon.Protos.ServiceDefinition.Builder>
getAppsBuilderList() {
return getAppsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ServiceDefinition, mesosphere.marathon.Protos.ServiceDefinition.Builder, mesosphere.marathon.Protos.ServiceDefinitionOrBuilder>
getAppsFieldBuilder() {
if (appsBuilder_ == null) {
appsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.ServiceDefinition, mesosphere.marathon.Protos.ServiceDefinition.Builder, mesosphere.marathon.Protos.ServiceDefinitionOrBuilder>(
apps_,
((bitField0_ & 0x00000004) == 0x00000004),
getParentForChildren(),
isClean());
apps_ = null;
}
return appsBuilder_;
}
// repeated .mesosphere.marathon.GroupDefinition groups = 4;
private java.util.List<mesosphere.marathon.Protos.GroupDefinition> groups_ =
java.util.Collections.emptyList();
private void ensureGroupsIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
groups_ = new java.util.ArrayList<mesosphere.marathon.Protos.GroupDefinition>(groups_);
bitField0_ |= 0x00000008;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder> groupsBuilder_;
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public java.util.List<mesosphere.marathon.Protos.GroupDefinition> getGroupsList() {
if (groupsBuilder_ == null) {
return java.util.Collections.unmodifiableList(groups_);
} else {
return groupsBuilder_.getMessageList();
}
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public int getGroupsCount() {
if (groupsBuilder_ == null) {
return groups_.size();
} else {
return groupsBuilder_.getCount();
}
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition getGroups(int index) {
if (groupsBuilder_ == null) {
return groups_.get(index);
} else {
return groupsBuilder_.getMessage(index);
}
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder setGroups(
int index, mesosphere.marathon.Protos.GroupDefinition value) {
if (groupsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureGroupsIsMutable();
groups_.set(index, value);
onChanged();
} else {
groupsBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder setGroups(
int index, mesosphere.marathon.Protos.GroupDefinition.Builder builderForValue) {
if (groupsBuilder_ == null) {
ensureGroupsIsMutable();
groups_.set(index, builderForValue.build());
onChanged();
} else {
groupsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder addGroups(mesosphere.marathon.Protos.GroupDefinition value) {
if (groupsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureGroupsIsMutable();
groups_.add(value);
onChanged();
} else {
groupsBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder addGroups(
int index, mesosphere.marathon.Protos.GroupDefinition value) {
if (groupsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureGroupsIsMutable();
groups_.add(index, value);
onChanged();
} else {
groupsBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder addGroups(
mesosphere.marathon.Protos.GroupDefinition.Builder builderForValue) {
if (groupsBuilder_ == null) {
ensureGroupsIsMutable();
groups_.add(builderForValue.build());
onChanged();
} else {
groupsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder addGroups(
int index, mesosphere.marathon.Protos.GroupDefinition.Builder builderForValue) {
if (groupsBuilder_ == null) {
ensureGroupsIsMutable();
groups_.add(index, builderForValue.build());
onChanged();
} else {
groupsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder addAllGroups(
java.lang.Iterable<? extends mesosphere.marathon.Protos.GroupDefinition> values) {
if (groupsBuilder_ == null) {
ensureGroupsIsMutable();
super.addAll(values, groups_);
onChanged();
} else {
groupsBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder clearGroups() {
if (groupsBuilder_ == null) {
groups_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
} else {
groupsBuilder_.clear();
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public Builder removeGroups(int index) {
if (groupsBuilder_ == null) {
ensureGroupsIsMutable();
groups_.remove(index);
onChanged();
} else {
groupsBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition.Builder getGroupsBuilder(
int index) {
return getGroupsFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinitionOrBuilder getGroupsOrBuilder(
int index) {
if (groupsBuilder_ == null) {
return groups_.get(index); } else {
return groupsBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public java.util.List<? extends mesosphere.marathon.Protos.GroupDefinitionOrBuilder>
getGroupsOrBuilderList() {
if (groupsBuilder_ != null) {
return groupsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(groups_);
}
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition.Builder addGroupsBuilder() {
return getGroupsFieldBuilder().addBuilder(
mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition.Builder addGroupsBuilder(
int index) {
return getGroupsFieldBuilder().addBuilder(
index, mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance());
}
/**
* <code>repeated .mesosphere.marathon.GroupDefinition groups = 4;</code>
*/
public java.util.List<mesosphere.marathon.Protos.GroupDefinition.Builder>
getGroupsBuilderList() {
return getGroupsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder>
getGroupsFieldBuilder() {
if (groupsBuilder_ == null) {
groupsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder>(
groups_,
((bitField0_ & 0x00000008) == 0x00000008),
getParentForChildren(),
isClean());
groups_ = null;
}
return groupsBuilder_;
}
// repeated string dependencies = 5;
private com.google.protobuf.LazyStringList dependencies_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureDependenciesIsMutable() {
if (!((bitField0_ & 0x00000010) == 0x00000010)) {
dependencies_ = new com.google.protobuf.LazyStringArrayList(dependencies_);
bitField0_ |= 0x00000010;
}
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public java.util.List<java.lang.String>
getDependenciesList() {
return java.util.Collections.unmodifiableList(dependencies_);
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public int getDependenciesCount() {
return dependencies_.size();
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public java.lang.String getDependencies(int index) {
return dependencies_.get(index);
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public com.google.protobuf.ByteString
getDependenciesBytes(int index) {
return dependencies_.getByteString(index);
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public Builder setDependencies(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureDependenciesIsMutable();
dependencies_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public Builder addDependencies(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureDependenciesIsMutable();
dependencies_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public Builder addAllDependencies(
java.lang.Iterable<java.lang.String> values) {
ensureDependenciesIsMutable();
super.addAll(values, dependencies_);
onChanged();
return this;
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public Builder clearDependencies() {
dependencies_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
return this;
}
/**
* <code>repeated string dependencies = 5;</code>
*/
public Builder addDependenciesBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureDependenciesIsMutable();
dependencies_.add(value);
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.GroupDefinition)
}
static {
defaultInstance = new GroupDefinition(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.GroupDefinition)
}
public interface DeploymentPlanDefinitionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string id = 1;
/**
* <code>required string id = 1;</code>
*/
boolean hasId();
/**
* <code>required string id = 1;</code>
*/
java.lang.String getId();
/**
* <code>required string id = 1;</code>
*/
com.google.protobuf.ByteString
getIdBytes();
// required string version = 2;
/**
* <code>required string version = 2;</code>
*/
boolean hasVersion();
/**
* <code>required string version = 2;</code>
*/
java.lang.String getVersion();
/**
* <code>required string version = 2;</code>
*/
com.google.protobuf.ByteString
getVersionBytes();
// required .mesosphere.marathon.GroupDefinition original = 4;
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
boolean hasOriginal();
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
mesosphere.marathon.Protos.GroupDefinition getOriginal();
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
mesosphere.marathon.Protos.GroupDefinitionOrBuilder getOriginalOrBuilder();
// required .mesosphere.marathon.GroupDefinition target = 5;
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
boolean hasTarget();
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
mesosphere.marathon.Protos.GroupDefinition getTarget();
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
mesosphere.marathon.Protos.GroupDefinitionOrBuilder getTargetOrBuilder();
}
/**
* Protobuf type {@code mesosphere.marathon.DeploymentPlanDefinition}
*/
public static final class DeploymentPlanDefinition extends
com.google.protobuf.GeneratedMessage
implements DeploymentPlanDefinitionOrBuilder {
// Use DeploymentPlanDefinition.newBuilder() to construct.
private DeploymentPlanDefinition(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private DeploymentPlanDefinition(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final DeploymentPlanDefinition defaultInstance;
public static DeploymentPlanDefinition getDefaultInstance() {
return defaultInstance;
}
public DeploymentPlanDefinition getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DeploymentPlanDefinition(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
id_ = input.readBytes();
break;
}
case 18: {
bitField0_ |= 0x00000002;
version_ = input.readBytes();
break;
}
case 34: {
mesosphere.marathon.Protos.GroupDefinition.Builder subBuilder = null;
if (((bitField0_ & 0x00000004) == 0x00000004)) {
subBuilder = original_.toBuilder();
}
original_ = input.readMessage(mesosphere.marathon.Protos.GroupDefinition.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(original_);
original_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000004;
break;
}
case 42: {
mesosphere.marathon.Protos.GroupDefinition.Builder subBuilder = null;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
subBuilder = target_.toBuilder();
}
target_ = input.readMessage(mesosphere.marathon.Protos.GroupDefinition.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(target_);
target_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000008;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DeploymentPlanDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DeploymentPlanDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.DeploymentPlanDefinition.class, mesosphere.marathon.Protos.DeploymentPlanDefinition.Builder.class);
}
public static com.google.protobuf.Parser<DeploymentPlanDefinition> PARSER =
new com.google.protobuf.AbstractParser<DeploymentPlanDefinition>() {
public DeploymentPlanDefinition parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DeploymentPlanDefinition(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<DeploymentPlanDefinition> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string id = 1;
public static final int ID_FIELD_NUMBER = 1;
private java.lang.Object id_;
/**
* <code>required string id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
id_ = s;
}
return s;
}
}
/**
* <code>required string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required string version = 2;
public static final int VERSION_FIELD_NUMBER = 2;
private java.lang.Object version_;
/**
* <code>required string version = 2;</code>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string version = 2;</code>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
version_ = s;
}
return s;
}
}
/**
* <code>required string version = 2;</code>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required .mesosphere.marathon.GroupDefinition original = 4;
public static final int ORIGINAL_FIELD_NUMBER = 4;
private mesosphere.marathon.Protos.GroupDefinition original_;
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public boolean hasOriginal() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition getOriginal() {
return original_;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinitionOrBuilder getOriginalOrBuilder() {
return original_;
}
// required .mesosphere.marathon.GroupDefinition target = 5;
public static final int TARGET_FIELD_NUMBER = 5;
private mesosphere.marathon.Protos.GroupDefinition target_;
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public boolean hasTarget() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition getTarget() {
return target_;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public mesosphere.marathon.Protos.GroupDefinitionOrBuilder getTargetOrBuilder() {
return target_;
}
private void initFields() {
id_ = "";
version_ = "";
original_ = mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
target_ = mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasId()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasVersion()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasOriginal()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTarget()) {
memoizedIsInitialized = 0;
return false;
}
if (!getOriginal().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
if (!getTarget().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getVersionBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeMessage(4, original_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeMessage(5, target_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getVersionBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, original_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, target_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.DeploymentPlanDefinition parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.DeploymentPlanDefinition prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.DeploymentPlanDefinition}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.DeploymentPlanDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DeploymentPlanDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DeploymentPlanDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.DeploymentPlanDefinition.class, mesosphere.marathon.Protos.DeploymentPlanDefinition.Builder.class);
}
// Construct using mesosphere.marathon.Protos.DeploymentPlanDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getOriginalFieldBuilder();
getTargetFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
id_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
version_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
if (originalBuilder_ == null) {
original_ = mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
} else {
originalBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
if (targetBuilder_ == null) {
target_ = mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
} else {
targetBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_DeploymentPlanDefinition_descriptor;
}
public mesosphere.marathon.Protos.DeploymentPlanDefinition getDefaultInstanceForType() {
return mesosphere.marathon.Protos.DeploymentPlanDefinition.getDefaultInstance();
}
public mesosphere.marathon.Protos.DeploymentPlanDefinition build() {
mesosphere.marathon.Protos.DeploymentPlanDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.DeploymentPlanDefinition buildPartial() {
mesosphere.marathon.Protos.DeploymentPlanDefinition result = new mesosphere.marathon.Protos.DeploymentPlanDefinition(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.id_ = id_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.version_ = version_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
if (originalBuilder_ == null) {
result.original_ = original_;
} else {
result.original_ = originalBuilder_.build();
}
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
if (targetBuilder_ == null) {
result.target_ = target_;
} else {
result.target_ = targetBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.DeploymentPlanDefinition) {
return mergeFrom((mesosphere.marathon.Protos.DeploymentPlanDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.DeploymentPlanDefinition other) {
if (other == mesosphere.marathon.Protos.DeploymentPlanDefinition.getDefaultInstance()) return this;
if (other.hasId()) {
bitField0_ |= 0x00000001;
id_ = other.id_;
onChanged();
}
if (other.hasVersion()) {
bitField0_ |= 0x00000002;
version_ = other.version_;
onChanged();
}
if (other.hasOriginal()) {
mergeOriginal(other.getOriginal());
}
if (other.hasTarget()) {
mergeTarget(other.getTarget());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasId()) {
return false;
}
if (!hasVersion()) {
return false;
}
if (!hasOriginal()) {
return false;
}
if (!hasTarget()) {
return false;
}
if (!getOriginal().isInitialized()) {
return false;
}
if (!getTarget().isInitialized()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.DeploymentPlanDefinition parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.DeploymentPlanDefinition) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string id = 1;
private java.lang.Object id_ = "";
/**
* <code>required string id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string id = 1;</code>
*/
public Builder setId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
/**
* <code>required string id = 1;</code>
*/
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000001);
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
* <code>required string id = 1;</code>
*/
public Builder setIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
// required string version = 2;
private java.lang.Object version_ = "";
/**
* <code>required string version = 2;</code>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string version = 2;</code>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
version_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string version = 2;</code>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string version = 2;</code>
*/
public Builder setVersion(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
version_ = value;
onChanged();
return this;
}
/**
* <code>required string version = 2;</code>
*/
public Builder clearVersion() {
bitField0_ = (bitField0_ & ~0x00000002);
version_ = getDefaultInstance().getVersion();
onChanged();
return this;
}
/**
* <code>required string version = 2;</code>
*/
public Builder setVersionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
version_ = value;
onChanged();
return this;
}
// required .mesosphere.marathon.GroupDefinition original = 4;
private mesosphere.marathon.Protos.GroupDefinition original_ = mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder> originalBuilder_;
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public boolean hasOriginal() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition getOriginal() {
if (originalBuilder_ == null) {
return original_;
} else {
return originalBuilder_.getMessage();
}
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public Builder setOriginal(mesosphere.marathon.Protos.GroupDefinition value) {
if (originalBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
original_ = value;
onChanged();
} else {
originalBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public Builder setOriginal(
mesosphere.marathon.Protos.GroupDefinition.Builder builderForValue) {
if (originalBuilder_ == null) {
original_ = builderForValue.build();
onChanged();
} else {
originalBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public Builder mergeOriginal(mesosphere.marathon.Protos.GroupDefinition value) {
if (originalBuilder_ == null) {
if (((bitField0_ & 0x00000004) == 0x00000004) &&
original_ != mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance()) {
original_ =
mesosphere.marathon.Protos.GroupDefinition.newBuilder(original_).mergeFrom(value).buildPartial();
} else {
original_ = value;
}
onChanged();
} else {
originalBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000004;
return this;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public Builder clearOriginal() {
if (originalBuilder_ == null) {
original_ = mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
onChanged();
} else {
originalBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition.Builder getOriginalBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getOriginalFieldBuilder().getBuilder();
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
public mesosphere.marathon.Protos.GroupDefinitionOrBuilder getOriginalOrBuilder() {
if (originalBuilder_ != null) {
return originalBuilder_.getMessageOrBuilder();
} else {
return original_;
}
}
/**
* <code>required .mesosphere.marathon.GroupDefinition original = 4;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder>
getOriginalFieldBuilder() {
if (originalBuilder_ == null) {
originalBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder>(
original_,
getParentForChildren(),
isClean());
original_ = null;
}
return originalBuilder_;
}
// required .mesosphere.marathon.GroupDefinition target = 5;
private mesosphere.marathon.Protos.GroupDefinition target_ = mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder> targetBuilder_;
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public boolean hasTarget() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition getTarget() {
if (targetBuilder_ == null) {
return target_;
} else {
return targetBuilder_.getMessage();
}
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public Builder setTarget(mesosphere.marathon.Protos.GroupDefinition value) {
if (targetBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
target_ = value;
onChanged();
} else {
targetBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public Builder setTarget(
mesosphere.marathon.Protos.GroupDefinition.Builder builderForValue) {
if (targetBuilder_ == null) {
target_ = builderForValue.build();
onChanged();
} else {
targetBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public Builder mergeTarget(mesosphere.marathon.Protos.GroupDefinition value) {
if (targetBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008) &&
target_ != mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance()) {
target_ =
mesosphere.marathon.Protos.GroupDefinition.newBuilder(target_).mergeFrom(value).buildPartial();
} else {
target_ = value;
}
onChanged();
} else {
targetBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public Builder clearTarget() {
if (targetBuilder_ == null) {
target_ = mesosphere.marathon.Protos.GroupDefinition.getDefaultInstance();
onChanged();
} else {
targetBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public mesosphere.marathon.Protos.GroupDefinition.Builder getTargetBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getTargetFieldBuilder().getBuilder();
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
public mesosphere.marathon.Protos.GroupDefinitionOrBuilder getTargetOrBuilder() {
if (targetBuilder_ != null) {
return targetBuilder_.getMessageOrBuilder();
} else {
return target_;
}
}
/**
* <code>required .mesosphere.marathon.GroupDefinition target = 5;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder>
getTargetFieldBuilder() {
if (targetBuilder_ == null) {
targetBuilder_ = new com.google.protobuf.SingleFieldBuilder<
mesosphere.marathon.Protos.GroupDefinition, mesosphere.marathon.Protos.GroupDefinition.Builder, mesosphere.marathon.Protos.GroupDefinitionOrBuilder>(
target_,
getParentForChildren(),
isClean());
target_ = null;
}
return targetBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.DeploymentPlanDefinition)
}
static {
defaultInstance = new DeploymentPlanDefinition(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.DeploymentPlanDefinition)
}
public interface TaskFailureOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string app_id = 1;
/**
* <code>required string app_id = 1;</code>
*/
boolean hasAppId();
/**
* <code>required string app_id = 1;</code>
*/
java.lang.String getAppId();
/**
* <code>required string app_id = 1;</code>
*/
com.google.protobuf.ByteString
getAppIdBytes();
// required .mesos.TaskID task_id = 2;
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
boolean hasTaskId();
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
org.apache.mesos.Protos.TaskID getTaskId();
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
org.apache.mesos.Protos.TaskIDOrBuilder getTaskIdOrBuilder();
// required .mesos.TaskState state = 3;
/**
* <code>required .mesos.TaskState state = 3;</code>
*/
boolean hasState();
/**
* <code>required .mesos.TaskState state = 3;</code>
*/
org.apache.mesos.Protos.TaskState getState();
// optional string message = 4 [default = ""];
/**
* <code>optional string message = 4 [default = ""];</code>
*/
boolean hasMessage();
/**
* <code>optional string message = 4 [default = ""];</code>
*/
java.lang.String getMessage();
/**
* <code>optional string message = 4 [default = ""];</code>
*/
com.google.protobuf.ByteString
getMessageBytes();
// optional string host = 5 [default = ""];
/**
* <code>optional string host = 5 [default = ""];</code>
*/
boolean hasHost();
/**
* <code>optional string host = 5 [default = ""];</code>
*/
java.lang.String getHost();
/**
* <code>optional string host = 5 [default = ""];</code>
*/
com.google.protobuf.ByteString
getHostBytes();
// required string version = 6;
/**
* <code>required string version = 6;</code>
*/
boolean hasVersion();
/**
* <code>required string version = 6;</code>
*/
java.lang.String getVersion();
/**
* <code>required string version = 6;</code>
*/
com.google.protobuf.ByteString
getVersionBytes();
// required string timestamp = 7;
/**
* <code>required string timestamp = 7;</code>
*/
boolean hasTimestamp();
/**
* <code>required string timestamp = 7;</code>
*/
java.lang.String getTimestamp();
/**
* <code>required string timestamp = 7;</code>
*/
com.google.protobuf.ByteString
getTimestampBytes();
// optional .mesos.SlaveID slaveId = 8;
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
boolean hasSlaveId();
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
org.apache.mesos.Protos.SlaveID getSlaveId();
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
org.apache.mesos.Protos.SlaveIDOrBuilder getSlaveIdOrBuilder();
}
/**
* Protobuf type {@code mesosphere.marathon.TaskFailure}
*/
public static final class TaskFailure extends
com.google.protobuf.GeneratedMessage
implements TaskFailureOrBuilder {
// Use TaskFailure.newBuilder() to construct.
private TaskFailure(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private TaskFailure(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final TaskFailure defaultInstance;
public static TaskFailure getDefaultInstance() {
return defaultInstance;
}
public TaskFailure getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TaskFailure(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
appId_ = input.readBytes();
break;
}
case 18: {
org.apache.mesos.Protos.TaskID.Builder subBuilder = null;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
subBuilder = taskId_.toBuilder();
}
taskId_ = input.readMessage(org.apache.mesos.Protos.TaskID.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(taskId_);
taskId_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000002;
break;
}
case 24: {
int rawValue = input.readEnum();
org.apache.mesos.Protos.TaskState value = org.apache.mesos.Protos.TaskState.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(3, rawValue);
} else {
bitField0_ |= 0x00000004;
state_ = value;
}
break;
}
case 34: {
bitField0_ |= 0x00000008;
message_ = input.readBytes();
break;
}
case 42: {
bitField0_ |= 0x00000010;
host_ = input.readBytes();
break;
}
case 50: {
bitField0_ |= 0x00000020;
version_ = input.readBytes();
break;
}
case 58: {
bitField0_ |= 0x00000040;
timestamp_ = input.readBytes();
break;
}
case 66: {
org.apache.mesos.Protos.SlaveID.Builder subBuilder = null;
if (((bitField0_ & 0x00000080) == 0x00000080)) {
subBuilder = slaveId_.toBuilder();
}
slaveId_ = input.readMessage(org.apache.mesos.Protos.SlaveID.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(slaveId_);
slaveId_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000080;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_TaskFailure_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_TaskFailure_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.TaskFailure.class, mesosphere.marathon.Protos.TaskFailure.Builder.class);
}
public static com.google.protobuf.Parser<TaskFailure> PARSER =
new com.google.protobuf.AbstractParser<TaskFailure>() {
public TaskFailure parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TaskFailure(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<TaskFailure> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string app_id = 1;
public static final int APP_ID_FIELD_NUMBER = 1;
private java.lang.Object appId_;
/**
* <code>required string app_id = 1;</code>
*/
public boolean hasAppId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string app_id = 1;</code>
*/
public java.lang.String getAppId() {
java.lang.Object ref = appId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
appId_ = s;
}
return s;
}
}
/**
* <code>required string app_id = 1;</code>
*/
public com.google.protobuf.ByteString
getAppIdBytes() {
java.lang.Object ref = appId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
appId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required .mesos.TaskID task_id = 2;
public static final int TASK_ID_FIELD_NUMBER = 2;
private org.apache.mesos.Protos.TaskID taskId_;
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public boolean hasTaskId() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public org.apache.mesos.Protos.TaskID getTaskId() {
return taskId_;
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public org.apache.mesos.Protos.TaskIDOrBuilder getTaskIdOrBuilder() {
return taskId_;
}
// required .mesos.TaskState state = 3;
public static final int STATE_FIELD_NUMBER = 3;
private org.apache.mesos.Protos.TaskState state_;
/**
* <code>required .mesos.TaskState state = 3;</code>
*/
public boolean hasState() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required .mesos.TaskState state = 3;</code>
*/
public org.apache.mesos.Protos.TaskState getState() {
return state_;
}
// optional string message = 4 [default = ""];
public static final int MESSAGE_FIELD_NUMBER = 4;
private java.lang.Object message_;
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public boolean hasMessage() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
message_ = s;
}
return s;
}
}
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public com.google.protobuf.ByteString
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional string host = 5 [default = ""];
public static final int HOST_FIELD_NUMBER = 5;
private java.lang.Object host_;
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public boolean hasHost() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public java.lang.String getHost() {
java.lang.Object ref = host_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
host_ = s;
}
return s;
}
}
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public com.google.protobuf.ByteString
getHostBytes() {
java.lang.Object ref = host_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
host_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required string version = 6;
public static final int VERSION_FIELD_NUMBER = 6;
private java.lang.Object version_;
/**
* <code>required string version = 6;</code>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required string version = 6;</code>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
version_ = s;
}
return s;
}
}
/**
* <code>required string version = 6;</code>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required string timestamp = 7;
public static final int TIMESTAMP_FIELD_NUMBER = 7;
private java.lang.Object timestamp_;
/**
* <code>required string timestamp = 7;</code>
*/
public boolean hasTimestamp() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>required string timestamp = 7;</code>
*/
public java.lang.String getTimestamp() {
java.lang.Object ref = timestamp_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
timestamp_ = s;
}
return s;
}
}
/**
* <code>required string timestamp = 7;</code>
*/
public com.google.protobuf.ByteString
getTimestampBytes() {
java.lang.Object ref = timestamp_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
timestamp_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .mesos.SlaveID slaveId = 8;
public static final int SLAVEID_FIELD_NUMBER = 8;
private org.apache.mesos.Protos.SlaveID slaveId_;
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public boolean hasSlaveId() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public org.apache.mesos.Protos.SlaveID getSlaveId() {
return slaveId_;
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public org.apache.mesos.Protos.SlaveIDOrBuilder getSlaveIdOrBuilder() {
return slaveId_;
}
private void initFields() {
appId_ = "";
taskId_ = org.apache.mesos.Protos.TaskID.getDefaultInstance();
state_ = org.apache.mesos.Protos.TaskState.TASK_STAGING;
message_ = "";
host_ = "";
version_ = "";
timestamp_ = "";
slaveId_ = org.apache.mesos.Protos.SlaveID.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasAppId()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTaskId()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasState()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasVersion()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTimestamp()) {
memoizedIsInitialized = 0;
return false;
}
if (!getTaskId().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
if (hasSlaveId()) {
if (!getSlaveId().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getAppIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeMessage(2, taskId_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeEnum(3, state_.getNumber());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(4, getMessageBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeBytes(5, getHostBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeBytes(6, getVersionBytes());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBytes(7, getTimestampBytes());
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeMessage(8, slaveId_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getAppIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, taskId_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, state_.getNumber());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, getMessageBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, getHostBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(6, getVersionBytes());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(7, getTimestampBytes());
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(8, slaveId_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.TaskFailure parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.TaskFailure parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.TaskFailure parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.TaskFailure parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.TaskFailure parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.TaskFailure parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.TaskFailure parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.TaskFailure parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.TaskFailure parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.TaskFailure parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.TaskFailure prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.TaskFailure}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.TaskFailureOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_TaskFailure_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_TaskFailure_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.TaskFailure.class, mesosphere.marathon.Protos.TaskFailure.Builder.class);
}
// Construct using mesosphere.marathon.Protos.TaskFailure.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getTaskIdFieldBuilder();
getSlaveIdFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
appId_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
if (taskIdBuilder_ == null) {
taskId_ = org.apache.mesos.Protos.TaskID.getDefaultInstance();
} else {
taskIdBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
state_ = org.apache.mesos.Protos.TaskState.TASK_STAGING;
bitField0_ = (bitField0_ & ~0x00000004);
message_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
host_ = "";
bitField0_ = (bitField0_ & ~0x00000010);
version_ = "";
bitField0_ = (bitField0_ & ~0x00000020);
timestamp_ = "";
bitField0_ = (bitField0_ & ~0x00000040);
if (slaveIdBuilder_ == null) {
slaveId_ = org.apache.mesos.Protos.SlaveID.getDefaultInstance();
} else {
slaveIdBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000080);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_TaskFailure_descriptor;
}
public mesosphere.marathon.Protos.TaskFailure getDefaultInstanceForType() {
return mesosphere.marathon.Protos.TaskFailure.getDefaultInstance();
}
public mesosphere.marathon.Protos.TaskFailure build() {
mesosphere.marathon.Protos.TaskFailure result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.TaskFailure buildPartial() {
mesosphere.marathon.Protos.TaskFailure result = new mesosphere.marathon.Protos.TaskFailure(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.appId_ = appId_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
if (taskIdBuilder_ == null) {
result.taskId_ = taskId_;
} else {
result.taskId_ = taskIdBuilder_.build();
}
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.state_ = state_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.message_ = message_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.host_ = host_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.version_ = version_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.timestamp_ = timestamp_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
if (slaveIdBuilder_ == null) {
result.slaveId_ = slaveId_;
} else {
result.slaveId_ = slaveIdBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.TaskFailure) {
return mergeFrom((mesosphere.marathon.Protos.TaskFailure)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.TaskFailure other) {
if (other == mesosphere.marathon.Protos.TaskFailure.getDefaultInstance()) return this;
if (other.hasAppId()) {
bitField0_ |= 0x00000001;
appId_ = other.appId_;
onChanged();
}
if (other.hasTaskId()) {
mergeTaskId(other.getTaskId());
}
if (other.hasState()) {
setState(other.getState());
}
if (other.hasMessage()) {
bitField0_ |= 0x00000008;
message_ = other.message_;
onChanged();
}
if (other.hasHost()) {
bitField0_ |= 0x00000010;
host_ = other.host_;
onChanged();
}
if (other.hasVersion()) {
bitField0_ |= 0x00000020;
version_ = other.version_;
onChanged();
}
if (other.hasTimestamp()) {
bitField0_ |= 0x00000040;
timestamp_ = other.timestamp_;
onChanged();
}
if (other.hasSlaveId()) {
mergeSlaveId(other.getSlaveId());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasAppId()) {
return false;
}
if (!hasTaskId()) {
return false;
}
if (!hasState()) {
return false;
}
if (!hasVersion()) {
return false;
}
if (!hasTimestamp()) {
return false;
}
if (!getTaskId().isInitialized()) {
return false;
}
if (hasSlaveId()) {
if (!getSlaveId().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.TaskFailure parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.TaskFailure) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string app_id = 1;
private java.lang.Object appId_ = "";
/**
* <code>required string app_id = 1;</code>
*/
public boolean hasAppId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string app_id = 1;</code>
*/
public java.lang.String getAppId() {
java.lang.Object ref = appId_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
appId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string app_id = 1;</code>
*/
public com.google.protobuf.ByteString
getAppIdBytes() {
java.lang.Object ref = appId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
appId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string app_id = 1;</code>
*/
public Builder setAppId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
appId_ = value;
onChanged();
return this;
}
/**
* <code>required string app_id = 1;</code>
*/
public Builder clearAppId() {
bitField0_ = (bitField0_ & ~0x00000001);
appId_ = getDefaultInstance().getAppId();
onChanged();
return this;
}
/**
* <code>required string app_id = 1;</code>
*/
public Builder setAppIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
appId_ = value;
onChanged();
return this;
}
// required .mesos.TaskID task_id = 2;
private org.apache.mesos.Protos.TaskID taskId_ = org.apache.mesos.Protos.TaskID.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.TaskID, org.apache.mesos.Protos.TaskID.Builder, org.apache.mesos.Protos.TaskIDOrBuilder> taskIdBuilder_;
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public boolean hasTaskId() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public org.apache.mesos.Protos.TaskID getTaskId() {
if (taskIdBuilder_ == null) {
return taskId_;
} else {
return taskIdBuilder_.getMessage();
}
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public Builder setTaskId(org.apache.mesos.Protos.TaskID value) {
if (taskIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
taskId_ = value;
onChanged();
} else {
taskIdBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public Builder setTaskId(
org.apache.mesos.Protos.TaskID.Builder builderForValue) {
if (taskIdBuilder_ == null) {
taskId_ = builderForValue.build();
onChanged();
} else {
taskIdBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public Builder mergeTaskId(org.apache.mesos.Protos.TaskID value) {
if (taskIdBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002) &&
taskId_ != org.apache.mesos.Protos.TaskID.getDefaultInstance()) {
taskId_ =
org.apache.mesos.Protos.TaskID.newBuilder(taskId_).mergeFrom(value).buildPartial();
} else {
taskId_ = value;
}
onChanged();
} else {
taskIdBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public Builder clearTaskId() {
if (taskIdBuilder_ == null) {
taskId_ = org.apache.mesos.Protos.TaskID.getDefaultInstance();
onChanged();
} else {
taskIdBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public org.apache.mesos.Protos.TaskID.Builder getTaskIdBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getTaskIdFieldBuilder().getBuilder();
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
public org.apache.mesos.Protos.TaskIDOrBuilder getTaskIdOrBuilder() {
if (taskIdBuilder_ != null) {
return taskIdBuilder_.getMessageOrBuilder();
} else {
return taskId_;
}
}
/**
* <code>required .mesos.TaskID task_id = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.TaskID, org.apache.mesos.Protos.TaskID.Builder, org.apache.mesos.Protos.TaskIDOrBuilder>
getTaskIdFieldBuilder() {
if (taskIdBuilder_ == null) {
taskIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.TaskID, org.apache.mesos.Protos.TaskID.Builder, org.apache.mesos.Protos.TaskIDOrBuilder>(
taskId_,
getParentForChildren(),
isClean());
taskId_ = null;
}
return taskIdBuilder_;
}
// required .mesos.TaskState state = 3;
private org.apache.mesos.Protos.TaskState state_ = org.apache.mesos.Protos.TaskState.TASK_STAGING;
/**
* <code>required .mesos.TaskState state = 3;</code>
*/
public boolean hasState() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required .mesos.TaskState state = 3;</code>
*/
public org.apache.mesos.Protos.TaskState getState() {
return state_;
}
/**
* <code>required .mesos.TaskState state = 3;</code>
*/
public Builder setState(org.apache.mesos.Protos.TaskState value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
state_ = value;
onChanged();
return this;
}
/**
* <code>required .mesos.TaskState state = 3;</code>
*/
public Builder clearState() {
bitField0_ = (bitField0_ & ~0x00000004);
state_ = org.apache.mesos.Protos.TaskState.TASK_STAGING;
onChanged();
return this;
}
// optional string message = 4 [default = ""];
private java.lang.Object message_ = "";
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public boolean hasMessage() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
message_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public com.google.protobuf.ByteString
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public Builder setMessage(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
message_ = value;
onChanged();
return this;
}
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public Builder clearMessage() {
bitField0_ = (bitField0_ & ~0x00000008);
message_ = getDefaultInstance().getMessage();
onChanged();
return this;
}
/**
* <code>optional string message = 4 [default = ""];</code>
*/
public Builder setMessageBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
message_ = value;
onChanged();
return this;
}
// optional string host = 5 [default = ""];
private java.lang.Object host_ = "";
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public boolean hasHost() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public java.lang.String getHost() {
java.lang.Object ref = host_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
host_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public com.google.protobuf.ByteString
getHostBytes() {
java.lang.Object ref = host_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
host_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public Builder setHost(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
host_ = value;
onChanged();
return this;
}
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public Builder clearHost() {
bitField0_ = (bitField0_ & ~0x00000010);
host_ = getDefaultInstance().getHost();
onChanged();
return this;
}
/**
* <code>optional string host = 5 [default = ""];</code>
*/
public Builder setHostBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
host_ = value;
onChanged();
return this;
}
// required string version = 6;
private java.lang.Object version_ = "";
/**
* <code>required string version = 6;</code>
*/
public boolean hasVersion() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required string version = 6;</code>
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
version_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string version = 6;</code>
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string version = 6;</code>
*/
public Builder setVersion(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
version_ = value;
onChanged();
return this;
}
/**
* <code>required string version = 6;</code>
*/
public Builder clearVersion() {
bitField0_ = (bitField0_ & ~0x00000020);
version_ = getDefaultInstance().getVersion();
onChanged();
return this;
}
/**
* <code>required string version = 6;</code>
*/
public Builder setVersionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
version_ = value;
onChanged();
return this;
}
// required string timestamp = 7;
private java.lang.Object timestamp_ = "";
/**
* <code>required string timestamp = 7;</code>
*/
public boolean hasTimestamp() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>required string timestamp = 7;</code>
*/
public java.lang.String getTimestamp() {
java.lang.Object ref = timestamp_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
timestamp_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string timestamp = 7;</code>
*/
public com.google.protobuf.ByteString
getTimestampBytes() {
java.lang.Object ref = timestamp_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
timestamp_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string timestamp = 7;</code>
*/
public Builder setTimestamp(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
timestamp_ = value;
onChanged();
return this;
}
/**
* <code>required string timestamp = 7;</code>
*/
public Builder clearTimestamp() {
bitField0_ = (bitField0_ & ~0x00000040);
timestamp_ = getDefaultInstance().getTimestamp();
onChanged();
return this;
}
/**
* <code>required string timestamp = 7;</code>
*/
public Builder setTimestampBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
timestamp_ = value;
onChanged();
return this;
}
// optional .mesos.SlaveID slaveId = 8;
private org.apache.mesos.Protos.SlaveID slaveId_ = org.apache.mesos.Protos.SlaveID.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.SlaveID, org.apache.mesos.Protos.SlaveID.Builder, org.apache.mesos.Protos.SlaveIDOrBuilder> slaveIdBuilder_;
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public boolean hasSlaveId() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public org.apache.mesos.Protos.SlaveID getSlaveId() {
if (slaveIdBuilder_ == null) {
return slaveId_;
} else {
return slaveIdBuilder_.getMessage();
}
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public Builder setSlaveId(org.apache.mesos.Protos.SlaveID value) {
if (slaveIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
slaveId_ = value;
onChanged();
} else {
slaveIdBuilder_.setMessage(value);
}
bitField0_ |= 0x00000080;
return this;
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public Builder setSlaveId(
org.apache.mesos.Protos.SlaveID.Builder builderForValue) {
if (slaveIdBuilder_ == null) {
slaveId_ = builderForValue.build();
onChanged();
} else {
slaveIdBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000080;
return this;
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public Builder mergeSlaveId(org.apache.mesos.Protos.SlaveID value) {
if (slaveIdBuilder_ == null) {
if (((bitField0_ & 0x00000080) == 0x00000080) &&
slaveId_ != org.apache.mesos.Protos.SlaveID.getDefaultInstance()) {
slaveId_ =
org.apache.mesos.Protos.SlaveID.newBuilder(slaveId_).mergeFrom(value).buildPartial();
} else {
slaveId_ = value;
}
onChanged();
} else {
slaveIdBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000080;
return this;
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public Builder clearSlaveId() {
if (slaveIdBuilder_ == null) {
slaveId_ = org.apache.mesos.Protos.SlaveID.getDefaultInstance();
onChanged();
} else {
slaveIdBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000080);
return this;
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public org.apache.mesos.Protos.SlaveID.Builder getSlaveIdBuilder() {
bitField0_ |= 0x00000080;
onChanged();
return getSlaveIdFieldBuilder().getBuilder();
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
public org.apache.mesos.Protos.SlaveIDOrBuilder getSlaveIdOrBuilder() {
if (slaveIdBuilder_ != null) {
return slaveIdBuilder_.getMessageOrBuilder();
} else {
return slaveId_;
}
}
/**
* <code>optional .mesos.SlaveID slaveId = 8;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.SlaveID, org.apache.mesos.Protos.SlaveID.Builder, org.apache.mesos.Protos.SlaveIDOrBuilder>
getSlaveIdFieldBuilder() {
if (slaveIdBuilder_ == null) {
slaveIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.apache.mesos.Protos.SlaveID, org.apache.mesos.Protos.SlaveID.Builder, org.apache.mesos.Protos.SlaveIDOrBuilder>(
slaveId_,
getParentForChildren(),
isClean());
slaveId_ = null;
}
return slaveIdBuilder_;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.TaskFailure)
}
static {
defaultInstance = new TaskFailure(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.TaskFailure)
}
public interface ZKStoreEntryOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string name = 1;
/**
* <code>required string name = 1;</code>
*/
boolean hasName();
/**
* <code>required string name = 1;</code>
*/
java.lang.String getName();
/**
* <code>required string name = 1;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
// required bytes uuid = 2;
/**
* <code>required bytes uuid = 2;</code>
*/
boolean hasUuid();
/**
* <code>required bytes uuid = 2;</code>
*/
com.google.protobuf.ByteString getUuid();
// required bytes value = 3;
/**
* <code>required bytes value = 3;</code>
*/
boolean hasValue();
/**
* <code>required bytes value = 3;</code>
*/
com.google.protobuf.ByteString getValue();
// optional bool compressed = 4 [default = false];
/**
* <code>optional bool compressed = 4 [default = false];</code>
*
* <pre>
* This flag indicates, if the byte array in value is gzip compressed
* Introduced in Marathon 0.12
* Optional to be backward compatible
* </pre>
*/
boolean hasCompressed();
/**
* <code>optional bool compressed = 4 [default = false];</code>
*
* <pre>
* This flag indicates, if the byte array in value is gzip compressed
* Introduced in Marathon 0.12
* Optional to be backward compatible
* </pre>
*/
boolean getCompressed();
}
/**
* Protobuf type {@code mesosphere.marathon.ZKStoreEntry}
*
* <pre>
**
* Describes a state entry, a versioned (via a UUID) key/value pair.
* Copied from libmesos (src/messages/state.pro) to ensure
* compatibility with ZooKeeperState from libmesos.
* </pre>
*/
public static final class ZKStoreEntry extends
com.google.protobuf.GeneratedMessage
implements ZKStoreEntryOrBuilder {
// Use ZKStoreEntry.newBuilder() to construct.
private ZKStoreEntry(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ZKStoreEntry(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ZKStoreEntry defaultInstance;
public static ZKStoreEntry getDefaultInstance() {
return defaultInstance;
}
public ZKStoreEntry getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ZKStoreEntry(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
name_ = input.readBytes();
break;
}
case 18: {
bitField0_ |= 0x00000002;
uuid_ = input.readBytes();
break;
}
case 26: {
bitField0_ |= 0x00000004;
value_ = input.readBytes();
break;
}
case 32: {
bitField0_ |= 0x00000008;
compressed_ = input.readBool();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ZKStoreEntry_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ZKStoreEntry_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ZKStoreEntry.class, mesosphere.marathon.Protos.ZKStoreEntry.Builder.class);
}
public static com.google.protobuf.Parser<ZKStoreEntry> PARSER =
new com.google.protobuf.AbstractParser<ZKStoreEntry>() {
public ZKStoreEntry parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ZKStoreEntry(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ZKStoreEntry> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string name = 1;
public static final int NAME_FIELD_NUMBER = 1;
private java.lang.Object name_;
/**
* <code>required string name = 1;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
name_ = s;
}
return s;
}
}
/**
* <code>required string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required bytes uuid = 2;
public static final int UUID_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString uuid_;
/**
* <code>required bytes uuid = 2;</code>
*/
public boolean hasUuid() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required bytes uuid = 2;</code>
*/
public com.google.protobuf.ByteString getUuid() {
return uuid_;
}
// required bytes value = 3;
public static final int VALUE_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString value_;
/**
* <code>required bytes value = 3;</code>
*/
public boolean hasValue() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required bytes value = 3;</code>
*/
public com.google.protobuf.ByteString getValue() {
return value_;
}
// optional bool compressed = 4 [default = false];
public static final int COMPRESSED_FIELD_NUMBER = 4;
private boolean compressed_;
/**
* <code>optional bool compressed = 4 [default = false];</code>
*
* <pre>
* This flag indicates, if the byte array in value is gzip compressed
* Introduced in Marathon 0.12
* Optional to be backward compatible
* </pre>
*/
public boolean hasCompressed() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional bool compressed = 4 [default = false];</code>
*
* <pre>
* This flag indicates, if the byte array in value is gzip compressed
* Introduced in Marathon 0.12
* Optional to be backward compatible
* </pre>
*/
public boolean getCompressed() {
return compressed_;
}
private void initFields() {
name_ = "";
uuid_ = com.google.protobuf.ByteString.EMPTY;
value_ = com.google.protobuf.ByteString.EMPTY;
compressed_ = false;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasName()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasUuid()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasValue()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getNameBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, uuid_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, value_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBool(4, compressed_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getNameBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, uuid_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, value_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(4, compressed_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ZKStoreEntry parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ZKStoreEntry prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ZKStoreEntry}
*
* <pre>
**
* Describes a state entry, a versioned (via a UUID) key/value pair.
* Copied from libmesos (src/messages/state.pro) to ensure
* compatibility with ZooKeeperState from libmesos.
* </pre>
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ZKStoreEntryOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ZKStoreEntry_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ZKStoreEntry_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ZKStoreEntry.class, mesosphere.marathon.Protos.ZKStoreEntry.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ZKStoreEntry.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
name_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
uuid_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
value_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000004);
compressed_ = false;
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ZKStoreEntry_descriptor;
}
public mesosphere.marathon.Protos.ZKStoreEntry getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ZKStoreEntry.getDefaultInstance();
}
public mesosphere.marathon.Protos.ZKStoreEntry build() {
mesosphere.marathon.Protos.ZKStoreEntry result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ZKStoreEntry buildPartial() {
mesosphere.marathon.Protos.ZKStoreEntry result = new mesosphere.marathon.Protos.ZKStoreEntry(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.name_ = name_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.uuid_ = uuid_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.value_ = value_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.compressed_ = compressed_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ZKStoreEntry) {
return mergeFrom((mesosphere.marathon.Protos.ZKStoreEntry)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ZKStoreEntry other) {
if (other == mesosphere.marathon.Protos.ZKStoreEntry.getDefaultInstance()) return this;
if (other.hasName()) {
bitField0_ |= 0x00000001;
name_ = other.name_;
onChanged();
}
if (other.hasUuid()) {
setUuid(other.getUuid());
}
if (other.hasValue()) {
setValue(other.getValue());
}
if (other.hasCompressed()) {
setCompressed(other.getCompressed());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasName()) {
return false;
}
if (!hasUuid()) {
return false;
}
if (!hasValue()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ZKStoreEntry parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ZKStoreEntry) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string name = 1;
private java.lang.Object name_ = "";
/**
* <code>required string name = 1;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string name = 1;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
name_ = value;
onChanged();
return this;
}
/**
* <code>required string name = 1;</code>
*/
public Builder clearName() {
bitField0_ = (bitField0_ & ~0x00000001);
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>required string name = 1;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
name_ = value;
onChanged();
return this;
}
// required bytes uuid = 2;
private com.google.protobuf.ByteString uuid_ = com.google.protobuf.ByteString.EMPTY;
/**
* <code>required bytes uuid = 2;</code>
*/
public boolean hasUuid() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required bytes uuid = 2;</code>
*/
public com.google.protobuf.ByteString getUuid() {
return uuid_;
}
/**
* <code>required bytes uuid = 2;</code>
*/
public Builder setUuid(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
uuid_ = value;
onChanged();
return this;
}
/**
* <code>required bytes uuid = 2;</code>
*/
public Builder clearUuid() {
bitField0_ = (bitField0_ & ~0x00000002);
uuid_ = getDefaultInstance().getUuid();
onChanged();
return this;
}
// required bytes value = 3;
private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
/**
* <code>required bytes value = 3;</code>
*/
public boolean hasValue() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required bytes value = 3;</code>
*/
public com.google.protobuf.ByteString getValue() {
return value_;
}
/**
* <code>required bytes value = 3;</code>
*/
public Builder setValue(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
value_ = value;
onChanged();
return this;
}
/**
* <code>required bytes value = 3;</code>
*/
public Builder clearValue() {
bitField0_ = (bitField0_ & ~0x00000004);
value_ = getDefaultInstance().getValue();
onChanged();
return this;
}
// optional bool compressed = 4 [default = false];
private boolean compressed_ ;
/**
* <code>optional bool compressed = 4 [default = false];</code>
*
* <pre>
* This flag indicates, if the byte array in value is gzip compressed
* Introduced in Marathon 0.12
* Optional to be backward compatible
* </pre>
*/
public boolean hasCompressed() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional bool compressed = 4 [default = false];</code>
*
* <pre>
* This flag indicates, if the byte array in value is gzip compressed
* Introduced in Marathon 0.12
* Optional to be backward compatible
* </pre>
*/
public boolean getCompressed() {
return compressed_;
}
/**
* <code>optional bool compressed = 4 [default = false];</code>
*
* <pre>
* This flag indicates, if the byte array in value is gzip compressed
* Introduced in Marathon 0.12
* Optional to be backward compatible
* </pre>
*/
public Builder setCompressed(boolean value) {
bitField0_ |= 0x00000008;
compressed_ = value;
onChanged();
return this;
}
/**
* <code>optional bool compressed = 4 [default = false];</code>
*
* <pre>
* This flag indicates, if the byte array in value is gzip compressed
* Introduced in Marathon 0.12
* Optional to be backward compatible
* </pre>
*/
public Builder clearCompressed() {
bitField0_ = (bitField0_ & ~0x00000008);
compressed_ = false;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ZKStoreEntry)
}
static {
defaultInstance = new ZKStoreEntry(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ZKStoreEntry)
}
public interface ResidencyDefinitionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional int64 relaunchEscalationTimeoutSeconds = 1;
/**
* <code>optional int64 relaunchEscalationTimeoutSeconds = 1;</code>
*/
boolean hasRelaunchEscalationTimeoutSeconds();
/**
* <code>optional int64 relaunchEscalationTimeoutSeconds = 1;</code>
*/
long getRelaunchEscalationTimeoutSeconds();
// optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;</code>
*/
boolean hasTaskLostBehavior();
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;</code>
*/
mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior getTaskLostBehavior();
}
/**
* Protobuf type {@code mesosphere.marathon.ResidencyDefinition}
*/
public static final class ResidencyDefinition extends
com.google.protobuf.GeneratedMessage
implements ResidencyDefinitionOrBuilder {
// Use ResidencyDefinition.newBuilder() to construct.
private ResidencyDefinition(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ResidencyDefinition(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ResidencyDefinition defaultInstance;
public static ResidencyDefinition getDefaultInstance() {
return defaultInstance;
}
public ResidencyDefinition getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ResidencyDefinition(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
relaunchEscalationTimeoutSeconds_ = input.readInt64();
break;
}
case 16: {
int rawValue = input.readEnum();
mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior value = mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(2, rawValue);
} else {
bitField0_ |= 0x00000002;
taskLostBehavior_ = value;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResidencyDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResidencyDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ResidencyDefinition.class, mesosphere.marathon.Protos.ResidencyDefinition.Builder.class);
}
public static com.google.protobuf.Parser<ResidencyDefinition> PARSER =
new com.google.protobuf.AbstractParser<ResidencyDefinition>() {
public ResidencyDefinition parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ResidencyDefinition(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ResidencyDefinition> getParserForType() {
return PARSER;
}
/**
* Protobuf enum {@code mesosphere.marathon.ResidencyDefinition.TaskLostBehavior}
*/
public enum TaskLostBehavior
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>RELAUNCH_AFTER_TIMEOUT = 0;</code>
*/
RELAUNCH_AFTER_TIMEOUT(0, 0),
/**
* <code>WAIT_FOREVER = 1;</code>
*/
WAIT_FOREVER(1, 1),
;
/**
* <code>RELAUNCH_AFTER_TIMEOUT = 0;</code>
*/
public static final int RELAUNCH_AFTER_TIMEOUT_VALUE = 0;
/**
* <code>WAIT_FOREVER = 1;</code>
*/
public static final int WAIT_FOREVER_VALUE = 1;
public final int getNumber() { return value; }
public static TaskLostBehavior valueOf(int value) {
switch (value) {
case 0: return RELAUNCH_AFTER_TIMEOUT;
case 1: return WAIT_FOREVER;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<TaskLostBehavior>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<TaskLostBehavior>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<TaskLostBehavior>() {
public TaskLostBehavior findValueByNumber(int number) {
return TaskLostBehavior.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return mesosphere.marathon.Protos.ResidencyDefinition.getDescriptor().getEnumTypes().get(0);
}
private static final TaskLostBehavior[] VALUES = values();
public static TaskLostBehavior valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private TaskLostBehavior(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:mesosphere.marathon.ResidencyDefinition.TaskLostBehavior)
}
private int bitField0_;
// optional int64 relaunchEscalationTimeoutSeconds = 1;
public static final int RELAUNCHESCALATIONTIMEOUTSECONDS_FIELD_NUMBER = 1;
private long relaunchEscalationTimeoutSeconds_;
/**
* <code>optional int64 relaunchEscalationTimeoutSeconds = 1;</code>
*/
public boolean hasRelaunchEscalationTimeoutSeconds() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional int64 relaunchEscalationTimeoutSeconds = 1;</code>
*/
public long getRelaunchEscalationTimeoutSeconds() {
return relaunchEscalationTimeoutSeconds_;
}
// optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;
public static final int TASKLOSTBEHAVIOR_FIELD_NUMBER = 2;
private mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior taskLostBehavior_;
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;</code>
*/
public boolean hasTaskLostBehavior() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;</code>
*/
public mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior getTaskLostBehavior() {
return taskLostBehavior_;
}
private void initFields() {
relaunchEscalationTimeoutSeconds_ = 0L;
taskLostBehavior_ = mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior.RELAUNCH_AFTER_TIMEOUT;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeInt64(1, relaunchEscalationTimeoutSeconds_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeEnum(2, taskLostBehavior_.getNumber());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(1, relaunchEscalationTimeoutSeconds_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, taskLostBehavior_.getNumber());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static mesosphere.marathon.Protos.ResidencyDefinition parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(mesosphere.marathon.Protos.ResidencyDefinition prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code mesosphere.marathon.ResidencyDefinition}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements mesosphere.marathon.Protos.ResidencyDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResidencyDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResidencyDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
mesosphere.marathon.Protos.ResidencyDefinition.class, mesosphere.marathon.Protos.ResidencyDefinition.Builder.class);
}
// Construct using mesosphere.marathon.Protos.ResidencyDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
relaunchEscalationTimeoutSeconds_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
taskLostBehavior_ = mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior.RELAUNCH_AFTER_TIMEOUT;
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return mesosphere.marathon.Protos.internal_static_mesosphere_marathon_ResidencyDefinition_descriptor;
}
public mesosphere.marathon.Protos.ResidencyDefinition getDefaultInstanceForType() {
return mesosphere.marathon.Protos.ResidencyDefinition.getDefaultInstance();
}
public mesosphere.marathon.Protos.ResidencyDefinition build() {
mesosphere.marathon.Protos.ResidencyDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public mesosphere.marathon.Protos.ResidencyDefinition buildPartial() {
mesosphere.marathon.Protos.ResidencyDefinition result = new mesosphere.marathon.Protos.ResidencyDefinition(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.relaunchEscalationTimeoutSeconds_ = relaunchEscalationTimeoutSeconds_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.taskLostBehavior_ = taskLostBehavior_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof mesosphere.marathon.Protos.ResidencyDefinition) {
return mergeFrom((mesosphere.marathon.Protos.ResidencyDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(mesosphere.marathon.Protos.ResidencyDefinition other) {
if (other == mesosphere.marathon.Protos.ResidencyDefinition.getDefaultInstance()) return this;
if (other.hasRelaunchEscalationTimeoutSeconds()) {
setRelaunchEscalationTimeoutSeconds(other.getRelaunchEscalationTimeoutSeconds());
}
if (other.hasTaskLostBehavior()) {
setTaskLostBehavior(other.getTaskLostBehavior());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
mesosphere.marathon.Protos.ResidencyDefinition parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (mesosphere.marathon.Protos.ResidencyDefinition) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// optional int64 relaunchEscalationTimeoutSeconds = 1;
private long relaunchEscalationTimeoutSeconds_ ;
/**
* <code>optional int64 relaunchEscalationTimeoutSeconds = 1;</code>
*/
public boolean hasRelaunchEscalationTimeoutSeconds() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional int64 relaunchEscalationTimeoutSeconds = 1;</code>
*/
public long getRelaunchEscalationTimeoutSeconds() {
return relaunchEscalationTimeoutSeconds_;
}
/**
* <code>optional int64 relaunchEscalationTimeoutSeconds = 1;</code>
*/
public Builder setRelaunchEscalationTimeoutSeconds(long value) {
bitField0_ |= 0x00000001;
relaunchEscalationTimeoutSeconds_ = value;
onChanged();
return this;
}
/**
* <code>optional int64 relaunchEscalationTimeoutSeconds = 1;</code>
*/
public Builder clearRelaunchEscalationTimeoutSeconds() {
bitField0_ = (bitField0_ & ~0x00000001);
relaunchEscalationTimeoutSeconds_ = 0L;
onChanged();
return this;
}
// optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;
private mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior taskLostBehavior_ = mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior.RELAUNCH_AFTER_TIMEOUT;
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;</code>
*/
public boolean hasTaskLostBehavior() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;</code>
*/
public mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior getTaskLostBehavior() {
return taskLostBehavior_;
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;</code>
*/
public Builder setTaskLostBehavior(mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
taskLostBehavior_ = value;
onChanged();
return this;
}
/**
* <code>optional .mesosphere.marathon.ResidencyDefinition.TaskLostBehavior taskLostBehavior = 2;</code>
*/
public Builder clearTaskLostBehavior() {
bitField0_ = (bitField0_ & ~0x00000002);
taskLostBehavior_ = mesosphere.marathon.Protos.ResidencyDefinition.TaskLostBehavior.RELAUNCH_AFTER_TIMEOUT;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:mesosphere.marathon.ResidencyDefinition)
}
static {
defaultInstance = new ResidencyDefinition(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:mesosphere.marathon.ResidencyDefinition)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_Constraint_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_Constraint_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_HealthCheckDefinition_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_HealthCheckDefinition_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ReadinessCheckDefinition_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ReadinessCheckDefinition_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_IpAddress_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_IpAddress_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_DiscoveryInfo_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_DiscoveryInfo_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ServiceDefinition_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ServiceDefinition_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ResourceRoles_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ResourceRoles_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_MarathonTask_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_MarathonTask_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_MarathonTask_Reservation_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_MarathonTask_Reservation_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_MarathonApp_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_MarathonApp_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ContainerInfo_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ContainerInfo_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ExtendedContainerInfo_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ExtendedContainerInfo_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_Volume_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_Volume_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_EventSubscribers_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_EventSubscribers_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_StorageVersion_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_StorageVersion_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_UpgradeStrategyDefinition_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_UpgradeStrategyDefinition_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_GroupDefinition_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_GroupDefinition_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_DeploymentPlanDefinition_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_DeploymentPlanDefinition_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_TaskFailure_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_TaskFailure_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ZKStoreEntry_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ZKStoreEntry_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_mesosphere_marathon_ResidencyDefinition_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_mesosphere_marathon_ResidencyDefinition_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\016marathon.proto\022\023mesosphere.marathon\032\021m" +
"esos/mesos.proto\"\257\001\n\nConstraint\022\r\n\005field" +
"\030\001 \002(\t\022:\n\010operator\030\002 \002(\0162(.mesosphere.ma" +
"rathon.Constraint.Operator\022\r\n\005value\030\003 \001(" +
"\t\"G\n\010Operator\022\n\n\006UNIQUE\020\000\022\010\n\004LIKE\020\001\022\013\n\007C" +
"LUSTER\020\002\022\014\n\010GROUP_BY\020\003\022\n\n\006UNLIKE\020\004\"\206\003\n\025H" +
"ealthCheckDefinition\022E\n\010protocol\030\001 \002(\01623" +
".mesosphere.marathon.HealthCheckDefiniti" +
"on.Protocol\022\021\n\tportIndex\030\002 \001(\r\022\036\n\022graceP" +
"eriodSeconds\030\003 \001(\r:\00215\022\033\n\017intervalSecond",
"s\030\004 \001(\r:\00210\022\032\n\016timeoutSeconds\030\005 \001(\r:\00220\022" +
"\017\n\004path\030\006 \001(\t:\001/\022!\n\026maxConsecutiveFailur" +
"es\030\007 \001(\r:\0013\022#\n\007command\030\010 \001(\0132\022.mesos.Com" +
"mandInfo\022\034\n\rignoreHttp1xx\030\t \001(\010:\005false\022\014" +
"\n\004port\030\n \001(\r\"5\n\010Protocol\022\010\n\004HTTP\020\000\022\007\n\003TC" +
"P\020\001\022\013\n\007COMMAND\020\002\022\t\n\005HTTPS\020\003\"\240\002\n\030Readines" +
"sCheckDefinition\022\014\n\004name\030\001 \001(\t\022H\n\010protoc" +
"ol\030\002 \001(\01626.mesosphere.marathon.Readiness" +
"CheckDefinition.Protocol\022\014\n\004path\030\003 \001(\t\022\020" +
"\n\010portName\030\004 \001(\t\022\026\n\016intervalMillis\030\005 \001(\004",
"\022\025\n\rtimeoutMillis\030\006 \001(\004\022\036\n\026httpStatusCod" +
"eForReady\030\007 \003(\r\022\034\n\024preserveLastResponse\030" +
"\010 \001(\010\"\037\n\010Protocol\022\010\n\004HTTP\020\000\022\t\n\005HTTPS\020\001\"t" +
"\n\tIpAddress\022\016\n\006groups\030\001 \003(\t\022\034\n\006labels\030\002 " +
"\003(\0132\014.mesos.Label\0229\n\rdiscoveryInfo\030\003 \001(\013" +
"2\".mesosphere.marathon.DiscoveryInfo\"+\n\r" +
"DiscoveryInfo\022\032\n\005ports\030\001 \003(\0132\013.mesos.Por" +
"t\"\272\010\n\021ServiceDefinition\022\n\n\002id\030\001 \002(\t\022\037\n\003c" +
"md\030\002 \002(\0132\022.mesos.CommandInfo\022\021\n\tinstance" +
"s\030\003 \002(\r\022\"\n\tresources\030\004 \003(\0132\017.mesos.Resou",
"rce\022\023\n\013description\030\005 \001(\t\022\r\n\005ports\030\006 \003(\r\022" +
"4\n\013constraints\030\007 \003(\0132\037.mesosphere.marath" +
"on.Constraint\022\022\n\010executor\030\010 \002(\t:\000\022>\n\022OBS" +
"OLETE_container\030\n \001(\0132\".mesosphere.marat" +
"hon.ContainerInfo\022)\n\007version\030\013 \001(\t:\0301970" +
"-01-01T00:00:00.000Z\022@\n\014healthChecks\030\014 \003" +
"(\0132*.mesosphere.marathon.HealthCheckDefi" +
"nition\022\025\n\007backoff\030\r \001(\003:\0041000\022\033\n\rbackoff" +
"Factor\030\016 \001(\001:\0041.15\022G\n\017upgradeStrategy\030\017 " +
"\001(\0132..mesosphere.marathon.UpgradeStrateg",
"yDefinition\022\024\n\014dependencies\030\020 \003(\t\022\021\n\tsto" +
"reUrls\030\021 \003(\t\022\034\n\rrequire_ports\030\022 \001(\010:\005fal" +
"se\022=\n\tcontainer\030\023 \001(\0132*.mesosphere.marat" +
"hon.ExtendedContainerInfo\022 \n\006labels\030\024 \003(" +
"\0132\020.mesos.Parameter\022\037\n\016maxLaunchDelay\030\025 " +
"\001(\003:\0073600000\022A\n\025acceptedResourceRoles\030\026 " +
"\001(\0132\".mesosphere.marathon.ResourceRoles\022" +
"\027\n\017last_scaling_at\030\027 \001(\003\022\035\n\025last_config_" +
"change_at\030\030 \001(\003\0221\n\tipAddress\030\031 \001(\0132\036.mes" +
"osphere.marathon.IpAddress\022;\n\tresidency\030",
"\032 \001(\0132(.mesosphere.marathon.ResidencyDef" +
"inition\022$\n\017portDefinitions\030\033 \003(\0132\013.mesos" +
".Port\022O\n\030readinessCheckDefinition\030\034 \003(\0132" +
"-.mesosphere.marathon.ReadinessCheckDefi" +
"nition\"\035\n\rResourceRoles\022\014\n\004role\030\001 \003(\t\"\260\007" +
"\n\014MarathonTask\022\n\n\002id\030\001 \002(\t\022\014\n\004host\030\002 \001(\t" +
"\022\r\n\005ports\030\003 \003(\r\022$\n\nattributes\030\004 \003(\0132\020.me" +
"sos.Attribute\022\021\n\tstaged_at\030\005 \001(\003\022\022\n\nstar" +
"ted_at\030\006 \001(\003\022,\n\021OBSOLETE_statuses\030\007 \003(\0132" +
"\021.mesos.TaskStatus\022)\n\007version\030\010 \001(\t:\030197",
"0-01-01T00:00:00.000Z\022!\n\006status\030\t \001(\0132\021." +
"mesos.TaskStatus\022\037\n\007slaveId\030\n \001(\0132\016.meso" +
"s.SlaveID\022-\n\021OBSOLETE_networks\030\013 \003(\0132\022.m" +
"esos.NetworkInfo\022B\n\013reservation\030\014 \001(\0132-." +
"mesosphere.marathon.MarathonTask.Reserva" +
"tion\032\231\004\n\013Reservation\022\030\n\020local_volume_ids" +
"\030\001 \003(\t\022B\n\005state\030\002 \002(\01323.mesosphere.marat" +
"hon.MarathonTask.Reservation.State\032\253\003\n\005S" +
"tate\022F\n\004type\030\001 \002(\01628.mesosphere.marathon" +
".MarathonTask.Reservation.State.Type\022L\n\007",
"timeout\030\002 \001(\0132;.mesosphere.marathon.Mara" +
"thonTask.Reservation.State.Timeout\032\303\001\n\007T" +
"imeout\022\021\n\tinitiated\030\001 \002(\003\022\020\n\010deadline\030\002 " +
"\002(\003\022R\n\006reason\030\003 \002(\0162B.mesosphere.maratho" +
"n.MarathonTask.Reservation.State.Timeout" +
".Reason\"?\n\006Reason\022\035\n\031RelaunchEscalationT" +
"imeout\020\001\022\026\n\022ReservationTimeout\020\002\"F\n\004Type" +
"\022\007\n\003New\020\001\022\014\n\010Launched\020\002\022\r\n\tSuspended\020\003\022\013" +
"\n\007Garbage\020\004\022\013\n\007Unknown\020\005\"M\n\013MarathonApp\022" +
"\014\n\004name\030\001 \001(\t\0220\n\005tasks\030\002 \003(\0132!.mesospher",
"e.marathon.MarathonTask\"1\n\rContainerInfo" +
"\022\017\n\005image\030\001 \002(\014:\000\022\017\n\007options\030\002 \003(\014\"\332\004\n\025E" +
"xtendedContainerInfo\022\'\n\004type\030\001 \002(\0162\031.mes" +
"os.ContainerInfo.Type\022,\n\007volumes\030\002 \003(\0132\033" +
".mesosphere.marathon.Volume\022E\n\006docker\030\003 " +
"\001(\01325.mesosphere.marathon.ExtendedContai" +
"nerInfo.DockerInfo\032\242\003\n\nDockerInfo\022\r\n\005ima" +
"ge\030\001 \002(\t\022>\n\007network\030\002 \001(\0162\'.mesos.Contai" +
"nerInfo.DockerInfo.Network:\004HOST\022X\n\rport" +
"_mappings\030\003 \003(\0132A.mesosphere.marathon.Ex",
"tendedContainerInfo.DockerInfo.PortMappi" +
"ng\022\031\n\nprivileged\030\004 \001(\010:\005false\022$\n\nparamet" +
"ers\030\005 \003(\0132\020.mesos.Parameter\022\030\n\020force_pul" +
"l_image\030\006 \001(\010\032\217\001\n\013PortMapping\022\021\n\thost_po" +
"rt\030\001 \002(\r\022\026\n\016container_port\030\002 \002(\r\022\020\n\010prot" +
"ocol\030\003 \001(\t\022\014\n\004name\030\004 \001(\t\022\034\n\006labels\030\005 \003(\013" +
"2\014.mesos.Label\022\027\n\014service_port\030d \001(\r:\0010\"" +
"\203\003\n\006Volume\022 \n\004mode\030\003 \002(\0162\022.mesos.Volume." +
"Mode\022\026\n\016container_path\030\001 \002(\t\022\021\n\thost_pat" +
"h\030\002 \001(\t\022\033\n\005image\030\004 \001(\0132\014.mesos.Image\022D\n\n",
"persistent\030\005 \001(\01320.mesosphere.marathon.V" +
"olume.PersistentVolumeInfo\022@\n\010external\030\006" +
" \001(\0132..mesosphere.marathon.Volume.Extern" +
"alVolumeInfo\032$\n\024PersistentVolumeInfo\022\014\n\004" +
"size\030\001 \002(\004\032a\n\022ExternalVolumeInfo\022\014\n\004size" +
"\030\001 \001(\004\022\014\n\004name\030\002 \002(\t\022\020\n\010provider\030\003 \002(\t\022\035" +
"\n\007options\030\004 \003(\0132\014.mesos.Label\")\n\020EventSu" +
"bscribers\022\025\n\rcallback_urls\030\001 \003(\t\"=\n\016Stor" +
"ageVersion\022\r\n\005major\030\001 \002(\r\022\r\n\005minor\030\002 \002(\r" +
"\022\r\n\005patch\030\003 \002(\r\"Z\n\031UpgradeStrategyDefini",
"tion\022\035\n\025minimumHealthCapacity\030\001 \002(\001\022\036\n\023m" +
"aximumOverCapacity\030\002 \001(\001:\0011\"\260\001\n\017GroupDef" +
"inition\022\n\n\002id\030\001 \002(\t\022\017\n\007version\030\002 \002(\t\0224\n\004" +
"apps\030\003 \003(\0132&.mesosphere.marathon.Service" +
"Definition\0224\n\006groups\030\004 \003(\0132$.mesosphere." +
"marathon.GroupDefinition\022\024\n\014dependencies" +
"\030\005 \003(\t\"\245\001\n\030DeploymentPlanDefinition\022\n\n\002i" +
"d\030\001 \002(\t\022\017\n\007version\030\002 \002(\t\0226\n\010original\030\004 \002" +
"(\0132$.mesosphere.marathon.GroupDefinition" +
"\0224\n\006target\030\005 \002(\0132$.mesosphere.marathon.G",
"roupDefinition\"\306\001\n\013TaskFailure\022\016\n\006app_id" +
"\030\001 \002(\t\022\036\n\007task_id\030\002 \002(\0132\r.mesos.TaskID\022\037" +
"\n\005state\030\003 \002(\0162\020.mesos.TaskState\022\021\n\007messa" +
"ge\030\004 \001(\t:\000\022\016\n\004host\030\005 \001(\t:\000\022\017\n\007version\030\006 " +
"\002(\t\022\021\n\ttimestamp\030\007 \002(\t\022\037\n\007slaveId\030\010 \001(\0132" +
"\016.mesos.SlaveID\"T\n\014ZKStoreEntry\022\014\n\004name\030" +
"\001 \002(\t\022\014\n\004uuid\030\002 \002(\014\022\r\n\005value\030\003 \002(\014\022\031\n\nco" +
"mpressed\030\004 \001(\010:\005false\"\326\001\n\023ResidencyDefin" +
"ition\022(\n relaunchEscalationTimeoutSecond" +
"s\030\001 \001(\003\022S\n\020taskLostBehavior\030\002 \001(\01629.meso",
"sphere.marathon.ResidencyDefinition.Task" +
"LostBehavior\"@\n\020TaskLostBehavior\022\032\n\026RELA" +
"UNCH_AFTER_TIMEOUT\020\000\022\020\n\014WAIT_FOREVER\020\001B\035" +
"\n\023mesosphere.marathonB\006Protos"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
internal_static_mesosphere_marathon_Constraint_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_mesosphere_marathon_Constraint_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_Constraint_descriptor,
new java.lang.String[] { "Field", "Operator", "Value", });
internal_static_mesosphere_marathon_HealthCheckDefinition_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_mesosphere_marathon_HealthCheckDefinition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_HealthCheckDefinition_descriptor,
new java.lang.String[] { "Protocol", "PortIndex", "GracePeriodSeconds", "IntervalSeconds", "TimeoutSeconds", "Path", "MaxConsecutiveFailures", "Command", "IgnoreHttp1Xx", "Port", });
internal_static_mesosphere_marathon_ReadinessCheckDefinition_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_mesosphere_marathon_ReadinessCheckDefinition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ReadinessCheckDefinition_descriptor,
new java.lang.String[] { "Name", "Protocol", "Path", "PortName", "IntervalMillis", "TimeoutMillis", "HttpStatusCodeForReady", "PreserveLastResponse", });
internal_static_mesosphere_marathon_IpAddress_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_mesosphere_marathon_IpAddress_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_IpAddress_descriptor,
new java.lang.String[] { "Groups", "Labels", "DiscoveryInfo", });
internal_static_mesosphere_marathon_DiscoveryInfo_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_mesosphere_marathon_DiscoveryInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_DiscoveryInfo_descriptor,
new java.lang.String[] { "Ports", });
internal_static_mesosphere_marathon_ServiceDefinition_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_mesosphere_marathon_ServiceDefinition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ServiceDefinition_descriptor,
new java.lang.String[] { "Id", "Cmd", "Instances", "Resources", "Description", "Ports", "Constraints", "Executor", "OBSOLETEContainer", "Version", "HealthChecks", "Backoff", "BackoffFactor", "UpgradeStrategy", "Dependencies", "StoreUrls", "RequirePorts", "Container", "Labels", "MaxLaunchDelay", "AcceptedResourceRoles", "LastScalingAt", "LastConfigChangeAt", "IpAddress", "Residency", "PortDefinitions", "ReadinessCheckDefinition", });
internal_static_mesosphere_marathon_ResourceRoles_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_mesosphere_marathon_ResourceRoles_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ResourceRoles_descriptor,
new java.lang.String[] { "Role", });
internal_static_mesosphere_marathon_MarathonTask_descriptor =
getDescriptor().getMessageTypes().get(7);
internal_static_mesosphere_marathon_MarathonTask_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_MarathonTask_descriptor,
new java.lang.String[] { "Id", "Host", "Ports", "Attributes", "StagedAt", "StartedAt", "OBSOLETEStatuses", "Version", "Status", "SlaveId", "OBSOLETENetworks", "Reservation", });
internal_static_mesosphere_marathon_MarathonTask_Reservation_descriptor =
internal_static_mesosphere_marathon_MarathonTask_descriptor.getNestedTypes().get(0);
internal_static_mesosphere_marathon_MarathonTask_Reservation_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_MarathonTask_Reservation_descriptor,
new java.lang.String[] { "LocalVolumeIds", "State", });
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_descriptor =
internal_static_mesosphere_marathon_MarathonTask_Reservation_descriptor.getNestedTypes().get(0);
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_descriptor,
new java.lang.String[] { "Type", "Timeout", });
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_descriptor =
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_descriptor.getNestedTypes().get(0);
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_MarathonTask_Reservation_State_Timeout_descriptor,
new java.lang.String[] { "Initiated", "Deadline", "Reason", });
internal_static_mesosphere_marathon_MarathonApp_descriptor =
getDescriptor().getMessageTypes().get(8);
internal_static_mesosphere_marathon_MarathonApp_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_MarathonApp_descriptor,
new java.lang.String[] { "Name", "Tasks", });
internal_static_mesosphere_marathon_ContainerInfo_descriptor =
getDescriptor().getMessageTypes().get(9);
internal_static_mesosphere_marathon_ContainerInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ContainerInfo_descriptor,
new java.lang.String[] { "Image", "Options", });
internal_static_mesosphere_marathon_ExtendedContainerInfo_descriptor =
getDescriptor().getMessageTypes().get(10);
internal_static_mesosphere_marathon_ExtendedContainerInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ExtendedContainerInfo_descriptor,
new java.lang.String[] { "Type", "Volumes", "Docker", });
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_descriptor =
internal_static_mesosphere_marathon_ExtendedContainerInfo_descriptor.getNestedTypes().get(0);
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_descriptor,
new java.lang.String[] { "Image", "Network", "PortMappings", "Privileged", "Parameters", "ForcePullImage", });
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_descriptor =
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_descriptor.getNestedTypes().get(0);
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ExtendedContainerInfo_DockerInfo_PortMapping_descriptor,
new java.lang.String[] { "HostPort", "ContainerPort", "Protocol", "Name", "Labels", "ServicePort", });
internal_static_mesosphere_marathon_Volume_descriptor =
getDescriptor().getMessageTypes().get(11);
internal_static_mesosphere_marathon_Volume_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_Volume_descriptor,
new java.lang.String[] { "Mode", "ContainerPath", "HostPath", "Image", "Persistent", "External", });
internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_descriptor =
internal_static_mesosphere_marathon_Volume_descriptor.getNestedTypes().get(0);
internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_Volume_PersistentVolumeInfo_descriptor,
new java.lang.String[] { "Size", });
internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_descriptor =
internal_static_mesosphere_marathon_Volume_descriptor.getNestedTypes().get(1);
internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_Volume_ExternalVolumeInfo_descriptor,
new java.lang.String[] { "Size", "Name", "Provider", "Options", });
internal_static_mesosphere_marathon_EventSubscribers_descriptor =
getDescriptor().getMessageTypes().get(12);
internal_static_mesosphere_marathon_EventSubscribers_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_EventSubscribers_descriptor,
new java.lang.String[] { "CallbackUrls", });
internal_static_mesosphere_marathon_StorageVersion_descriptor =
getDescriptor().getMessageTypes().get(13);
internal_static_mesosphere_marathon_StorageVersion_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_StorageVersion_descriptor,
new java.lang.String[] { "Major", "Minor", "Patch", });
internal_static_mesosphere_marathon_UpgradeStrategyDefinition_descriptor =
getDescriptor().getMessageTypes().get(14);
internal_static_mesosphere_marathon_UpgradeStrategyDefinition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_UpgradeStrategyDefinition_descriptor,
new java.lang.String[] { "MinimumHealthCapacity", "MaximumOverCapacity", });
internal_static_mesosphere_marathon_GroupDefinition_descriptor =
getDescriptor().getMessageTypes().get(15);
internal_static_mesosphere_marathon_GroupDefinition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_GroupDefinition_descriptor,
new java.lang.String[] { "Id", "Version", "Apps", "Groups", "Dependencies", });
internal_static_mesosphere_marathon_DeploymentPlanDefinition_descriptor =
getDescriptor().getMessageTypes().get(16);
internal_static_mesosphere_marathon_DeploymentPlanDefinition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_DeploymentPlanDefinition_descriptor,
new java.lang.String[] { "Id", "Version", "Original", "Target", });
internal_static_mesosphere_marathon_TaskFailure_descriptor =
getDescriptor().getMessageTypes().get(17);
internal_static_mesosphere_marathon_TaskFailure_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_TaskFailure_descriptor,
new java.lang.String[] { "AppId", "TaskId", "State", "Message", "Host", "Version", "Timestamp", "SlaveId", });
internal_static_mesosphere_marathon_ZKStoreEntry_descriptor =
getDescriptor().getMessageTypes().get(18);
internal_static_mesosphere_marathon_ZKStoreEntry_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ZKStoreEntry_descriptor,
new java.lang.String[] { "Name", "Uuid", "Value", "Compressed", });
internal_static_mesosphere_marathon_ResidencyDefinition_descriptor =
getDescriptor().getMessageTypes().get(19);
internal_static_mesosphere_marathon_ResidencyDefinition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_mesosphere_marathon_ResidencyDefinition_descriptor,
new java.lang.String[] { "RelaunchEscalationTimeoutSeconds", "TaskLostBehavior", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
org.apache.mesos.Protos.getDescriptor(),
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}
| [
"zhfang@DMYUJIE.local"
] | zhfang@DMYUJIE.local |
36b7ae5f494270f74d0130d25dc15aba4691c306 | b091e3a9d89da3d8ad9010b12661bfa553ab3a77 | /aulajsf/src/main/java/br/unipar/jsfaula/bean/VotacaoBean.java | 463862957b1db7e60087249a407db80e6507ea9b | [] | no_license | PortugaHue/unipar-2018 | eb34057d867e80d88830c4da9537c6f4051af83f | fc69b57a3c3ffcb9ca3f254b0f66ef29be7a21d7 | refs/heads/master | 2020-04-22T07:44:57.097054 | 2018-11-21T01:33:18 | 2018-11-21T01:33:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 870 | java | package br.unipar.jsfaula.bean;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean(name="votacaoBean")
@ViewScoped
public class VotacaoBean {
private String numero = "";
public void corrige() {
numero = "";
}
public void setNumero1() {
numero += "1";
}
public void setNumero2() {
numero += "2";
}
public void setNumero3() {
numero += "3";
}
public void setNumero4() {
numero += "4";
}
public void setNumero5() {
numero += "5";
}
public void setNumero6() {
numero += "6";
}
public void setNumero7() {
numero += "7";
}
public void setNumero8() {
numero += "8";
}
public void setNumero9() {
numero += "9";
}
public void setNumeroZero() {
numero += "0";
}
public String getNumero() {
return numero;
}
public void setNumero(String numero) {
this.numero = numero;
}
}
| [
"renato.mussinato@matera.com"
] | renato.mussinato@matera.com |
c6bc61c8813215dcb9e4372ba899a55a4345fca3 | a6be80c7cc489f4ea2d7012fde301ff5f0c8f16e | /diving-school/src/main/java/com/drs/controller/ReservationController.java | 6bfebc011ffc02d587137c8bde77c57acec25122 | [] | no_license | liukai90/diving-school | 9be656412845fab8fb26bbbd5e1b823aa8c96ab2 | 1f6aa34f2234f1a6105b450af130a4ff6d0acc6a | refs/heads/master | 2021-01-01T15:21:15.999596 | 2017-12-19T09:29:29 | 2017-12-19T09:29:29 | 97,600,427 | 18 | 4 | null | null | null | null | UTF-8 | Java | false | false | 4,522 | java | package com.drs.controller;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.drs.pojo.OrderDateMessage;
import com.drs.pojo.OrderQueryVo;
import com.drs.pojo.TbCar;
import com.drs.pojo.TbReservationExample;
import com.drs.pojo.TbReservationExample.Criteria;
import com.drs.pojo.TbStudent;
import com.drs.pojo.TbTime;
import com.drs.service.Reservation;
import com.drs.service.Student;
import com.drs.service.TimeManagement;
import com.drs.service.VehicleManagement;
import com.drs.service.impl.StudentService;
import com.drs.service.impl.TimeManagementService;
import com.drs.service.impl.VehicleManagementService;
@Controller
//@Configuration
//@ComponentScan("com.drs.service")
public class ReservationController {
@Autowired
private Reservation reservationService;
@Autowired
private TimeManagement timeManagementService;
@Autowired
private VehicleManagement vehicleManagementService;
@Autowired
private Student studentService;
@RequestMapping("/getAllMark")
@ResponseBody
public List<TbCar> getAllMark()throws Exception{
return vehicleManagementService.findAllCar();
}
@RequestMapping("/getAllTime")
@ResponseBody
public List<TbTime> getAllTime()throws Exception{
return timeManagementService.findAllTime();
}
@RequestMapping("/isHaveOrder")
@ResponseBody
public OrderDateMessage isHaveOrder(HttpServletRequest req,Date submitDate)throws Exception{
String phone=(String) req.getSession().getAttribute("phone");
return reservationService.isAlreadyOrder(phone, submitDate);
}
@RequestMapping("/checkCar")
@ResponseBody
public TbCar checkCar(Integer id)throws Exception{
return vehicleManagementService.getCarById(id);
}
@RequestMapping(value="/checkOrder",method={RequestMethod.GET,RequestMethod.POST})
@ResponseBody
public OrderDateMessage checkOrder(HttpServletRequest req,Integer carId,Date submitDate,Integer timeId)throws Exception{
String phone=(String) req.getSession().getAttribute("phone");
Integer studentId=studentService.getStudentByPhone(phone).getId();
return reservationService.checkOrder(studentId,carId, submitDate, timeId);
}
@RequestMapping("/submitOrder")
public String submitDate(HttpServletRequest req,Integer carId,Date submitDate,Integer timeId)
throws Exception{
ModelMap modelMap=new ModelMap();
String phone=(String) req.getSession().getAttribute("phone");
Integer studentId=studentService.getStudentByPhone(phone).getId();
boolean flag=reservationService.submitOrder(studentId, carId, timeId, submitDate);
if(flag){
return "redirect:stuMainPage.action";
}else{
modelMap.addAttribute("orderInformation", "预约失败");
return "WEB-INF/student/studyCar";
}
}
@RequestMapping("/myOrderPage")
public String myOrderPage()throws Exception{
return "WEB-INF/student/myOrder";
}
@RequestMapping("/myOrderInformation")
@ResponseBody
public OrderQueryVo myOrderInformation(HttpServletRequest req)throws Exception{
String phone=(String) req.getSession().getAttribute("phone");
Integer studentId=studentService.getStudentByPhone(phone).getId();
return reservationService.getOrderInformation(studentId);
}
@RequestMapping("/cancelOrder")
public String cancelOrder(Integer id)throws Exception{
reservationService.cancelOrder(id);
return "redirect:myOrderPage.action";
}
@RequestMapping("/bookingManagement")
public String bookingManagement()throws Exception{
return "WEB-INF/admin/bookingManagement";
}
@RequestMapping("/findOrderBySubmitDate")
@ResponseBody
public OrderQueryVo findOrderBySubmitDate(Date submitDate)throws Exception{
return reservationService.getReservations(submitDate);
}
@RequestMapping("/findOrderByCar")
@ResponseBody
public OrderQueryVo findOrderByCar(Date submitDate,Integer carId)throws Exception{
return reservationService.getReservations(submitDate, carId);
}
}
| [
"15738512109@163.com"
] | 15738512109@163.com |
df89ce8635a11279b46de61d5ad8ffd19fe944fe | 57e08782d4d39ee871037f600b45ba8fb623fd54 | /ebank/src/main/java/pe/openebusiness/ebank/controller/MassiveChargeController.java | 6821a7ce8d4678a485ebc8fdf72ab082cb6b5b7f | [] | no_license | samHuaman/ebank | 244390599d91bbd875e83f87bf64db578a842576 | bcd39600fdeab5aa84ed211423428a8a70016771 | refs/heads/master | 2020-12-02T06:18:58.632302 | 2017-08-22T14:59:33 | 2017-08-22T14:59:33 | 96,815,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,274 | java | package pe.openebusiness.ebank.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import pe.openebusiness.ebank.bind.CustomHttpResponse;
import pe.openebusiness.ebank.model.FileType;
import pe.openebusiness.ebank.service.MassiveChargeService;
@RestController
@RequestMapping(value = "massive-charge")
public class MassiveChargeController {
@Autowired
MassiveChargeService chargeService;
@ResponseBody
@RequestMapping(value = "getAllFileTypes")
private List<FileType> getAllFileTypes() {
List<FileType> fileTypes = chargeService.getAllFileTypes();
return fileTypes;
}
@ResponseBody
@RequestMapping(value = "postFile", method = RequestMethod.POST)
private CustomHttpResponse postFile(Integer type_id, @RequestParam("file") MultipartFile file) {
CustomHttpResponse response = chargeService.postFile(type_id, file);
return response;
}
} | [
"paco9194_gc@hotmail.com"
] | paco9194_gc@hotmail.com |
f33aea9fa78ec287360c58f925dd451e3371d99f | 5be01ffe763bea98a1adeb873531ab4c0ecaf864 | /SendAndReceive/src/sendandreceive/SendAndReceive.java | 8854628e423a626038e92a44aab9a30b6984e821 | [] | no_license | gerrymafi/SMS | 07daa4e2e371b41f4ecb7ef8649208a1d31ed087 | 48e38b096555c84c8fe40750184930ea85275cde | refs/heads/master | 2021-01-24T06:09:04.337163 | 2015-02-26T08:50:51 | 2015-02-26T08:50:51 | 31,354,894 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 513 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sendandreceive;
import smsutil.TxtService;
/**
*
* @author madziwal
*/
public class SendAndReceive {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
TxtService txtService = new TxtService();
TxtService.sendMessage("263732375306", "Sample Message");
}
}
| [
"gerrymafi@gmail.com"
] | gerrymafi@gmail.com |
23087b733c9dc2737a6401c33d93fbdab3a4d394 | c271d38fe5664854a6e130757e9de83d45a78caa | /src/main/java/vn/gmobile/uniboard/message/UserGetResponse.java | d8460ec033eb87c14d953a35ede47f9fd0c17744 | [] | no_license | hiepnvh/guniboard | c87112711b5bd41a71680929eb2b1d2af00d1d58 | 348d2ae95a0444cd05509e519ed208d4b22fedfc | refs/heads/master | 2021-01-22T22:39:12.556856 | 2017-03-31T09:11:28 | 2017-03-31T09:11:28 | 85,564,189 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,342 | java | package vn.gmobile.uniboard.message;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
import com.bean.json.JsonUtils;
import vn.gmobile.uniboard.conf.JsParams;
import vn.gmobile.uniboard.model.MenuFunction;
import vn.gmobile.uniboard.model.Profile;
import vn.gmobile.uniboard.model.User;
public class UserGetResponse extends JsonResponse {
JSONArray _jsonUsers;
JSONArray _jsonProfiles;
JSONArray _jsonFunctions;
public UserGetResponse() {
_jsonUsers = new JSONArray();
_jsonFunctions = new JSONArray();
_jsonProfiles = new JSONArray();
}
public void setTotalCount(int totalCount) throws Exception {
write(JsParams.GET_USER_RESPONSE.TOTAL_COUNT, totalCount);
}
public void addUser(User user,Profile profile, List<MenuFunction> functions) throws Exception {
System.out.println(profile.get(Profile.NAME));
JSONObject jsUser = JsonUtils.fromBeanToJson(user);
_jsonUsers.put(jsUser);
JSONObject jProfile = JsonUtils.fromBeanToJson(profile);
_jsonProfiles.put(jProfile);
JSONArray jFunctions = JsonUtils.fromBeanListToJsonArray(functions);
_jsonFunctions.put(jFunctions);
write(JsParams.GET_USER_RESPONSE.USER_LIST, _jsonUsers);
write(JsParams.GET_USER_RESPONSE.FUNCTION_LIST, _jsonFunctions);
write(JsParams.GET_USER_RESPONSE.PROFILE_LIST, _jsonProfiles);
}
}
| [
"hiepnvh@gmail.com"
] | hiepnvh@gmail.com |
8924865e8610be15d27b1e0b474542341948a01c | aa02709e000575ef0f620ed90730d75fd2a4e6d5 | /src/dao/implement/UniversityDaoImpl.java | df034dfac6f9b8bea672493add35c999bc37f839 | [] | no_license | sam2094/jsp-course-project | 9fa730662b624d940290516bd5393a8621c476de | 0bb8719e22b2c34f38d2dba9df000411ee2c6f36 | refs/heads/master | 2020-05-29T15:05:19.329212 | 2019-05-29T11:28:56 | 2019-05-29T11:28:56 | 189,211,888 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,622 | java | package dao.implement;
import dao.DataManager;
import dao.UniversityDao;
import model.Student;
import model.University;
import util.JdbcUtility;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
public class UniversityDaoImpl implements UniversityDao {
@Override
public List<University> getUniversityList() throws Exception {
List<University> universityList = new ArrayList<>();
Connection connection = null;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
String query = "select * from university";
try {
connection = DataManager.getConnection();
if (connection != null) {
preparedStatement = connection.prepareStatement(query);
resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
University university = new University();
university.setId(resultSet.getLong("id"));
university.setName(resultSet.getString("name"));
universityList.add(university);
}
} else {
System.out.println("No connection");
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
try {
JdbcUtility.close(connection, preparedStatement, resultSet);
} catch (Exception ex) {
ex.printStackTrace();
}
}
return universityList;
}
}
| [
"hasanov2094@gmail.com"
] | hasanov2094@gmail.com |
f9b97ef68b05a90defaeadc6b14e7fea0ec0dd16 | 199a7a39bd205c2ded76f7d5827a47d4e0737307 | /src/main/java/test/CI.java | 70f8e49ac5724c00c3a6ea1b24195dd5e820635e | [] | no_license | sushreesmitad/PractIt | e2defac4ccd01eeadc567d626f96d612f0851bc3 | fe454c3ee9b47f8ad574ac7801c2fa87663b2a37 | refs/heads/master | 2020-04-02T07:29:39.124473 | 2016-07-04T07:47:03 | 2016-07-04T07:47:03 | 61,272,315 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package test;
import static java.lang.System.*;
public class CI {
public void method(String s) {
System.out.println("string is " + s);
}
public static void main(String... args) {
CI ci = new CI();
ci.method("10");
/* lineSeparator() */
}
}
| [
"sushreesmita.dhal13@gmail.com"
] | sushreesmita.dhal13@gmail.com |
06244bc0e5dd8bd81397aaffc5720ff481b12edd | ccfd3bf0fd2ca6602b9ee5b069a3c94bb8d5beac | /IRMS/IRMS-ejb/src/java/ejb/CIRBeanRemote.java | 27bde6a0df74aa1ca2397ff79fc4e58487c48fdf | [] | no_license | wujingyun/SubmitIRMS | 36d9eaf740aeec709e1fa21a4a1d39aae11931ec | 97d308b90ed6af5807dddce8d949082e2781ae8c | refs/heads/master | 2021-01-17T16:39:43.008967 | 2013-11-14T05:43:02 | 2013-11-14T05:43:02 | 14,390,618 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 679 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ejb;
import entity.Membership;
import entity.PointTrans;
import exception.ExistException;
import java.util.List;
import javax.ejb.Local;
import javax.ejb.Remote;
/**
*
* @author WU JINGYUN
*/
@Remote
public interface CIRBeanRemote {
public double getAvgExpenditure(long customerId);
public void setCustomerClvGroup(Long customerId,String group) throws ExistException;
public void setCustomerClv(Long customerId,double CLV) throws ExistException ;
public double getMaxClv();
public double getMinClv();
}
| [
"wujingyun1128@gmail.com"
] | wujingyun1128@gmail.com |
68e165506f5592efcdb5943c558770fb826eb412 | 1f85758dfc15cded3c0fa97b18a93661acf4f127 | /TairraosHome/app/src/main/java/com/tairraos/xmatrix/family/activity/IFamilyInfoView.java | 3428e97a3069613eb9af47b5cec7d2fd740cf9ce | [
"MIT"
] | permissive | tuyalele/tuyaCamp-AndroidSDK | 0d284cab7e65fbe35bd74653e9c48e1496ca2942 | e81a997f5a94fd8e874a74ff5a003bdf564e29b6 | refs/heads/master | 2023-02-07T16:49:02.934256 | 2020-12-23T12:14:37 | 2020-12-23T12:14:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 455 | java | package com.tairraos.xmatrix.family.activity;
import android.content.Context;
import com.tuya.smart.home.sdk.bean.HomeBean;
import com.tuya.smart.home.sdk.bean.MemberBean;
import java.util.List;
public interface IFamilyInfoView {
Context getContext();
long getHomeId();
void setHomeData(HomeBean homeBean);
void setMemberData(List<MemberBean> memberList);
void doRemoveView(boolean isSuccess);
void showToast(int res);
}
| [
"xiaolet@cisco.com"
] | xiaolet@cisco.com |
d7791e490ac40db1e14c510ecf8e0adb0ce37510 | d897c98d6b6d5d67e55fe698f119ef364b5166e0 | /order-service/src/main/java/com/sn/ex/orderservice/OrderServiceApplication.java | 26763f69b2977869e561fa416efff1b67e247616 | [] | no_license | sonnguyenkim/microservices-ex | d85d7036566b5fe7eb5fb8695b29157d5709b8a9 | 524b3365666b4544ac776f0261a888e94724e297 | refs/heads/master | 2022-11-06T16:33:34.145692 | 2020-06-24T21:01:18 | 2020-06-24T21:01:18 | 274,767,336 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 781 | java | package com.sn.ex.orderservice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
@EnableEurekaClient
@EnableCircuitBreaker
public class OrderServiceApplication {
@Bean
@LoadBalanced
public RestTemplate getRestTemplate() {
return new RestTemplate();
}
public static void main(String[] args) {
SpringApplication.run(OrderServiceApplication.class, args);
}
}
| [
"sonnguyenkim@gmail.com"
] | sonnguyenkim@gmail.com |
64166646237bc28b8cf06877f0fe4cdda7767476 | 7b20c89490c55aebfd0c62046dfe7525566d5256 | /library/src/main/java/ir/protech21/banner/layoutmanager/BannerLayoutManager.java | 551d0b8f2ca53604967c5238045380b4f1eb7705 | [] | no_license | mortezarakhtiani/AsonehLibrary | b90334a3d526b3a21aedda90fc8a2d69f7913c6c | ccd6ab78bdf57fa8df02e2c494ee441e9b00e035 | refs/heads/master | 2023-07-04T09:06:17.196978 | 2020-05-31T20:27:32 | 2020-05-31T20:27:32 | 396,637,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 33,124 | java | package ir.protech21.banner.layoutmanager;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.OrientationHelper;
import androidx.recyclerview.widget.RecyclerView;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import java.util.ArrayList;
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
/**
* An implementation of {@link RecyclerView.LayoutManager} which behaves like view pager.
* Please make sure your child view have the same size.
*/
@SuppressWarnings({"WeakerAccess", "unused", "SameParameterValue"})
public class BannerLayoutManager extends RecyclerView.LayoutManager {
public static final int DETERMINE_BY_MAX_AND_MIN = -1;
public static final int HORIZONTAL = OrientationHelper.HORIZONTAL;
public static final int VERTICAL = OrientationHelper.VERTICAL;
private static final int DIRECTION_NO_WHERE = -1;
private static final int DIRECTION_FORWARD = 0;
private static final int DIRECTION_BACKWARD = 1;
protected static final int INVALID_SIZE = Integer.MAX_VALUE;
private SparseArray<View> positionCache = new SparseArray<>();
protected int mDecoratedMeasurement;
protected int mDecoratedMeasurementInOther;
/**
* Current orientation. Either {@link #HORIZONTAL} or {@link #VERTICAL}
*/
int mOrientation;
protected int mSpaceMain;
protected int mSpaceInOther;
/**
* The offset of property which will change while scrolling
*/
protected float mOffset;
/**
* Many calculations are made depending on orientation. To keep it clean, this interface
* helps {@link LinearLayoutManager} make those decisions.
* Based on {@link #mOrientation}, an implementation is lazily created in
* {@link #ensureLayoutState} method.
*/
protected OrientationHelper mOrientationHelper;
/**
* Defines if layout should be calculated from end to start.
*/
private boolean mReverseLayout = false;
/**
* This keeps the final value for how LayoutManager should start laying out views.
* It is calculated by checking {@link #getReverseLayout()} and View's layout direction.
* {@link #onLayoutChildren(RecyclerView.Recycler, RecyclerView.State)} is run.
*/
private boolean mShouldReverseLayout = false;
/**
* Works the same way as {@link android.widget.AbsListView#setSmoothScrollbarEnabled(boolean)}.
* see {@link android.widget.AbsListView#setSmoothScrollbarEnabled(boolean)}
*/
private boolean mSmoothScrollbarEnabled = true;
/**
* When LayoutManager needs to scroll to a position, it sets this variable and requests a
* layout which will check this variable and re-layout accordingly.
*/
private int mPendingScrollPosition = NO_POSITION;
private SavedState mPendingSavedState = null;
protected float mInterval; //the mInterval of each item's mOffset
/* package */ OnPageChangeListener onPageChangeListener;
private boolean mRecycleChildrenOnDetach;
private boolean mInfinite = true;
private boolean mEnableBringCenterToFront;
private int mLeftItems;
private int mRightItems;
/**
* max visible item count
*/
private int mMaxVisibleItemCount = DETERMINE_BY_MAX_AND_MIN;
private Interpolator mSmoothScrollInterpolator;
private int mDistanceToBottom = INVALID_SIZE;
/**
* use for handle focus
*/
private View currentFocusView;
/**
* @return the mInterval of each item's mOffset
*/
/**
* @return the mInterval of each item's mOffset
*/
private int itemSpace = 20;
private float centerScale = 1.2f;
private float moveSpeed=1.0f;
protected float getDistanceRatio() {
if (moveSpeed == 0) return Float.MAX_VALUE;
return 1 / moveSpeed;
}
protected float setInterval() {
return mDecoratedMeasurement * ((centerScale - 1) / 2 + 1) + itemSpace;
}
public void setItemSpace(int itemSpace) {
this.itemSpace = itemSpace;
}
public void setCenterScale(float centerScale) {
this.centerScale = centerScale;
}
public void setMoveSpeed(float moveSpeed) {
assertNotInLayoutOrScroll(null);
if (this.moveSpeed == moveSpeed) return;
this.moveSpeed = moveSpeed;
}
protected void setItemViewProperty(View itemView, float targetOffset) {
float scale = calculateScale(targetOffset + mSpaceMain);
itemView.setScaleX(scale);
itemView.setScaleY(scale);
}
/**
* @param x start positon of the view you want scale
* @return the scale rate of current scroll mOffset
*/
private float calculateScale(float x) {
float deltaX = Math.abs(x - (mOrientationHelper.getTotalSpace() - mDecoratedMeasurement) / 2f);
float diff = 0f;
if ((mDecoratedMeasurement - deltaX) > 0) diff = mDecoratedMeasurement - deltaX;
return (centerScale - 1f) / mDecoratedMeasurement * diff + 1;
}
/**
* cause elevation is not support below api 21,
* so you can set your elevation here for supporting it below api 21
* or you can just setElevation in {@link #setItemViewProperty(View, float)}
*/
protected float setViewElevation(View itemView, float targetOffset) {
return 0;
}
/**
* Creates a horizontal ViewPagerLayoutManager
*/
public BannerLayoutManager(Context context) {
this(context, HORIZONTAL, false);
}
/**
* @param orientation Layout orientation. Should be {@link #HORIZONTAL} or {@link #VERTICAL}
*/
public BannerLayoutManager(Context context, int orientation) {
this(context,orientation,false);
}
public BannerLayoutManager(Context context, int orientation, boolean reverseLayout) {
setEnableBringCenterToFront(true);
setMaxVisibleItemCount(3);
setOrientation(orientation);
setReverseLayout(reverseLayout);
setAutoMeasureEnabled(true);
setItemPrefetchEnabled(false);
}
@Override
public RecyclerView.LayoutParams generateDefaultLayoutParams() {
return new RecyclerView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
}
/**
* Returns whether LayoutManager will recycle its children when it is detached from
* RecyclerView.
*
* @return true if LayoutManager will recycle its children when it is detached from
* RecyclerView.
*/
public boolean getRecycleChildrenOnDetach() {
return mRecycleChildrenOnDetach;
}
/**
* Set whether LayoutManager will recycle its children when it is detached from
* RecyclerView.
* <p>
* If you are using a {@link RecyclerView.RecycledViewPool}, it might be a good idea to set
* this flag to <code>true</code> so that views will be available to other RecyclerViews
* immediately.
* <p>
* Note that, setting this flag will result in a performance drop if RecyclerView
* is restored.
*
* @param recycleChildrenOnDetach Whether children should be recycled in detach or not.
*/
public void setRecycleChildrenOnDetach(boolean recycleChildrenOnDetach) {
mRecycleChildrenOnDetach = recycleChildrenOnDetach;
}
@Override
public void onDetachedFromWindow(RecyclerView view, RecyclerView.Recycler recycler) {
super.onDetachedFromWindow(view, recycler);
if (mRecycleChildrenOnDetach) {
removeAndRecycleAllViews(recycler);
recycler.clear();
}
}
@Override
public Parcelable onSaveInstanceState() {
if (mPendingSavedState != null) {
return new SavedState(mPendingSavedState);
}
SavedState savedState = new SavedState();
savedState.position = mPendingScrollPosition;
savedState.offset = mOffset;
savedState.isReverseLayout = mShouldReverseLayout;
return savedState;
}
@Override
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof SavedState) {
mPendingSavedState = new SavedState((SavedState) state);
requestLayout();
}
}
/**
* @return true if {@link #getOrientation()} is {@link #HORIZONTAL}
*/
@Override
public boolean canScrollHorizontally() {
return mOrientation == HORIZONTAL;
}
/**
* @return true if {@link #getOrientation()} is {@link #VERTICAL}
*/
@Override
public boolean canScrollVertically() {
return mOrientation == VERTICAL;
}
/**
* Returns the current orientation of the layout.
*
* @return Current orientation, either {@link #HORIZONTAL} or {@link #VERTICAL}
* @see #setOrientation(int)
*/
public int getOrientation() {
return mOrientation;
}
/**
* Sets the orientation of the layout. {@link BannerLayoutManager}
* will do its best to keep scroll position.
*
* @param orientation {@link #HORIZONTAL} or {@link #VERTICAL}
*/
public void setOrientation(int orientation) {
if (orientation != HORIZONTAL && orientation != VERTICAL) {
throw new IllegalArgumentException("invalid orientation:" + orientation);
}
assertNotInLayoutOrScroll(null);
if (orientation == mOrientation) {
return;
}
mOrientation = orientation;
mOrientationHelper = null;
mDistanceToBottom = INVALID_SIZE;
removeAllViews();
}
/**
* Returns the max visible item count, {@link #DETERMINE_BY_MAX_AND_MIN} means it haven't been set now
* And it will use {@link #maxRemoveOffset()} and {@link #minRemoveOffset()} to handle the range
*
* @return Max visible item count
*/
public int getMaxVisibleItemCount() {
return mMaxVisibleItemCount;
}
/**
* Set the max visible item count, {@link #DETERMINE_BY_MAX_AND_MIN} means it haven't been set now
* And it will use {@link #maxRemoveOffset()} and {@link #minRemoveOffset()} to handle the range
*
* @param mMaxVisibleItemCount Max visible item count
*/
public void setMaxVisibleItemCount(int mMaxVisibleItemCount) {
assertNotInLayoutOrScroll(null);
if (this.mMaxVisibleItemCount == mMaxVisibleItemCount) return;
this.mMaxVisibleItemCount = mMaxVisibleItemCount;
removeAllViews();
}
/**
* Calculates the view layout order. (e.g. from end to start or start to end)
* RTL layout support is applied automatically. So if layout is RTL and
* {@link #getReverseLayout()} is {@code true}, elements will be laid out starting from left.
*/
private void resolveShouldLayoutReverse() {
if (mOrientation == HORIZONTAL && getLayoutDirection() == ViewCompat.LAYOUT_DIRECTION_RTL) {
mReverseLayout = !mReverseLayout;
}
}
/**
* Returns if views are laid out from the opposite direction of the layout.
*
* @return If layout is reversed or not.
* @see #setReverseLayout(boolean)
*/
public boolean getReverseLayout() {
return mReverseLayout;
}
/**
* Used to reverse item traversal and layout order.
* This behaves similar to the layout change for RTL views. When set to true, first item is
* laid out at the end of the UI, second item is laid out before it etc.
* <p>
* For horizontal layouts, it depends on the layout direction.
* When set to true, If {@link RecyclerView} is LTR, than it will
* layout from RTL, if {@link RecyclerView}} is RTL, it will layout
* from LTR.
*/
public void setReverseLayout(boolean reverseLayout) {
assertNotInLayoutOrScroll(null);
if (reverseLayout == mReverseLayout) {
return;
}
mReverseLayout = reverseLayout;
removeAllViews();
}
public void setSmoothScrollInterpolator(Interpolator smoothScrollInterpolator) {
this.mSmoothScrollInterpolator = smoothScrollInterpolator;
}
@Override
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) {
final int offsetPosition = getOffsetToPosition(position);
if (mOrientation == VERTICAL) {
recyclerView.smoothScrollBy(0, offsetPosition, mSmoothScrollInterpolator);
} else {
recyclerView.smoothScrollBy(offsetPosition, 0, mSmoothScrollInterpolator);
}
}
@Override
public void scrollToPosition(int position) {
if (!mInfinite && (position < 0 || position >= getItemCount())) return;
mPendingScrollPosition = position;
mOffset = mShouldReverseLayout ? position * -mInterval : position * mInterval;
requestLayout();
}
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
if (state.getItemCount() == 0) {
removeAndRecycleAllViews(recycler);
mOffset = 0;
return;
}
ensureLayoutState();
resolveShouldLayoutReverse();
//make sure properties are correct while measure more than once
View scrap = recycler.getViewForPosition(0);
measureChildWithMargins(scrap, 0, 0);
mDecoratedMeasurement = mOrientationHelper.getDecoratedMeasurement(scrap);
mDecoratedMeasurementInOther = mOrientationHelper.getDecoratedMeasurementInOther(scrap);
mSpaceMain = (mOrientationHelper.getTotalSpace() - mDecoratedMeasurement) / 2;
if (mDistanceToBottom == INVALID_SIZE) {
mSpaceInOther = (getTotalSpaceInOther() - mDecoratedMeasurementInOther) / 2;
} else {
mSpaceInOther =getTotalSpaceInOther() - mDecoratedMeasurementInOther - mDistanceToBottom;
}
mInterval = setInterval();
setUp();
mLeftItems = (int) Math.abs(minRemoveOffset() / mInterval) + 1;
mRightItems = (int) Math.abs(maxRemoveOffset() / mInterval) + 1;
if (mPendingSavedState != null) {
mShouldReverseLayout = mPendingSavedState.isReverseLayout;
mPendingScrollPosition = mPendingSavedState.position;
mOffset = mPendingSavedState.offset;
}
if (mPendingScrollPosition != NO_POSITION) {
mOffset = mShouldReverseLayout ?
mPendingScrollPosition * -mInterval : mPendingScrollPosition * mInterval;
}
detachAndScrapAttachedViews(recycler);
layoutItems(recycler);
}
public int getTotalSpaceInOther() {
if (mOrientation == HORIZONTAL) {
return getHeight() - getPaddingTop()
- getPaddingBottom();
} else {
return getWidth() - getPaddingLeft()
- getPaddingRight();
}
}
@Override
public void onLayoutCompleted(RecyclerView.State state) {
super.onLayoutCompleted(state);
mPendingSavedState = null;
mPendingScrollPosition = NO_POSITION;
}
@Override
public boolean onAddFocusables(RecyclerView recyclerView, ArrayList<View> views, int direction, int focusableMode) {
final int currentPosition = getCurrentPosition();
final View currentView = findViewByPosition(currentPosition);
if (currentView == null) return true;
if (recyclerView.hasFocus()) {
final int movement = getMovement(direction);
if (movement != DIRECTION_NO_WHERE) {
final int targetPosition = movement == DIRECTION_BACKWARD ?
currentPosition - 1 : currentPosition + 1;
recyclerView.smoothScrollToPosition(targetPosition);
}
} else {
currentView.addFocusables(views, direction, focusableMode);
}
return true;
}
@Override
public View onFocusSearchFailed(View focused, int focusDirection, RecyclerView.Recycler recycler, RecyclerView.State state) {
return null;
}
private int getMovement(int direction) {
if (mOrientation == VERTICAL) {
if (direction == View.FOCUS_UP) {
return mShouldReverseLayout ? DIRECTION_FORWARD : DIRECTION_BACKWARD;
} else if (direction == View.FOCUS_DOWN) {
return mShouldReverseLayout ? DIRECTION_BACKWARD : DIRECTION_FORWARD;
} else {
return DIRECTION_NO_WHERE;
}
} else {
if (direction == View.FOCUS_LEFT) {
return mShouldReverseLayout ? DIRECTION_FORWARD : DIRECTION_BACKWARD;
} else if (direction == View.FOCUS_RIGHT) {
return mShouldReverseLayout ? DIRECTION_BACKWARD : DIRECTION_FORWARD;
} else {
return DIRECTION_NO_WHERE;
}
}
}
void ensureLayoutState() {
if (mOrientationHelper == null) {
mOrientationHelper = OrientationHelper.createOrientationHelper(this, mOrientation);
}
}
/**
* You can set up your own properties here or change the exist properties like mSpaceMain and mSpaceInOther
*/
protected void setUp() {
}
private float getProperty(int position) {
return mShouldReverseLayout ? position * -mInterval : position * mInterval;
}
@Override
public void onAdapterChanged(RecyclerView.Adapter oldAdapter, RecyclerView.Adapter newAdapter) {
removeAllViews();
mOffset = 0;
}
@Override
public int computeHorizontalScrollOffset(RecyclerView.State state) {
return computeScrollOffset();
}
@Override
public int computeVerticalScrollOffset(RecyclerView.State state) {
return computeScrollOffset();
}
@Override
public int computeHorizontalScrollExtent(RecyclerView.State state) {
return computeScrollExtent();
}
@Override
public int computeVerticalScrollExtent(RecyclerView.State state) {
return computeScrollExtent();
}
@Override
public int computeHorizontalScrollRange(RecyclerView.State state) {
return computeScrollRange();
}
@Override
public int computeVerticalScrollRange(RecyclerView.State state) {
return computeScrollRange();
}
private int computeScrollOffset() {
if (getChildCount() == 0) {
return 0;
}
if (!mSmoothScrollbarEnabled) {
return !mShouldReverseLayout ?
getCurrentPosition() : getItemCount() - getCurrentPosition() - 1;
}
final float realOffset = getOffsetOfRightAdapterPosition();
return !mShouldReverseLayout ? (int) realOffset : (int) ((getItemCount() - 1) * mInterval + realOffset);
}
private int computeScrollExtent() {
if (getChildCount() == 0) {
return 0;
}
if (!mSmoothScrollbarEnabled) {
return 1;
}
return (int) mInterval;
}
private int computeScrollRange() {
if (getChildCount() == 0) {
return 0;
}
if (!mSmoothScrollbarEnabled) {
return getItemCount();
}
return (int) (getItemCount() * mInterval);
}
@Override
public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler, RecyclerView.State state) {
if (mOrientation == VERTICAL) {
return 0;
}
return scrollBy(dx, recycler, state);
}
@Override
public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) {
if (mOrientation == HORIZONTAL) {
return 0;
}
return scrollBy(dy, recycler, state);
}
private int scrollBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) {
if (getChildCount() == 0 || dy == 0) {
return 0;
}
ensureLayoutState();
int willScroll = dy;
float realDx = dy / getDistanceRatio();
if (Math.abs(realDx) < 0.00000001f) {
return 0;
}
float targetOffset = mOffset + realDx;
//handle the boundary
if (!mInfinite && targetOffset < getMinOffset()) {
willScroll -= (targetOffset - getMinOffset()) * getDistanceRatio();
} else if (!mInfinite && targetOffset > getMaxOffset()) {
willScroll = (int) ((getMaxOffset() - mOffset) * getDistanceRatio());
}
realDx = willScroll / getDistanceRatio();
mOffset += realDx;
//handle recycle
layoutItems(recycler);
return willScroll;
}
private void layoutItems(RecyclerView.Recycler recycler) {
detachAndScrapAttachedViews(recycler);
positionCache.clear();
final int itemCount = getItemCount();
if (itemCount == 0) return;
// make sure that current position start from 0 to 1
final int currentPos = mShouldReverseLayout ?
-getCurrentPositionOffset() : getCurrentPositionOffset();
int start = currentPos - mLeftItems;
int end = currentPos + mRightItems;
// handle max visible count
if (useMaxVisibleCount()) {
boolean isEven = mMaxVisibleItemCount % 2 == 0;
if (isEven) {
int offset = mMaxVisibleItemCount / 2;
start = currentPos - offset + 1;
end = currentPos + offset + 1;
} else {
int offset = (mMaxVisibleItemCount - 1) / 2;
start = currentPos - offset;
end = currentPos + offset + 1;
}
}
if (!mInfinite) {
if (start < 0) {
start = 0;
if (useMaxVisibleCount()) end = mMaxVisibleItemCount;
}
if (end > itemCount) end = itemCount;
}
float lastOrderWeight = Float.MIN_VALUE;
for (int i = start; i < end; i++) {
if (useMaxVisibleCount() || !removeCondition(getProperty(i) - mOffset)) {
// start and end base on current position,
// so we need to calculate the adapter position
int adapterPosition = i;
if (i >= itemCount) {
adapterPosition %= itemCount;
} else if (i < 0) {
int delta = (-adapterPosition) % itemCount;
if (delta == 0) delta = itemCount;
adapterPosition = itemCount - delta;
}
final View scrap = recycler.getViewForPosition(adapterPosition);
measureChildWithMargins(scrap, 0, 0);
resetViewProperty(scrap);
// we need i to calculate the real offset of current view
final float targetOffset = getProperty(i) - mOffset;
layoutScrap(scrap, targetOffset);
final float orderWeight = mEnableBringCenterToFront ?
setViewElevation(scrap, targetOffset) : adapterPosition;
if (orderWeight > lastOrderWeight) {
addView(scrap);
} else {
addView(scrap, 0);
}
if (i == currentPos) currentFocusView = scrap;
lastOrderWeight = orderWeight;
positionCache.put(i, scrap);
}
}
currentFocusView.requestFocus();
}
private boolean useMaxVisibleCount() {
return mMaxVisibleItemCount != DETERMINE_BY_MAX_AND_MIN;
}
private boolean removeCondition(float targetOffset) {
return targetOffset > maxRemoveOffset() || targetOffset < minRemoveOffset();
}
private void resetViewProperty(View v) {
v.setRotation(0);
v.setRotationY(0);
v.setRotationX(0);
v.setScaleX(1f);
v.setScaleY(1f);
v.setAlpha(1f);
}
/* package */ float getMaxOffset() {
return !mShouldReverseLayout ? (getItemCount() - 1) * mInterval : 0;
}
/* package */ float getMinOffset() {
return !mShouldReverseLayout ? 0 : -(getItemCount() - 1) * mInterval;
}
private void layoutScrap(View scrap, float targetOffset) {
final int left = calItemLeft(scrap, targetOffset);
final int top = calItemTop(scrap, targetOffset);
if (mOrientation == VERTICAL) {
layoutDecorated(scrap, mSpaceInOther + left, mSpaceMain + top,
mSpaceInOther + left + mDecoratedMeasurementInOther, mSpaceMain + top + mDecoratedMeasurement);
} else {
layoutDecorated(scrap, mSpaceMain + left, mSpaceInOther + top,
mSpaceMain + left + mDecoratedMeasurement, mSpaceInOther + top + mDecoratedMeasurementInOther);
}
setItemViewProperty(scrap, targetOffset);
}
protected int calItemLeft(View itemView, float targetOffset) {
return mOrientation == VERTICAL ? 0 : (int) targetOffset;
}
protected int calItemTop(View itemView, float targetOffset) {
return mOrientation == VERTICAL ? (int) targetOffset : 0;
}
/**
* when the target offset reach this,
* the view will be removed and recycled in {@link #layoutItems(RecyclerView.Recycler)}
*/
protected float maxRemoveOffset() {
return mOrientationHelper.getTotalSpace() - mSpaceMain;
}
/**
* when the target offset reach this,
* the view will be removed and recycled in {@link #layoutItems(RecyclerView.Recycler)}
*/
protected float minRemoveOffset() {
return -mDecoratedMeasurement - mOrientationHelper.getStartAfterPadding() - mSpaceMain;
}
public int getCurrentPosition() {
if (getItemCount() == 0) return 0;
int position = getCurrentPositionOffset();
if (!mInfinite) return Math.abs(position);
position = !mShouldReverseLayout ?
//take care of position = getItemCount()
(position >= 0 ?
position % getItemCount() :
getItemCount() + position % getItemCount()) :
(position > 0 ?
getItemCount() - position % getItemCount() :
-position % getItemCount());
return position == getItemCount() ? 0 : position;
}
@Override
public View findViewByPosition(int position) {
final int itemCount = getItemCount();
if (itemCount == 0) return null;
for (int i = 0; i < positionCache.size(); i++) {
final int key = positionCache.keyAt(i);
if (key >= 0) {
if (position == key % itemCount) return positionCache.valueAt(i);
} else {
int delta = key % itemCount;
if (delta == 0) delta = -itemCount;
if (itemCount + delta == position) return positionCache.valueAt(i);
}
}
return null;
}
private int getCurrentPositionOffset() {
return Math.round(mOffset / mInterval);
}
/**
* Sometimes we need to get the right offset of matching adapter position
* cause when {@link #mInfinite} is set true, there will be no limitation of {@link #mOffset}
*/
private float getOffsetOfRightAdapterPosition() {
if (mShouldReverseLayout)
return mInfinite ?
(mOffset <= 0 ?
(mOffset % (mInterval * getItemCount())) :
(getItemCount() * -mInterval + mOffset % (mInterval * getItemCount()))) :
mOffset;
else
return mInfinite ?
(mOffset >= 0 ?
(mOffset % (mInterval * getItemCount())) :
(getItemCount() * mInterval + mOffset % (mInterval * getItemCount()))) :
mOffset;
}
/**
*
* @return the dy between center and current position
*/
public int getOffsetToCenter() {
if (mInfinite)
return (int) ((getCurrentPositionOffset() * mInterval - mOffset) * getDistanceRatio());
return (int) ((getCurrentPosition() *
(!mShouldReverseLayout ? mInterval : -mInterval) - mOffset) * getDistanceRatio());
}
public int getOffsetToPosition(int position) {
if (mInfinite)
return (int) (((getCurrentPositionOffset() +
(!mShouldReverseLayout ? position - getCurrentPosition() : getCurrentPosition() - position)) *
mInterval - mOffset) * getDistanceRatio());
return (int) ((position *
(!mShouldReverseLayout ? mInterval : -mInterval) - mOffset) * getDistanceRatio());
}
public void setOnPageChangeListener(OnPageChangeListener onPageChangeListener) {
this.onPageChangeListener = onPageChangeListener;
}
public void setInfinite(boolean enable) {
assertNotInLayoutOrScroll(null);
if (enable == mInfinite) {
return;
}
mInfinite = enable;
requestLayout();
}
public boolean getInfinite() {
return mInfinite;
}
public int getDistanceToBottom() {
return mDistanceToBottom == INVALID_SIZE ?
(getTotalSpaceInOther() - mDecoratedMeasurementInOther) / 2 : mDistanceToBottom;
}
public void setDistanceToBottom(int mDistanceToBottom) {
assertNotInLayoutOrScroll(null);
if (this.mDistanceToBottom == mDistanceToBottom) return;
this.mDistanceToBottom = mDistanceToBottom;
removeAllViews();
}
/**
* When smooth scrollbar is enabled, the position and size of the scrollbar thumb is computed
* based on the number of visible pixels in the visible items. This however assumes that all
* list items have similar or equal widths or heights (depending on list orientation).
* If you use a list in which items have different dimensions, the scrollbar will change
* appearance as the user scrolls through the list. To avoid this issue, you need to disable
* this property.
* <p>
* When smooth scrollbar is disabled, the position and size of the scrollbar thumb is based
* solely on the number of items in the adapter and the position of the visible items inside
* the adapter. This provides a stable scrollbar as the user navigates through a list of items
* with varying widths / heights.
*
* @param enabled Whether or not to enable smooth scrollbar.
* @see #setSmoothScrollbarEnabled(boolean)
*/
public void setSmoothScrollbarEnabled(boolean enabled) {
mSmoothScrollbarEnabled = enabled;
}
public void setEnableBringCenterToFront(boolean bringCenterToTop) {
assertNotInLayoutOrScroll(null);
if (mEnableBringCenterToFront == bringCenterToTop) {
return;
}
this.mEnableBringCenterToFront = bringCenterToTop;
requestLayout();
}
public boolean getEnableBringCenterToFront() {
return mEnableBringCenterToFront;
}
/**
* Returns the current state of the smooth scrollbar feature. It is enabled by default.
*
* @return True if smooth scrollbar is enabled, false otherwise.
* @see #setSmoothScrollbarEnabled(boolean)
*/
public boolean getSmoothScrollbarEnabled() {
return mSmoothScrollbarEnabled;
}
private static class SavedState implements Parcelable {
int position;
float offset;
boolean isReverseLayout;
SavedState() {
}
SavedState(Parcel in) {
position = in.readInt();
offset = in.readFloat();
isReverseLayout = in.readInt() == 1;
}
public SavedState(SavedState other) {
position = other.position;
offset = other.offset;
isReverseLayout = other.isReverseLayout;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(position);
dest.writeFloat(offset);
dest.writeInt(isReverseLayout ? 1 : 0);
}
public static final Creator<SavedState> CREATOR
= new Creator<SavedState>() {
@Override
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}
@Override
public SavedState[] newArray(int size) {
return new SavedState[size];
}
};
}
public interface OnPageChangeListener {
void onPageSelected(int position);
void onPageScrollStateChanged(int state);
}
}
| [
"mortezarakhtiani@gmail.com"
] | mortezarakhtiani@gmail.com |
f2a512bd7c495c8aa5bb227ae3236bf9faaadc13 | 185cdbbef558f3460e7264ea1813a9d8ca8b5f39 | /src/main/java/ru/ratnikov/structural/adapter/CartesianPoint.java | af0a57eaa44aba44e62a25692aef10d1d489b884 | [] | no_license | titanmet/patterns | d65f57079c80c72ffe6fb49cb735677051b79f44 | 277c2d7900c65312fdeaa7eca299490b1864ea1e | refs/heads/master | 2020-04-20T13:14:16.033507 | 2019-02-02T18:29:16 | 2019-02-02T18:29:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 212 | java | package ru.ratnikov.structural.adapter;
public class CartesianPoint implements Cartesian {
@Override
public void setPoint(double x, double y) {
System.out.println("x: " + x + " y: " + y);
}
} | [
"titanmet@mail.ru"
] | titanmet@mail.ru |
0699f84de636fdb985aaf9e008435d38f0ad271e | c2aad1fc08fc344a94723e48de7fe4871ea99143 | /JavaSource/org/unitime/timetable/reports/exam/AbbvExamScheduleByCourseReport.java | f13f502d1591ff5cb7f8edeb5353d691ea6e0278 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"EPL-1.0",
"LGPL-3.0-only",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"CDDL-1.0",
"LicenseRef-scancode-fr... | permissive | Monyancha/unitime | 592318976395525d7c47ba2515b9375e90c31a3c | 482dfb20b5e26554fa6e2fc6fb230bc409caad25 | refs/heads/master | 2020-07-22T07:52:57.879126 | 2019-09-06T13:53:48 | 2019-09-06T13:53:48 | 207,118,452 | 3 | 0 | Apache-2.0 | 2019-09-08T13:41:40 | 2019-09-08T13:41:40 | null | UTF-8 | Java | false | false | 14,709 | java | /*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* The Apereo Foundation 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:
*
* 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 org.unitime.timetable.reports.exam;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.TreeSet;
import java.util.Vector;
import org.unitime.timetable.model.ExamType;
import org.unitime.timetable.model.Session;
import org.unitime.timetable.model.SubjectArea;
import org.unitime.timetable.solver.exam.ui.ExamAssignment;
import org.unitime.timetable.solver.exam.ui.ExamAssignmentInfo;
import org.unitime.timetable.solver.exam.ui.ExamRoomInfo;
import org.unitime.timetable.solver.exam.ui.ExamInfo.ExamSectionInfo;
import com.lowagie.text.DocumentException;
/**
* @author Tomas Muller
*/
public class AbbvExamScheduleByCourseReport extends PdfLegacyExamReport {
public AbbvExamScheduleByCourseReport(int mode, File file, Session session, ExamType examType, Collection<SubjectArea> subjectAreas, Collection<ExamAssignmentInfo> exams) throws IOException, DocumentException {
super(mode, file, "SCHEDULE BY COURSE", session, examType, subjectAreas, exams);
}
public void printReport() throws DocumentException {
Vector<String> lines = new Vector();
int n = iNrLines - 2;
if (!iDispRooms) {
ExamSectionInfo last = null; int lx = 0;
for (ExamAssignment exam : new TreeSet<ExamAssignment>(getExams())) {
if (exam.getPeriod()==null || !hasSubjectArea(exam)) continue;
boolean firstSection = true;
TreeSet<ExamSectionInfo> sections = new TreeSet<ExamSectionInfo>(new Comparator<ExamSectionInfo>() {
public int compare(ExamSectionInfo s1, ExamSectionInfo s2) {
if (!hasSubjectAreas()) return s1.compareTo(s2);
if (hasSubjectArea(s1.getOwner().getCourse().getSubjectArea())) {
if (!hasSubjectArea(s2.getOwner().getCourse().getSubjectArea())) return -1;
} else if (hasSubjectArea(s2.getOwner().getCourse().getSubjectArea())) return 1;
return s1.compareTo(s2);
}
});
sections.addAll(exam.getSectionsIncludeCrosslistedDummies());
for (ExamSectionInfo section : sections) {
boolean sameSubj = false, sameCrs = false, sameSct = false, sameItype = false;
if ((lx%n)!=0 && last!=null) {
if (last.getSubject().equals(section.getSubject())) {
sameSubj = true;
if (last.getCourseNbr().equals(section.getCourseNbr())) {
sameCrs = true;
if (last.getSection().equals(section.getSection()))
sameSct = true;
if (last.getItype().equals(section.getItype()))
sameItype = true;
}
}
}
last = section; lx++;
if (firstSection) {
if (iItype) {
lines.add(
rpad(sameSubj?"":section.getSubject(),7)+" "+
rpad(sameCrs?"":section.getCourseNbr(),8)+" "+
rpad(sameItype?"":section.getItype().length()==0?"ALL":section.getItype(),5)+" "+
lpad(sameSct?"":section.getSection(),9)+" "+
formatPeriod(exam));
} else {
lines.add(
rpad(sameSubj?"":section.getSubject(),7)+" "+
rpad(sameCrs?"":section.getCourseNbr(),8)+" "+
lpad(sameSct?"":section.getSection().length()==0?"ALL":section.getSection(),9)+" "+
formatShortPeriodNoEndTime(exam));
}
} else {
if (iItype) {
String w = "w/"+(sameCrs?"":section.getSubject()+" ")+
(sameCrs?"":section.getCourseNbr()+" ")+
(sameItype?"":(section.getItype().length()==0?"ALL":section.getItype())+" ")+
(sameSct?"":section.getSection());
if (w.length()<32) w = lpad(w,32);
lines.add(w);
} else {
String w = "w/"+
(sameCrs?"":section.getSubject()+" ")+
(sameCrs?"":section.getCourseNbr()+" ")+
(sameSct?"":section.getSection().length()==0?"ALL":section.getSection());
if (w.length()<26) w = lpad(w, 26);
lines.add(w);
}
}
firstSection = false;
}
}
if (iItype) {
if (iExternal) {
setHeader(new String[] {
"Subject Course ExtID Section Date Time | Subject Course ExtID Section Date Time ",
"------- -------- ----- --------- --------- --------------- | ------- -------- ----- --------- --------- ---------------"});
} else {
setHeader(new String[] {
"Subject Course Type Section Date Time | Subject Course Type Section Date Time ",
"------- -------- ----- --------- --------- --------------- | ------- -------- ----- --------- --------- ---------------"});
// ".........1.........2.........3.........4.........5.........6"
}
} else {
setHeader(new String[] {
"Subject Course Section Date Time | Subject Course Section Date Time | Subject Course Section Date Time ",
"------- -------- --------- ------- ------ | ------- -------- --------- ------- ------ | ------- -------- --------- ------- ------"});
// ".........1.........2.........3.........4123"
}
printHeader();
if (iItype) {
for (int idx=0; idx<lines.size(); idx+=2*n) {
for (int i=0;i<n;i++) {
String a = (i+idx+0*n<lines.size()?lines.elementAt(i+idx+0*n):"");
String b = (i+idx+1*n<lines.size()?lines.elementAt(i+idx+1*n):"");
println(rpad(a,60)+"| "+b);
}
}
} else {
for (int idx=0; idx<lines.size(); idx+=3*n) {
for (int i=0;i<n;i++) {
String a = (i+idx+0*n<lines.size()?lines.elementAt(i+idx+0*n):"");
String b = (i+idx+1*n<lines.size()?lines.elementAt(i+idx+1*n):"");
String c = (i+idx+2*n<lines.size()?lines.elementAt(i+idx+2*n):"");
println(rpad(a,43)+"| "+rpad(b,43)+"| "+c);
}
}
}
} else {
ExamSectionInfo last = null; int lx = 0;
for (ExamAssignment exam : new TreeSet<ExamAssignment>(getExams())) {
if (exam.getPeriod()==null || !hasSubjectArea(exam)) continue;
Vector<String> rooms = new Vector();
if (exam.getRooms()==null || exam.getRooms().isEmpty()) {
rooms.add(rpad(iNoRoom,11));
} else for (ExamRoomInfo room : exam.getRooms()) {
rooms.add(formatRoom(room));
}
Vector<ExamSectionInfo> sections = new Vector(exam.getSectionsIncludeCrosslistedDummies());
Collections.sort(sections, new Comparator<ExamSectionInfo>() {
public int compare(ExamSectionInfo s1, ExamSectionInfo s2) {
if (!hasSubjectAreas()) return s1.compareTo(s2);
if (hasSubjectArea(s1.getOwner().getCourse().getSubjectArea())) {
if (!hasSubjectArea(s2.getOwner().getCourse().getSubjectArea())) return -1;
} else if (hasSubjectArea(s2.getOwner().getCourse().getSubjectArea())) return 1;
return s1.compareTo(s2);
}
});
for (int i=0;i<Math.max(rooms.size(),sections.size());i++) {
String a = (i<rooms.size()?rooms.elementAt(i):rpad("",11));
ExamSectionInfo section = (i<sections.size()?sections.elementAt(i):null);
boolean sameSubj = false, sameCrs = false, sameSct = false, sameItype = false;
if ((lx%n)!=0 && last!=null) {
if (section!=null && last.getSubject().equals(section.getSubject())) {
sameSubj = true;
if (last.getCourseNbr().equals(section.getCourseNbr())) {
sameCrs = true;
if (last.getSection().equals(section.getSection()))
sameSct = true;
if (last.getItype().equals(section.getItype()))
sameItype = true;
}
}
}
if (i==0) {
if (iItype) {
lines.add(
rpad(sameSubj?"":section.getSubject(),7)+" "+
rpad(sameCrs?"":section.getCourseNbr(),8)+" "+
rpad(sameItype?"":section.getItype().length()==0?"ALL":section.getItype(),5)+" "+
lpad(sameSct?"":section.getSection(),9)+" "+
formatShortPeriod(section.getExamAssignment())+" "+a);
} else {
lines.add(
rpad(sameSubj?"":section.getSubject(),7)+" "+
rpad(sameCrs?"":section.getCourseNbr(),8)+" "+
lpad(sameSct?"":section.getSection().length()==0?"ALL":section.getSection(),9)+" "+
formatPeriod(section.getExamAssignment())+" "+a);
}
} else if (section!=null) {
if (iItype) {
String w = "w/"+(sameCrs?"":section.getSubject()+" ")+
(sameCrs?"":section.getCourseNbr()+" ")+
(sameItype?"":(section.getItype().length()==0?"ALL":section.getItype())+" ")+
(sameSct?"":section.getSection());
if (w.length()<32) w = lpad(w,32);
lines.add(rpad(w,55)+a);
} else {
String w = "w/"+
(sameCrs?"":section.getSubject()+" ")+
(sameCrs?"":section.getCourseNbr()+" ")+
(sameSct?"":section.getSection().length()==0?"ALL":section.getSection());
if (w.length()<26) w = lpad(w, 26);
lines.add(rpad(w,53)+a);
}
} else {
lines.add(rpad("",(iItype?55:53))+a);
}
lx++;
}
}
if (iItype) {
if (iExternal) {
setHeader(new String[] {
"Subject Course ExtID Section Date Time Bldg Room |Subject Course ExtID Section Date Time Bldg Room",
"------- -------- ----- --------- ------- ------------- ----- -----|------- -------- ----- --------- ------- ------------- ----- -----"});
// ".........1.........2.........3.........4.........5.........6123456"
} else {
setHeader(new String[] {
"Subject Course Type Section Date Time Bldg Room |Subject Course Type Section Date Time Bldg Room",
"------- -------- ----- --------- ------- ------------- ----- -----|------- -------- ----- --------- ------- ------------- ----- -----"});
}
} else {
setHeader(new String[] {
"Subject Course Section Date Time Bldg Room | Subject Course Section Date Time Bldg Room ",
"------- -------- --------- --------- --------------- ----- ----- | ------- -------- --------- --------- --------------- ----- -----"});
// ".........1.........2.........3.........4.........5.........612345"
}
printHeader();
for (int idx=0; idx<lines.size(); idx+=2*n) {
for (int i=0;i<n;i++) {
String a = (i+idx+0*n<lines.size()?lines.elementAt(i+idx+0*n):rpad("",65));
String b = (i+idx+1*n<lines.size()?lines.elementAt(i+idx+1*n):rpad("",65));
if (iItype)
println(rpad(a,66)+"|"+rpad(b, 66));
else
println(rpad(a,65)+"| "+rpad(b, 64));
}
}
}
}
}
| [
"muller@unitime.org"
] | muller@unitime.org |
c167b829e971dd9c109ebdccc1cba63e4cdfe477 | 40665051fadf3fb75e5a8f655362126c1a2a3af6 | /datasalt-pangool/22ae3f07a92a9dc1872dc6c4b12eb661902fe386/26/PangoolUrlResolution.java | e63f0d32853287bca652644880263e15b0269012 | [] | no_license | fermadeiral/StyleErrors | 6f44379207e8490ba618365c54bdfef554fc4fde | d1a6149d9526eb757cf053bc971dbd92b2bfcdf1 | refs/heads/master | 2020-07-15T12:55:10.564494 | 2019-10-24T02:30:45 | 2019-10-24T02:30:45 | 205,546,543 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,737 | java | /**
* Copyright [2012] [Datasalt Systems S.L.]
*
* 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 com.datasalt.pangool.benchmark.cogroup;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import com.datasalt.pangool.io.ITuple;
import com.datasalt.pangool.io.Schema;
import com.datasalt.pangool.io.Schema.Field;
import com.datasalt.pangool.io.Schema.Field.Type;
import com.datasalt.pangool.io.Tuple;
import com.datasalt.pangool.tuplemr.TupleMRBuilder;
import com.datasalt.pangool.tuplemr.TupleMRException;
import com.datasalt.pangool.tuplemr.mapred.lib.input.HadoopInputFormat;
import com.datasalt.pangool.tuplemr.mapred.lib.output.HadoopOutputFormat;
import com.datasalt.pangool.tuplemr.mapred.tuplemr.TupleMapper;
import com.datasalt.pangool.tuplemr.mapred.tuplemr.TupleReducer;
import com.datasalt.pangool.utils.HadoopUtils;
/**
* Code for solving the URL Resolution CoGroup Problem in Pangool.
* <p>
* The URL Resolution CoGroup Problem is: We have one file with URL Registers: {url timestamp ip} and another file with
* canonical URL mapping: {url canonicalUrl}. We want to obtain the URL Registers file with the url substituted with the
* canonical one according to the mapping file: {canonicalUrl timestamp ip}.
*/
public class PangoolUrlResolution {
@SuppressWarnings("serial")
public static class UrlProcessor extends TupleMapper<LongWritable, Text> {
private Tuple tuple;
@Override
public void map(LongWritable key, Text value, TupleMRContext context, Collector collector)
throws IOException, InterruptedException {
if(tuple == null) {
tuple = new Tuple(context.getTupleMRConfig().getIntermediateSchema("urlRegister"));
}
String[] fields = value.toString().split("\t");
tuple.set("url", fields[0]);
tuple.set("timestamp", Long.parseLong(fields[1]));
tuple.set("ip", fields[2]);
collector.write(tuple);
}
}
@SuppressWarnings("serial")
public static class UrlMapProcessor extends TupleMapper<LongWritable, Text> {
private Tuple tuple;
@Override
public void map(LongWritable key, Text value, TupleMRContext context, Collector collector)
throws IOException, InterruptedException {
if(tuple == null) {
tuple = new Tuple(context.getTupleMRConfig().getIntermediateSchema("urlMap"));
}
String[] fields = value.toString().split("\t");
tuple.set("url", fields[0]);
tuple.set("canonicalUrl", fields[1]);
collector.write(tuple);
}
}
@SuppressWarnings("serial")
public static class Handler extends TupleReducer<Text, NullWritable> {
private Text result;
@Override
public void reduce(ITuple group, Iterable<ITuple> tuples, TupleMRContext context, Collector collector)
throws IOException, InterruptedException, TupleMRException {
if (result == null) {
result = new Text();
}
String cannonicalUrl = null;
for(ITuple tuple : tuples) {
if("urlMap".equals(tuple.getSchema().getName())) {
cannonicalUrl = tuple.get("canonicalUrl").toString();
} else {
result.set(cannonicalUrl + "\t" + tuple.get("timestamp") + "\t" + tuple.get("ip"));
collector.write(result, NullWritable.get());
}
}
}
}
public Job getJob(Configuration conf, String input1, String input2, String output) throws TupleMRException,
IOException {
List<Field> urlRegisterFields = new ArrayList<Field>();
urlRegisterFields.add(Field.create("url",Type.STRING));
urlRegisterFields.add(Field.create("timestamp",Type.LONG));
urlRegisterFields.add(Field.create("ip",Type.STRING));
List<Field> urlMapFields = new ArrayList<Field>();
urlMapFields.add(Field.create("url",Type.STRING));
urlMapFields.add(Field.create("canonicalUrl",Type.STRING));
TupleMRBuilder grouper = new TupleMRBuilder(conf,"Pangool Url Resolution");
grouper.addIntermediateSchema(new Schema("urlMap", urlMapFields));
grouper.addIntermediateSchema(new Schema("urlRegister", urlRegisterFields));
grouper.setGroupByFields("url");
grouper.setTupleReducer(new Handler());
grouper.setOutput(new Path(output), new HadoopOutputFormat(TextOutputFormat.class), Text.class, NullWritable.class);
grouper.addInput(new Path(input1), new HadoopInputFormat(TextInputFormat.class), new UrlMapProcessor());
grouper.addInput(new Path(input2), new HadoopInputFormat(TextInputFormat.class), new UrlProcessor());
return grouper.createJob();
}
public static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException,
TupleMRException {
Configuration conf = new Configuration();
FileSystem fS = FileSystem.get(conf);
String input1 = args[0];
String input2 = args[1];
String output = args[2];
HadoopUtils.deleteIfExists(fS, new Path(output));
new PangoolUrlResolution().getJob(conf, input1, input2, output).waitForCompletion(true);
}
}
| [
"fer.madeiral@gmail.com"
] | fer.madeiral@gmail.com |
fc0a1614507ec2c4147c83044bbf30c89f2ca687 | 94aa05f69d2ad96318e953eec3f8f9fe20868e43 | /FMS/src/com/trimax/its/pis/action/PisScrollMessage.java | 05ac6b6cc82e5c82c91f12bcb0a70325384ac64f | [] | no_license | dassurjeetkumar/FleetManagementSystem | 1da26365cc4a6f687df9e2b19568a9c2b7ddefa9 | 0a7a583c3b8c821c45c6f8d77285313aaab397f4 | refs/heads/master | 2020-08-12T20:11:45.682989 | 2019-10-13T15:10:06 | 2019-10-13T15:10:06 | 214,834,959 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 12,448 | java | package com.trimax.its.pis.action;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import org.json.simple.JSONObject;
import com.opensymphony.xwork2.ActionSupport;
import com.trimax.its.common.CommonValidation;
import com.trimax.its.pis.dao.PisDisplayMappingDao;
import com.trimax.its.pis.dao.PisScrollMessageDao;
import com.trimax.its.pis.model.PisScrollMessageModel;
public class PisScrollMessage extends ActionSupport {
private PisScrollMessageModel pisScrollMessageModel;
private String msg;
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public PisScrollMessageModel getPisScrollMessageModel() {
return pisScrollMessageModel;
}
public void setPisScrollMessageModel(
PisScrollMessageModel pisScrollMessageModel) {
this.pisScrollMessageModel = pisScrollMessageModel;
}
public String viewPisScrollMessage() {
return "success";
}
private String requestType;
public String getRequestType() {
return requestType;
}
public void setRequestType(String requestType) {
this.requestType = requestType;
}
public String createScrollMessage() {
return "success";
}
/**
*
* @deleteScrollMessage
*/
public String deleteScrollMessage() {
HttpServletRequest request = ServletActionContext.getRequest();
PisScrollMessageDao pisscrollmessagedao = new PisScrollMessageDao();
int displaymappid = Integer.parseInt(request
.getParameter("scrollmessgid"));
pisscrollmessagedao.deleteScrollMessage(Integer.parseInt(request
.getParameter("scrollmessgid")));
msg = "Scroll Message Id " + displaymappid + " Deleted successfully";
return "success";
}
/**
*
* @editScrollMessage
*/
public String editScrollMessage() {
HttpServletRequest request = ServletActionContext.getRequest();
PisScrollMessageDao pisscrollmessagedao = new PisScrollMessageDao();
pisScrollMessageModel = pisscrollmessagedao
.getScrollMessageDetails(Integer.parseInt(request
.getParameter("id")));
return "success";
}
/**
*
* @updateScrollMessage
*/
public String updateScrollMessage() {
int id = pisScrollMessageModel.getPis_id();
String scrollMessage = pisScrollMessageModel.getMessage().trim();
int displayunitid = pisScrollMessageModel.getScroll_display_unit().getPis_display_unit_id();
int busstandid = pisScrollMessageModel.getBusstand().getOrg_chart_id();
String fontcolor=pisScrollMessageModel.getFont_color();
String backgroundcolor=pisScrollMessageModel.getBackground_color();
if (("".equals(scrollMessage)) || (scrollMessage == null)
|| (scrollMessage.length() == 0)) {
addFieldError("message", "Scroll Message Message is Manadatory");
return "input";
}
if (("".equals(fontcolor)) || (fontcolor == null)
|| (fontcolor.length() == 0)) {
addFieldError("font_color", "Scroll Message Font Color is Manadatory");
return "input";
}
if (("".equals(backgroundcolor)) || (backgroundcolor == null)
|| (backgroundcolor.length() == 0)) {
addFieldError("background_color", "Scroll Message Background Color is Manadatory");
return "input";
}
CommonValidation cm = new CommonValidation();
/*if (!cm.isSpecialChar(scrollMessage)) {
addFieldError("message",
"Scroll Message is Should be a alphanumeric");
return "input";
}*/
if (busstandid == 0) {
addFieldError("busstandid",
"Scroll Message Bus Stand Id is Manadatory");
// msg = " Please Insert Shift Type Details Again";
return "input";
}
if (displayunitid == 0) {
addFieldError("displayunit",
"Scroll Message Display Unit is Manadatory");
// msg = " Please Insert Shift Type Details Again";
return "input";
}
String date1 = pisScrollMessageModel.getEffective_date();
String date2 = pisScrollMessageModel.getEnd_date();
try{
if(pisScrollMessageModel.getEffective_date()==null || (pisScrollMessageModel.getEffective_date().equals("")) || pisScrollMessageModel.getEffective_date().length()<=0){
addFieldError("startdate",
"Scroll Message Effective Date is Manadatory");
return "input";
}
if(pisScrollMessageModel.getEnd_date().trim().length()>0){
//validate str& end date
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Date effstdate=sdf.parse(pisScrollMessageModel.getEffective_date());
Date effenddate=sdf.parse(pisScrollMessageModel.getEnd_date());
if(effstdate.compareTo(effenddate)>0){
addActionError("End Date should be greater than Start Date");
return INPUT;
}/*else if(effstdate.compareTo(effenddate)==0){
System.out.println("Date1 is equal to Date2");
addActionError("Effective End Date should be greater than Effective Start Date");
return INPUT;
}*/
}
}catch(Exception e){e.printStackTrace();}
PisScrollMessageDao pisscrollmessagedao = new PisScrollMessageDao();
int duplicateeditcount = 0;
if (scrollMessage != null) {
duplicateeditcount = pisscrollmessagedao.checkForDuplicateScrollMessage(
scrollMessage, id);
}
if (duplicateeditcount== 0) {
pisscrollmessagedao.saveEditedDisplayMappingDetails(requestType, id,
pisScrollMessageModel);
msg = "Scroll Message Id " + id + " Updated Succesfully";
} else {
msg = "Scroll Message already exists";
return "input";
}
return "success";
}
/**
*
* @saveScrollMessage
*/
public String saveScrollMessage() {
System.out.println("**********inside save************");
String scrollMessage = pisScrollMessageModel.getMessage().trim();
int displayunitid = pisScrollMessageModel.getScroll_display_unit().getPis_display_unit_id();
int busstandid = pisScrollMessageModel.getBusstand().getOrg_chart_id();
String fontcolor=pisScrollMessageModel.getFont_color();
String backgroundcolor=pisScrollMessageModel.getBackground_color();
if (("".equals(scrollMessage)) || (scrollMessage == null)
|| (scrollMessage.length() == 0)) {
addFieldError("message", "Scroll Message Message is Manadatory");
return "input";
}
if (("".equals(fontcolor)) || (fontcolor == null)
|| (fontcolor.length() == 0)) {
addFieldError("font_color", "Scroll Message Font Color is Manadatory");
return "input";
}
if (("".equals(backgroundcolor)) || (backgroundcolor == null)
|| (backgroundcolor.length() == 0)) {
addFieldError("background_color", "Scroll Message Background Color is Manadatory");
return "input";
}
CommonValidation cm = new CommonValidation();
/*if (!cm.isSpecialChar(scrollMessage)) {
addFieldError("message",
"Scroll Message is Should be a alphanumeric");
return "input";
}*/
if (busstandid == 0) {
addFieldError("busstandid",
"Scroll Message Bus Stand Id is Manadatory");
// msg = " Please Insert Shift Type Details Again";
return "input";
}
if (displayunitid == 0) {
addFieldError("displayunit",
"Scroll Message Display Unit is Manadatory");
// msg = " Please Insert Shift Type Details Again";
return "input";
}
String date1 = pisScrollMessageModel.getEffective_date();
String date2 = pisScrollMessageModel.getEnd_date();
try{
if(pisScrollMessageModel.getEffective_date()==null || (pisScrollMessageModel.getEffective_date().equals("")) || pisScrollMessageModel.getEffective_date().length()<=0){
addFieldError("startdate",
"Scroll Message Effective Date is Manadatory");
return "input";
}
if(pisScrollMessageModel.getEnd_date().trim().length()>0){
//validate str& end date
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Date effstdate=sdf.parse(pisScrollMessageModel.getEffective_date());
Date effenddate=sdf.parse(pisScrollMessageModel.getEnd_date());
if(effstdate.compareTo(effenddate)>0){
addActionError("End Date should be greater than Start Date");
return INPUT;
}/*else if(effstdate.compareTo(effenddate)==0){
System.out.println("Date1 is equal to Date2");
addActionError("Effective End Date should be greater than Effective Start Date");
return INPUT;
}*/
}
}catch(Exception e){e.printStackTrace();}
PisScrollMessageDao pisscrollmessagedao = new PisScrollMessageDao();
int duplicateinsertcount = 0;
if ((!"".equals(scrollMessage)) || (scrollMessage != null)
|| (scrollMessage.length() != 0))
{
duplicateinsertcount = pisscrollmessagedao.checkForDuplicateScrollMessageInsert(pisScrollMessageModel);
}
if(duplicateinsertcount==0)
{
int insertid = pisscrollmessagedao.insertPisScrollMessageModelDetails(pisScrollMessageModel);
msg = "Scroll Message Id " + insertid + " Inserted Succesfully";
}
else
{
msg = "Scroll Message already Exists";
return "input";
}
return "success";
}
/**
* @showScrollMessageList
* @return
* @throws IOException
*/
public String showScrollMessageList() throws IOException {
System.out
.println("\n \t ************Start of showScrollMessageList*****************");
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
PisScrollMessageDao pisscrolldao = new PisScrollMessageDao();
JSONObject result = new JSONObject();
response.setContentType("application/json");
response.setHeader("Cache-Control", "no-store");
PrintWriter out = response.getWriter();
try {
String[] cols = { "", "pis_id", "bus_stand_id","display_unit_id",
"message","font_color","background_color","effective_date", "end_date" };
// int cnt =
// vehiclealertconfigdao.getTotalVehicleAlertConfigDataRecords();
// int cnt = orgdao.getTotalRecordsOfWayBill();
// System.out.println("Count------>" + cnt);
int amount = 10;
int start = 0;
int col = 0;
String dir = "asc";
// sStart : 0 : sAmount : 10 : sCol : 1 : sdir : asc
String sStart = request.getParameter("iDisplayStart");
String sAmount = request.getParameter("iDisplayLength");
String sCol = request.getParameter("iSortCol_0");
String sdir = request.getParameter("sSortDir_0");
if (sStart != null) {
start = Integer.parseInt(sStart);
if (start < 0) {
start = 0;
}
}
if (sAmount != null) {
amount = Integer.parseInt(sAmount);
if (amount < 10 || amount > 50) {
amount = 10;
}
}
if (sCol != null) {
col = Integer.parseInt(sCol);
if (col < 0 || col > 5)
col = 0;
}
if (sdir != null) {
if (!sdir.equals("asc"))
dir = "desc";
}
int total = -1;
// total =
// vehiclealertconfigdao.getTotalVehicleAlertConfigDataRecords();
result = pisscrolldao.getPisScrollMessageData(total, request,
cols[Integer.parseInt(sCol)], sdir);
out.print(result);
} catch (Exception e) {
System.out
.println("\n \t Exception in prepare showScrollMessageList : "
+ e.getMessage());
e.printStackTrace();
} finally {
}
return null;
}
/**
* Find all Bus Stations
*
* @return
*/
public String findDisplayUnit() {
PisScrollMessageDao pisscrolldao = new PisScrollMessageDao();
// serviceTypeIds=rmDao.getServiceId();
List<String> l1 = pisscrolldao.getDisplayUnitId();
List<String> l2 = pisscrolldao.getDisplayUnitName();
String regionTypeAjaxString = "";
regionTypeAjaxString += "<option value=0>Select</option>";
for (int i = 0; i < l1.size(); i++) {
regionTypeAjaxString += "<option id='display_unit" + l1.get(i)
+ "' value=" + l1.get(i).toString() + ">"
+ l2.get(i).toString() + "</option>";
}
// regionTypeAjaxString += "</select>";
System.out.println("regiontypestring is..."+regionTypeAjaxString);
HttpServletResponse response = ServletActionContext.getResponse();
PrintWriter out;
try {
out = response.getWriter();
out.print(regionTypeAjaxString);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
| [
"55807233+dassurjeetkumar@users.noreply.github.com"
] | 55807233+dassurjeetkumar@users.noreply.github.com |
cb76eeeff75194b4a9a5883a2ba1f0f319b4177b | a5c151ffd6a76c4590fcfdb296f95d68a8ebf230 | /src/main/java/com/libi/test/RegisterControllerTest.java | f951a7373bbdd7b3daf6920a212ad6067c9728d4 | [] | no_license | libi1206/money-manager | 88aabcda5c41bf7e8780ac686473c558f39d8902 | 4153d38a9e2baa0af6bd788d3aeaeece68f6750a | refs/heads/master | 2022-12-23T20:05:57.291320 | 2019-03-02T13:41:37 | 2019-03-02T13:41:37 | 192,648,775 | 1 | 1 | null | 2022-12-16T09:53:54 | 2019-06-19T03:04:55 | Java | UTF-8 | Java | false | false | 1,141 | java | package com.libi.test;
import com.libi.commons.ResponseTemplate;
import com.libi.config.RootConfig;
import com.libi.config.WebConfig;
import com.libi.controller.RegisterController;
import com.libi.entity.SysUser;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
/**
* @author libi
* 测试用户注册
*/
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = {RootConfig.class,WebConfig.class})
public class RegisterControllerTest {
@Autowired
RegisterController registerController;
@Test
public void testRegister() {
SysUser user = new SysUser();
user.setUserName("libi1206");
user.setPassword("123");
ResponseTemplate responseTemplate = registerController.register(user,null);
System.out.println(responseTemplate.getData());
}
}
| [
"843298330@qq.com"
] | 843298330@qq.com |
a5824e6e25e531b586d8b50e2942466f68d0873b | 657c62bd2223973cb36605c5135ad286e35b948d | /app/src/main/java/com/contadoruno/UnoScoreHelper/Estacion/Adapters/AdaptadorAddJugador.java | 610212dd48a792b16d902361016eba3c493bc43a | [
"MIT"
] | permissive | LucasLazogue/ContadorUNO | 391cd6152153408279b3844266ff6c446ff37f92 | 63b08c1ef370d9bafa4ffc47d1b47ba2153c28aa | refs/heads/master | 2023-08-17T13:45:06.165431 | 2023-08-11T01:50:01 | 2023-08-11T01:50:01 | 372,339,512 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,317 | java | package com.contadoruno.UnoScoreHelper.Estacion.Adapters;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView;
import com.contadoruno.UnoScoreHelper.Logica.Interfaces.IJugadorController;
import com.contadoruno.UnoScoreHelper.Logica.Singleton.Factory;
import com.contadoruno.UnoScoreHelper.R;
import java.util.Arrays;
import java.util.List;
public class AdaptadorAddJugador extends RecyclerView.Adapter<AdaptadorAddJugador.ViewHolder> {
private int layout;
private List<String> jugadores;
private List<String> seleccionados;
private Context context;
public AdaptadorAddJugador(int layout, List<String> jugadores, Context mContext) {
Factory f = Factory.getInstance();
IJugadorController jc = f.getIJugadorController();
String[] jgs = jc.getJugadores();
this.jugadores = Arrays.asList(jgs);
this.layout = layout;
this.seleccionados = jugadores;
this.context = mContext;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(this.layout, parent, false);
AdaptadorAddJugador.ViewHolder vh = new ViewHolder(v);
return vh;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.bind(jugadores.get(position), position);
if (!seleccionados.contains(jugadores.get(position))) {
holder.itemView.findViewById(R.id.layoutPintar).setBackgroundResource(android.R.color.transparent);
}
else {
holder.itemView.findViewById(R.id.layoutPintar).setBackgroundResource(R.color.purple_200);
}
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RelativeLayout layoutSelec = holder.itemView.findViewById(R.id.layoutPintar);
int pos = holder.getAdapterPosition();
if (seleccionados.contains(jugadores.get(pos))) {
seleccionados.remove(jugadores.get(pos));
//layoutSelec.setBackgroundResource(android.R.color.transparent);
layoutSelec.setBackgroundResource(R.drawable.rounded_layout_seleccionar);
}
else {
seleccionados.add(jugadores.get(pos));
layoutSelec.setBackgroundResource(R.drawable.rounded_layout_seleccionar_painted);
//layoutSelec.setBackgroundResource(R.color.purple_200);
}
}
});
ImageView remove = holder.itemView.findViewById(R.id.basuritaJugador);
remove.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Factory f = Factory.getInstance();
IJugadorController jc = f.getIJugadorController();
AlertDialog.Builder builder = new AlertDialog.Builder(context);
View alertBorrar = LayoutInflater.from(context).inflate(R.layout.dialog_borrar_jugador, null);
builder.setView(alertBorrar);
final Button cancelarBorradoJugador = alertBorrar.findViewById(R.id.cancelarBorradoJugador);
final Button aceptarBorradoJugador = alertBorrar.findViewById(R.id.aceptarBorradoJugador);
AlertDialog borrarJugador = builder.create();
borrarJugador.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
borrarJugador.show();
aceptarBorradoJugador.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
seleccionados.remove(jugadores.get(position));
jc.eliminarJugador(jugadores.get(position));
updateAdapter();
borrarJugador.dismiss();
}
});
cancelarBorradoJugador.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
borrarJugador.dismiss();
}
});
}
});
}
@Override
public int getItemCount() {
return this.jugadores.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private TextView nombre;
private View view;
public ViewHolder(@NonNull View itemView) {
super(itemView);
this.nombre = itemView.findViewById(R.id.nombreAdd);
this.view = itemView.findViewById(R.id.layoutPintar);
}
public void bind(final String nombre, int position) {
this.nombre.setText(nombre);
if (!seleccionados.contains(jugadores.get(position))) {
view.setBackgroundResource(android.R.color.transparent);
}
else {
view.setBackgroundResource(R.color.purple_200);
}
}
}
public void updateAdapter() {
Factory f = Factory.getInstance();
IJugadorController jc = f.getIJugadorController();
String[] j = jc.getJugadores();
List<String> jgs = Arrays.asList(j);
this.jugadores = jgs;
notifyDataSetChanged();
}
public List<String> getSeleccionados() {
return this.seleccionados;
}
} | [
"lucas.lazogue@fing.edu.uy"
] | lucas.lazogue@fing.edu.uy |
3d70bdad0c93c810706df255b35ad2eded05332c | dd1679d375edbeb68baada47743cecfedd81c7ea | /Lab04/CarInfoSys/src/main/java/com/example/CarInfoSys/Repository/CarRepository.java | 8af86f1c4cab658d5845cd5c46db43f94dd59210 | [] | no_license | LuisValentim1/TQS_Labs | 18132b70c01dbb8ea9fdeb597e98be1c9f927806 | 8bb9cb4b20c9a1e4742ecd18b2ecd021daefd233 | refs/heads/main | 2023-04-27T12:17:03.942763 | 2021-05-11T22:30:26 | 2021-05-11T22:30:26 | 349,541,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 316 | java | package com.example.CarInfoSys.Repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.example.CarInfoSys.Entities.Car;
@Repository
public interface CarRepository extends JpaRepository<Car, Long> {
Car findByName(String name);
}
| [
"lvalentim@ua.pt"
] | lvalentim@ua.pt |
0f471334596af3a15b7a94e9851150d05e3239fa | 5ca88f726fa01d459663d1c11daf088d7b75fde6 | /src/main/java/com/iyihua/itimes/component/message/RedisMessage.java | 208b35354a381cf138f76c4a522ab31b51cb84e9 | [
"Apache-2.0"
] | permissive | YihuaWanglv/timeitem-itimes | 4079b2caf9b5984a11744e806f721ffafaeedab8 | 96c4b3087f8e3d410a6361d691b0fc9ec3e5afed | refs/heads/master | 2021-01-17T20:36:37.225710 | 2016-05-31T09:49:32 | 2016-05-31T09:49:32 | 60,076,618 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package com.iyihua.itimes.component.message;
import java.io.Serializable;
public class RedisMessage implements Serializable {
private static final long serialVersionUID = -8679950617238188971L;
int id;
String message;
Object data;
public RedisMessage(int id, String message, Object obj) {
this.id = id;
this.message = message;
this.data = obj;
}
@Override
public String toString() {
return "RedisMessage [message=" + message + ", data=" + data.toString() + ", id=" + id + "]";
}
public int getId() {
return id;
}
public String getMessage() {
return message;
}
public Object getData() {
return data;
}
} | [
"wanglvyihua@gmail.com"
] | wanglvyihua@gmail.com |
69d032c8ac77f666b7b472c0228c11b96a858212 | 605c4c1d9bca88b86385acb20da24a0ea9f3a188 | /src/treemapsimple/test/DescendingTailMapTest.java | 556fac2eabf9290c7a0aede7fc08f2fa602fdbfe | [] | no_license | detectivejd/TreeMap_Casero | 65853902eb9f9ade6b8d2ecf67da8abc168ac45a | f0f240672beab8bd45df6d1640843d8fcbfbee07 | refs/heads/master | 2020-03-22T19:11:13.801152 | 2018-11-28T02:04:16 | 2018-11-28T02:04:16 | 140,511,595 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,483 | java | package treemapsimple.test;
import treemapsimple.structs.MyTreeMap;
public class DescendingTailMapTest extends Test
{
//<editor-fold desc="relleno de datos">
private MyTreeMap<Integer,String>cargando(){
MyTreeMap<Integer,String> map = new MyTreeMap();
map.put(1, "Deborah");
map.put(2, "Tommy");
map.put(3, "Franco");
map.put(4, "Manuela");
map.put(5, "Miguel");
map.put(6, "Denisse");
return map;
}
//</editor-fold>
//<editor-fold desc="pruebas">
private void probando_cola_normal() throws Exception {
MyTreeMap<Integer,String> map = cargando();
MyTreeMap.DescendingSubMap<Integer,String> aux = (MyTreeMap.DescendingSubMap<Integer,String>) map.descendingMap().tailMap(3);
this.comprobar_que(aux.size() == 3);
this.comprobar_que(aux.firstKey() != null);
this.comprobar_que(aux.lastKey() != null);
}
private void probando_cola_nula() throws Exception {
MyTreeMap<Integer,String> map = cargando();
MyTreeMap.DescendingSubMap<Integer,String> aux = (MyTreeMap.DescendingSubMap<Integer,String>) map.descendingMap().tailMap(null);
this.comprobar_que(aux.isEmpty());
this.comprobar_que(aux.firstKey() == null);
this.comprobar_que(aux.lastKey() == null);
}
private void probando_cola_con_clave_inexistente() throws Exception {
MyTreeMap<Integer,String> map = cargando();
MyTreeMap.DescendingSubMap<Integer,String> aux = (MyTreeMap.DescendingSubMap<Integer,String>) map.descendingMap().tailMap(12);
this.comprobar_que(aux.size() == 6);
this.comprobar_que(aux.firstKey() != null);
this.comprobar_que(aux.lastKey() != null);
}
private void probando_cola_con_clave_grande() throws Exception {
MyTreeMap<Integer,String> map = cargando();
MyTreeMap.DescendingSubMap<Integer,String> aux = (MyTreeMap.DescendingSubMap<Integer,String>) map.descendingMap().tailMap(2000);
this.comprobar_que(!aux.isEmpty());
this.comprobar_que(aux.firstKey() != null);
this.comprobar_que(aux.lastKey() != null);
}
//</editor-fold>
@Override
public void test() {
try {
probando_cola_normal();
probando_cola_nula();
probando_cola_con_clave_inexistente();
probando_cola_con_clave_grande();
} catch(Exception ex){
ex.printStackTrace();
}
}
} | [
"corajejd@gmail.com"
] | corajejd@gmail.com |
f63ae7cc1ab519488a81f2de98b123a9dce4a29e | 2f32c8a1fb83c1a2ad120661fa51e07d1b421058 | /main/java/org/deri/cqels/engine/iterator/MappingIterCursorByKey.java | dbd6191369950975ba75c39074c672f3b9c98cb9 | [] | no_license | yashpalsingh8/UpCQELS | be7d95126c05d3ba317f6fa788d363d038181f58 | 86db0539008c14ec1aae0b46f7efdae50402a6bc | refs/heads/master | 2016-09-08T01:35:24.983321 | 2015-08-13T18:27:27 | 2015-08-13T18:27:27 | 40,595,689 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,507 | java | package org.deri.cqels.engine.iterator;
import java.util.ArrayList;
import org.deri.cqels.data.Mapping;
import org.deri.cqels.engine.ExecContext;
import com.hp.hpl.jena.sparql.core.Var;
import com.sleepycat.je.CursorConfig;
import com.sleepycat.je.Database;
import com.sleepycat.je.DatabaseEntry;
import com.sleepycat.je.LockMode;
import com.sleepycat.je.OperationStatus;
public class MappingIterCursorByKey extends MappingIterCursor {
DatabaseEntry key;
Mapping mapping;
ArrayList<Var> vars;
public MappingIterCursorByKey(ExecContext context,Database db,DatabaseEntry key,Mapping mapping,ArrayList<Var> vars) {
super(context, db);
curEnt = new DatabaseEntry();
this.key = key;
this.mapping = mapping;
this.vars = vars;
}
@Override
public void _readNext() {
// TODO Auto-generated method stub
DatabaseEntry _key = new DatabaseEntry();
curEnt = new DatabaseEntry();
if(cursor == null) {
cursor = db.openCursor(null, CursorConfig.READ_COMMITTED);
cursor.getSearchKey(key, curEnt, LockMode.DEFAULT);
if(!(cursor.getSearchKey(key, curEnt, LockMode.DEFAULT) == OperationStatus.SUCCESS))
curEnt = null;
}
else{
if(!(cursor.getNextDup(_key, curEnt, LockMode.DEFAULT) == OperationStatus.SUCCESS))
curEnt = null;
}
}
@Override
protected Mapping moveToNextMapping() {
Mapping _mapping = null;
if(curEnt != null) {
_mapping = org.deri.cqels.util.Utils.data2Mapping(context, curEnt, mapping, vars);
_readNext();
}
return _mapping;
}
}
| [
"yassin@50376002-6a81-4c7e-a986-a4fdbc2ec141"
] | yassin@50376002-6a81-4c7e-a986-a4fdbc2ec141 |
a34f0f970e437b1b2901b46ab17214831a39b953 | 055e79ff164404741a1ea3a387ab7240495d32b0 | /bxadmin/bxadmin-system/src/main/java/com/banxia/modules/system/service/dto/DeptDto.java | f21c833f9b3c96a17fbd4d0e4bc120641e53df2c | [
"Apache-2.0"
] | permissive | Aidenqing/banxia-admin | aca72fa8e5d9994a4fa7df0f1c05ea2bf68a5840 | 8fdb9396f89732f3980207d21a0623bb55f146b1 | refs/heads/master | 2022-12-06T21:58:33.519999 | 2020-08-31T06:11:41 | 2020-08-31T06:11:41 | 290,379,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,864 | java | /*
* Copyright 2019-2020 Qing
*
* 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 com.banxia.modules.system.service.dto;
import com.banxia.base.BaseDTO;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
/**
* @author Qing
* @date 2019-03-25
*/
@Getter
@Setter
public class DeptDto extends BaseDTO implements Serializable {
private Long id;
private String name;
private Boolean enabled;
private Integer deptSort;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<DeptDto> children;
private Long pid;
private Integer subCount;
public Boolean getHasChildren() {
return subCount > 0;
}
public Boolean getLeaf() {
return subCount <= 0;
}
public String getLabel() {
return name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DeptDto deptDto = (DeptDto) o;
return Objects.equals(id, deptDto.id) &&
Objects.equals(name, deptDto.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
} | [
"wu18227660504@gmail.com"
] | wu18227660504@gmail.com |
0c7abf56f4eb3a4822519d429f7efb0f7db7e36c | dbe7dd609ebbe2a591531cbacb41443abc0d058a | /src/main/java/AiHex/hexBoards/BoardData.java | 918355eca85a6059ebe4b8a8d3c4a62e5bfa9b53 | [] | no_license | msaqibkamran/Hex-Game-Playing-By-Alpha-Beta-Pruning | b93d630ec00973f7c3c50b4dda65985159430cbe | 1903fb41c13da3a89dbc32b3b37846754c2ce2b9 | refs/heads/master | 2023-05-17T22:20:09.396631 | 2021-06-09T09:40:10 | 2021-06-09T09:40:10 | 375,294,936 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,019 | java | package AiHex.hexBoards;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
public class BoardData {
public static final int RED_BORDER1_NODE = 0;
public static final int BLUE_BORDER1_NODE = 1;
public static final int RED_BORDER2_NODE = 2;
public static final int BLUE_BORDER2_NODE = 3;
private HexLocation[][] board;
private AdjMatrix redAdjMatrix;
private AdjMatrix blueAdjMatrix;
private int size;
public BoardData(int size) {
this.size = size;
this.board = new HexLocation[size][size];
this.redAdjMatrix = new AdjMatrix((int) Math.pow(size, 2) + 4);
this.blueAdjMatrix = new AdjMatrix((int) Math.pow(size, 2) + 4);
initBoard();
initAdjMatrix();
}
public HexLocation[][] getBoard() {
return this.board;
}
public AdjMatrix getAdjMatrix(int colour) {
AdjMatrix returnVal;
switch (colour) {
case Board.RED:
returnVal = redAdjMatrix.clone();
break;
case Board.BLUE:
returnVal = blueAdjMatrix.clone();
break;
default:
System.err.println("incorrect colour");
returnVal = null;
break;
}
return returnVal;
}
public AdjMatrix getAdjMatrix(int colour, int season) {
AdjMatrix returnVal;
switch (colour) {
case Board.RED:
returnVal = redAdjMatrix.clone();
break;
case Board.BLUE:
returnVal = blueAdjMatrix.clone();
break;
default:
System.err.println("incorrect colour");
returnVal = null;
break;
}
for (int row = 0; row < size; row++)
for (int column = 0; column < size; column++)
if (board[column][row].getValue() == Board.BLANK && board[column][row].getSeason() != season) {
int node = board[column][row].getNodeID();
returnVal.wipeNode(node);
}
return returnVal;
}
public BoardData(int size, HexLocation[][] board,
AdjMatrix redAdjMatrix, AdjMatrix blueAdjMatrix) {
this.size = size;
this.board = board;
this.redAdjMatrix = redAdjMatrix;
this.blueAdjMatrix = blueAdjMatrix;
}
public boolean checkWin(int colour) {
boolean returnVal = false;
switch (colour) {
case Board.RED:
if (redAdjMatrix.read(RED_BORDER1_NODE, RED_BORDER2_NODE) == AdjMatrix.LINK)
returnVal = true;
break;
case Board.BLUE:
if (blueAdjMatrix.read(BLUE_BORDER1_NODE, BLUE_BORDER2_NODE) == AdjMatrix.LINK)
returnVal = true;
break;
default:
System.err.println("incorrect colour");
break;
}
return returnVal;
}
@Override
public BoardData clone() {
HexLocation[][] boardClone = new HexLocation[size][size];
for (int i = 0; i < size; i++)
for (int j = 0; j < size; j++)
boardClone[i][j] = board[i][j].clone();
return new BoardData(size, boardClone, redAdjMatrix.clone(), blueAdjMatrix.clone());
}
public HexLocation get(int x, int y) {
return board[x][y];
}
private ArrayList<Integer> getAdjMatrixNeighbours(int node, int colour) {
ArrayList<Integer> neighbours = new ArrayList<Integer>();
AdjMatrix adjMatrix = null;
switch (colour) {
case Board.RED:
adjMatrix = redAdjMatrix;
break;
case Board.BLUE:
adjMatrix = blueAdjMatrix;
break;
}
for (int i = 0; i < adjMatrix.size(); i++)
if (i != node && adjMatrix.read(node, i) == AdjMatrix.LINK)
neighbours.add(i);
return neighbours;
}
public ArrayList<Integer> getBoardNeighbours(int x, int y) {
ArrayList<Point> temp = new ArrayList<Point>();
temp.add(new Point(x - 1, y));
temp.add(new Point(x + 1, y - 1));
temp.add(new Point(x, y - 1));
temp.add(new Point(x + 1, y));
temp.add(new Point(x - 1, y + 1));
temp.add(new Point(x, y + 1));
ArrayList<Integer> neighbours = new ArrayList<Integer>();
for (Point n : temp)
if (n.x > -1 && n.y > -1 && n.x < size && n.y < size) {
int nodeIndex = board[n.x][n.y].getNodeID();
neighbours.add(nodeIndex);
}
return neighbours;
}
public ArrayList<Point> getBoardNeighbours(int x, int y, int z) {
ArrayList<Point> temp = new ArrayList<Point>();
temp.add(new Point(x - 1, y));
temp.add(new Point(x + 1, y - 1));
temp.add(new Point(x, y - 1));
temp.add(new Point(x + 1, y));
temp.add(new Point(x - 1, y + 1));
temp.add(new Point(x, y + 1));
return temp;
}
public ArrayList<Integer> getPath(int start, int target, int colour) {
ArrayList<Integer> tree = new ArrayList<Integer>();
ArrayList<Integer> parentIndex = new ArrayList<Integer>();
boolean finished = false;
tree.add(start);
parentIndex.add(-1);
/*
* iterate through the tree (whilst adding to it)
*/
for (int index = 0; index < tree.size() && !finished; index++) {
int node = tree.get(index);
if (node == target)
finished = true;
else {
ArrayList<Integer> newChildren = getAdjMatrixNeighbours(
node, colour);
Collections.shuffle(newChildren);
for (int child : newChildren)
if (!tree.contains(child)) {
tree.add(child);
parentIndex.add(index);
}
}
}
ArrayList<Integer> path = new ArrayList<Integer>();
/*
* find the path;
*/
if (finished) {
int treeIndex = tree.indexOf(target);
path.add(tree.get(treeIndex));
int parent = parentIndex.get(treeIndex);
while (parent != -1) {
path.add(tree.get(parent));
parent = parentIndex.get(parent);
}
}
return path;
}
public ArrayList<Point> getWinningPath(int colour) {
ArrayList<Integer> nodePath;
ArrayList<Point> winningPath = new ArrayList<Point>();
int borderA = 0;
int borderB = 0;
switch (colour) {
case Board.RED:
borderA = RED_BORDER1_NODE;
borderB = RED_BORDER2_NODE;
break;
case Board.BLUE:
borderA = BLUE_BORDER1_NODE;
borderB = BLUE_BORDER2_NODE;
break;
}
nodePath = getPath(borderA, borderB, colour);
for (int node : nodePath) {
Point xy = getXYpos(node);
if (xy != null)
winningPath.add(xy);
}
return winningPath;
}
public ArrayList<Integer> getWinningPath(int colour, int z) {
ArrayList<Integer> nodePath;
ArrayList<Point> winningPath = new ArrayList<Point>();
int borderA = 0;
int borderB = 0;
switch (colour) {
case Board.RED:
borderA = RED_BORDER1_NODE;
borderB = RED_BORDER2_NODE;
break;
case Board.BLUE:
borderA = BLUE_BORDER1_NODE;
borderB = BLUE_BORDER2_NODE;
break;
}
nodePath = getPath(borderA, borderB, colour);
return nodePath;
}
public Point getXYpos(int node) {
if (node < 4)
return null;
else {
node = node - 4;
int y = node / size;
int x = node % size;
return new Point(x, y);
}
}
private void initAdjMatrix() {
/*
* first, we build identical neighbour relationships for the main bodies
* of both red and blue
*/
for (int row = 0; row < size; row++)
for (int column = 0; column < size; column++) {
int node = board[column][row].getNodeID();
ArrayList<Integer> neighbours = getBoardNeighbours(column, row);
for (int neighbour : neighbours) {
blueAdjMatrix.write(node, neighbour, AdjMatrix.LINK);
redAdjMatrix.write(node, neighbour, AdjMatrix.LINK);
}
}
/*
* next, we build the neighbour relationships for the individual borders
*/
for (int row = 0; row < size; row++) {
int leftSideNeighbour = board[0][row].getNodeID();
int rightSideNeighbour = board[size - 1][row].getNodeID();
blueAdjMatrix.write(BLUE_BORDER1_NODE, leftSideNeighbour,
AdjMatrix.LINK);
blueAdjMatrix.write(BLUE_BORDER2_NODE, rightSideNeighbour,
AdjMatrix.LINK);
}
for (int column = 0; column < size; column++) {
int northSideNeighbour = board[column][0].getNodeID();
int southSideNeighbour = board[column][size - 1].getNodeID();
redAdjMatrix.write(RED_BORDER1_NODE, northSideNeighbour,
AdjMatrix.LINK);
redAdjMatrix.write(RED_BORDER2_NODE, southSideNeighbour,
AdjMatrix.LINK);
}
/*
* finally, make all nodes reach themselves
*/
for (int i = 0; i < redAdjMatrix.size(); i++) {
redAdjMatrix.write(i, i, AdjMatrix.LINK);
blueAdjMatrix.write(i, i, AdjMatrix.LINK);
}
}
public void initBoard() {
Random random = new Random();
int nodeIndex = 4; // 0-3 are taken by borders
for (int row = 0; row < size; row++)
for (int column = 0; column < size; column++) {
board[column][row] = new HexLocation(nodeIndex);
nodeIndex++;
}
}
public void set(int x, int y, int value) {
int node = board[x][y].getNodeID();
board[x][y].setValue(value);
switch (value) {
case Board.RED:
redAdjMatrix.bypassAndRemoveNode(node);
blueAdjMatrix.wipeNode(node);
break;
case Board.BLUE:
redAdjMatrix.wipeNode(node);
blueAdjMatrix.bypassAndRemoveNode(node);
break;
default:
System.err.println("incorrect colour");
break;
}
}
/*
* sets a nodes value, but does not bypass it. this is useful if we want to
* keep the neighbour stucture intact.
*/
public void set_noNewLinks(int x, int y, int value) {
int node = board[x][y].getNodeID();
board[x][y].setValue(value);
switch (value) {
case Board.RED:
blueAdjMatrix.wipeNode(node);
break;
case Board.BLUE:
redAdjMatrix.wipeNode(node);
break;
default:
System.err.println("incorrect colour");
break;
}
}
}
| [
"saqibkamran007@gmail.com"
] | saqibkamran007@gmail.com |
ef409c6851a7ad77de55d19d0f1f16852db1c791 | 6500848c3661afda83a024f9792bc6e2e8e8a14e | /gp_JADX/com/google/android/finsky/accounts/impl/C0990e.java | d35683ae8924318704c9ac761d19a04617055a18 | [] | no_license | enaawy/gproject | fd71d3adb3784d12c52daf4eecd4b2cb5c81a032 | 91cb88559c60ac741d4418658d0416f26722e789 | refs/heads/master | 2021-09-03T03:49:37.813805 | 2018-01-05T09:35:06 | 2018-01-05T09:35:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,342 | java | package com.google.android.finsky.accounts.impl;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import android.text.TextUtils;
import com.google.android.finsky.aa.C0955b;
import com.google.android.finsky.aa.C0957n;
import com.google.android.finsky.accounts.C0985d;
import com.google.android.finsky.aq.C1500a;
import com.google.android.finsky.as.C1506e;
import com.google.android.finsky.utils.C4680k;
import com.google.android.finsky.utils.ba;
import com.squareup.leakcanary.C7582R;
import java.util.Locale;
class C0990e implements C0985d {
public static final Account[] f5979c = new Account[0];
public static final String f5980d = ba.m21789a("finsky.sw_account_type");
public String[] f5981e;
public final Context f5982f;
public final C1500a f5983g;
public final C1506e f5984h;
public final AccountManager f5985i;
C0990e(Context context, AccountManager accountManager, C1506e c1506e, C1500a c1500a) {
this.f5982f = context;
this.f5985i = accountManager;
this.f5984h = c1506e;
this.f5983g = c1500a;
}
public synchronized String[] mo1185c() {
if (this.f5981e == null) {
if (this.f5984h.m8839b()) {
this.f5981e = new String[]{f5980d, "cn.google", "com.google"};
} else if (this.f5984h.m8841d()) {
this.f5981e = new String[0];
} else {
Object a = C4680k.m21818a((String) C0955b.ep.m28964b());
int length = a.length;
this.f5981e = new String[(length + 1)];
this.f5981e[0] = "com.google";
System.arraycopy(a, 0, this.f5981e, 1, length);
}
}
return this.f5981e;
}
public Account[] mo1188d() {
int i;
int i2;
Account account;
int i3 = 0;
Account[] accounts = this.f5985i.getAccounts();
String[] c = mo1185c();
boolean b = this.f5984h.m8839b();
int length = accounts.length;
for (i = 0; i < accounts.length; i++) {
for (Object equals : c) {
if (accounts[i].type.equals(equals)) {
i2 = 1;
break;
}
}
i2 = 0;
if (i2 != 0) {
boolean z;
Account account2 = accounts[i];
if (!b || "cn.google".equals(account2.type) || f5980d.equals(account2.type)) {
z = true;
} else {
z = C0990e.mo1194a(account2.name);
}
if (z) {
}
}
accounts[i] = null;
length--;
}
if (length > 1) {
for (i = 0; i < accounts.length; i++) {
Account account3 = accounts[i];
if (account3 != null && account3.type.equals("com.google.work")) {
i2 = length;
for (length = 0; length < accounts.length; length++) {
if (i != length) {
account = accounts[length];
if (account != null && account3.name.equalsIgnoreCase(account.name)) {
accounts[length] = null;
i2--;
}
}
}
length = i2;
}
}
}
if (length == accounts.length) {
return accounts;
}
if (length == 0) {
return f5979c;
}
Account[] accountArr = new Account[length];
int length2 = accounts.length;
i2 = 0;
while (i2 < length2) {
account = accounts[i2];
if (account != null) {
i = i3 + 1;
accountArr[i3] = account;
} else {
i = i3;
}
i2++;
i3 = i;
}
return accountArr;
}
private static boolean mo1194a(String str) {
return str != null && str.toLowerCase(Locale.ENGLISH).endsWith("@google.com");
}
public void mo1182a(Account account, C0957n c0957n) {
if (account != null) {
if (!this.f5984h.m8839b() || "cn.google".equals(account.type) || f5980d.equals(account.type)) {
c0957n.m5763a(account.name);
}
}
}
public Account mo1189e() {
Account[] d = mo1188d();
if (d.length > 0) {
return d[0];
}
return null;
}
public Account mo1183b(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
for (Account account : mo1188d()) {
if (account.name.equalsIgnoreCase(str)) {
return account;
}
}
return null;
}
public boolean mo1184c(String str) {
return mo1183b(str) != null;
}
public boolean mo1190f() {
for (Account account : mo1188d()) {
if (account.type.equals("com.google") && C0990e.mo1194a(account.name)) {
return true;
}
}
return false;
}
public Account mo1181a(C0957n c0957n) {
Account b = mo1183b((String) c0957n.m5760a());
if (b != null) {
return b;
}
b = mo1189e();
mo1182a(b, c0957n);
return b;
}
public String mo1187d(String str) {
if (str == null) {
return null;
}
return (this.f5984h.m8839b() || this.f5983g.m8818a()) ? mo1186d(mo1183b(str)) : str;
}
public String mo1186d(Account account) {
if (account == null) {
return null;
}
if ("cn.google".equals(account.type)) {
return account.name.substring(0, account.name.indexOf("@"));
}
if (C1500a.m8816c(account)) {
return this.f5982f.getString(C7582R.string.work_account_label);
}
return account.name;
}
public String[] mo1191g() {
Account[] d = mo1188d();
String[] strArr = new String[d.length];
for (int i = 0; i < d.length; i++) {
strArr[i] = d[i].name;
}
return strArr;
}
}
| [
"genius.ron@gmail.com"
] | genius.ron@gmail.com |
95fcacc3d6f14dd35d9f7c2fa00a8bd8ccd93987 | 425ac2b3d2ba036202c1dc72c561d3a904df33ad | /support/cas-server-support-oauth-webflow/src/main/java/org/apereo/cas/support/oauth/web/flow/OAuth20WebflowConfigurer.java | 16ab49810e6a002c3a9091dd0b2a1751de069013 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | fogbeam/cas_mirror | fee69b4b1a7bf5cac87da75b209edc3cc3c1d5d6 | b7daea814f1238e95a6674663b2553555a5b2eed | refs/heads/master | 2023-01-07T08:34:26.200966 | 2021-08-12T19:14:41 | 2021-08-12T19:14:41 | 41,710,765 | 1 | 2 | Apache-2.0 | 2022-12-27T15:39:03 | 2015-09-01T01:53:24 | Java | UTF-8 | Java | false | false | 1,856 | java | package org.apereo.cas.support.oauth.web.flow;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.web.flow.CasWebflowConstants;
import org.apereo.cas.web.flow.configurer.AbstractCasWebflowConfigurer;
import lombok.val;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.webflow.definition.registry.FlowDefinitionRegistry;
import org.springframework.webflow.engine.ActionState;
import org.springframework.webflow.engine.ViewState;
import org.springframework.webflow.engine.builder.support.FlowBuilderServices;
/**
* This is {@link OAuth20WebflowConfigurer}.
*
* @author Misagh Moayyed
* @since 5.0.0
*/
public class OAuth20WebflowConfigurer extends AbstractCasWebflowConfigurer {
public OAuth20WebflowConfigurer(final FlowBuilderServices flowBuilderServices,
final FlowDefinitionRegistry loginFlowDefinitionRegistry,
final ConfigurableApplicationContext applicationContext,
final CasConfigurationProperties casProperties) {
super(flowBuilderServices, loginFlowDefinitionRegistry, applicationContext, casProperties);
}
@Override
protected void doInitialize() {
val loginFlow = getLoginFlow();
if (loginFlow != null) {
val state = getTransitionableState(loginFlow, CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM, ViewState.class);
state.getEntryActionList().add(createEvaluateAction("oauth20RegisteredServiceUIAction"));
val createTicketState = getState(loginFlow, CasWebflowConstants.STATE_ID_CREATE_TICKET_GRANTING_TICKET, ActionState.class);
createTicketState.getExitActionList().add(createEvaluateAction("oauth20SessionStoreTicketGrantingTicketAction"));
}
}
}
| [
"mm1844@gmail.com"
] | mm1844@gmail.com |
4a8b61c560d6e51326a38b04675e29e5500e0d09 | 2b08e8ffc0215294477ff73d400bffb5ea7b06c7 | /myblog/src/main/java/com/home/myblog/service/IArticleService.java | fb361ac196ef8949d4bd7c81b8c65c0a44f49f7a | [] | no_license | zldtctc/MyBlog | 152320a2157775a42519c68f05c81cb6412f76e7 | 5e268df96dea532788ad6549e4b9ba5795fdf675 | refs/heads/master | 2020-07-21T08:17:29.414199 | 2019-09-06T14:39:00 | 2019-09-06T14:39:00 | 206,794,230 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 853 | java | package com.home.myblog.service;
import java.util.List;
import com.home.myblog.entity.Article;
/**
* 关于用户发布的动态信息的业务接口
* @author Thinkpad
*
*/
public interface IArticleService {
/**
* 保存用户发布信息的业务
* @param article
*/
void saveContent(Article article,Integer userId,String username);
/**
* 查找用户发布的信息
* @param id 当前用户的id
* @return
*/
List<Article> getContentById(Integer userId);
/**
* 点赞
* @param articleId 被点赞的文章id
* @param userId 文章所属的用户id
*/
Integer clickGood(Integer articleId,Integer userId);
/**
* 根据当前用户的id,查找当前用户好友的文章
* @param uid
* @return
*/
List<Article> getFrindsArticles(Integer uid,Integer pass);
}
| [
"525001033@qq.com"
] | 525001033@qq.com |
5f0e17bee8b33c4a48c2bc9c58b3a5dcbfc9ccfe | c8fcad06858c474948ad328ec5aba284b257d468 | /org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6042_TreeStructureGridExample.java | 5538531071afe4cdbc358426571545516d57c267 | [] | no_license | binhthanhnguyen/nebula.widgets.nattable | 5af3ec8d5089f68de4227e7e5ced87936f26a77d | b05cb2eeff9bce170e344c1194131eda666e74d5 | refs/heads/master | 2020-06-14T17:18:49.583450 | 2016-11-24T22:46:03 | 2016-11-24T22:46:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 27,467 | java | /*******************************************************************************
* Copyright (c) 2013, 2014, 2015 Dirk Fauth and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dirk Fauth <dirk.fauth@googlemail.com> - initial API and implementation
* Dirk Fauth <dirk.fauth@googlemail.com> - modified example for correct unique handling of elements
*******************************************************************************/
package org.eclipse.nebula.widgets.nattable.examples._600_GlazedLists._604_Tree;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.nebula.widgets.nattable.NatTable;
import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration;
import org.eclipse.nebula.widgets.nattable.config.AbstractUiBindingConfiguration;
import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry;
import org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration;
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
import org.eclipse.nebula.widgets.nattable.data.IColumnPropertyAccessor;
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
import org.eclipse.nebula.widgets.nattable.data.IRowDataProvider;
import org.eclipse.nebula.widgets.nattable.data.ListDataProvider;
import org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor;
import org.eclipse.nebula.widgets.nattable.data.convert.DefaultDateDisplayConverter;
import org.eclipse.nebula.widgets.nattable.dataset.person.PersonService;
import org.eclipse.nebula.widgets.nattable.dataset.person.PersonWithAddress;
import org.eclipse.nebula.widgets.nattable.examples.AbstractNatExample;
import org.eclipse.nebula.widgets.nattable.examples.runner.StandaloneNatExampleRunner;
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer;
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.tree.GlazedListTreeData;
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.tree.GlazedListTreeRowModel;
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider;
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider;
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider;
import org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer;
import org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer;
import org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer;
import org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer;
import org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer;
import org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer;
import org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform;
import org.eclipse.nebula.widgets.nattable.layer.DataLayer;
import org.eclipse.nebula.widgets.nattable.layer.ILayer;
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
import org.eclipse.nebula.widgets.nattable.layer.cell.AbstractOverrider;
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
import org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter;
import org.eclipse.nebula.widgets.nattable.painter.cell.CheckBoxPainter;
import org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter;
import org.eclipse.nebula.widgets.nattable.painter.cell.decorator.PaddingDecorator;
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
import org.eclipse.nebula.widgets.nattable.tree.ITreeRowModel;
import org.eclipse.nebula.widgets.nattable.tree.TreeLayer;
import org.eclipse.nebula.widgets.nattable.tree.command.TreeCollapseAllCommand;
import org.eclipse.nebula.widgets.nattable.tree.command.TreeExpandAllCommand;
import org.eclipse.nebula.widgets.nattable.tree.command.TreeExpandToLevelCommand;
import org.eclipse.nebula.widgets.nattable.tree.config.TreeConfigAttributes;
import org.eclipse.nebula.widgets.nattable.tree.painter.IndentedTreeImagePainter;
import org.eclipse.nebula.widgets.nattable.tree.painter.TreeImagePainter;
import org.eclipse.nebula.widgets.nattable.ui.NatEventData;
import org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry;
import org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher;
import org.eclipse.nebula.widgets.nattable.ui.menu.IMenuItemProvider;
import org.eclipse.nebula.widgets.nattable.ui.menu.IMenuItemState;
import org.eclipse.nebula.widgets.nattable.ui.menu.MenuItemProviders;
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuAction;
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder;
import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum;
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import ca.odell.glazedlists.EventList;
import ca.odell.glazedlists.GlazedLists;
import ca.odell.glazedlists.SortedList;
import ca.odell.glazedlists.TransformedList;
import ca.odell.glazedlists.TreeList;
/**
* Simple example showing how to create a tree within a grid.
*/
public class _6042_TreeStructureGridExample extends AbstractNatExample {
public static final String MARRIED_LABEL = "marriedLabel";
public static final String DATE_LABEL = "dateLabel";
public static void main(String[] args) throws Exception {
StandaloneNatExampleRunner.run(new _6042_TreeStructureGridExample());
}
@Override
public String getDescription() {
return "This example shows how to create a tree within a grid."
+ " It creates a tree structure where the tree nodes are newly"
+ " added elements that contain all children. It also shows"
+ " how to create a multi level tree and how to exchange the"
+ " tree painter via configuration.";
}
@Override
public Control createExampleControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new GridLayout());
// create a new ConfigRegistry which will be needed for GlazedLists
// handling
ConfigRegistry configRegistry = new ConfigRegistry();
// property names of the Person class
String[] propertyNames = { "lastName", "firstName", "gender", "married", "birthday" };
// mapping from property to label, needed for column header labels
Map<String, String> propertyToLabelMap = new HashMap<String, String>();
propertyToLabelMap.put("lastName", "Lastname");
propertyToLabelMap.put("firstName", "Firstname");
propertyToLabelMap.put("gender", "Gender");
propertyToLabelMap.put("married", "Married");
propertyToLabelMap.put("birthday", "Birthday");
IColumnPropertyAccessor<PersonWithAddress> columnPropertyAccessor =
new ReflectiveColumnPropertyAccessor<PersonWithAddress>(propertyNames);
final BodyLayerStack bodyLayerStack =
new BodyLayerStack(
PersonService.getPersonsWithAddress(5),
columnPropertyAccessor,
new PersonWithAddressTwoLevelTreeFormat());
// new PersonWithAddressTreeFormat());
// build the column header layer
IDataProvider columnHeaderDataProvider =
new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabelMap);
DataLayer columnHeaderDataLayer =
new DefaultColumnHeaderDataLayer(columnHeaderDataProvider);
ILayer columnHeaderLayer =
new ColumnHeaderLayer(columnHeaderDataLayer, bodyLayerStack, bodyLayerStack.getSelectionLayer());
// build the row header layer
IDataProvider rowHeaderDataProvider =
new DefaultRowHeaderDataProvider(bodyLayerStack.getBodyDataProvider());
DataLayer rowHeaderDataLayer =
new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
ILayer rowHeaderLayer =
new RowHeaderLayer(rowHeaderDataLayer, bodyLayerStack, bodyLayerStack.getSelectionLayer());
// build the corner layer
IDataProvider cornerDataProvider =
new DefaultCornerDataProvider(columnHeaderDataProvider, rowHeaderDataProvider);
DataLayer cornerDataLayer =
new DataLayer(cornerDataProvider);
ILayer cornerLayer =
new CornerLayer(cornerDataLayer, rowHeaderLayer, columnHeaderLayer);
// build the grid layer
GridLayer gridLayer =
new GridLayer(bodyLayerStack, columnHeaderLayer, rowHeaderLayer, cornerLayer);
// turn the auto configuration off as we want to add our header menu
// configuration
final NatTable natTable = new NatTable(container, gridLayer, false);
// as the autoconfiguration of the NatTable is turned off, we have to
// add the DefaultNatTableStyleConfiguration and the ConfigRegistry
// manually
natTable.setConfigRegistry(configRegistry);
natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
natTable.addConfiguration(new AbstractRegistryConfiguration() {
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
// register a CheckBoxPainter as CellPainter for the married
// information
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER,
new CheckBoxPainter(),
DisplayMode.NORMAL,
MARRIED_LABEL);
configRegistry.registerConfigAttribute(
CellConfigAttributes.DISPLAY_CONVERTER,
new DefaultDateDisplayConverter("MM/dd/yyyy"),
DisplayMode.NORMAL,
DATE_LABEL);
// exchange the painter that is used to render the tree
// structure the following will use triangles instead of
// plus/minus icons to show the tree structure and
// expand/collapse state and adds padding between cell
// border and tree icons.
TreeImagePainter treeImagePainter =
new TreeImagePainter(
false,
GUIHelper.getImage("right"), //$NON-NLS-1$
GUIHelper.getImage("right_down"), null); //$NON-NLS-1$
ICellPainter treeStructurePainter =
new BackgroundPainter(
new PaddingDecorator(
new IndentedTreeImagePainter(10,
null, CellEdgeEnum.LEFT, treeImagePainter,
false, 2, true),
0, 5, 0, 5, false));
configRegistry.registerConfigAttribute(
TreeConfigAttributes.TREE_STRUCTURE_PAINTER,
treeStructurePainter,
DisplayMode.NORMAL);
}
});
natTable.addConfiguration(new TreeDebugMenuConfiguration(natTable));
natTable.configure();
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
Composite buttonPanel = new Composite(container, SWT.NONE);
buttonPanel.setLayout(new RowLayout());
GridDataFactory.fillDefaults().grab(true, false).applyTo(buttonPanel);
Button collapseAllButton = new Button(buttonPanel, SWT.PUSH);
collapseAllButton.setText("Collapse All");
collapseAllButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
natTable.doCommand(new TreeCollapseAllCommand());
}
});
Button expandAllButton = new Button(buttonPanel, SWT.PUSH);
expandAllButton.setText("Expand All");
expandAllButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
natTable.doCommand(new TreeExpandAllCommand());
}
});
Button expandToLevelButton = new Button(buttonPanel, SWT.PUSH);
expandToLevelButton.setText("Expand To Level");
expandToLevelButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
natTable.doCommand(new TreeExpandToLevelCommand(1));
}
});
return container;
}
/**
* Always encapsulate the body layer stack in an AbstractLayerTransform to
* ensure that the index transformations are performed in later commands.
*
* @param <PersonWithAddress>
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
class BodyLayerStack extends AbstractLayerTransform {
private final TreeList treeList;
private final IRowDataProvider bodyDataProvider;
private final SelectionLayer selectionLayer;
public BodyLayerStack(
List<PersonWithAddress> values,
IColumnPropertyAccessor<PersonWithAddress> columnPropertyAccessor,
TreeList.Format treeFormat) {
// wrapping of the list to show into GlazedLists
// see http://publicobject.com/glazedlists/ for further information
EventList<PersonWithAddress> eventList = GlazedLists.eventList(values);
TransformedList<PersonWithAddress, PersonWithAddress> rowObjectsGlazedList =
GlazedLists.threadSafeList(eventList);
// use the SortedList constructor with 'null' for the Comparator
// because the Comparator
// will be set by configuration
SortedList<PersonWithAddress> sortedList =
new SortedList<PersonWithAddress>(rowObjectsGlazedList, null);
// wrap the SortedList with the TreeList
this.treeList =
new TreeList(sortedList, treeFormat, TreeList.nodesStartExpanded());
this.bodyDataProvider =
new ListDataProvider<Object>(
this.treeList, new PersonWithAddressTreeColumnPropertyAccessor(columnPropertyAccessor));
DataLayer bodyDataLayer = new DataLayer(this.bodyDataProvider);
// simply apply labels for every column by index
bodyDataLayer.setConfigLabelAccumulator(new AbstractOverrider() {
@Override
public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) {
Object rowObject = BodyLayerStack.this.bodyDataProvider.getRowObject(rowPosition);
if (rowObject instanceof PersonWithAddress) {
if (columnPosition == 3) {
configLabels.addLabel(MARRIED_LABEL);
} else if (columnPosition == 4) {
configLabels.addLabel(DATE_LABEL);
}
}
}
});
// layer for event handling of GlazedLists and PropertyChanges
GlazedListsEventLayer<PersonWithAddress> glazedListsEventLayer =
new GlazedListsEventLayer<PersonWithAddress>(bodyDataLayer, this.treeList);
GlazedListTreeData<Object> treeData = new GlazedListTreeData<Object>(this.treeList);
ITreeRowModel<Object> treeRowModel = new GlazedListTreeRowModel<Object>(treeData);
// ITreeRowModel<Object> treeRowModel = new
// TreeRowModel<Object>(treeData);
this.selectionLayer = new SelectionLayer(glazedListsEventLayer);
TreeLayer treeLayer = new TreeLayer(this.selectionLayer, treeRowModel);
ViewportLayer viewportLayer = new ViewportLayer(treeLayer);
setUnderlyingLayer(viewportLayer);
}
public SelectionLayer getSelectionLayer() {
return this.selectionLayer;
}
public TreeList<PersonWithAddress> getTreeList() {
return this.treeList;
}
public IDataProvider getBodyDataProvider() {
return this.bodyDataProvider;
}
}
private class PersonWithAddressTreeColumnPropertyAccessor implements IColumnPropertyAccessor<Object> {
private IColumnPropertyAccessor<PersonWithAddress> cpa;
public PersonWithAddressTreeColumnPropertyAccessor(IColumnPropertyAccessor<PersonWithAddress> cpa) {
this.cpa = cpa;
}
@Override
public Object getDataValue(Object rowObject, int columnIndex) {
if (rowObject instanceof PersonWithAddress) {
return this.cpa.getDataValue((PersonWithAddress) rowObject, columnIndex);
} else if (columnIndex == 0) {
return rowObject;
}
return null;
}
@Override
public void setDataValue(Object rowObject, int columnIndex, Object newValue) {
if (rowObject instanceof PersonWithAddress) {
this.cpa.setDataValue((PersonWithAddress) rowObject,
columnIndex, newValue);
}
}
@Override
public int getColumnCount() {
return this.cpa.getColumnCount();
}
@Override
public String getColumnProperty(int columnIndex) {
return this.cpa.getColumnProperty(columnIndex);
}
@Override
public int getColumnIndex(String propertyName) {
return this.cpa.getColumnIndex(propertyName);
}
}
@SuppressWarnings("unused")
private class PersonWithAddressTreeFormat implements TreeList.Format<Object> {
@Override
public void getPath(List<Object> path, Object element) {
if (element instanceof PersonWithAddress) {
PersonWithAddress ele = (PersonWithAddress) element;
path.add(new LastNameGroup(ele.getId(), ele.getLastName()));
}
path.add(element);
}
@Override
public boolean allowsChildren(Object element) {
return true;
}
@Override
public Comparator<? super Object> getComparator(int depth) {
return new Comparator<Object>() {
@Override
public int compare(Object o1, Object o2) {
String e1 = (o1 instanceof PersonWithAddress) ? ((PersonWithAddress) o1).getLastName() : o1.toString();
String e2 = (o2 instanceof PersonWithAddress) ? ((PersonWithAddress) o2).getLastName() : o2.toString();
return e1.compareTo(e2);
}
};
}
}
private class PersonWithAddressTwoLevelTreeFormat implements TreeList.Format<Object> {
AtomicInteger counter = new AtomicInteger();
Map<String, LastNameGroup> lastNames = new HashMap<String, LastNameGroup>();
Map<String, FirstNameGroup> firstNames = new HashMap<String, FirstNameGroup>();
@Override
public void getPath(List<Object> path, Object element) {
if (element instanceof PersonWithAddress) {
PersonWithAddress ele = (PersonWithAddress) element;
if (!this.lastNames.containsKey(ele.getLastName())) {
this.lastNames.put(ele.getLastName(), new LastNameGroup(this.counter.incrementAndGet(), ele.getLastName()));
}
path.add(this.lastNames.get(ele.getLastName()));
String firstNameKey = ele.getLastName() + "_" + ele.getFirstName();
if (!this.firstNames.containsKey(firstNameKey)) {
this.firstNames.put(firstNameKey, new FirstNameGroup(ele.getLastName(), ele.getFirstName()));
}
path.add(this.firstNames.get(firstNameKey));
}
path.add(element);
}
@Override
public boolean allowsChildren(Object element) {
return true;
}
@Override
public Comparator<? super Object> getComparator(final int depth) {
return new Comparator<Object>() {
@Override
public int compare(Object o1, Object o2) {
String e1 = (o1 instanceof PersonWithAddress)
? (depth == 0 ? ((PersonWithAddress) o1).getLastName() : ((PersonWithAddress) o1).getFirstName()) : o1.toString();
String e2 = (o2 instanceof PersonWithAddress)
? (depth == 0 ? ((PersonWithAddress) o2).getLastName() : ((PersonWithAddress) o2).getFirstName()) : o2.toString();
return e1.compareTo(e2);
}
};
}
}
// To make expand/collapse work correctly with the TreeRowModel, the
// elements in the TreeList needs to be identifiable. This is necessary so
// List#indexOf() returns the correct positions
class LastNameGroup implements Comparable<LastNameGroup> {
int id;
String lastName;
public LastNameGroup(int id, String lastName) {
this.id = id;
this.lastName = lastName;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + this.id;
result = prime * result + ((this.lastName == null) ? 0 : this.lastName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LastNameGroup other = (LastNameGroup) obj;
if (this.id != other.id)
return false;
if (this.lastName == null) {
if (other.lastName != null)
return false;
} else if (!this.lastName.equals(other.lastName))
return false;
return true;
}
@Override
public String toString() {
return this.lastName;
}
@Override
public int compareTo(LastNameGroup o) {
return this.lastName.compareTo(o.lastName);
}
}
// firstname group is unique within a lastname group
class FirstNameGroup implements Comparable<FirstNameGroup> {
String lastName;
String firstName;
public FirstNameGroup(String lastName, String firstName) {
this.lastName = lastName;
this.firstName = firstName;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.firstName == null) ? 0 : this.firstName.hashCode());
result = prime * result + ((this.lastName == null) ? 0 : this.lastName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FirstNameGroup other = (FirstNameGroup) obj;
if (this.firstName == null) {
if (other.firstName != null)
return false;
} else if (!this.firstName.equals(other.firstName))
return false;
if (this.lastName == null) {
if (other.lastName != null)
return false;
} else if (!this.lastName.equals(other.lastName))
return false;
return true;
}
@Override
public String toString() {
return this.firstName;
}
@Override
public int compareTo(FirstNameGroup o) {
return this.firstName.compareTo(o.firstName);
}
}
class TreeDebugMenuConfiguration extends AbstractUiBindingConfiguration {
private final Menu menu;
public TreeDebugMenuConfiguration(final NatTable natTable) {
this.menu = new PopupMenuBuilder(natTable)
.withMenuItemProvider("expandToLevel", new IMenuItemProvider() {
@Override
public void addMenuItem(final NatTable natTable, Menu popupMenu) {
MenuItem menuItem = new MenuItem(popupMenu, SWT.PUSH);
menuItem.setText("Expand 1 level");
menuItem.setEnabled(true);
menuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
NatEventData eventData = MenuItemProviders.getNatEventData(event);
int rowIndex = natTable.getRowIndexByPosition(eventData.getRowPosition());
natTable.doCommand(new TreeExpandToLevelCommand(rowIndex, 1));
}
});
}
})
.withVisibleState("expandToLevel", new IMenuItemState() {
@Override
public boolean isActive(NatEventData natEventData) {
ILayerCell cell = natTable.getCellByPosition(
natEventData.getColumnPosition(), natEventData.getRowPosition());
return cell.getConfigLabels().hasLabel(TreeLayer.TREE_COLUMN_CELL);
}
})
.withInspectLabelsMenuItem()
.build();
}
@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
uiBindingRegistry.registerMouseDownBinding(
new MouseEventMatcher(SWT.NONE, null, 3),
new PopupMenuAction(this.menu));
}
}
}
| [
"dirk.fauth@googlemail.com"
] | dirk.fauth@googlemail.com |
c3285bd333d2d22ff01fce67b03a44c05554ff6c | e04c795a40335c09ced8612b0b639e45e5865777 | /KambanPPMTool/src/main/java/io/agilesalves/ppmtool/web/UserController.java | 7df5abf6f0e04b5294bc9d31df7aa4344bcb127c | [] | no_license | salvescoding/agile-tool | 7a7cf16dd02477975b0a05565a33c3354a508e50 | 8e49209fc1ddb40cdbd07662f7c59c4b9f963067 | refs/heads/master | 2020-04-10T07:28:47.467396 | 2018-12-30T17:57:35 | 2018-12-30T17:57:35 | 160,492,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69 | java | package io.agilesalves.ppmtool.web;
public class UserController {
}
| [
"salves2383@gmail.com"
] | salves2383@gmail.com |
d9ce2212331b602912fce1295834cd0c67e09582 | 32f42c4ad215f76837bc232e999d7ac32792bcea | /Aug/16thAug/S4.java | 36e3e8caa7741cd03b2b93b6a2975ed966f1fe9b | [] | no_license | rajesh4java/ht | 2315c05f95dd7a4be92530f5267a1ef33ec0cff9 | 6a49d4672ebd14ce9e3fbc369a8c85cfcd5e8905 | refs/heads/master | 2021-01-01T19:25:05.756495 | 2014-09-21T04:01:54 | 2014-09-21T04:01:54 | 24,281,466 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 271 | java | class A
{
private int n;
public int getN()
{
return n;
}
public void setN(int n)
{
n=n;
}
}
class S4
{
public static void main(String args[])
{
System.out.println("Vishnu");
A a1=new A();
System.out.println(a1.getN());
int k=a1.getN();
System.out.println(a1.getN());
}
}
| [
"vinideas@gmail.com"
] | vinideas@gmail.com |
32542a0b81f9be7ea0fb5f7d447e98d3596aa8cc | a83f21db529aea9e25576a05050a875e367d9d4d | /src/main/java/com/rp/sec09/Lec01Buffer.java | 18a9465e66582869fd870f5500318212e50132eb | [] | no_license | hienhoangminh/reactor-java-playground | 11ec28d05bcb860a99fc736b06bdf6f0593e4f39 | ad387c493e125ece8ca3db35cf1b83b7808cd436 | refs/heads/main | 2023-06-04T16:44:36.449906 | 2021-06-26T14:52:39 | 2021-06-26T14:52:39 | 380,522,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 583 | java | package com.rp.sec09;
import com.rp.courseUtill.Util;
import reactor.core.publisher.Flux;
import java.time.Duration;
public class Lec01Buffer {
public static void main(String[] args) {
eventStream()
// .buffer(5)
// .buffer(Duration.ofSeconds(2))
.bufferTimeout(5, Duration.ofSeconds(2))
.subscribe(Util.subscriber());
Util.sleepSeconds(60);
}
private static Flux<String> eventStream(){
return Flux.interval(Duration.ofMillis(800))
.map(i -> "event " + i);
}
}
| [
"hienhoangminh290788@gmail.com"
] | hienhoangminh290788@gmail.com |
2a068fd709a24591f2296dbfef4a9c793fcff576 | c206e1aa416e0b6ca1e6b08a5a67dcf8cb031cc1 | /src/main/java/com/hl/listener/MyHttpSessionListener.java | 2f4c55806ec2565eec4c7b09ed27dadaa32fa8e5 | [] | no_license | huangleisir/springboot | 1731e188a13a57a02a54d670ad1a400dad2e7569 | cc47fc3e79235c84d5962478ccb5dc56e5c71d08 | refs/heads/master | 2021-06-14T17:51:57.001722 | 2019-11-16T10:50:45 | 2019-11-16T10:50:45 | 97,099,605 | 0 | 0 | null | 2017-07-17T07:35:57 | 2017-07-13T08:35:35 | Java | UTF-8 | Java | false | false | 618 | java | package com.hl.listener;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
/**
* 监听Session的创建与销毁
*
*/
@WebListener
public class MyHttpSessionListener implements HttpSessionListener {
@Override
public void sessionCreated(HttpSessionEvent se) {
System.out.println("Session 被创建");
}
@Override
public void sessionDestroyed(HttpSessionEvent se) {
System.out.println("ServletContex初始化");
}
} | [
"huangleisir@qq.com"
] | huangleisir@qq.com |
b46ef556a5d3a53dbcb934efc7cdc193db010d7d | f656b7c50a53f29410bd3bc066e34eca5931f019 | /src/main/java/org/rauschig/wicketjs/JsCall.java | 349d99fe6e04f523ccd5e70437875c8754ff6f59 | [] | no_license | thrau/wicket-js | 049bb720ae4994f94f6c6f3dfd5c5ce4da262505 | c6b7582f324b183aebde40885c37135f21ef06fe | refs/heads/master | 2016-09-05T13:56:56.788331 | 2015-03-30T15:21:33 | 2015-03-30T15:21:33 | 16,632,747 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,645 | java | /**
* Copyright 2014 Thomas Rausch
*
* 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 org.rauschig.wicketjs;
import java.util.ArrayList;
import java.util.List;
import org.rauschig.wicketjs.util.JsUtils;
/**
* Represents a member function call.
*
* <pre>
* new JsCall("console.log", "logging", 42, "this", JsExpression.THIS, new JsFunction(...));
* </pre>
*
* would compile to
*
* <pre>
* console.log('logging', 42, 'this', this, function(...){...});
* </pre>
*/
public class JsCall extends AbstractJsExpression {
private static final long serialVersionUID = -1541822119879211306L;
private IJsExpression function;
private List<IJsExpression> arguments;
/**
* Creates a new JsCall, calling the given functionName with the given arguments. Each argument is converted into a
* JS syntax token.
*
* @param functionName the function to call
* @param arguments the arguments of the call
* @see org.rauschig.wicketjs.util.JsUtils#asArgumentList(Object...)
*/
public JsCall(CharSequence functionName, Object... arguments) {
this(functionName, JsUtils.asArgumentList(arguments));
}
public JsCall(CharSequence function) {
this(new JsIdentifier(function));
}
public JsCall(CharSequence function, List<IJsExpression> arguments) {
this(new JsIdentifier(function), arguments);
}
public JsCall(IJsExpression function) {
this(function, new ArrayList<IJsExpression>());
}
public JsCall(IJsExpression function, List<IJsExpression> arguments) {
this.function = function;
this.arguments = arguments;
}
public IJsExpression getFunction() {
return function;
}
public List<IJsExpression> getArguments() {
return arguments;
}
/**
* Alias for {@link #addArgument(Object)}.
*
* @param argument the argument to add
* @return this for chaining
* @see #addArgument(Object)
*/
public JsCall arg(Object argument) {
return addArgument(argument);
}
/**
* Alias for {@link #addArgument(IJsExpression)}.
*
* @param argument the argument to add
* @return this for chaining
* @see #addArgument(IJsExpression)
*/
public JsCall arg(IJsExpression argument) {
return addArgument(argument);
}
/**
* Converts the given Object into a JS syntax token and adds it as argument to the call.
*
* @param argument the argument to add
* @return this for chaining
* @see org.rauschig.wicketjs.util.JsUtils#asArgument(Object)
*/
public JsCall addArgument(Object argument) {
return addArgument(JsUtils.asArgument(argument));
}
/**
* Adds the given argument to the call.
*
* @param argument the argument to add
* @return this for chaining
*/
public JsCall addArgument(IJsExpression argument) {
arguments.add(argument);
return this;
}
@Override
public void accept(IJsExpressionVisitor visitor) {
visitor.visit(this);
}
}
| [
"thomas@rauschig.org"
] | thomas@rauschig.org |
44db5d8b8ea1b5308263ca2aa40fee988dd4104a | 6e8819e9799b8f44b6785019f5e27f20a4cd35ed | /app/src/main/java/com/merjanapp/merjan/model/DetailActivityModel.java | 365d72f59ca22c0605d1a88d52dd9f61ef85ce8b | [] | no_license | Hazemhabeb/morganApp | 430c82ccd5418ab1e3514b706be62392a72bac25 | 76f5f9fda4cfff0405fc113501e9fb63bebd13ab | refs/heads/master | 2020-09-28T06:08:26.859435 | 2019-12-08T17:47:34 | 2019-12-08T17:47:34 | 226,707,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,638 | java | package com.merjanapp.merjan.model;
import java.util.ArrayList;
public class DetailActivityModel {
private int id=0;
private String name="";
private String price="";
private String city="";
private String country="";
private ArrayList<String> images = new ArrayList<>();
private ArrayList<String> services = new ArrayList<>();
private ArrayList<DetailInfoModel> info = new ArrayList<>();
public DetailActivityModel() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public ArrayList<String> getImages() {
return images;
}
public void setImages(ArrayList<String> images) {
this.images = images;
}
public ArrayList<String> getServices() {
return services;
}
public void setServices(ArrayList<String> services) {
this.services = services;
}
public ArrayList<DetailInfoModel> getInfo() {
return info;
}
public void setInfo(ArrayList<DetailInfoModel> info) {
this.info = info;
}
}
| [
"hazemhabeb94@gmail.com"
] | hazemhabeb94@gmail.com |
d2eb854005c7e70f1be2134aa3c785b157809c5d | 70b2994b106a9ffe461112fdd8772232ab7bed28 | /src/syntaxtree/MethodDeclaration.java | 4752c77e052c4ec18382e6a6673a6e03d9646bd4 | [] | no_license | GregorySam/MiniJavaIR | e48de7ce77c611f904840e5e6ac3027aff7f126a | 0f8ace0d7a23a6c0ff8979a671fb9486d9f37106 | refs/heads/master | 2020-05-23T18:32:02.524836 | 2019-05-22T22:06:22 | 2019-05-22T22:06:22 | 186,890,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,066 | java | //
// Generated by JTB 1.3.2 DIT@UoA patched
//
package syntaxtree;
/**
* Grammar production:
* f0 -> "public"
* f1 -> Type()
* f2 -> Identifier()
* f3 -> "("
* f4 -> ( FormalParameterList() )?
* f5 -> ")"
* f6 -> "{"
* f7 -> ( VarDeclaration() )*
* f8 -> ( Statement() )*
* f9 -> "return"
* f10 -> Expression()
* f11 -> ";"
* f12 -> "}"
*/
public class MethodDeclaration implements Node {
public NodeToken f0;
public Type f1;
public Identifier f2;
public NodeToken f3;
public NodeOptional f4;
public NodeToken f5;
public NodeToken f6;
public NodeListOptional f7;
public NodeListOptional f8;
public NodeToken f9;
public Expression f10;
public NodeToken f11;
public NodeToken f12;
public MethodDeclaration(NodeToken n0, Type n1, Identifier n2, NodeToken n3, NodeOptional n4, NodeToken n5, NodeToken n6, NodeListOptional n7, NodeListOptional n8, NodeToken n9, Expression n10, NodeToken n11, NodeToken n12) {
f0 = n0;
f1 = n1;
f2 = n2;
f3 = n3;
f4 = n4;
f5 = n5;
f6 = n6;
f7 = n7;
f8 = n8;
f9 = n9;
f10 = n10;
f11 = n11;
f12 = n12;
}
public MethodDeclaration(Type n0, Identifier n1, NodeOptional n2, NodeListOptional n3, NodeListOptional n4, Expression n5) {
f0 = new NodeToken("public");
f1 = n0;
f2 = n1;
f3 = new NodeToken("(");
f4 = n2;
f5 = new NodeToken(")");
f6 = new NodeToken("{");
f7 = n3;
f8 = n4;
f9 = new NodeToken("return");
f10 = n5;
f11 = new NodeToken(";");
f12 = new NodeToken("}");
}
public void accept(visitor.Visitor v) {
v.visit(this);
}
public <R,A> R accept(visitor.GJVisitor<R,A> v, A argu) {
return v.visit(this,argu);
}
public <R> R accept(visitor.GJNoArguVisitor<R> v) {
return v.visit(this);
}
public <A> void accept(visitor.GJVoidVisitor<A> v, A argu) {
v.visit(this,argu);
}
}
| [
"gregoryman@windowslive.com"
] | gregoryman@windowslive.com |
b12692dde180dc12052ababc8f8ff9c86cb3917e | aed7e4e162207a39905b503752bec8336953ba39 | /src/test/java/com/netflix/governator/autobind/CustomAutoBind.java | f8e980d664701cc0644d34c92f7d6b56c7cbdd91 | [
"Apache-2.0"
] | permissive | jaxlaw/governator | 2edd78dcb70411805b5e3fbf7cb65b253d8ddae7 | eab5f7a14765d5722a94414bf9d8e7406d19c39e | refs/heads/master | 2021-01-16T18:15:14.652610 | 2012-12-05T21:17:29 | 2012-12-05T21:17:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 553 | java | package com.netflix.governator.autobind;
import com.google.inject.BindingAnnotation;
import com.netflix.governator.annotations.AutoBind;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.ANNOTATION_TYPE, ElementType.PARAMETER})
@BindingAnnotation
@AutoBind
public @interface CustomAutoBind
{
String str();
int value();
}
| [
"jordan@jordanzimmerman.com"
] | jordan@jordanzimmerman.com |
e15e39ed5e71a9336101f2e79f1d28f695382b21 | 95e944448000c08dd3d6915abb468767c9f29d3c | /sources/com/google/android/gms/internal/p763e/C16371d.java | fcfed2f00e403f900d47af8a9b67f768bdd1c72d | [] | no_license | xrealm/tiktok-src | 261b1faaf7b39d64bb7cb4106dc1a35963bd6868 | 90f305b5f981d39cfb313d75ab231326c9fca597 | refs/heads/master | 2022-11-12T06:43:07.401661 | 2020-07-04T20:21:12 | 2020-07-04T20:21:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 790 | java | package com.google.android.gms.internal.p763e;
import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException;
import com.google.android.gms.maps.model.Tile;
/* renamed from: com.google.android.gms.internal.e.d */
public final class C16371d extends C16368a implements C16369b {
C16371d(IBinder iBinder) {
super(iBinder, "com.google.android.gms.maps.model.internal.ITileProviderDelegate");
}
/* renamed from: a */
public final Tile mo42461a(int i, int i2, int i3) throws RemoteException {
Parcel a = mo42457a();
a.writeInt(i);
a.writeInt(i2);
a.writeInt(i3);
Parcel a2 = mo42458a(1, a);
Tile tile = (Tile) C16373f.m53341a(a2, Tile.CREATOR);
a2.recycle();
return tile;
}
}
| [
"65450641+Xyzdesk@users.noreply.github.com"
] | 65450641+Xyzdesk@users.noreply.github.com |
5e721ff059319985d8f6416753dd0788d2fdd9c0 | 05b7699df65ce719dc94fbfa03852aeafc6f1334 | /java/com/juyo/us/T_omega_itter/WebViewActivity.java | 0a9336c7126bac66788763033470b39361e4ca45 | [] | no_license | juyoung101/CyanAndroidTwitter | 907ab26f7a7d44c3cff9d1631bc12952a95f5ca4 | 8f0bef2bec7d6f7ee571a17f54ec05d1998f70f6 | refs/heads/master | 2021-01-19T01:42:56.513590 | 2016-07-27T21:04:22 | 2016-07-27T21:04:22 | 64,327,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,906 | java | package com.juyo.us.T_omega_itter;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.webkit.CookieSyncManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;
public class WebViewActivity extends Activity {
protected WebViewActivity thisAct;
protected WebView webView;
public static String EXTRA_URL = "extra_url";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);
thisAct = this;
CookieSyncManager.createInstance(this);
setTitle("Login");
ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setBackgroundDrawable(new ColorDrawable(Color.BLACK));
ColorDrawable cd = new ColorDrawable(getResources().getColor(android.R.color.transparent));
cd.setBounds(0,0,0,0);
actionBar.setIcon(cd);
int actionBarTitleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
if (actionBarTitleId > 0) {
TextView title = (TextView) findViewById(actionBarTitleId);
if (title != null) {
title.setTextColor(Color.parseColor("#00CCDD"));
}
}
final String url = this.getIntent().getStringExtra(EXTRA_URL);
if (url == null) {
Log.e("Twitter", "URL cannot be null");
finish();
}
webView = null;
webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new MyWebViewClient());
this.clearThisWebViewsCache();
//TODO indev commented out for faster login
// CookieManager cookieManager = CookieManager.getInstance();
// cookieManager.removeAllCookie();
webView.loadUrl(url);
}
protected void clearThisWebViewsCache() {
this.webView.clearCache(true);
this.webView.clearHistory();
this.webView.clearFormData();
this.webView.clearCache(false);
}
class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains(getResources().getString(R.string.twitter_callback))) {
Uri uri = Uri.parse(url);
/* Sending results back */
String verifier = uri.getQueryParameter(getString(R.string.twitter_oauth_verifier));
Intent resultIntent = new Intent();
resultIntent.putExtra(getString(R.string.twitter_oauth_verifier), verifier);
setResult(RESULT_OK, resultIntent);
/* closing webview */
thisAct.clearThisWebViewsCache();//remove webview cache so users can logout. Also security.
finish();
return true;
}
return false;
}
}
} | [
"juyoung101@msn.com"
] | juyoung101@msn.com |
9ca94856389b5b3db177a488a1cd16989fd88e95 | dfb0965395e8a083b33aea170921181eacc25326 | /src/main/java/com/hexlindia/drool/discussion/services/api/rest/DiscussionTopicRestService.java | eb7496129b866a13d68fa2fa181a30dc9b2dae2b | [] | no_license | AbhayChandel/drool-java-server | 75745e1cc553b6120233d2d935a8e302be486fb8 | 2c66732b474219d590415e61bd6f15fbeac4c8ab | refs/heads/develop-0.1.0 | 2020-09-15T22:00:50.806980 | 2020-06-11T08:18:33 | 2020-06-11T08:18:33 | 223,564,068 | 0 | 0 | null | 2020-06-11T08:18:34 | 2019-11-23T09:31:46 | Java | UTF-8 | Java | false | false | 1,318 | java | package com.hexlindia.drool.discussion.services.api.rest;
import com.hexlindia.drool.discussion.dto.DiscussionTopicDto;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/${rest.uri.version}/discussion")
public interface DiscussionTopicRestService {
@PostMapping(value = "/post")
ResponseEntity<DiscussionTopicDto> post(@RequestBody DiscussionTopicDto discussionTopicDto);
@PutMapping(value = "/update")
ResponseEntity<Boolean> updateTitle(@RequestBody DiscussionTopicDto discussionTopicDto);
@PutMapping(value = "/views/increment")
ResponseEntity<String> incrementViews(@RequestBody String id);
@PutMapping(value = "/likes/increment")
ResponseEntity<String> incrementLikes(@RequestBody DiscussionTopicDto discussionTopicDto);
@PutMapping(value = "/likes/decrement")
ResponseEntity<String> decrementLikes(@RequestBody DiscussionTopicDto discussionTopicDto);
@PutMapping(value = "/changeownership")
ResponseEntity<DiscussionTopicDto> changeOwnership(@RequestBody DiscussionTopicDto discussionTopicDto);
}
| [
"abhay1072@gmail.com"
] | abhay1072@gmail.com |
3915de3adbc42a6ca820ad5cac6d01ac2bbdef45 | da8eb07b40b460046104b5949f77b8552a183361 | /questcraft/src/main/java/llantwit/questcraft/server/QuestServerProcessor.java | 8e2ff8feca5f4578deb5f14d757e94b8da57a62a | [] | no_license | whelks-chance/test | 392e60aae5cb2b8e3e59a05a250ea33dc67f4a3d | 19d6078010629b67b9f5fd6774c4131e5f7abb53 | refs/heads/master | 2021-01-01T17:09:24.768250 | 2012-02-27T15:31:21 | 2012-02-27T15:31:21 | 3,561,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,622 | java | package llantwit.questcraft.server;
import llantwit.questcraft.gameObjects.User;
import llantwit.questcraft.gameObjects.visualObjects.Monster;
import llantwit.questcraft.gameObjects.visualObjects.PointlessSquare;
import llantwit.questcraft.maps.Maps;
import llantwit.simpleServer.xmlserver.ServerProcessor;
import llantwit.utils.drawing.VisualObject;
import llantwit.utils.xml.DomPain;
import llantwit.utils.xml.SimpleXML;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
/**
* Created by IntelliJ IDEA.
* User: Ian Harvey
* Date: 20/12/2011
* Time: 18:34
* To change this template use File | Settings | File Templates.
*/
public class QuestServerProcessor implements ServerProcessor {
public static final String COMMENT = "A simple comment";
public static final String ROOT = "questCraft";
public static final String RECEIVED = "Received";
public static final String MAP = "map";
public static final String MAPDATA = "mapData";
public static final String MAPSIZE = "mapSize";
public static final String USER_DATA = "userData";
public static final String KNOWN_USERS = "knownUsers";
public static final String USER_ID = "userID";
public static final String USER_X_LOCATION = "userX";
public static final String USER_Y_LOCATION = "userY";
public static final String VISUALS = "visuals";
public static final String VISUAL_HEIGHT = "visualHeight";
public static final String VISUAL_WIDTH = "visualWidth";
public static final String DISCONNECTED_USERS = "disconnectedUsers";
public static final String REPLY_TO = "replyTo";
public static final String CARRYING = "carrying";
public static final String BROKEN_BLOCKS = "brokenBlocks";
private HashMap<String, User> userHashMap = new HashMap<String, User>();
// private ArrayList<String> userUUIDs = new ArrayList<String>();
private ArrayList<String> disconnectedUsers = new ArrayList<String>();
private ArrayList<Monster> monsters = new ArrayList<Monster>();
int mapWidth = 15;
int mapHeight = 10;
private char [] map;
public QuestServerProcessor(){
map = Maps.createMap(mapWidth, mapHeight);
new GameThread(500).start();
monsters.add(new Monster(5, 5));
monsters.add(new Monster(8, 5));
}
public String process(String uuid, String input) {
System.out.println("Processor in : " + input);
String output = "error";
try {
Document outDocument = SimpleXML.makeXMLDocument(ROOT);
SimpleXML.addRootComment(outDocument, COMMENT);
if(input.contains("?xml version=")){
Document inDocument = SimpleXML.documentFromString(input);
Element userData = DomPain.getFirstChildElement(inDocument.getDocumentElement(), USER_DATA);
String userUUID = DomPain.getFirstChildElementContent(userData, USER_ID);
if(userUUID == null || userUUID.equals("")){
userUUID = uuid;
}
String broken = DomPain.getFirstChildElementContent(inDocument.getDocumentElement(), BROKEN_BLOCKS);
if(broken != null){
String[] blocks = broken.split(",");
for (String block : blocks) {
char newChar = Maps.getRandomChar(new char[]{' ', '0', '*'}, new int[]{3, 6, 1});
map[Integer.parseInt(block)] = newChar;
}
}
User user = getUser(userUUID);
VisualObject playerObject = user.getVisualObject();
playerObject.setX(Integer.parseInt(DomPain.getFirstChildElementContent(userData, USER_X_LOCATION)));
playerObject.setY(Integer.parseInt(DomPain.getFirstChildElementContent(userData, USER_Y_LOCATION)));
checkPositionInteraction(user);
Element disconnected = outDocument.createElement( QuestServerProcessor.DISCONNECTED_USERS );
for(String id : disconnectedUsers){
SimpleXML.createElement(outDocument, disconnected, USER_ID, id);
}
outDocument.getDocumentElement().appendChild( disconnected );
Element otherUsers = outDocument.createElement( QuestServerProcessor.KNOWN_USERS );
for(User knownUser : userHashMap.values()){
Element userElement = SimpleXML.createElement(outDocument, otherUsers, QuestServerProcessor.USER_DATA, null);
SimpleXML.createElement(outDocument, userElement, USER_ID, knownUser.getUserUUID());
SimpleXML.createElement(outDocument, userElement, USER_X_LOCATION, String.valueOf(knownUser.getVisualObject().getX()));
SimpleXML.createElement(outDocument, userElement, USER_Y_LOCATION, String.valueOf(knownUser.getVisualObject().getY()));
}
outDocument.getDocumentElement().appendChild( otherUsers );
Element element = outDocument.createElement(REPLY_TO);
element.setTextContent(userUUID);
outDocument.getDocumentElement().appendChild(element);
Element mapElement = outDocument.createElement(MAP);
SimpleXML.createElement(outDocument, mapElement, MAPDATA, new String(map));
SimpleXML.createElement(outDocument, mapElement, MAPSIZE, mapWidth + "," + mapHeight + ",1");
outDocument.getDocumentElement().appendChild(mapElement);
String items = "";
for(Character item : user.getItemList()){
items += item;
}
SimpleXML.createElement(outDocument, outDocument.getDocumentElement(), CARRYING, items);
} else {
Element element = outDocument.createElement(RECEIVED);
element.setTextContent(input);
outDocument.getDocumentElement().appendChild(element);
}
output = SimpleXML.getXMLasString(outDocument);
System.out.println("Processor out : " + output);
output = SimpleXML.flattenString(output);
} catch (Exception e) {
e.printStackTrace();
}
return output;
}
private void checkPositionInteraction(User user) {
VisualObject visualObject = user.getVisualObject();
int x = visualObject.getX();
int y = visualObject.getY();
int pos = (y * mapWidth) + x;
if(pos < map.length){
char posChar = map[pos];
if(posChar != ' '){
switch (posChar){
case '*':
user.giveItem(Maps.DIAMOND);
map[pos] = ' ';
break;
case '0':
user.giveItem(Maps.ORE);
map[pos] = ' ';
}
}
}
}
public String process(String input) {
return null;
}
public void clientDisconnect(String clientUUID) {
// userUUIDs.remove(clientUUID);
disconnectedUsers.add(clientUUID);
userHashMap.remove(clientUUID);
}
public void newUser(String uuid) {
// userUUIDs.add(uuid);
}
public static ArrayList<User> getKnownUsers(Document document){
Element knownUsersElement = DomPain.getFirstChildElement(document.getDocumentElement(), QuestServerProcessor.KNOWN_USERS);
List<Element> knownUsers = DomPain.getChildElements( knownUsersElement, QuestServerProcessor.USER_DATA);
ArrayList<User> users = new ArrayList<User>();
for(Element element : knownUsers){
String userID = DomPain.getFirstChildElementContent(element, QuestServerProcessor.USER_ID);
int x = Integer.parseInt(DomPain.getFirstChildElementContent(element, QuestServerProcessor.USER_X_LOCATION));
int y = Integer.parseInt(DomPain.getFirstChildElementContent(element, QuestServerProcessor.USER_Y_LOCATION));
User user = new User(userID);
user.setVisualObject( new PointlessSquare(x, y, 50, 50));
user.getPlayerBlock().setX(x);
user.getPlayerBlock().setY(y);
users.add(user);
}
return users;
}
private User getUser(String userUUID) {
User user;
if( userHashMap.containsKey(userUUID)){
user = userHashMap.get(userUUID);
} else {
user = new User( userUUID );
user.setVisualObject( new PointlessSquare(0,0,0,0));
userHashMap.put(userUUID, user);
}
return user;
}
class GameThread extends Thread{
private boolean end;
private int time;
public void end(){
end = true;
}
public void run(){
while(!end){
Random random = new Random(System.currentTimeMillis());
for( Monster monster : monsters){
int rand = random.nextInt(10);
int pos = (monster.getY() * mapWidth) + monster.getX();
char c;
switch (rand){
case 1:
c = map[pos + 1];
if( c == ' '){
// System.out.println( c + " = * *" );
map[pos] = ' ';
monster.moveX(1);
} else{
// System.out.println("Blocked moving right");
}
break;
case 2:
c = map[pos - 1];
if( c == ' '){
// System.out.println( c + " = * *" );
map[pos] = ' ';
monster.moveX(-1);
} else{
// System.out.println("Blocked moving left");
}
break;
case 3:
c = map[pos + mapWidth];
if(c == ' '){
// System.out.println( c + " = * *" );
map[pos] = ' ';
monster.moveY(1);
} else{
// System.out.println("Blocked moving down");
}
break;
case 4:
c = map[pos - mapWidth];
if( c == ' '){
// System.out.println( c + " = * *" );
map[pos] = ' ';
monster.moveY(-1);
} else{
// System.out.println("Blocked moving up");
}
break;
}
pos = (monster.getY() * mapWidth) + monster.getX();
map[pos] = '@';
}
try {
Thread.sleep(time);
} catch (InterruptedException ignored) {}
}
}
public GameThread(final int time){
this.time = time;
}
}
}
| [
"iharvey111@googlemail.com"
] | iharvey111@googlemail.com |
932334ffb9aed1a540659f35b16951e31290e31b | cbe1e006b8a2ff4def93cbf7c6099b183ac66da3 | /android/app/src/main/java/cn/nieking/flutterhelloworld/MainActivity.java | e118c476f0fa776288074412e034f6e17da3762b | [
"Apache-2.0"
] | permissive | NieQing/FlutterDemo_HelloWorld | 56026f4f62ac6b40726c95de6e9a90266b1f335a | 4341aae02f205122a873869fa6635815706a3af7 | refs/heads/master | 2020-03-17T05:03:48.247678 | 2018-05-14T03:39:25 | 2018-05-14T03:39:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | package cn.nieking.flutterhelloworld;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
| [
"jzjtaizi@qq.com"
] | jzjtaizi@qq.com |
79a8e1c4552b6d7f4698398dcb239828339ac99f | 528d83b83bb3e104cd5808c325a8743401f3427b | /arms/src/main/java/com/chieveke/arms/utils/sys/ScreenUtil.java | a6e5a56c35333c886b2951c9640367324afbceac | [
"Apache-2.0"
] | permissive | Chieve/KotlinMvp | aa8ebe4e1a05563ae64932f0bb501566b0db4a1e | c7b754e07729ddada1b9a249157847b4342a9c26 | refs/heads/master | 2020-03-29T08:09:08.782820 | 2018-10-24T02:04:32 | 2018-10-24T02:04:32 | 149,696,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,965 | java | package com.chieveke.arms.utils.sys;
import android.app.Dialog;
import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.widget.PopupWindow;
import com.chieveke.arms.utils.AppContext;
import java.lang.reflect.Field;
public class ScreenUtil {
private static final String TAG = "Demo.ScreenUtil";
private static double RATIO = 0.85;
public static int screenWidth;
public static int screenHeight;
public static int screenMin;// 宽高中,小的一边
public static int screenMax;// 宽高中,较大的值
public static float density;
public static float scaleDensity;
public static float xdpi;
public static float ydpi;
public static int densityDpi;
public static int dialogWidth;
public static int statusbarheight;
public static int navbarheight;
static {
init(AppContext.get());
}
public static int dip2px(float dipValue) {
return (int) (dipValue * density + 0.5f);
}
public static int px2dip(float pxValue) {
return (int) (pxValue / density + 0.5f);
}
public static int sp2px(float spValue) {
return (int) (spValue * scaleDensity + 0.5f);
}
public static int getDialogWidth() {
dialogWidth = (int) (screenMin * RATIO);
return dialogWidth;
}
public static void init(Context context) {
if (null == context) {
return;
}
DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics();
screenWidth = dm.widthPixels;
screenHeight = dm.heightPixels;
screenMin = (screenWidth > screenHeight) ? screenHeight : screenWidth;
density = dm.density;
scaleDensity = dm.scaledDensity;
xdpi = dm.xdpi;
ydpi = dm.ydpi;
densityDpi = dm.densityDpi;
Log.d(TAG, "screenWidth=" + screenWidth + " screenHeight=" + screenHeight + " density=" + density);
}
public static int getDisplayWidth() {
if (screenWidth == 0) {
GetInfo(AppContext.get());
}
return screenWidth;
}
public static int getDisplayHeight() {
if (screenHeight == 0) {
GetInfo(AppContext.get());
}
return screenHeight;
}
public static void GetInfo(Context context) {
if (null == context) {
return;
}
DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics();
screenWidth = dm.widthPixels;
screenHeight = dm.heightPixels;
screenMin = (screenWidth > screenHeight) ? screenHeight : screenWidth;
screenMax = (screenWidth < screenHeight) ? screenHeight : screenWidth;
density = dm.density;
scaleDensity = dm.scaledDensity;
xdpi = dm.xdpi;
ydpi = dm.ydpi;
densityDpi = dm.densityDpi;
statusbarheight = getStatusBarHeight(context);
navbarheight = getNavBarHeight(context);
Log.d(TAG, "screenWidth=" + screenWidth + " screenHeight=" + screenHeight + " density=" + density);
}
public static int getStatusBarHeight(Context context) {
if (statusbarheight == 0) {
try {
Class<?> c = Class.forName("com.android.internal.R$dimen");
Object o = c.newInstance();
Field field = c.getField("status_bar_height");
int x = (Integer) field.get(o);
statusbarheight = context.getResources().getDimensionPixelSize(x);
} catch (Exception e) {
e.printStackTrace();
}
}
if (statusbarheight == 0) {
statusbarheight = ScreenUtil.dip2px(25);
}
return statusbarheight;
}
public static int getNavBarHeight(Context context) {
Resources resources = context.getResources();
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
return resources.getDimensionPixelSize(resourceId);
}
return 0;
}
/**
* 设置dialog大小占屏幕的宽高
* @param widthRatio 宽度比例
* @param heightRatio 高度比例
* @param isTrue 高度和宽度是否相等
* @param type -> 1: 和宽度相等
* -> 2: 和高度相等
*/
public static void setWindowDisplay(Dialog mDialog, Context mContext, double widthRatio, double heightRatio, boolean isTrue, int type){
Window dialogWindow = mDialog.getWindow();
WindowManager.LayoutParams params = dialogWindow.getAttributes();
DisplayMetrics metrics = mContext.getResources().getDisplayMetrics(); // 获取屏幕宽、高
if (isTrue){
if (type == 1){
params.width = (int) (metrics.widthPixels * widthRatio);
params.height = (int) (metrics.widthPixels * widthRatio);
}else{
params.width = (int) (metrics.heightPixels * heightRatio);
params.height = (int) (metrics.heightPixels * heightRatio);
}
}else{
params.width = (int) (metrics.widthPixels * widthRatio);
params.height = (int) (metrics.heightPixels * heightRatio);
}
dialogWindow.setAttributes(params);
}
/**
* 设置dialog大小占屏幕的宽高
* @param widthRatio 宽度比例
* @param heightRatio 高度比例
*/
public static void setWindowDisplay(PopupWindow mWindows, Context mContext, double widthRatio, double heightRatio){
DisplayMetrics metrics = mContext.getResources().getDisplayMetrics(); // 获取屏幕宽、高
mWindows.setWidth((int) (metrics.widthPixels * widthRatio));
mWindows.setHeight((int) (metrics.heightPixels * heightRatio));
}
}
| [
"chieve@live.cn"
] | chieve@live.cn |
08b0ef502bed4d58fc6351a34f29710a8e1f0f06 | b7a9fae1554729346d2a280e03a7897bd03e2daf | /RedBull/src/main/java/kr/co/redbull/main/web/MainController.java | 8dcba2f743c87707f4bc5ac5faee6af0c4c910bd | [] | no_license | HR-Kim/RedBull3 | c547877ae79445ffd44d2344f7d1a133b285eb42 | 03f9eb1e58cfe08b23a954e00ba3d995ac45e013 | refs/heads/master | 2022-12-21T09:08:41.129562 | 2019-10-29T07:12:54 | 2019-10-29T07:12:54 | 205,103,745 | 1 | 0 | null | 2022-12-16T08:45:12 | 2019-08-29T07:14:49 | PLSQL | UTF-8 | Java | false | false | 6,402 | java | package kr.co.redbull.main.web;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import kr.co.redbull.category.service.CategoryService;
import kr.co.redbull.cmn.Search;
import kr.co.redbull.image.service.Image;
import kr.co.redbull.image.service.ImageService;
import kr.co.redbull.product.service.Product;
@Controller
public class MainController {
Logger LOG = LoggerFactory.getLogger(this.getClass());
@Autowired
CategoryService categoryService;
@Autowired
ImageService imageService;
// View를 상수로 선언
private final String VIEW_NM = "main/main";
/**화면 호출*/
//http://localhost:8080/redbull/main/main.do
@RequestMapping(value="main/main.do", method = RequestMethod.GET)
public String main(Search search, Model model, HttpServletRequest request) {
LOG.debug("============================");
LOG.debug("=MainController VIEW_NM: " + VIEW_NM);
LOG.debug("============================");
//0---search------------------------------------------------------------------
LOG.debug("================================");
LOG.debug("MainController search:"+search);
LOG.debug("================================");
//NUll 처리
if(search.getPageSize()==0) search.setPageSize(9);
if(search.getSearchDiv()==null) search.setSearchDiv("10");
if(search.getPageNum()==0) search.setPageNum(1);
if(search.getSearchWord()==null) search.setSearchWord("");
model.addAttribute("vo", search);
//1---랭킹 리스트------------------------------------------------------------------
List<Product> rankList = (List<Product>)categoryService.get_rankList(search);
List<Product> rankoutList = new ArrayList<Product>();
// 썸네일 설정 : 안쓰는 detail에 이미지 경로를 넣자
for (int i = 0; i < rankList.size(); i++) { // 랭킹 리스트에서
Product getrankOne = rankList.get(i); // 객체와
String getrankPnum = getrankOne.getpNum(); // 제품 번호를 가져옴
// Pnum으로 검색
Search rankSearch = new Search();
rankSearch.setSearchWord(getrankPnum); // 제품 번호를 set하고
String ranksaveFileNm = "";
List<Image> rankImageList = new ArrayList<Image>();
rankImageList = (List<Image>) imageService.get_refnumList(rankSearch); // 이미지를 검색
// 검색 결과가 없다면? : 기본 이미지
if (rankImageList.size() < 1) {
ranksaveFileNm = "resources/img/product/noimage.jpg";
} else {
// 있으면 첫번째 이미지
ranksaveFileNm = rankImageList.get(0).getSaveFileNm();
}
getrankOne.setDetail(ranksaveFileNm); // 이미지를 제품 객체에 set
rankoutList.add(getrankOne);
}
model.addAttribute("ranklist", rankoutList);
// 랭킹 총건수
int ranktotalCnt = 0;
if(null!=rankoutList && rankoutList.size()>0) {
ranktotalCnt = rankoutList.get(0).getTotalCnt();
model.addAttribute("ranktotalCnt", ranktotalCnt);
}
//2---세일상품 리스트------------------------------------------------------------------
List<Product> saleList = (List<Product>)categoryService.get_hotSaleList(search);
List<Product> saleoutList = new ArrayList<Product>();
// 썸네일 설정 : 안쓰는 detail에 이미지 경로를 넣자
for (int i = 0; i < saleList.size(); i++) { // 랭킹 리스트에서
Product getsaleOne = saleList.get(i); // 객체와
String getsalePnum = getsaleOne.getpNum(); // 제품 번호를 가져옴
// Pnum으로 검색
Search saleSearch = new Search();
saleSearch.setSearchWord(getsalePnum); // 제품 번호를 set하고
String salesaveFileNm = "";
List<Image> saleImageList = new ArrayList<Image>();
saleImageList = (List<Image>) imageService.get_refnumList(saleSearch); // 이미지를 검색
// 검색 결과가 없다면? : 기본 이미지
if (saleImageList.size() < 1) {
salesaveFileNm = "resources/img/product/noimage.jpg";
} else {
// 있으면 첫번째 이미지
salesaveFileNm = saleImageList.get(0).getSaveFileNm();
}
getsaleOne.setDetail(salesaveFileNm); // 이미지를 제품 객체에 set
saleoutList.add(getsaleOne);
}
model.addAttribute("salelist", saleoutList);
// 세일 총건수
int saletotalCnt = 0;
if(null!=saleoutList && saleoutList.size()>0) {
saletotalCnt = saleoutList.get(0).getTotalCnt();
model.addAttribute("saletotalCnt", saletotalCnt);
}
//3---신상 리스트------------------------------------------------------------------
List<Product> newList = (List<Product>)categoryService.get_newList(search);
List<Product> newoutList = new ArrayList<Product>();
// 썸네일 설정 : 안쓰는 detail에 이미지 경로를 넣자
for (int i = 0; i < newList.size(); i++) { // 랭킹 리스트에서
Product getnewOne = newList.get(i); // 객체와
String getnewPnum = getnewOne.getpNum(); // 제품 번호를 가져옴
// Pnum으로 검색
Search newSearch = new Search();
newSearch.setSearchWord(getnewPnum); // 제품 번호를 set하고
String newsaveFileNm = "";
List<Image> newImageList = new ArrayList<Image>();
newImageList = (List<Image>) imageService.get_refnumList(newSearch); // 이미지를 검색
// 검색 결과가 없다면? : 기본 이미지
if (newImageList.size() < 1) {
newsaveFileNm = "resources/img/product/noimage.jpg";
} else {
// 있으면 첫번째 이미지
newsaveFileNm = newImageList.get(0).getSaveFileNm();
}
getnewOne.setDetail(newsaveFileNm); // 이미지를 제품 객체에 set
newoutList.add(getnewOne);
}
model.addAttribute("newlist", newoutList);
// 신상 총건수
int newtotalCnt = 0;
if(null!=newoutList && newoutList.size()>0) {
newtotalCnt = newoutList.get(0).getTotalCnt();
model.addAttribute("newtotalCnt", newtotalCnt);
}
return VIEW_NM;
}//--main
}//--class
| [
"sist@DESKTOP-IR0HIIQ"
] | sist@DESKTOP-IR0HIIQ |
f9bca594ba2c52fe15e2626d9299d91bbb2a0b04 | c00795cb3ca93694e659d4cb5111d0cf60eec265 | /src/main/java/demo/library/rest/controller/GreetingController.java | 5a358a5d8252566ff8fb6871a0bec18cda4b514c | [
"MIT"
] | permissive | rnowley/book-library | 399aa4678c7870d9279c5e5f172476e4336da409 | 78cd5e2414c562e0644e1e53b20c31b82ea3a936 | refs/heads/master | 2021-09-07T07:06:45.287828 | 2018-02-19T10:11:32 | 2018-02-19T10:11:32 | 119,502,267 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package demo.library.rest.controller;
import demo.library.rest.Greeting;
import java.util.concurrent.atomic.AtomicLong;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class GreetingController {
private static final String TEMPLATE = "Hello, %s!";
private final AtomicLong counter = new AtomicLong();
@RequestMapping("/greeting")
public Greeting greeting(@RequestParam(value = "name", defaultValue = "World") String name) {
return new Greeting(counter.incrementAndGet(), String.format(TEMPLATE, name));
}
}
| [
"nowley.r@gmail.com"
] | nowley.r@gmail.com |
cc5b711ba2155086485aa515c30343d27aa4ec35 | 19a182ca53b87de8a496747ad3d94289888aa7fc | /src/main/test/net/cheltsov/shtoss/dao/sql/SqlInitializerTest.java | 5d74bdb2d31ae2d313b4f7d6aa13ec9e57b91ea0 | [] | no_license | lelik112/shtoss | 60c7cc87ae1a1b5acd783154e45695d802d4665e | 59d05cc9e4f5b297ef393e8085e801417fb49681 | refs/heads/master | 2021-05-11T02:54:00.480357 | 2018-02-05T16:47:25 | 2018-02-05T16:47:25 | 117,897,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,620 | java | package net.cheltsov.shtoss.dao.sql;
import net.cheltsov.shtoss.database.ConnectionPool;
import net.cheltsov.shtoss.exception.DaoException;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
public class SqlInitializerTest {
@BeforeTest
public void init() {
ConnectionPool.getInstance();
}
@Test
public void testGetAutoCommitTrue() throws DaoException {
SqlInitializer initializer = new SqlInitializer();
assertTrue(initializer.getAutoCommit());
initializer.close();
}
@Test
public void testSetAutoCommitTrue() throws DaoException {
SqlInitializer initializer = new SqlInitializer();
initializer.setAutoCommit(false);
initializer.setAutoCommit(true);
assertTrue(initializer.getAutoCommit());
initializer.close();
}
@Test
public void testSetAutoCommitFalse() throws DaoException {
SqlInitializer initializer = new SqlInitializer();
initializer.setAutoCommit(false);
assertFalse(initializer.getAutoCommit());
initializer.close();
}
@Test
public void testIsClosedFalse() throws DaoException {
SqlInitializer initializer = new SqlInitializer();
assertFalse(initializer.isClosed());
initializer.close();
}
@Test
public void testIsClosedTrue() throws DaoException {
SqlInitializer initializer = new SqlInitializer();
initializer.close();
assertTrue(initializer.isClosed());
}
} | [
"cheltsov112@gmail.com"
] | cheltsov112@gmail.com |
3bd50cbd3f7be34d9ace54b2e419b62be7ab0045 | a48cf08675396778d3bb21943b6bbd0ec94f3302 | /gulimall-common/src/main/java/com/zfliu/common/utils/R.java | d1113a910fe13554c756a8d4d54c4027dbadf9cc | [] | no_license | liuzhefeng/guli-mall | 06ea7fdc317e2e83da546ac2d36ce60f3017b8d7 | 05c3d7fa19a7a086e75eeb3de00d9426b22cc3bd | refs/heads/main | 2023-08-13T15:40:16.965640 | 2021-10-13T09:05:56 | 2021-10-13T09:05:56 | 372,141,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,301 | java | /**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有,侵权必究!
*/
package com.zfliu.common.utils;
import org.apache.http.HttpStatus;
import java.util.HashMap;
import java.util.Map;
/**
* 返回数据
*
* @author Mark sunlightcs@gmail.com
*/
public class R extends HashMap<String, Object> {
private static final long serialVersionUID = 1L;
public R() {
put("code", 0);
put("msg", "success");
}
public static R error() {
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员");
}
public static R error(String msg) {
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg);
}
public static R error(int code, String msg) {
R r = new R();
r.put("code", code);
r.put("msg", msg);
return r;
}
public static R ok(String msg) {
R r = new R();
r.put("msg", msg);
return r;
}
public static R ok(Map<String, Object> map) {
R r = new R();
r.putAll(map);
return r;
}
public static R ok() {
return new R();
}
public R put(String key, Object value) {
super.put(key, value);
return this;
}
}
| [
"756792312@qq.com"
] | 756792312@qq.com |
e69194e812c640047b1279a19353df7f2cec656f | dae59ead386b4a51ee79dd2dfd40eb0e6ce15dad | /app/src/androidTest/java/com/example/jisan/firebase/ExampleInstrumentedTest.java | c7e3039cad5e97ab10394805d11d5fac4e4bf3fd | [] | no_license | MHHJisan/Firebase | 75857fe1421aab15e1303a3f63689761c550fc21 | 052bca49c5a49d3ec6cebe9f3e95db3f252df9cb | refs/heads/master | 2021-06-13T04:30:33.056658 | 2017-04-14T14:37:23 | 2017-04-14T14:37:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 756 | java | package com.example.jisan.firebase;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.jisan.firebase", appContext.getPackageName());
}
}
| [
"mhhaque4@gmail.com"
] | mhhaque4@gmail.com |
228af1cd7259769ff56f642958b783187ce540d9 | 6b4f0939c46401494dbb849f720f91947861c7c6 | /Hibernate_Lab57/src/com/kantravi/hibernate/Student.java | a9e675d2335380c9e4437327482c25d6f03e5682 | [] | no_license | Ravikant09/Hibernate | 096b975d1144aae6a1623232afa0daa9832dc48d | 18e2e8cb2214a87dcf26e766f8c69055f9ef7a63 | refs/heads/develop | 2020-03-13T15:57:56.058326 | 2018-04-26T17:17:06 | 2018-04-26T17:17:06 | 131,187,853 | 0 | 0 | null | 2018-04-26T17:28:17 | 2018-04-26T17:14:40 | Java | UTF-8 | Java | false | false | 1,613 | java | package com.kantravi.hibernate;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="students")
public class Student {
@Id
@Embedded
@AttributeOverrides({
@AttributeOverride(name="bid",column=@Column(name="bid")),
@AttributeOverride(name="sid",column=@Column(name="sid"))
})
private SID studentId;
@Column(name="sName")
private String sName;
@Column(name="email")
private String email;
@Column(name="phone")
private Long phone;
public Student() {}
public Student(SID studentId, String sName, String email, Long phone) {
this.studentId = studentId;
this.sName = sName;
this.email = email;
this.phone = phone;
}
//Here SID which is composite primary key must has to supply in constructor as Hibernate cannot generate Composite PK
public SID getStudentId() {
return studentId;
}
public void setStudentId(SID studentId) {
this.studentId = studentId;
}
public String getsName() {
return sName;
}
public void setsName(String sName) {
this.sName = sName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Long getPhone() {
return phone;
}
public void setPhone(Long phone) {
this.phone = phone;
}
@Override
public String toString() {
return "Student [studentId=" + studentId + ", sName=" + sName + ", email=" + email + ", phone=" + phone + "]";
}
}
| [
"37937959+Ravikant09@users.noreply.github.com"
] | 37937959+Ravikant09@users.noreply.github.com |
00faafa1b9e18c68070ebcf62399498915d6f3cb | 8ef620e793b81374f2d3c447cc362ab94519b768 | /src/test/java/com/greenbean/poplar/sqlla/test/Main.java | 6a8608cfa28ae51bcd6c9f0544fb3c0e14b6d2bf | [] | no_license | PathogenABC/sqlla | 7aee777afaf50096421f6d31f8eece3560121d2a | 420b990eaf8232cd7cdc9c0926d7ec670409cf27 | refs/heads/master | 2020-12-30T12:23:01.987003 | 2017-10-24T08:14:28 | 2017-10-24T08:14:28 | 91,426,269 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,661 | java | package com.greenbean.poplar.sqlla.test;
import com.greenbean.poplar.sqlla.Sqlla;
import com.greenbean.poplar.sqlla.Transaction;
import com.greenbean.poplar.sqlla.view.ViewObject;
import java.io.IOException;
import java.util.Date;
import java.util.List;
/**
* Created by chrisding on 2017/5/10.
* Function: NULL
*/
public class Main {
private static Sqlla sSqlla;
public static void main0(String[] args) throws IOException {
// InputStream confResource = Main.class.getResourceAsStream("/sqlla/c3p0_config.properties");
// Sqlla.ConnectionPool pool = new C3P0ConnectionPool(confResource);
Sqlla.ConnectionPool pool = new C3P0ConnectionPool("sqlla/conf/c3p0_config.properties");
Sqlla sqlla = new Sqlla.Builder().pool(pool).build();
sSqlla = sqlla;
final UserDao api = sqlla.createApi(UserDao.class);
UserBean bean = api.getUserById("test_123");
if (bean == null) {
System.out.println("no user with id 'test_123'");
} else {
System.out.println(bean);
}
List<UserBean> beans = api.getUserByPhone("13241133612");
if (beans == null) {
System.out.println("no user with phone '13241133612'");
} else {
System.out.println(beans);
}
boolean exist = api.userExist("李明洙");
System.out.println("user named '李明洙' " + (exist ? "exists" : "doesn't exist"));
List<ViewObject> viewObjects = api.selectUsers();
System.out.println(viewObjects);
boolean yes = api.insertUser("test_1234", "张三", "13241133616");
System.out.println("insert user " + (yes ? "committed" : "failed"));
}
public static void main1(String[] args) {
Sqlla.ConnectionPool pool = new C3P0ConnectionPool("sqlla/conf/c3p0_config.properties");
final Sqlla sqlla = new Sqlla.Builder().pool(pool).build();
sSqlla = sqlla;
final UserDao api = sqlla.createApi(UserDao.class);
UserBean maxIdUser = api.maxIdUser();
System.out.println(maxIdUser);
sqlla.transact(new Transaction<Void>() {
@Override
protected void transact() throws Exception {
boolean yes = api.insertUser("test_1234", "王五", "13241133615");
System.out.println("insert user " + (yes ? "committed" : "failed"));
boolean exist = api.userExist("李明洙"); // sql 错误, 会rollback
System.out.println("user named '李明洙' " + (exist ? "exists" : "doesn't exist"));
sqlla.transact(new Transaction<Void>() {
@Override
protected void transact() throws Exception {
boolean yes = api.insertUser("test_1234", "赵六", "13241133616");
commit(null);
System.out.println("insert user " + (yes ? "committed" : "failed"));
}
});
}
});
maxIdUser = api.maxIdUser();
System.out.println(maxIdUser);
}
static boolean transferMoney(final String myUid, final String acceptorUid, final float money) {
// return sSqlla.transact(new Transaction<Boolean>() {
// public Boolean transact() throws Exception {
// MoneyDao api = sSqlla.createApi(MoneyDao.class);
// boolean b = api.addMoneyForUser(-money, myUid);
// b &= api.addMoneyForUser(money, acceptorUid);
// if (!b) rollback();
// return b;
// }
// }, false);
return false;
}
static boolean transferMoneyAndUpdateJifen() {
// return sSqlla.transact(new Transaction<Boolean>() {
// @Override
// protected Boolean transact() throws Exception {
// MoneyDao api = sSqlla.createApi(MoneyDao.class);
// boolean b = transferMoney("111", "222", 100);
// b &= api.addJifenForUser("111", 2);
// b &= api.addJifenForUser("222", 2);
// if (!b) rollback();
// return b;
// }
// }, false);
return false;
}
public static void main(String[] args) {
Sqlla.ConnectionPool pool = new C3P0ConnectionPool("sqlla/conf/c3p0_corner_config.properties");
Sqlla sqlla = new Sqlla.Builder().pool(pool).build();
ModelApi api = sqlla.createApi(ModelApi.class);
List<LikeUserModel> list = api.getLikeRecordListByTargetUser(6, new Date(Long.MAX_VALUE), 40);
System.out.printf("list = " + list);
}
}
| [
"djk@runagain.cn"
] | djk@runagain.cn |
03866613e94ef418eeeb32ad698213007654807f | 5da1723afb3bc462c4818ddb5db61883e5caca63 | /src/com/texnedo/PasswordCracker.java | b4f05e301106b66d137b974ad2ef6c9cc77670cd | [] | no_license | texnedo/algo-tasks | 2e417036ce7114244d3deeb3f60a46dba4ceb228 | 8fb90a6589ce1a8ad0cda09dbaf7c1ac143d356f | refs/heads/master | 2022-12-11T07:47:07.214876 | 2022-12-04T23:19:19 | 2022-12-04T23:19:19 | 189,897,415 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,611 | java | package com.texnedo;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
public class PasswordCracker {
private static final String WRONG_PASSWORD = "WRONG PASSWORD";
public static String passwordCracker(List<String> passwords, String loginAttempt) {
HashSet<String> existingPasswords = new HashSet<>();
int minLength = Integer.MAX_VALUE;
int maxLength = 0;
for (String password : passwords) {
existingPasswords.add(password);
if (password.length() > maxLength) {
maxLength = password.length();
}
if (password.length() < minLength) {
minLength = password.length();
}
}
return passwordCrackerInternal(
existingPasswords, new HashMap<>(),
minLength, maxLength, loginAttempt
);
}
private static String passwordCrackerInternal(HashSet<String> passwords,
HashMap<String, String> existing,
int minLength,
int maxLength,
String loginAttempt) {
String result = existing.get(loginAttempt);
if (result != null) {
return result;
}
for (int i = minLength; i < loginAttempt.length() + 1 && i <= maxLength; i++) {
String token = loginAttempt.substring(0, i);
if (passwords.contains(token)) {
if (token.length() == loginAttempt.length()) {
existing.put(loginAttempt, token);
return token;
}
String restPart = passwordCrackerInternal(
passwords,
existing,
minLength,
maxLength,
loginAttempt.substring(i)
);
if (!WRONG_PASSWORD.equals(restPart)) {
String resultSum = String.format("%s %s", token, restPart);
existing.put(loginAttempt, resultSum);
return resultSum;
}
}
}
return WRONG_PASSWORD;
}
public static void main(String[] args) {
List<String> passwords = Arrays.asList("because", "can", "do", "must", "we", "what");
String attempt = "wedowhatwemustbecausewecan";
System.out.println(passwordCracker(passwords, attempt));
}
}
| [
"monthtur@gmail.com"
] | monthtur@gmail.com |
c1c23740b8e6e207cda6bd89578c4d584476fc38 | b01a21d3c7cc435af23fb7ecab0562c58f47905d | /lottery/swiss_lottery/src/View/TicketListArea.java | 5dd8b7c89cda8da8453391011457445abb2102e5 | [] | no_license | Lucindor/Lottery | 85a66c7ea9b0ea1a31841d543c545463053007ca | d0e57a5e86ed9adff754582afbe5d903157bcfa6 | refs/heads/master | 2020-05-17T01:27:15.158272 | 2019-04-25T16:10:29 | 2019-04-25T16:10:29 | 183,426,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package View;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
public class TicketListArea extends VBox {
private Label lblInfo = new Label("Your tips:");
public TicketListArea(){
super();
getChildren().addAll(lblInfo);
this.getStyleClass().add("ticketListArea");
}
}
| [
"noreply@github.com"
] | Lucindor.noreply@github.com |
6f4e4bc3d29cbca483ee5ffaa1cc1f58e671ba03 | 05551a91224fe4ba2ea662097b9acea96accdcf3 | /src/main/java/com/instructional/system/management/config/CrossConfig.java | 6f884e600c17d81f58de9bfcd3e8f5af7c6e93a9 | [] | no_license | ljjwyn/management | b34ee4f76bf7ef7ad73887541dde4ea1d6682db0 | c85d572b7e7cdced462eedae251aa08e9f789cef | refs/heads/master | 2023-04-16T07:16:06.921471 | 2021-04-29T11:15:27 | 2021-04-29T11:15:27 | 362,790,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | package com.instructional.system.management.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class CrossConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:9528",
"http://localhost:63342", "http://192.168.31.108:9528")
.allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
.allowCredentials(true)
.maxAge(3600)
.allowedHeaders("Access-Control-Allow-Headers", "*");
}
}
| [
"294810052@qq.com"
] | 294810052@qq.com |
1c1fccb9411df7b8f82de772b81b67444559fcd6 | 6f08f8fc0aabce74253c32e5d8ba28cc7af488b8 | /Range1.java | 5893e28ea0b12136dfe5cbc6af790c88104ae440 | [] | no_license | Prasanna-qisit/guvi | 563cb77673dea4ade57e20f3d2906453fe1b8e7e | 156468d6120293b3630edb15ff0563a0eb5271c7 | refs/heads/master | 2020-03-26T04:56:36.981736 | 2018-09-14T10:20:20 | 2018-09-14T10:20:20 | 144,529,955 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 292 | java | import java.util.*;
import java.lang.*;
import java.io.*;
class Range1
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
if(n>=1 && n<=10)
System.out.println("yes");
else
System.out.println("no");
}
}
| [
"noreply@github.com"
] | Prasanna-qisit.noreply@github.com |
db050dc7f2fb7340e6a2b515ae6b9834859843d5 | 539d5c714d577c294368a6ac5ecd5aae0dbc561e | /src/Model/User.java | 89e8a6614a027d07581598ce31fa79dd7ebfbc90 | [] | no_license | nguyenduclam1711/game-giai-toan | 31eff4e8b98cb2803f9764ed3bca80aa3711bd16 | b9e725aa10b01f3f08bbcaf2cd669b4b91f59a1f | refs/heads/master | 2020-06-19T01:21:25.313877 | 2019-07-14T03:08:05 | 2019-07-14T03:08:05 | 196,517,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 770 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Model;
import java.io.Serializable;
public class User implements Serializable{
private String userName;
private String passWord;
public User(String userName, String passWord) {
this.userName = userName;
this.passWord = passWord;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassWord() {
return passWord;
}
public void setPassWord(String passWord) {
this.passWord = passWord;
}
}
| [
"nguyenduclam1711@gmail.com"
] | nguyenduclam1711@gmail.com |
20620d2ecebf8e959a24b35502ad8a028b05e0cf | 285e56bbad8debf60fa5dc3fbe0db31402c58064 | /SpringMVCEmployee/src/com/wipro/employee/model/Employee.java | c86674f8d172466a3e4f51821866896daaf056d6 | [] | no_license | MohanaPradeepN/payslip | 878d877dd011a83030e0dc45de829b61f5d87a9f | 4b9203cd5bfef47c23ca347f7fef414d27a09b58 | refs/heads/master | 2020-05-19T23:12:13.811430 | 2019-05-06T19:57:42 | 2019-05-06T19:57:42 | 185,262,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,421 | java | package com.wipro.employee.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
@Entity
public class Employee {
@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator = "employee")
@SequenceGenerator(name = "employee", sequenceName = "employee_id_seq")
private int employeeId;
@Column(columnDefinition = "VARCHAR(25)")
private String empName;
@Column(columnDefinition = "VARCHAR(40)")
private String dept;
@Column(columnDefinition = "VARCHAR(40)")
private String designation;
@Column(columnDefinition = "NUMBER(7,2)")
private double salary;
public int getEmployeeId() {
return employeeId;
}
public void setEmployeeId(int employeeId) {
this.employeeId = employeeId;
}
public String getEmpName() {
return empName;
}
public void setEmpName(String empName) {
this.empName = empName;
}
public String getDept() {
return dept;
}
public void setDept(String dept) {
this.dept = dept;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
}
| [
"noreply@github.com"
] | MohanaPradeepN.noreply@github.com |
8cdc82b709d5381ac3df4755b1d603fee8070ba7 | 028cbe18b4e5c347f664c592cbc7f56729b74060 | /external/modules/weld/core/1.1.10.Final/tests-arquillian/src/test/java/org/jboss/weld/tests/named/Fish.java | 5e9b983dfd9b35e4b39379c99bdc86d097387d76 | [] | no_license | dmatej/Glassfish-SVN-Patched | 8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e | 269e29ba90db6d9c38271f7acd2affcacf2416f1 | refs/heads/master | 2021-05-28T12:55:06.267463 | 2014-11-11T04:21:44 | 2014-11-11T04:21:44 | 23,610,469 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,161 | java | /*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.weld.tests.named;
/**
* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
*/
public interface Fish {
}
| [
"jjsnyder83@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5"
] | jjsnyder83@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5 |
d06f0b2d4ec7cbc8380f17b1c8748d6afd212de1 | da9616db5dea64d74cdd3b9efcf12d415f8b4a73 | /task_2/dmitriy.osipov/bookshop/src/main/java/com/task/bookshop/repository/BookRepositoryImpl.java | 0f064ea793aa1a0ee76c8569dd359b6e72997662 | [] | no_license | jelem/javaee | e3f4247e14db6bdf78ef1ce2ececd29ec5b8119a | dd1c4cace608dafd14b0bda65579013cbf7cf29b | refs/heads/master | 2021-01-02T09:28:24.050270 | 2017-11-20T13:34:46 | 2017-11-20T13:34:46 | 99,216,102 | 1 | 19 | null | 2017-11-20T13:34:47 | 2017-08-03T09:34:39 | Java | UTF-8 | Java | false | false | 2,845 | java | package com.task.bookshop.repository;
import com.task.bookshop.exceptions.BookAlreadyExistsException;
import com.task.bookshop.exceptions.BookNotExistsException;
import com.task.bookshop.model.Book;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
public class BookRepositoryImpl implements BookRepository {
private List<Book> bookList;
public BookRepositoryImpl() {
bookList = new ArrayList<>();
demoData();
}
@Override
public void save(Book book) throws BookAlreadyExistsException {
if (bookList.contains(book)) {
throw new BookAlreadyExistsException("Book is already added");
}
bookList.add(book);
}
@Override
public void update(Book book) throws BookNotExistsException {
Optional<Book> oldBook = bookList.stream()
.filter(x -> x.getId().equals(book.getId())).findFirst();
int index = bookList.indexOf(oldBook
.orElseThrow(() -> new BookNotExistsException("There is no book with such ID")));
bookList.set(index, book);
}
@Override
public boolean exists(Book book) {
return bookList.contains(book);
}
@Override
public List<Book> findAll() {
return bookList;
}
@Override
public Book getById(String id) {
return bookList.stream().filter(x -> x.getId().equals(id)).findFirst()
.orElse(Book.getEmptyBook());
}
@Override
public List<Book> findAllByAuthorLike(String author) {
return bookList.stream().filter(x -> x.getAuthor().toLowerCase().contains(author.toLowerCase()))
.collect(Collectors.toList());
}
@Override
public List<Book> findAllByYear(int year) {
return bookList.stream().filter(x -> x.getYear() == year).collect(Collectors.toList());
}
@Override
public List<Book> findAllByTitleLike(String title) {
return bookList.stream().filter(x -> x.getTitle().toLowerCase().contains(title.toLowerCase()))
.collect(Collectors.toList());
}
private void demoData() {
bookList.add(new Book("Code Complete", "Steve McConnell", 2004));
bookList.add(new Book("The Unified Software Development Process",
"Grady Booch, Ivar Jacobson, James Rumbaugh", 1995));
bookList.add(new Book("Java 8. The Complete Reference, 9th Edition",
"Herbert Schildt", 2015));
bookList.add(new Book("Java. Библиотека профессионала. Том 1. Основы",
"Хорстманн К., Корнелл Г.", 2016));
bookList.add(new Book("The Lord of the Rings", "J.R.R. Tolkien", 2017));
bookList.add(new Book("The Hobbit", "J.R.R. Tolkien", 2016));
bookList.add(new Book("The Chronicles of Amber", "Roger Zelazny", 2016));
bookList.add(new Book("The Steel Rat", "Harry Harrison", 2015));
bookList.add(new Book("The Steel Rat", "Harry Harrison", 2017));
}
}
| [
"stanislav_parkhomenko@yahoo.com"
] | stanislav_parkhomenko@yahoo.com |
8133b0008519130fb799939607560dd8d15d0628 | 5ce7540d3d92624363bb9049486b0c88178c7f16 | /demo/src/main/java/com/zpl/service/impl/HelloServiceImpl.java | ffa55a8389e888fccd22bee3b1798a5566ffce72 | [] | no_license | zplswf/Springboot | 39d709b27823ef9c4255cfa43e65176f74179602 | 1a5fcb1598b5295142a8226f42b7afaeb6fc87fd | refs/heads/master | 2021-01-19T19:55:03.515389 | 2017-04-17T05:29:30 | 2017-04-17T05:29:30 | 88,464,206 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package com.zpl.service.impl;
import org.springframework.stereotype.Service;
import com.zpl.service.HelloService;
@Service
public class HelloServiceImpl implements HelloService {
@Override
public void sayHello() {
System.out.println("ok");
}
}
| [
"peilizhang@pptv.com"
] | peilizhang@pptv.com |
319b5749f63be69d3e88b54ac39e6a60305b85a6 | 12003f7ac744e366781056e6272443bd4c602684 | /src/腾讯50道精选/多数元素.java | 45be1da26909f54d1cca3c682d17abf34092f14c | [
"MIT"
] | permissive | zzzjunjie/algorithm | fe1c2cf0d34c8e633de388e2098d0fc5fb8f4bac | 65d9be1ad6838e4ee2011e30f3aee75cf3918bab | refs/heads/master | 2023-06-25T21:13:37.842206 | 2021-07-25T16:04:07 | 2021-07-25T16:04:07 | 387,781,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,035 | java | package 腾讯50道精选;
public class 多数元素 {
// 思路:取众数,然后看看众数是不是出现了len/2次以上
public int majorityElement(int[] nums) {
int pre = 0;
int preCount = 0;
for (int i = 0; i < nums.length; i++) {
int num = nums[i];
if (preCount > 0) {
if (pre == num) {
preCount++;
} else {
preCount--;
}
} else {
if (num == pre) {
preCount++;
} else {
pre = num;
preCount++;
}
}
}
// 存在一个众数
if (preCount > 0) {
int count = 0;
for (int num : nums) {
if (num == pre) {
count++;
}
}
if (count > nums.length / 2) {
return pre;
}
}
return 0;
}
}
| [
"1367970137@qq.com"
] | 1367970137@qq.com |
61faa9bd08e3c32fe207c4804c84b200a030431e | 154b60b38deb1b8d28ae502f51beda3c2547bd12 | /src/com/simplecalculator/SimpleCalculator.java | ebcfd44263e26e5862910c3991eec47ff8aac577 | [] | no_license | ShaktiCV/Simple-calculator_ThroughConsole | 6c6a72fbc7f68ac4882ac565de46c5113c028dcd | 7ae0bfb0756e953ba39bf87775ece55db4d27fe8 | refs/heads/master | 2023-03-25T06:58:46.331051 | 2021-03-19T10:48:25 | 2021-03-19T10:48:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,108 | java | package com.simplecalculator;
import java.util.Scanner;
public class SimpleCalculator {
public static void main(String[] args) {
String answer;
Calculator calc = new Calculator();
Menu selectmenu = new Menu();
Scanner scanner = new Scanner(System.in);
do {
System.out.println("Select one of the Menu options \r\n "
+"Addition: A , Subtraction: S, Multiplication: M, Division:D" );
calc.operation=selectmenu.selectOperation(scanner);
System.out.println("Select the first number");
calc.firstnumber = calc.selectNumber(scanner);
System.out.println("Select the second number");
calc.secondnumber = calc.selectNumber(scanner);
while((calc.secondnumber==0 && calc.operation.equalsIgnoreCase("d")) ){
System.out.println("0 in divisor will give infinity. Enter another number");
calc.secondnumber = calc.selectNumber(scanner);
}
calc.calculate();
System.out.println("Select 'Y' to continue or 'N' to exit");
answer = scanner.next();
} while(!answer.equalsIgnoreCase("n"));
scanner.close();
System.out.println("Thank you!");
}
}
| [
"shakticv@gmail.com"
] | shakticv@gmail.com |
8b2a3f71909e18214d05c8587dbf3f3c0295ecb9 | cd3ad23add8fc66cb3e289762efad52df539068e | /CSC 20/Final Project/src/Course.java | e1549a5cac748a52788ab20f6c0ccf1a2281c768 | [] | no_license | Rajvee21/Programming_projects | 5bd8030a2d145c99669be9722a99a03e191ab0de | a3ce57aff39131dde4179cf1362abcf6a942c262 | refs/heads/master | 2022-12-11T14:50:04.221206 | 2020-09-02T06:25:55 | 2020-09-02T06:25:55 | 292,165,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,450 | java | public class Course{
private int units;
private int number;
private String name;
private Course preRequisite;
private int section;
private Person instructor;
//constructor
public Course(int units,int number, String name, Course preRequisite, int section, Person instructor){
this.units = units;
this.number = number;
this.name = name;
this.preRequisite = preRequisite;
this.section = section;
this.instructor = instructor;
}
//getter
public int getUnits(){
return units;
}
public int getNumber(){
return number;
}
public String getName(){
return name;
}
public Course getPreRequisite(){
return preRequisite;
}
public int getSection(){
return section;
}
public Person getInstructor(){
return instructor;
}
//setter
public void setUnits(int units){
this.units = units;
}
public void setNumber(int number){
this.number = number;
}
public void setName(String name){
this.name = name;
}
public void setPreRequisite(Course preRequisite){
this.preRequisite = preRequisite;
}
public void setSection(int section){
this.section = section;
}
public void setInstructor(Person instructor){
this.instructor = instructor;
}
//equals
public boolean equals(Course other){
if(other instanceof Course) {
if(this.getNumber() == other.getNumber()){
return true;
}
}
return false;
}
//toString
public String toString(){
return "\nUnits: " + getUnits() + "\nCourse Name: " + getName() + "\nCourse Number: " + getNumber() + "\nPreRequisite: " + getPreRequisite().getName() +
"\nSection: " + getSection() + "\nInstructor " + getInstructor();
}
//compareTo
public int compareTo(Course other){
if(other instanceof Course){
if(this.getNumber() < other.getNumber()){
return -1;
}
else if(this.getNumber() > other.getNumber()){
return 1;
}
else{
return 0;
}
}
else{
//returns -2 because it is not an instanceof
return -2;
}
}
} | [
"rajveemodi21@gmail.com"
] | rajveemodi21@gmail.com |
299835c4307a5347ed2a122f561cbb883627d9e4 | 08391963f0e55aacdf8b8cd307b8d28753f8b570 | /app/src/main/java/com/anita/anitamotorcycle/activities/GetLocationActivity.java | 02c69e29e07d2422e7bbc92a4bfd02d6dd4bb861 | [] | no_license | domarshmello/AnitaMotorcycle | ba65794f118c7b01fc35a7dfbc1a081b0ec67597 | 5f9a1c0f8d4cca7e6ca06ecf4c3af143a9d1bbc1 | refs/heads/master | 2022-04-27T18:28:42.853772 | 2020-04-27T13:23:09 | 2020-04-27T13:23:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,558 | java | package com.anita.anitamotorcycle.activities;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import com.anita.anitamotorcycle.R;
import com.anita.anitamotorcycle.helps.MotorHelper;
import com.anita.anitamotorcycle.utils.PermissionUtils;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.MapStatus;
import com.baidu.mapapi.map.MapStatusUpdate;
import com.baidu.mapapi.map.MapStatusUpdateFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.MyLocationData;
import com.baidu.mapapi.model.LatLng;
import com.hb.dialog.dialog.ConfirmDialog;
public class GetLocationActivity extends AppCompatActivity {
private String mLocation = "定位";
private static final String TAG = "LocationActivity";
MapView mMapView = null;
BaiduMap mBaiduMap;
private ImageView mSaLocation;
LocationClient mLocClient;
private LatLng latLng;
boolean isFirstLoc = true; // 是否首次定位
public MyLocationListenner myListener = new MyLocationListenner();
private ImageView mIv_back;
private TextView mTv_position;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_location);
Log.d(TAG, "onCreate: 测试1");
mMapView = findViewById(R.id.bmapView);
mIv_back = findViewById(R.id.iv_location_back);
mMapView = findViewById(R.id.bmapView);
mSaLocation = findViewById(R.id.sa_location);
mTv_position = findViewById(R.id.tv_position);
PermissionUtils.getGPSPermission1(this);
Log.d(TAG, "onCreate: 测试2");
requestLocation();
initListener();
}
private void requestLocation() {
mBaiduMap = mMapView.getMap();
// 开启定位图层
mBaiduMap.setMyLocationEnabled(true);
// 定位初始化
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true); // 打开gps
option.setIsNeedAddress(true);
option.setCoorType("bd09ll"); // 设置坐标类型
option.setScanSpan(1000);//可选,设置的扫描间隔,单位是毫秒,设置发起定位请求的间隔需要大于等于1000ms才是有效的
option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);//可选,默认高精度,设置定位模式,高精度,低功耗,仅设备
option.setNeedDeviceDirect(true);//在网络定位时,是否需要设备方向- true:需要 ; false:不需要。默认为false
option.SetIgnoreCacheException(false);//可选,默认false,设置是否收集CRASH信息,默认收集
option.setIgnoreKillProcess(false);//可选,默认true,定位SDK内部是一个SERVICE,并放到了独立进程,设置是否在stop的时候杀死这个进程,默认不杀死
option.setIsNeedLocationDescribe(true);//可选,默认false,设置是否需要位置语义化结果,可以在BDLocation
mLocClient.setLocOption(option);
mLocClient.start();
Log.d(TAG, "onCreate: 测试3");
}
private void initListener() {
mIv_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.putExtra("location", mLocation);
Log.i("location:", mLocation);
setResult(1001, intent);
finish();//关闭当前activity并返回刚才跳到这里的activity(只有使用了这个方法onActivityResult才会起作用)
}
});
mSaLocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//把定位点再次显现出来
MapStatusUpdate mapStatusUpdate = MapStatusUpdateFactory.newLatLng(latLng);
mBaiduMap.animateMapStatus(mapStatusUpdate);
}
});
Log.d(TAG, "initListener: 测试4");
}
/**
* 定位SDK监听函数
*/
public class MyLocationListenner extends BDAbstractLocationListener {
@Override
public void onReceiveLocation(BDLocation location) {
Log.d(TAG, "onCreate: 测试5");
// map view 销毁后不在处理新接收的位置
if (location == null || mMapView == null) {
return;
}
latLng = new LatLng(location.getLatitude(), location.getLongitude());
MyLocationData locData = new MyLocationData.Builder()
.accuracy(location.getRadius())
// 此处设置开发者获取到的方向信息,顺时针0-360
.direction(100).latitude(location.getLatitude())
.longitude(location.getLongitude()).build();
mBaiduMap.setMyLocationData(locData);
if (isFirstLoc) {
Log.d(TAG, "onCreate: 测试6");
isFirstLoc = false;
LatLng ll = new LatLng(location.getLatitude(),
location.getLongitude());
MapStatus.Builder builder = new MapStatus.Builder();
builder.target(ll).zoom(18.0f);
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}
if (location.getLocType() == BDLocation.TypeGpsLocation) {// GPS定位结果
Log.d(TAG, "onReceiveLocation: GPS定位结果--" + location.getAddrStr());
} else if (location.getLocType() == BDLocation.TypeNetWorkLocation) {// 网络定位结果
Log.d(TAG, "onReceiveLocation: 网络定位结果" + location.getAddrStr());
} else if (location.getLocType() == BDLocation.TypeOffLineLocation) {// 离线定位结果
Log.d(TAG, "onReceiveLocation: 离线定位结果" + location.getAddrStr());
} else if (location.getLocType() == BDLocation.TypeServerError) {//服务器错误
Toast.makeText(GetLocationActivity.this, "服务器错误,请检查", Toast.LENGTH_SHORT).show();
} else if (location.getLocType() == BDLocation.TypeNetWorkException) {//网络错误
Toast.makeText(GetLocationActivity.this, "网络错误,请检查", Toast.LENGTH_SHORT).show();
} else if (location.getLocType() == BDLocation.TypeCriteriaException) {//手机模式错误
Toast.makeText(GetLocationActivity.this, "手机模式错误,请检查是否飞行", Toast.LENGTH_SHORT).show();
}
mLocation = location.getAddrStr();
if (mLocation != null) {
mTv_position.setText("当前定位:" + mLocation);
Log.d(TAG, "onReceiveLocation当前定位: " + mLocation);
// 更新摩托车定位标记
}
}
public void onReceivePoi(BDLocation poiLocation) {
}
}
/**
* 动态获取定位权限的回调
*
* @param requestCode
* @param permissions
* @param grantResults
*/
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
Log.d(TAG, "onRequestPermissionsResult:动态获取定位权限的回调 ");
if (requestCode == 200) {
//判断结果
if (grantResults.length == 5 && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED && grantResults[2] == PackageManager.PERMISSION_GRANTED && grantResults[3] == PackageManager.PERMISSION_GRANTED && grantResults[4] == PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "has permissions..");
//有权限
requestLocation();
} else {
Log.d(TAG, "no permissionS...");
//没权限
// finish();
if (!ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_COARSE_LOCATION) && !ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION) && !ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.READ_PHONE_STATE) && !ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE) && !ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.READ_EXTERNAL_STORAGE)) {
//走到这里,说明用户之前用户禁止权限的同时,勾选了不再询问
//那么,你需要弹出一个dialog,提示用户需要权限,然后跳转到设置里头去打开。
Log.d(TAG, "用户之前勾选了不再询问...");
//TODO:弹出一个框框,然后提示用户说需要开启权限。
showComfirmDialog();
} else {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, 200);
//请求权限
Log.d(TAG, "请求权限...");
}
}
}
}
private void showComfirmDialog() {
ConfirmDialog confirmDialog = new ConfirmDialog(this);
confirmDialog.setLogoImg(R.mipmap.dialog_notice).setMsg("勾选了不再询问,需先到请到手机设置里开启相应权限");
confirmDialog.setClickListener(new ConfirmDialog.OnBtnClickListener() {
@Override
public void ok() {
//TODO:用户点击确定的时候,跳转到设置里去
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getPackageName(), null);
intent.setData(uri);
//在activity结果范围的地方,再次检查是否有权限
startActivityForResult(intent, 200);
}
@Override
public void cancel() {
Toast.makeText(getApplicationContext(), "取消", Toast.LENGTH_LONG).show();
}
});
confirmDialog.show();
}
@Override
public void onBackPressed() {
super.onBackPressed();
Intent intent = new Intent();
intent.putExtra("location", mLocation);
Log.i("location:", mLocation);
setResult(1001, intent);
finish();//关闭当前activity并返回刚才跳到这里的activity(只有使用了这个方法onActivityResult才会起作用)
}
@Override
protected void onDestroy() {
Log.d(TAG, "onDestroy: ");
super.onDestroy();
//在activity执行onDestroy时执行mMapView.onDestroy(),实现地图生命周期管理
mLocClient.stop();
// 关闭定位图层
mBaiduMap.setMyLocationEnabled(false);
mMapView.onDestroy();
mMapView = null;
}
@Override
protected void onResume() {
Log.d(TAG, "onResume: ");
super.onResume();
//在activity执行onResume时执行mMapView. onResume (),实现地图生命周期管理
mMapView.onResume();
}
@Override
protected void onPause() {
Log.d(TAG, "onPause: ");
super.onPause();
//在activity执行onPause时执行mMapView. onPause (),实现地图生命周期管理
mMapView.onPause();
}
}
| [
"“zhouwzh@minstone.com.cn”"
] | “zhouwzh@minstone.com.cn” |
6382a02903c30bd5f0b357681382ba1862b8ff61 | dd80a584130ef1a0333429ba76c1cee0eb40df73 | /sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/exportgradle/GradleExportWizard.java | 29f88026ac7be92fd136e72224617d8e42e0099f | [
"BSD-3-Clause",
"EPL-1.0",
"MIT"
] | permissive | karunmatharu/Android-4.4-Pay-by-Data | 466f4e169ede13c5835424c78e8c30ce58f885c1 | fcb778e92d4aad525ef7a995660580f948d40bc9 | refs/heads/master | 2021-03-24T13:33:01.721868 | 2017-02-18T17:48:49 | 2017-02-18T17:48:49 | 81,847,777 | 0 | 2 | MIT | 2020-03-09T00:02:12 | 2017-02-13T16:47:00 | null | UTF-8 | Java | false | false | 3,556 | java | /*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
*
* 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 com.android.ide.eclipse.adt.internal.wizards.exportgradle;
import com.android.ide.eclipse.adt.AdtPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.ui.IExportWizard;
import org.eclipse.ui.IWorkbench;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
public class GradleExportWizard extends Wizard implements IExportWizard {
private ProjectSetupBuilder mBuilder = new ProjectSetupBuilder();
private ProjectSelectionPage mFirstPage;
private ConfirmationPage mSecondPage;
private FinalPage mFinalPage;
/**
* Creates buildfile.
*/
@Override
public boolean performFinish() {
if (mBuilder.canGenerate()) {
generateBuildfiles(mSecondPage);
getContainer().showPage(mFinalPage);
return false;
}
return true;
}
@Override
public void addPages() {
mFirstPage = new ProjectSelectionPage(mBuilder);
addPage(mFirstPage);
mSecondPage = new ConfirmationPage(mBuilder);
addPage(mSecondPage);
mFinalPage = new FinalPage(mBuilder);
addPage(mFinalPage);
}
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
setWindowTitle(ExportMessages.WindowTitle);
setNeedsProgressMonitor(true);
}
@Override
public boolean canFinish() {
return mBuilder.canFinish() || mBuilder.canGenerate();
}
/**
* Converts Eclipse Java projects to Gradle build files. Displays error dialogs.
*/
public boolean generateBuildfiles(final WizardPage page) {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor pm) throws InterruptedException {
Collection<GradleModule> modules = mBuilder.getModules();
final int count = modules.size();
SubMonitor localmonitor = SubMonitor.convert(pm, ExportMessages.StatusMessage,
count);
BuildFileCreator.createBuildFiles(
mBuilder,
page.getShell(),
localmonitor.newChild(count));
}
};
try {
getContainer().run(false, false, runnable);
} catch (InvocationTargetException e) {
AdtPlugin.log(e, null);
return false;
} catch (InterruptedException e) {
AdtPlugin.log(e, null);
return false;
}
if (page.getErrorMessage() != null) {
return false;
}
return true;
}
}
| [
"karun.matharu@gmail.com"
] | karun.matharu@gmail.com |
5e5b2860cad2ba76e1170daab5f75af2a0381bc0 | 053ece99ab96634d126690eb3c9f38a1ea245f43 | /app/src/main/java/com/cl/rkm_hdmi_display/SharedPreferencesUtils.java | 26b59d9d2752bb041d96029a72fc127021b3383b | [] | no_license | Jokermaycry/launcher_tianlai | f4ec4c103dc15748ae7f564e820e0bd6f39d560b | 67156935940fd8323b681ed74cedc4be6f724789 | refs/heads/master | 2020-05-30T06:11:22.491309 | 2019-05-31T09:49:32 | 2019-05-31T09:49:32 | 189,570,011 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,729 | java | package com.cl.rkm_hdmi_display;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.wifi.WifiConfiguration;
public class SharedPreferencesUtils {
private static SharedPreferences preferences;
private static final String PREFS_NAME = "com.xin_ui.main";
private static int MODE = Context.MODE_WORLD_READABLE|Context.MODE_WORLD_WRITEABLE;
public SharedPreferencesUtils(Context context) {
}
public static void save(Context context, String key, String value) {
preferences = context
.getSharedPreferences(PREFS_NAME, MODE);
Editor editor = preferences.edit();
editor.putString(key, value);
editor.commit();
}
public static String get(Context context, String key) {
preferences = context
.getSharedPreferences(PREFS_NAME,MODE);
return preferences.getString(key, null);
}
//��һ���Dz鿴��û�����Keyû�еĻ�������Ĭ��false�� ��ִ������������set�����������ִ���������������ҵ�����ص�Key�ͻ�õ����Key��ֵ��
public static boolean getSplash(Context context, String key) {
preferences = context
.getSharedPreferences(PREFS_NAME,MODE);
return preferences.getBoolean(key, false);
}
//��һ��key���ٸ�key����һ��ֵ��Ϊ������IJ���key��ֵ����д�ġ�
public static void setSplash(Context context, String key, boolean value) {
preferences = context
.getSharedPreferences(PREFS_NAME, MODE);
Editor editor = preferences.edit();
editor.putBoolean(key, value);
editor.commit();
}
public static void setData(Context context,String key,String value){
preferences = context
.getSharedPreferences(PREFS_NAME,MODE);
Editor editor = preferences.edit();
editor.putString(key, value);
editor.commit();
}
public static String getData(Context context,String key){
preferences = context.
getSharedPreferences(PREFS_NAME, MODE);
return preferences.getString(key, null);
}
public static void setsum(Context context,String key,int value){
preferences = context
.getSharedPreferences(PREFS_NAME,MODE);
Editor editor = preferences.edit();
editor.putInt(key, value);
editor.commit();
}
public static int getsum(Context context,String key){
preferences = context
.getSharedPreferences(PREFS_NAME, MODE);
return preferences.getInt(key, 0);
}
public static void ClearData(Context context){
preferences = context
.getSharedPreferences(PREFS_NAME,MODE);
Editor editor = preferences.edit();
editor.clear();
editor.commit();
}
} | [
"2468180203@qq.com"
] | 2468180203@qq.com |
b7dbcd86013d07c757344492e4d03ae424209e4c | 03f247035e56c01ddff04d84150611f53554d6de | /pet-clinic-data/src/main/java/ferralucho/springframework/sfgpetclinic/services/map/VetServiceMap.java | d6f66c20b5b81cba50aa13da8cbaede99a048a7a | [
"MIT"
] | permissive | ferralucho/Spring-Pet-Clinic | f60631bb14e265f3c097fa0d4194f16f2c0ad5c2 | 6e9f743687cd1397c62c2e192f4b9283e1d08e5e | refs/heads/master | 2020-04-11T01:21:35.830278 | 2019-02-05T02:04:52 | 2019-02-05T02:04:52 | 161,412,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,549 | java | package ferralucho.springframework.sfgpetclinic.services.map;
import ferralucho.springframework.sfgpetclinic.model.Speciality;
import ferralucho.springframework.sfgpetclinic.model.Vet;
import ferralucho.springframework.sfgpetclinic.services.SpecialtyService;
import ferralucho.springframework.sfgpetclinic.services.VetService;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import java.util.Set;
@Service
@Profile({"default", "map"})
public class VetServiceMap extends AbstractMapService<Vet, Long> implements VetService {
private final SpecialtyService specialtyService;
public VetServiceMap(SpecialtyService specialtyService) {
this.specialtyService = specialtyService;
}
@Override
public Set<Vet> findAll() {
return super.findAll();
}
@Override
public void deleteById(Long id) {
super.deleteById(id);
}
@Override
public void delete(Vet object) {
super.delete(object);
}
@Override
public Vet save(Vet object) {
if (object.getSpecialities().size() > 0){
object.getSpecialities().forEach(speciality -> {
if(speciality.getId() == null){
Speciality savedSpecialty = specialtyService.save(speciality);
speciality.setId(savedSpecialty.getId());
}
});
}
return super.save(object);
}
@Override
public Vet findById(Long id) {
return super.findById(id);
}
}
| [
"lucianodarioferrari@gmail.com"
] | lucianodarioferrari@gmail.com |
19643195044f923f83c186c997ce779f913becaa | e2dc570266b4621da5f5fe0d6db7fcd0a727146a | /nestrefresh/src/main/java/com/todou/nestrefresh/material/resources/NRCancelableFontCallback.java | 42a80146169e25948e021de12b07ca5f6246b319 | [
"Apache-2.0"
] | permissive | csh159/nestrefresh | 37bc13f8b5a35505f87aa4bc62a22ded51d4bd17 | 7eb9766a8e40d290c45cfd30df5a719f86e698a2 | refs/heads/master | 2020-06-15T15:21:20.157704 | 2019-06-28T14:04:24 | 2019-06-28T14:04:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,346 | java | package com.todou.nestrefresh.material.resources;
import android.graphics.Typeface;
import com.todou.nestrefresh.material.TextAppearanceFontCallback;
public final class NRCancelableFontCallback extends TextAppearanceFontCallback {
/** Functional interface for method to call when font is retrieved (or fails with fallback). */
public interface ApplyFont {
void apply(Typeface font);
}
private final Typeface fallbackFont;
private final ApplyFont applyFont;
private boolean cancelled;
public NRCancelableFontCallback(ApplyFont applyFont, Typeface fallbackFont) {
this.fallbackFont = fallbackFont;
this.applyFont = applyFont;
}
@Override
public void onFontRetrieved(Typeface font, boolean fontResolvedSynchronously) {
updateIfNotCancelled(font);
}
@Override
public void onFontRetrievalFailed(int reason) {
updateIfNotCancelled(fallbackFont);
}
/**
* Cancels this callback. No async operations will actually be interrupted as a result of this
* method, but it will ignore any subsequent result of the fetch.
*
* <p>Callback cannot be resumed after canceling. New callback has to be created.
*/
public void cancel() {
cancelled = true;
}
private void updateIfNotCancelled(Typeface updatedFont) {
if (!cancelled) {
applyFont.apply(updatedFont);
}
}
}
| [
"yytodou123@gmail.com"
] | yytodou123@gmail.com |
cc68c9bf85066bdcbbaf9797b29d29c79229748e | c19cb77e3958a194046d6f84ca97547cc3a223c3 | /pkix/src/main/java/org/bouncycastle/cms/CMSSignatureEncryptionAlgorithmFinder.java | b1cd91fd53a414ceb24744dbd842ee4c1c2c3eba | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | bcgit/bc-java | 1b6092bc5d2336ec26ebd6da6eeaea6600b4c70a | 62b03c0f704ebd243fe5f2d701aef4edd77bba6e | refs/heads/main | 2023-09-04T00:48:33.995258 | 2023-08-30T05:33:42 | 2023-08-30T05:33:42 | 10,416,648 | 1,984 | 1,021 | MIT | 2023-08-26T05:14:28 | 2013-06-01T02:38:42 | Java | UTF-8 | Java | false | false | 723 | java | package org.bouncycastle.cms;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
/**
* Finder which is used to look up the algorithm identifiers representing the encryption algorithms that
* are associated with a particular signature algorithm.
*/
public interface CMSSignatureEncryptionAlgorithmFinder
{
/**
* Return the encryption algorithm identifier associated with the passed in signatureAlgorithm
* @param signatureAlgorithm the algorithm identifier of the signature of interest
* @return the algorithm identifier to be associated with the encryption algorithm used in signature creation.
*/
AlgorithmIdentifier findEncryptionAlgorithm(AlgorithmIdentifier signatureAlgorithm);
}
| [
"dgh@cryptoworkshop.com"
] | dgh@cryptoworkshop.com |
64660d762ac5b64f05f7ea2976b12bae8b9ce912 | acf26d65e54b6bebe663dacf8677f7178be8724e | /app/src/main/java/com/qooplite/alpay/cryptolab/VerschluesselnActivity.java | e1ec3e10af14da803e5573b9860d57c8514ff076 | [] | no_license | WeCyberFacility/CryptoLab | 53f70b4ddc600e756dd5838bdc696c919933e9fd | be96bb3f37be4786d8787a95156297476cb91193 | refs/heads/master | 2020-04-10T19:45:59.018060 | 2019-07-12T20:55:18 | 2019-07-12T20:55:18 | 161,246,290 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69,946 | java | package com.qooplite.alpay.cryptolab;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
public class VerschluesselnActivity extends AppCompatActivity {
public static Verschluesselung currentVerschluesselung;
//Alle GUI Elemente deklarieren:
TextView namever;
ImageView stern1;
ImageView stern2;
ImageView stern3;
ImageView stern4;
ImageView stern5;
ImageView infoVer;
EditText inputTxt1;
EditText inputTxt2;
EditText inputTxt3;
EditText inputTxt4;
EditText outputTxt;
ImageView verschluesselnBtn;
ArrayList<ImageView> sterne = new ArrayList<>();
ArrayList<EditText> inputs = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_verschluesseln);
hideSystemUI();
namever = findViewById(R.id.nameec);
stern1 = findViewById(R.id.stern1ec);
stern2 = findViewById(R.id.stern2ec);
stern3 = findViewById(R.id.stern3ec);
stern4 = findViewById(R.id.stern4ec);
stern5 = findViewById(R.id.stern5ec);
verschluesselnBtn = findViewById(R.id.verschluesselnbtn);
inputTxt1 = findViewById(R.id.input1txt);
inputTxt2 = findViewById(R.id.input2txt);
inputTxt3 = findViewById(R.id.input3txt);
inputTxt4 = findViewById(R.id.input4txt);
outputTxt = findViewById(R.id.outputtxtec);
infoVer = findViewById(R.id.infoversc);
sterne.add(stern1);
sterne.add(stern2);
sterne.add(stern3);
sterne.add(stern4);
sterne.add(stern5);
inputs.add(inputTxt1);
inputs.add(inputTxt2);
inputs.add(inputTxt3);
inputs.add(inputTxt4);
infoLaden();
inputsLaden();
final Dialog infoDialog;
infoDialog = new Dialog(this);
infoDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
infoDialog.setContentView(R.layout.verschluesselunginfolayout);
infoDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
final TextView infoName = infoDialog.findViewById(R.id.nameinfo);
final TextView infotext = infoDialog.findViewById(R.id.infotext);
final TextView infoinputtext = infoDialog.findViewById(R.id.inputtext);
final TextView infoputputtext = infoDialog.findViewById(R.id.outputtext);
infoVer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
infoName.setText(currentVerschluesselung.getName().toString().trim());
infotext.setText(currentVerschluesselung.getBeschreibung().toString().trim());
infoinputtext.setText(currentVerschluesselung.getInput().toString().trim());
infoputputtext.setText(currentVerschluesselung.getOutput().toString().trim());
infoDialog.show();
}
});
//clickListener:
verschluesselnBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
boolean fehltwas = false;
for(EditText currentET : inputs) {
if(currentET.getVisibility() == View.VISIBLE) {
if(inputTxt1.getText().toString().trim().equals("")) {
fehltwas = true;
break;
} else {
continue;
}
}
}
if(fehltwas) {
Toast.makeText(VerschluesselnActivity.this, "Please fill in all required inputs!", Toast.LENGTH_SHORT).show();
} else {
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate);
verschluesselnBtn.startAnimation(animation);
try {
verschluesseln(currentVerschluesselung.getName());
}catch (Exception e) {
Toast.makeText(VerschluesselnActivity.this, "something went wrong .. please check your inputs!", Toast.LENGTH_SHORT).show();
}
}
}
});
}
public void infoLaden(){
namever.setText(currentVerschluesselung.getName());
for(int h = 0; h<currentVerschluesselung.getSicherheitslevel(); h++){
sterne.get(h).setImageResource(R.mipmap.sternvoll);
}
}
public void inputsLaden(){
for(int i = currentVerschluesselung.getAnzahlInputs(); i<4; i++) {
inputs.get(i).setVisibility(View.INVISIBLE);
}
}
public void hideSystemUI(){
this.getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
public void verschluesseln(String verschluesselungsName) {
switch (verschluesselungsName) {
case "XOR":
outputTxt.setText(XOR(inputTxt1.getText().toString(), inputTxt2.getText().toString()));
break;
case "Modulo":
outputTxt.setText(Modulo(Integer.parseInt(inputTxt1.getText().toString()), Integer.parseInt(inputTxt2.getText().toString())));
break;
case "Faktorization":
outputTxt.setText(Faktorisierung(Integer.parseInt(inputTxt1.getText().toString())));
break;
case "Vignere":
outputTxt.setText(Vignere(inputTxt1.getText().toString(), inputTxt2.getText().toString()));
break;
case "DES Key-Schedule":
outputTxt.setText(getRoundKey(Integer.parseInt(inputTxt1.getText().toString()), inputTxt2.getText().toString()));
break;
case "DES R-Block":
outputTxt.setText(getRBlockAfterRounds(inputTxt1.getText().toString(), Integer.parseInt(inputTxt2.getText().toString())));
break;
case "DES Feistel":
outputTxt.setText(feistelFunktion(inputTxt1.getText().toString(), inputTxt2.getText().toString()));
break;
case "DES Round":
outputTxt.setText(eineKompletteRunde(inputTxt1.getText().toString(), inputTxt2.getText().toString(),inputTxt3.getText().toString(), Integer.parseInt(inputTxt4.getText().toString())));
break;
case "AES GF8":
outputTxt.setText(hexMultiplikation(inputTxt1.getText().toString(), inputTxt2.getText().toString()));
break;
case "AES Key-Expansion":
outputTxt.setText(KeyExpansion(inputTxt1.getText().toString()));
break;
case "AES Mix-Columns":
outputTxt.setText(MixColumns(inputTxt1.getText().toString()));
break;
case "AES Transformation":
outputTxt.setText(AESTransformation(inputTxt1.getText().toString()));
break;
case "AES 3-Rounds":
outputTxt.setText( AESDreiRunden(inputTxt1.getText().toString(), inputTxt2.getText().toString(), inputTxt3.getText().toString()));
break;
case "RC4 Loop":
outputTxt.setText(RC4Loop(inputTxt1.getText().toString(), inputTxt2.getText().toString()));
break;
case "RC4 Key-Schedule":
outputTxt.setText(RC4KeySchedule(inputTxt1.getText().toString()));
break;
case "RC4 Encryption":
outputTxt.setText(RC4Verschluesselung(inputTxt1.getText().toString(), inputTxt2.getText().toString()));
break;
default:System.out.println("Verschlüsselung nicht gefunden!");
}
}
//Verschluesselungsmethoden:
public String XOR(String ersterString, String zweiterString){
if(ersterString.length() != zweiterString.length()) {
if(ersterString.length() > zweiterString.length()) {
while(ersterString.length() != zweiterString.length()) {
zweiterString = "0" + zweiterString;
}
} else {
while(ersterString.length() != zweiterString.length()) {
ersterString = "0" + ersterString;
}
}
//System.out.println("0 addiert!");
}
String bitStringEins = "";
String bitStringZwei = "";
for(int i = 0; i<ersterString.length(); i++) {
bitStringEins = bitStringEins + HexToBit(Character.toString(ersterString.charAt(i)));
}
for(int i = 0; i<ersterString.length(); i++) {
bitStringZwei = bitStringZwei + HexToBit(Character.toString(zweiterString.charAt(i)));
}
String xorString = "";
for(int j = 0; j<bitStringEins.length(); j++) {
String currentBit1 = Character.toString(bitStringEins.charAt(j));
String currentBit2 = Character.toString(bitStringZwei.charAt(j));
if(currentBit1.equals(currentBit2)) {
xorString = xorString + "0";
continue;
} else {
xorString = xorString + "1";
continue;
}
}
return xorString;
}
public String XORBits(String bitEins, String bitZwei) {
String xorString = "";
for(int j = 0; j<bitEins.length(); j++) {
String currentBit1 = Character.toString(bitEins.charAt(j));
String currentBit2 = Character.toString(bitZwei.charAt(j));
if(currentBit1.equals(currentBit2)) {
xorString = xorString + "0";
continue;
} else {
xorString = xorString + "1";
continue;
}
}
return xorString;
}
public String HexToBit(String hexzahl){
String noll = "0000";
String eins = "0001";
String zwei = "0010";
String drei = "0011";
String vier = "0100";
String fünf = "0101";
String sechs = "0110";
String sieben = "0111";
String acht = "1000";
String neun = "1001";
String a = "1010";
String b = "1011";
String c = "1100";
String d = "1101";
String e = "1110";
String f = "1111";
String Anoll = "0";
String Aeins = "1";
String Azwei = "2";
String Adrei = "3";
String Avier = "4";
String Afünf = "5";
String Asechs = "6";
String Asieben = "7";
String Aacht = "8";
String Aneun = "9";
String Aa = "a";
String Ab = "b";
String Ac = "c";
String Ad = "d";
String Ae = "e";
String Af = "f";
HashMap<String, String> mappingTabelle = new HashMap<>();
mappingTabelle.put(Anoll, noll);
mappingTabelle.put(Aeins, eins);
mappingTabelle.put(Azwei, zwei);
mappingTabelle.put(Adrei, drei);
mappingTabelle.put(Avier, vier);
mappingTabelle.put(Afünf, fünf);
mappingTabelle.put(Asechs, sechs);
mappingTabelle.put(Asieben, sieben);
mappingTabelle.put(Aacht, acht);
mappingTabelle.put(Aneun, neun);
mappingTabelle.put(Aa, a);
mappingTabelle.put(Ab, b);
mappingTabelle.put(Ac, c);
mappingTabelle.put(Ad, d);
mappingTabelle.put(Ae, e);
mappingTabelle.put(Af, f);
return mappingTabelle.get(hexzahl);
}
public String Modulo(int zahl1, int zahl2){
if(zahl1 < zahl2) {
return String.valueOf(zahl1);
} else if(zahl1 == zahl2) {
return "0";
} else {
int zwischenSumme = zahl1;
while(zwischenSumme > zahl2) {
zwischenSumme = zwischenSumme - zahl2;
}
return String.valueOf(zwischenSumme);
}
}
public String Faktorisierung(int zahl1){
ArrayList<Integer> primzahlenListe = isPrim(zahl1);
int counter = 0;
String output = "";
for(int i = primzahlenListe.size()-1; i>=0; i--) {
if(zahl1<=1) {
break;
} else {
while (zahl1 % primzahlenListe.get(i) == 0) {
zahl1 = zahl1 / primzahlenListe.get(i);
if(counter == 0) {
output = output + String.valueOf(primzahlenListe.get(i));
} else {
output = output + "*" + String.valueOf(primzahlenListe.get(i));
}
counter++;
}
}
}
return output;
}
public ArrayList<Integer> isPrim(int in) {
ArrayList<Integer> primZahlenBisZahl = new ArrayList<>();
int a = in;
for ( int i = in ;i>0;i--) {
int c = 1;
int d =0;
for (int t = i;t >0;t--) {
if(d>2 ) {
break;
}
if(i %c==0) {
d++;
}
c++;
}
if(d == 2 ) {
primZahlenBisZahl.add(i);
}else {
}
}
return primZahlenBisZahl;
}
//--------------------------------
public String Vignere(String chiffreText, String Key){
String[] BuchstabenArray = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
String[] keyArray = WortInStringArray(Key);
String loesung = "";
for(int i = 0; i<chiffreText.length(); i++) {
String currentBuchstabe = String.valueOf(chiffreText.charAt(i));
int verschiebungsZahl = sucheVerschiebungsZahl(BuchstabenArray, keyArray[i%keyArray.length]);
String[] verschobenesArray = verschiebeArray(verschiebungsZahl);
int positionVonChiffreTextBuchstaben = sucheVerschiebungsZahl(verschobenesArray, currentBuchstabe.toLowerCase());
loesung = loesung + BuchstabenArray[positionVonChiffreTextBuchstaben];
}
return loesung;
}
public String[] WortInStringArray(String wort){
String[] wortArray = new String[wort.length()];
for(int i = 0; i<wort.length(); i++){
wortArray[i] =String.valueOf(wort.charAt(i));
}
return wortArray;
}
public int sucheVerschiebungsZahl(String[] array, String buchstabe) {
int zahl = 0;
for(int i = 0; i<array.length; i++) {
if(buchstabe.equals(array[i])) {
zahl = i;
break;
}
}
return zahl;
}
public String[] verschiebeArray(int verschiebungszahl) {
String[] BuchstabenArray = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
String[] verschobenesArray = new String[BuchstabenArray.length];
for(int i = 0; i<BuchstabenArray.length; i++) {
verschobenesArray[i] = BuchstabenArray[(i+verschiebungszahl)%BuchstabenArray.length];
}
return verschobenesArray;
}
public String roundKey(String key, int anzahlRunden){
HashMap<Integer, Integer> VerschiebungsMap = new HashMap<>();
VerschiebungsMap.put(1, 1);
VerschiebungsMap.put(2, 1);
VerschiebungsMap.put(3, 2);
VerschiebungsMap.put(4, 2);
VerschiebungsMap.put(5, 2);
VerschiebungsMap.put(6, 2);
VerschiebungsMap.put(7, 2);
VerschiebungsMap.put(8, 2);
VerschiebungsMap.put(9, 1);
VerschiebungsMap.put(10, 2);
VerschiebungsMap.put(11, 2);
VerschiebungsMap.put(12, 2);
VerschiebungsMap.put(13, 2);
VerschiebungsMap.put(14, 2);
VerschiebungsMap.put(15, 2);
VerschiebungsMap.put(16, 1);
String cBlock = cBlockKriegen(key);
String dBlock = dBlockKriegen(key);
int anzahlVerschiebungen = 0;
for(int i = 1; i<=anzahlRunden; i++) {
anzahlVerschiebungen = anzahlVerschiebungen + VerschiebungsMap.get(i);
}
String[] cBlockArray = verschiebeArray(WortInStringArray(cBlock), anzahlVerschiebungen);
String[] dBlockArray = verschiebeArray(WortInStringArray(dBlock), anzahlVerschiebungen);
String solution = "";
for(int h = 0; h<cBlockArray.length; h++) {
solution = solution + cBlockArray[h];
}
for(int h = 0; h<dBlockArray.length; h++) {
solution = solution + cBlockArray[h];
}
return Permutation(solution);
}
public String[] verschiebeArray(String[] anfangsArray, int verschiebungszahl) {
String[] verschobenesArray = new String[anfangsArray.length];
for(int i = 0; i<verschobenesArray.length; i++) {
verschobenesArray[i] = anfangsArray[(i+verschiebungszahl)%anfangsArray.length];
}
System.out.println(Arrays.toString(verschobenesArray));
return verschobenesArray;
}
public String cBlockKriegen(String bit){
String[] bitArray = WortInStringArray(bit);
Integer[][] KeyScheduleMatrx = new Integer[8][8];
int counter = 1;
for(int i = 0; i<KeyScheduleMatrx.length; i++) {
for(int j = 0; j<KeyScheduleMatrx[i].length; j++) {
KeyScheduleMatrx[i][j] = counter;
counter++;
}
}
matrixAnzeigen(KeyScheduleMatrx);
int anzahlBits = 0;
int counterr = 0;
Integer[] Cblock = new Integer[28];
for(int i = 7; i>=0; i--) {
Cblock[counterr] = KeyScheduleMatrx[i][0];
counterr++;
}
for(int i = 7; i>=0; i--) {
Cblock[counterr] = KeyScheduleMatrx[i][1];
counterr++;
}
for(int i = 7; i>=0; i--) {
Cblock[counterr] = KeyScheduleMatrx[i][2];
counterr++;
}
for(int i = 7; i>=4; i--) {
Cblock[counterr] = KeyScheduleMatrx[i][3];
counterr++;
}
String cBlockBit = "";
for(int j = 0; j<Cblock.length; j++) {
cBlockBit = cBlockBit + ( WortInStringArray(bit)[Cblock[j] - 1] );
}
return cBlockBit;
}
public String dBlockKriegen(String bit){
String[] bitArray = WortInStringArray(bit);
Integer[][] KeyScheduleMatrx = new Integer[8][8];
int counter = 1;
for(int i = 0; i<KeyScheduleMatrx.length; i++) {
for(int j = 0; j<KeyScheduleMatrx[i].length; j++) {
KeyScheduleMatrx[i][j] = counter;
counter++;
}
}
int counterr = 0;
Integer[] DBlock = new Integer[28];
for(int i = 7; i>=0; i--) {
DBlock[counterr] = KeyScheduleMatrx[i][6];
counterr++;
}
for(int i = 7; i>=0; i--) {
DBlock[counterr] = KeyScheduleMatrx[i][5];
counterr++;
}
for(int i = 7; i>=0; i--) {
DBlock[counterr] = KeyScheduleMatrx[i][4];
counterr++;
}
for(int i = 3; i>=0; i--) {
DBlock[counterr] = KeyScheduleMatrx[i][3];
counterr++;
}
String DBlockBit = "";
for(int j = 0; j<DBlock.length; j++) {
DBlockBit = DBlockBit + ( WortInStringArray(bit)[DBlock[j] - 1] );
}
return DBlockBit;
}
public void matrixAnzeigen(Integer[][] matrix){
for(int i = 0; i<matrix.length; i++) {
}
}
public String Permutation(String rundenschluessel){
String[] rundenschluesselArray = WortInStringArray(rundenschluessel);
String output = "";
Integer[] permutationTable = new Integer[] {14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8,
16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48,
44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32};
for(int j = 0; j<permutationTable.length; j++) {
output = output + rundenschluesselArray[permutationTable[j] - 1];
}
return output;
}
public int anzahlVerschiebungen(int rounds) {
HashMap<Integer, Integer> VerschiebungsMap = new HashMap<>();
VerschiebungsMap.put(1, 1);
VerschiebungsMap.put(2, 1);
VerschiebungsMap.put(3, 2);
VerschiebungsMap.put(4, 2);
VerschiebungsMap.put(5, 2);
VerschiebungsMap.put(6, 2);
VerschiebungsMap.put(7, 2);
VerschiebungsMap.put(8, 2);
VerschiebungsMap.put(9, 1);
VerschiebungsMap.put(10, 2);
VerschiebungsMap.put(11, 2);
VerschiebungsMap.put(12, 2);
VerschiebungsMap.put(13, 2);
VerschiebungsMap.put(14, 2);
VerschiebungsMap.put(15, 2);
VerschiebungsMap.put(16, 1);
int anzahlVerschiebungen = 0;
for(int i = 1; i<=rounds; i++) {
anzahlVerschiebungen = anzahlVerschiebungen + VerschiebungsMap.get(i);
}
return anzahlVerschiebungen;
}
public String getRoundKey(int round, String key) {
int leftShiftscounter = anzahlVerschiebungen(round);
String blocksTogether = "";
String cBlock= cBlockKriegen(key);
String dBlock = dBlockKriegen(key);
String cBlockShifted="";
String dBlockShifted = "";
String roundKey="";
for(int i = 0; i<cBlock.length();i++) {
cBlockShifted = cBlockShifted + cBlock.charAt((leftShiftscounter+i)%cBlock.length());
dBlockShifted = dBlockShifted + dBlock.charAt((leftShiftscounter+i)%dBlock.length());
}
blocksTogether = cBlockShifted+dBlockShifted;
int [][] pc2 = new int [][] {{13,16,10,23,0,4},
{2,27,14,5,20,9},
{22,18,11,3,25,7},
{15,6,26,19,12,1},
{40,51,30,36,46,54},
{29,39,50,44,32,47},
{43,48,38,55,33,52},
{45,41,49,35,28,31}};
for(int p = 0; p<pc2.length;p++) {
for ( int j = 0; j<pc2[p].length;j++) {
roundKey = roundKey + blocksTogether.charAt(pc2[p][j]);
}
}
return roundKey;
}
public String getRBlockAfterRounds(String klartext, int runde){
String ausgabe = "";
ArrayList<String> ausgabeArray = new ArrayList<>();
for(int i = 1; i<=runde; i++) {
if(i == 1) {
ausgabeArray = ersteRundeBerechnen(klartext);
} else {
ausgabeArray = eineRundeBerechnenR(ausgabeArray.get(0), ausgabeArray.get(1));
}
}
return ausgabeArray.get(0);
}
public ArrayList<String> eineRundeBerechnenR(String rBlock, String lBlock){
ArrayList<String> sBoxenEingabe = AchterGruppenFuerSBoxenKriegen(DESexpansionE(rBlock));
String C = "";
ArrayList<Integer[][]> sBoxen = initialisieresBoxen();
int counter = 0;
for(String currentAchtergruppe : sBoxenEingabe) {
int vertikalIndex = sBoxVertikalIndexKriegen(currentAchtergruppe);
int horizontal = sBoxHorizontalIndexKriegen(currentAchtergruppe);
// System.out.println("SBox Wert: " + sBoxen.get(counter)[vertikalIndex][horizontal]);
C+= getBinary(sBoxen.get(counter)[vertikalIndex][horizontal]);
counter++;
}
// System.out.println("C: " + C + " lenght: " + C.length());
ArrayList<String> ausgabeArray = new ArrayList<>();
String desPermutation = DESPermutationNachSBox(C);
String l = rBlock;
String r = XORBits(lBlock, desPermutation);
String Ausgabe = l + r;
ausgabeArray.add(r);
ausgabeArray.add(l);
ausgabeArray.add(Ausgabe);
return ausgabeArray;
}
public ArrayList<String> ersteRundeBerechnen(String klarText){
String rBlock = rBlockaus64BitsKriegen(klarText);
String lBlock = lBlockaus64BitsKriegen(klarText);
//System.out.println("RBlock: " + rBlock);
// System.out.println("LBlock: " + lBlock);
String desXorKey = XORBits(DESexpansionE(rBlock), nullKey());
//System.out.println("DES XOR 48Bit KEY: " + desXorKey);
ArrayList<String> sBoxenEingabe = AchterGruppenFuerSBoxenKriegen(DESexpansionE(rBlock));
String C = "";
ArrayList<Integer[][]> sBoxen = initialisieresBoxen();
int counter = 0;
for(String currentAchtergruppe : sBoxenEingabe) {
int vertikalIndex = sBoxVertikalIndexKriegen(currentAchtergruppe);
int horizontal = sBoxHorizontalIndexKriegen(currentAchtergruppe);
// System.out.println("SBox Wert: " + sBoxen.get(counter)[vertikalIndex][horizontal]);
C+= getBinary(sBoxen.get(counter)[vertikalIndex][horizontal]);
counter++;
}
// System.out.println("C: " + C + " lenght: " + C.length());
ArrayList<String> ausgabeArray = new ArrayList<>();
String desPermutation = DESPermutationNachSBox(C);
String l = rBlock;
String r = XORBits(lBlock, desPermutation);
String Ausgabe = l + r;
ausgabeArray.add(r);
ausgabeArray.add(l);
ausgabeArray.add(Ausgabe);
return ausgabeArray;
}
public String nullKey(){
String nullen = "";
for(int i = 1; i<=48; i++ ) {
nullen+="0";
}
// System.out.println("Nullen: " + nullen + " length: " + nullen.length());
return nullen;
}
public String rBlockaus64BitsKriegen(String klarText){
Integer[] RBlockReihenfolge = new Integer[]{57, 49, 41, 33, 25,17,9,1,59,51,43,35,27,19,11,3,61,53,45,37,29,21,13,5,63,55,47,39,31,23,15,7};
String rBlock = "";
for(int i = 0; i<RBlockReihenfolge.length; i++) {
rBlock += klarText.charAt(RBlockReihenfolge[i]-1);
}
return rBlock;
}
public String lBlockaus64BitsKriegen(String klarText){
Integer[] LBlockReihenfolge = new Integer[]{58,50,42,34,26,18,10,2,60,52,44,36,28,20,12,4,62,54,46,38,30,22,14,6,64,56,48,40,32,24,16,8};
String lBlock = "";
for(int i = 0; i<LBlockReihenfolge.length; i++) {
lBlock += klarText.charAt(LBlockReihenfolge[i]-1);
}
return lBlock;
}
public String DESexpansionE(String rBlock){
Integer[] desExpansionsReihenfolge = new Integer[]{32,1,2,3,4,5,4,5,6,7,8,9,8,9,
10,11,12,13,12,13,14,15,16,17,16
,17,18,19,20,21,20,21,22,23,24,25,
24,25,26,27,28,29,28,29,30,31,32,1};
String desexpansionR0 = "";
for(int i = 0; i<desExpansionsReihenfolge.length; i++) {
desexpansionR0 += rBlock.charAt(desExpansionsReihenfolge[i]-1);
}
// System.out.println("DES Expansion: " + desexpansionR0 + " lenght: " + desexpansionR0.length());
return desexpansionR0;
}
public String DESPermutationNachSBox(String rBlock){
Integer[] desExpansionsReihenfolge = new Integer[]{16,7,20,21,29,12,28,17,1,15,23,26,5,18,31,10,2,8,24,14,32,27,3,9,19,13,30,6,22,11,4,25};
String desPermutationC = "";
for(int i = 0; i<desExpansionsReihenfolge.length; i++) {
desPermutationC += rBlock.charAt(desExpansionsReihenfolge[i]-1);
}
return desPermutationC;
}
public ArrayList<String> AchterGruppenFuerSBoxenKriegen(String text){
String block1 = "";
String block2 = "";
String block3 = "";
String block4 = "";
String block5 = "";
String block6 = "";
String block7 = "";
String block8 = "";
for(int i = 0; i< text.length(); i++) {
if(i<6 && i>=0) {
block1+=text.charAt(i);
}
if(i<12 && i>=6) {
block2+=text.charAt(i);
}
if(i<18 && i>=12) {
block3+=text.charAt(i);
}
if(i<24 && i>=18) {
block4+=text.charAt(i);
}
if(i<30 && i>=24) {
block5+=text.charAt(i);
}
if(i<36 && i>=30) {
block6+=text.charAt(i);
}
if(i<42 && i>=36) {
block7+=text.charAt(i);
}
if(i<48 && i>=42) {
block8+=text.charAt(i);
}
}
/* System.out.print("" + block1);
System.out.print("|" + block2);
System.out.print("|" + block3);
System.out.print("|" + block4);
System.out.print("|" + block5);
System.out.print("|" + block6);
System.out.print("|" + block7);
System.out.print("|" + block8);
*/
ArrayList<String> achterGruppen = new ArrayList<>();
achterGruppen.add(block1);
achterGruppen.add(block2);
achterGruppen.add(block3);
achterGruppen.add(block4);
achterGruppen.add(block5);
achterGruppen.add(block6);
achterGruppen.add(block7);
achterGruppen.add(block8);
return achterGruppen;
}
public ArrayList<Integer[][]> initialisieresBoxen() {
Integer[][] sBox1 = new Integer[][] {{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7},
{0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8},
{4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0},
{15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13}};
Integer[][] sBox2 = new Integer[][] {{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 },
{3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5},
{0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15},
{13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9}};
Integer[][] sBox3 = new Integer[][] {{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8},
{13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 },
{13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7},
{1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}};
Integer[][] sBox4 = new Integer[][] {{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 },
{13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9 },
{10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4},
{3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 }};
Integer[][] sBox5 = new Integer[][] {{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9},
{14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6},
{4 ,2 ,1, 11, 10, 13, 7 ,8, 15, 9, 12, 5, 6, 3, 0, 14 },
{11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3}};
Integer[][] sBox6 = new Integer[][] {{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11},
{10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8 },
{9, 14, 15, 5, 2, 8, 12 ,3, 7 ,0, 4, 10, 1, 13, 11, 6 },
{4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13}};
Integer [][] sBox7 = new Integer [][] {{4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9,7, 5, 10, 6, 1},
{13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6},
{1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2},
{6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 }} ;
Integer [][] sBox8 = new Integer [][] {{13 ,2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7},
{1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2},
{7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8},
{2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 }} ;
ArrayList<Integer[][]> ListeMitSBoxen = new ArrayList<>();
ListeMitSBoxen.add(sBox1);
ListeMitSBoxen.add(sBox2);
ListeMitSBoxen.add(sBox3);
ListeMitSBoxen.add(sBox4);
ListeMitSBoxen.add(sBox5);
ListeMitSBoxen.add(sBox6);
ListeMitSBoxen.add(sBox7);
ListeMitSBoxen.add(sBox8);
return ListeMitSBoxen;
}
public int sBoxVertikalIndexKriegen(String bits){
String ersteBit = Character.toString(bits.charAt(0));
String letzteBit = Character.toString(bits.charAt(5));
int indexVertikal = getIndex("0" + "0" + ersteBit + letzteBit);
//System.out.println(bits + " V: " + indexVertikal);
return indexVertikal;
}
public int sBoxHorizontalIndexKriegen(String bits) {
String zweiteBit = Character.toString(bits.charAt(1));
String dritteBit = Character.toString(bits.charAt(2));
String vierteBit = Character.toString(bits.charAt(3));
String fünfteBit = Character.toString(bits.charAt(4));
int indesHorizontal = getIndex(zweiteBit + dritteBit + vierteBit + fünfteBit);
//System.out.println(bits + " H: " + indesHorizontal);
return indesHorizontal;
}
public String getBinary(int toBinary) {
String output = "";
switch(toBinary) {
case 0: output= "0000"; break;
case 1: output= "0001"; break;
case 2: output= "0010"; break;
case 3: output= "0011"; break;
case 4: output= "0100"; break;
case 5: output= "0101"; break;
case 6: output= "0110"; break;
case 7: output= "0111"; break;
case 8: output= "1000"; break;
case 9: output= "1001"; break;
case 10:output= "1010"; break;
case 11:output= "1011"; break;
case 12:output= "1100"; break;
case 13:output= "1101"; break;
case 14:output= "1110"; break;
case 15:output= "1111"; break;
}
return output;
}
public int getIndex(String toIndex) {
int output;
switch(toIndex) {
case "0000": output= 0; break;
case "0001": output= 1; break;
case "0010": output= 2; break;
case "0011": output= 3; break;
case "0100": output= 4; break;
case "0101": output= 5; break;
case "0110": output= 6; break;
case "0111": output= 7; break;
case "1000": output= 8; break;
case "1001": output= 9; break;
case "1010": output= 10; break;
case "1011": output= 11; break;
case "1100": output= 12; break;
case "1101": output= 13; break;
case "1110": output= 14; break;
case "1111": output= 15; break;
default: output=0;break;
}
return output;
}
public String feistelFunktion(String klarText, String key) {
String rBlock = rBlock32BitKriegen(klarText);
String lBlock = lBlock32BitKriegen(klarText);
//System.out.println(rBlock + rBlock.length() + " --- " + lBlock + lBlock.length());
// System.out.println(key + " KEY" + key.length());
ArrayList<String> ausgabeArray = eineRundeMitKey(rBlock, lBlock, key);
String output = XORBits(ausgabeArray.get(1), ausgabeArray.get(0));
//Nur die neuen rBlock ausgeben!
return ausgabeArray.get(0);
}
public ArrayList<String> eineRundeMitKey(String rBlock, String lBlock, String Key){
String desXorKey = XORBits(DESexpansionE(rBlock), Key);
//System.out.println("DES XOR 48Bit KEY: " + desXorKey);
ArrayList<String> sBoxenEingabe = AchterGruppenFuerSBoxenKriegen(desXorKey);
String C = "";
ArrayList<Integer[][]> sBoxen = initialisieresBoxen();
int counter = 0;
for(String currentAchtergruppe : sBoxenEingabe) {
int vertikalIndex = sBoxVertikalIndexKriegen(currentAchtergruppe);
int horizontal = sBoxHorizontalIndexKriegen(currentAchtergruppe);
// System.out.println("SBox Wert: " + sBoxen.get(counter)[vertikalIndex][horizontal]);
C+= getBinary(sBoxen.get(counter)[vertikalIndex][horizontal]);
counter++;
}
// System.out.println("C: " + C + " lenght: " + C.length());
ArrayList<String> ausgabeArray = new ArrayList<>();
String desPermutation = DESPermutationNachSBox(C);
String l = rBlock;
String r = XORBits(lBlock, desPermutation);
String Ausgabe = l + r;
ausgabeArray.add(r);
ausgabeArray.add(l);
ausgabeArray.add(Ausgabe);
return ausgabeArray;
}
public String lBlock32BitKriegen(String klarText){
String output = "";
for(int i = 0; i<klarText.length() ; i++) {
if(i<32) {
output+=Character.toString(klarText.charAt(i));
}
}
return output;
}
public String rBlock32BitKriegen(String klarText){
String output = "";
for(int i = 0; i<klarText.length() ; i++) {
if(i>=32) {
output+=Character.toString(klarText.charAt(i));
}
}
return output;
}
public String eineKompletteRunde(String lBlock, String rBlock, String key, int runde) {
ArrayList<String> ausgabeArray = new ArrayList<>();
ausgabeArray = eineRundeMitKey(rBlock, lBlock, getRoundKey(runde, key));
return ausgabeArray.get(1) + ausgabeArray.get(0);
}
public String hexMultiplikation(String hex1, String hex2) {
String hex1InBits = HexToBit(Character.toString(hex1.charAt(0))) + HexToBit(Character.toString(hex1.charAt(1)));
String hex2InBits = HexToBit(Character.toString(hex2.charAt(0))) + HexToBit(Character.toString(hex2.charAt(1)));
//System.out.println(hex1 + " hey 1" + " " + hex2 + " hex2");
//System.out.println("Bit1: " + hex1InBits + " bit2: " + hex2InBits);
int zahl1 = bitInDezimal(hex1InBits);
int zahl2 = bitInDezimal(hex2InBits);
//System.out.println("Zahl1: " + zahl1);
//System.out.println("Zahl2: " + zahl2);
int result = 0;
String resultInBits = "";
if(zahl2 == 3) {
int zwischenResult = 2 * zahl1;
String zwischenResultInBits = dezimalInBits(zwischenResult);
//System.out.println("ZR: " +zwischenResultInBits);
resultInBits = XORBits(zwischenResultInBits, "0000" + hex1InBits);
//System.out.println("Result: " + resultInBits);
} else {
result = zahl1 * zahl2;
resultInBits = dezimalInBits(result);
//System.out.println("Result: " + resultInBits);
}
String modulo = "000100011011";
String resultXorOrNot = "";
if(xorMachen(resultInBits)) {
// System.out.println(modulo);
String xor = XORBits(resultInBits, modulo);
// System.out.println("XOR: " + xor);
resultXorOrNot = xor;
} else {
resultXorOrNot = resultInBits;
}
String ersterPart = bitsPartsKriegen(1, resultXorOrNot);
String zweiterPart = bitsPartsKriegen(2, resultXorOrNot);
//System.out.println("Erster Part: " + ersterPart + " Zweiter Part: " + zweiterPart);
String ersterPartHex = bitsToHex(ersterPart);
String zweiterPartHex = bitsToHex(zweiterPart);
return ersterPartHex + zweiterPartHex;
}
public String bitsPartsKriegen(int part, String bits) {
String result = "";
if(part == 1) {
for(int i = 4; i<= 7; i++) {
result+=Character.toString(bits.charAt(i));
}
} else {
for(int i = 8; i<= 11; i++) {
result+=Character.toString(bits.charAt(i));
}
}
return result;
}
public int bitInDezimal(String bits) {
int counter = 0;
int result = 0;
for(int i = bits.length()-1; i >= 0; i--) {
if(Character.toString(bits.charAt(i)).equals("1")) {
result+=Math.pow(2, counter);
//System.out.println("Zwei hoch: " + counter + " = " + Math.pow(2, counter));
counter++;
}
else {
counter++;
}
}
return result;
}
public boolean xorMachen(String bits) {
boolean result = false;
for(int i = 0; i<4; i++) {
if(Character.toString(bits.charAt(i)).equals("1")){
result = true;
}
}
return result;
}
public String bitsToHex(String bits) {
String output;
switch(bits) {
case "0000": output= "0"; break;
case "0001": output= "1"; break;
case "0010": output= "2"; break;
case "0011": output= "3"; break;
case "0100": output= "4"; break;
case "0101": output= "5"; break;
case "0110": output= "6"; break;
case "0111": output= "7"; break;
case "1000": output= "8"; break;
case "1001": output= "9"; break;
case "1010": output= "a"; break;
case "1011": output= "b"; break;
case "1100": output= "c"; break;
case "1101": output= "d"; break;
case "1110": output= "e"; break;
case "1111": output= "f"; break;
default: output="0";break;
}
return output;
}
public String dezimalInBits(int zahl) {
int counter = zahl;
String result = "";
while(zahl >= 1) {
if(zahl%2 == 0) {
result+="0";
zahl = zahl/2;
} else {
result+="1";
zahl = zahl/2;
}
}
return bitsAuffüllenUndUmdrehen(result);
}
public String bitsAuffüllenUndUmdrehen(String bits){
while(bits.length() < 12) {
bits+="0";
}
//System.out.println(bits);
String result = "";
for(int i = bits.length()-1; i>=0; i--) {
result += Character.toString(bits.charAt(i));
}
// System.out.println("umgedreht: " + result);
return result;
}
public String[] stringArrayKriegen(String bits){
String[] sa = new String[bits.length()];
for(int i = 7; i>=0; i-- ) {
sa[i] = Character.toString(bits.charAt(i));
}
return sa;
}
public String KeyExpansion(String hexaKey){
// hexaKey = "0cb4da23cab44ec34543b4293990be63";
//Runde 1:
String[][] MatrixAusKex_1 = getMatrixAusKey(hexaKey);
String[][] original_1Kopie = getMatrixAusKey(hexaKey);
String[][] rotWordMatrix_1 = rotateWord(MatrixAusKex_1);
String[][] aftersBoxMatrix_1 = sBoxAnwenden(rotWordMatrix_1);
String[][] afterRcon_1 = neueMatrixgenerieren(aftersBoxMatrix_1, original_1Kopie, 0);
String keyBit1 = matrixZuKey(afterRcon_1);
String keyHex1 = keyzuHexKey(keyBit1);
//Runde 1:
String[][] MatrixAusKex_2 = getMatrixAusKey(keyHex1);
String[][] original_2Kopie = getMatrixAusKey(keyHex1);
String[][] rotWordMatrix_2 = rotateWord(MatrixAusKex_2);
String[][] aftersBoxMatrix_2 = sBoxAnwenden(rotWordMatrix_2);
String[][] afterRcon_2 = neueMatrixgenerieren(aftersBoxMatrix_2, original_2Kopie, 1);
String keyBit2 = matrixZuKey(afterRcon_2);
String keyHex2 = keyzuHexKey(keyBit2);
//Falls mehr gefordert einfach erweitern!
/* //Runde 1:
String[][] MatrixAusKex_3 = getMatrixAusKey(keyHex2);
String[][] original_3Kopie = getMatrixAusKey(keyHex2);
String[][] rotWordMatrix_3 = rotateWord(MatrixAusKex_3);
String[][] aftersBoxMatrix_3 = sBoxAnwenden(rotWordMatrix_3);
String[][] afterRcon_3 = neueMatrixgenerieren(aftersBoxMatrix_3, original_3Kopie, 2);
String keyBit3 = matrixZuKey(afterRcon_3);
String keyHex3 = keyzuHexKey(keyBit3);*/
String lösung = hexaKey + "_" + keyHex1 + "_" + keyHex2;
// System.out.println("Lösung " + lösung);
return lösung;
}
public String[][] rotateWord(String[][] matrix){
String[][] matrixKopie = new String[][]{};
matrixKopie = matrix.clone();
String[][] rotWord = matrixKopie;
String bits1 = matrix[0][3];
String bits2 = matrix[1][3];
String bits3 = matrix[2][3];
String bits4 = matrix[3][3];
rotWord[0][3] = bits2;
rotWord[1][3] = bits3;
rotWord[2][3] = bits4;
rotWord[3][3] = bits1;
return rotWord;
}
public String keyzuHexKey(String key) {
String ausgabe = "";
String currentBitString = "";
int counter = 0;
for (int i = 0; i<key.length(); i++) {
currentBitString+=Character.toString(key.charAt(i));
counter++;
if(counter%4 == 0) {
counter = 0;
ausgabe+=bitsToHex(currentBitString);
currentBitString = "";
continue;
} else {
continue;
}
}
return ausgabe;
}
public String[][] neueMatrixgenerieren(String[][] sBoxMatrix, String[][] normaleMatrix, int kexindex){
String[][] ausgabe = new String[4][4];
sBox sBoxrCon = new sBox();
//Erste Spalte:
ausgabe[0][0] = XORBits(XORBits(normaleMatrix[0][0], sBoxMatrix[0][3]), sBoxrCon.getrConString(kexindex));
for(int i = 1; i<4; i++) {
ausgabe[i][0] = XORBits(XORBits(normaleMatrix[i][0], sBoxMatrix[i][3]), "00000000");
}
//die anderen Spalten:
for(int j = 1; j<4; j++) {
for(int h = 0; h<4; h++) {
ausgabe[h][j] = XORBits(normaleMatrix[h][j], ausgabe[h][j-1]);
}
}
return ausgabe;
}
public String matrixZuKey(String[][] matrix) {
String ausgabe = "";
for(int i = 0; i<4; i++) {
for(int h = 0; h<4; h++) {
ausgabe+=matrix[h][i];
}
}
return ausgabe;
}
public String matrixZuKeyAnders(String[][] matrix) {
String ausgabe = "";
for(int i = 0; i<4; i++) {
for(int h = 0; h<4; h++) {
ausgabe+=matrix[i][h];
}
}
return ausgabe;
}
public String[][] sBoxAnwenden(String[][] matrix){
String[][] ausgabe = matrix;
sBox sBoxInitialize = new sBox();
//HexWerte vor dem SubBytes:
String bithex1 = bitsToHex(ausgabe[0][3].substring(0, 4)) + bitsToHex(ausgabe[0][3].substring(4, 8));
String bithex2 = bitsToHex(ausgabe[1][3].substring(0, 4)) + bitsToHex(ausgabe[1][3].substring(4, 8));
String bithex3 = bitsToHex(ausgabe[2][3].substring(0, 4)) + bitsToHex(ausgabe[2][3].substring(4, 8));
String bithex4 = bitsToHex(ausgabe[3][3].substring(0, 4)) + bitsToHex(ausgabe[3][3].substring(4, 8));
String sBox1 = sBoxInitialize.getSBoxString(hexToZahl(Character.toString(bithex1.charAt(0))), hexToZahl(Character.toString(bithex1.charAt(1))));
String sBox2 = sBoxInitialize.getSBoxString(hexToZahl(Character.toString(bithex2.charAt(0))), hexToZahl(Character.toString(bithex2.charAt(1))));
String sBox3 = sBoxInitialize.getSBoxString(hexToZahl(Character.toString(bithex3.charAt(0))), hexToZahl(Character.toString(bithex3.charAt(1))));
String sBox4 = sBoxInitialize.getSBoxString(hexToZahl(Character.toString(bithex4.charAt(0))), hexToZahl(Character.toString(bithex4.charAt(1))));
String neueSboxString1 = HexToBit(Character.toString(sBox1.charAt(0))) + HexToBit(Character.toString(sBox1.charAt(1)));
String neueSboxString2 = HexToBit(Character.toString(sBox2.charAt(0))) + HexToBit(Character.toString(sBox2.charAt(1)));
String neueSboxString3 = HexToBit(Character.toString(sBox3.charAt(0))) + HexToBit(Character.toString(sBox3.charAt(1)));
String neueSboxString4 = HexToBit(Character.toString(sBox4.charAt(0))) + HexToBit(Character.toString(sBox4.charAt(1)));
ausgabe[0][3] = neueSboxString1;
ausgabe[1][3] = neueSboxString2;
ausgabe[2][3] = neueSboxString3;
ausgabe[3][3] = neueSboxString4;
return ausgabe;
}
public String[][] subBytes(String[][] matrix) {
String[][] ausgabe = new String[4][4];
sBox sBoxInitialize = new sBox();
for(int i = 0; i<4; i++) {
for(int h = 0; h<4; h++) {
String sBoxWert = sBoxInitialize.getSBoxString(hexToZahl(Character.toString(matrix[h][i].charAt(0))), hexToZahl(Character.toString(matrix[h][i].charAt(1))));
ausgabe[h][i] = sBoxWert;
}
}
/* System.out.println("Original: ");
System.out.println(Arrays.toString(matrix[0]));
System.out.println(Arrays.toString(matrix[1]));
System.out.println(Arrays.toString(matrix[2]));
System.out.println(Arrays.toString(matrix[3]));
System.out.println("SBOXEN: ");
System.out.println(Arrays.toString(ausgabe[0]));
System.out.println(Arrays.toString(ausgabe[1]));
System.out.println(Arrays.toString(ausgabe[2]));
System.out.println(Arrays.toString(ausgabe[3]));*/
return ausgabe;
}
public int hexToZahl(String hex) {
int output;
switch(hex) {
case "0": output= 0; break;
case "1": output= 1; break;
case "2": output= 2; break;
case "3": output= 3; break;
case "4": output= 4; break;
case "5": output= 5; break;
case "6": output= 6; break;
case "7": output= 7; break;
case "8": output= 8; break;
case "9": output= 9; break;
case "a": output= 10; break;
case "b": output= 11; break;
case "c": output= 12; break;
case "d": output= 13; break;
case "e": output= 14; break;
case "f": output= 15; break;
default: output=0;break;
}
return output;
}
public String[][] getMatrixAusKey(String hexaKey) {
String hdeximal = getAlleHexToBit(hexaKey);
String[] acterBlöckeBits = bitsInAchterBloeckeAufteilen(hdeximal);
String[][] sMatrix = new String[4][4];
int pos = 0;
for (int i = 0; i < sMatrix.length; i++)
for (int j = 0; j < sMatrix[i].length; j++)
sMatrix[j][i] = acterBlöckeBits[pos++];
return sMatrix;
}
public String[][] getHexMatrixAusBitMatrix(String[][] bitMatrix) {
String[][] sMatrix = new String[4][4];
int pos = 0;
for (int i = 0; i < sMatrix.length; i++)
for (int j = 0; j < sMatrix[i].length; j++)
sMatrix[j][i] = bitsToHex(bitMatrix[j][i].substring(0,4)) + bitsToHex(bitMatrix[j][i].substring(4,8));
return sMatrix;
}
public String[] bitsInAchterBloeckeAufteilen(String bits){
String[] arrayBloecke = new String[16];
int counter = 0;
for(int i = 1; i<=bits.length(); i++) {
if(i%8 != 0) {
if(arrayBloecke[counter] == null) {
arrayBloecke[counter] = Character.toString(bits.charAt(i-1));
} else {
arrayBloecke[counter]+= Character.toString(bits.charAt(i-1));
}
} else {
if(arrayBloecke[counter] == null) {
arrayBloecke[counter] = Character.toString(bits.charAt(i-1));
} else {
arrayBloecke[counter]+= Character.toString(bits.charAt(i-1));
}
counter++;
}
}
return arrayBloecke;
}
public String getAlleHexToBit(String hexa){
String result = "";
for(int i = 0; i<hexa.length(); i++) {
result+= HexToBit(Character.toString(hexa.charAt(i)));
}
return result;
}
public String MixColumns(String hexaKey) {
String[][] original_1Kopie = getMatrixAusKey(hexaKey);
//hexaKey = "d4bf5d30e0b452aeb84111f11e2798e5";
String[][] MatrixAusKey = getMatrixAusKey(hexaKey);
//System.out.println("Hexa Kex: " + hexaKey);
/* System.out.println("Matrix:");
System.out.println(Arrays.toString(MatrixAusKey[0]));
System.out.println(Arrays.toString(MatrixAusKey[1]));
System.out.println(Arrays.toString(MatrixAusKey[2]));
System.out.println(Arrays.toString(MatrixAusKey[3]));*/
String mixColumnCHex = "02010103030201010103020101010302";
String[][] mixColumnCMatrix = getMatrixAusKey(mixColumnCHex);
String[][] ausgabeMatrix = new String[4][4];
for(int i = 0; i<ausgabeMatrix.length; i++) {
for (int h = 0; h<ausgabeMatrix[0].length; h++) {
String zahl1 = hexMultiplikation(bitsToHex(MatrixAusKey[0][i].substring(0, 4)) + bitsToHex(MatrixAusKey[0][i].substring(4,8)), bitsToHex(mixColumnCMatrix[h][0].substring(0, 4)) + bitsToHex(mixColumnCMatrix[h][0].substring(4,8)));
String zahl2 = hexMultiplikation(bitsToHex(MatrixAusKey[1][i].substring(0, 4)) + bitsToHex(MatrixAusKey[1][i].substring(4,8)), bitsToHex(mixColumnCMatrix[h][1].substring(0, 4)) + bitsToHex(mixColumnCMatrix[h][1].substring(4,8)));
String zahl3 = hexMultiplikation(bitsToHex(MatrixAusKey[2][i].substring(0, 4)) + bitsToHex(MatrixAusKey[2][i].substring(4,8)), bitsToHex(mixColumnCMatrix[h][2].substring(0, 4)) + bitsToHex(mixColumnCMatrix[h][2].substring(4,8)));
String zahl4 = hexMultiplikation(bitsToHex(MatrixAusKey[3][i].substring(0, 4)) + bitsToHex(MatrixAusKey[3][i].substring(4,8)), bitsToHex(mixColumnCMatrix[h][3].substring(0, 4)) + bitsToHex(mixColumnCMatrix[h][3].substring(4,8)));
/* System.out.println("einzelne Spalten: ");
System.out.println(zahl1);
System.out.println(zahl2);
System.out.println(zahl3);
System.out.println(zahl4);
System.out.println(hexMultiplikation("02", "d4"));
System.out.println(hexMultiplikation("03", "bf"));
System.out.println(hexMultiplikation("01", "5d"));
System.out.println(hexMultiplikation("01", "30"));*/
String ersteHalf = XORBits(getAlleHexToBit(zahl1), getAlleHexToBit(zahl2));
// System.out.println("XOR erste Hälfte: " + ersteHalf);
String zweiteHalf = XORBits(ersteHalf, getAlleHexToBit(zahl3));
//System.out.println("XOR zweite Hälfte: " + zweiteHalf);
String finalXOR = XORBits(zweiteHalf, getAlleHexToBit(zahl4));
//System.out.println("XOR final Hälfte: " + finalXOR);
String mixedColumn = bitsToHex(finalXOR.substring(0, 4)) + bitsToHex(finalXOR.substring(4,8));
//System.out.println("Mixed Column: " + mixedColumn);
ausgabeMatrix[h][i] = mixedColumn;
}
}
String neuerKey = HexMatrixZuKey(ausgabeMatrix);
return neuerKey;
}
public String HexMatrixZuKey(String[][] HexMatrix) {
String ausgabe = "";
for(int i = 0; i<4; i++) {
for(int h = 0; h<4; h++) {
ausgabe+=HexMatrix[h][i];
}
}
//System.out.println("Neuer Key: " + ausgabe);
return ausgabe;
}
public String[][] shiftRows(String[][] matrix) {
String[][] ausgabe = new String[4][4];
ausgabe[0] = matrix[0];
//Erste Spalte:
for(int i = 0; i<4; i++) {
ausgabe[1][i] = matrix[1][(i+1)%4];
}
//Zweite Spalte:
for(int i = 0; i<4; i++) {
ausgabe[2][i] = matrix[2][(i+2)%4];
}
//Dritte Spalte:
for(int i = 0; i<4; i++) {
ausgabe[3][i] = matrix[3][(i+3)%4];
}
/*
System.out.println("SHIFT ROWS:");
System.out.println(Arrays.toString(ausgabe[0]));
System.out.println(Arrays.toString(ausgabe[1]));
System.out.println(Arrays.toString(ausgabe[2]));
System.out.println(Arrays.toString(ausgabe[3]));*/
return ausgabe;
}
public String AESTransformation(String hexWert) {
String[][] matrix = getHexMatrixAusBitMatrix(getMatrixAusKey(hexWert));
String[][] subBytes = subBytes(matrix);
String[][] shiftRows = shiftRows(subBytes);
String shiftRowsWert = matrixZuKey(shiftRows);
//System.out.println(shiftRowsWert);
String result = MixColumns(shiftRowsWert);
addRoundKey(matrix,shiftRows);
return result;
}
public String[][] addRoundKey(String[][] matrix, String[][] roundKey) {
String[][] ausgabe = new String[4][4];
for(int i=0; i<4; i++) {
for(int h = 0; h<4; h++) {
String xorBits = XORBits(HexToBit(Character.toString(matrix[h][i].charAt(0))) + HexToBit(Character.toString(matrix[h][i].charAt(1))), HexToBit(Character.toString(roundKey[h][i].charAt(0))) + HexToBit(Character.toString(roundKey[h][i].charAt(1))));
ausgabe[h][i] = bitsToHex(xorBits.substring(0,4)) + bitsToHex(xorBits.substring(4,8));
}
}
return ausgabe;
}
public String KeyFuerEineRunde(String hexaKey, int runde){
// hexaKey = "0cb4da23cab44ec34543b4293990be63";
String ausgabe = hexaKey;
for(int i = 1; i<=runde; i++) {
String[][] MatrixAusKex_1 = getMatrixAusKey(ausgabe);
String[][] original_1Kopie = getMatrixAusKey(ausgabe);
String[][] rotWordMatrix_1 = rotateWord(MatrixAusKex_1);
String[][] aftersBoxMatrix_1 = sBoxAnwenden(rotWordMatrix_1);
String[][] afterRcon_1 = neueMatrixgenerieren(aftersBoxMatrix_1, original_1Kopie, i);
String keyBit1 = matrixZuKey(afterRcon_1);
ausgabe = keyzuHexKey(keyBit1);
}
// System.out.println("Lösung " + lösung);
return ausgabe;
}
public String standardRunde(String hexWert, String key, int runde) {
String[][] matrix = getHexMatrixAusBitMatrix(getMatrixAusKey(hexWert));
String[][] subBytes = subBytes(matrix);
String[][] shiftRows = shiftRows(subBytes);
String shiftRowsWert = matrixZuKey(shiftRows);
//System.out.println(shiftRowsWert);
String mixColumns = MixColumns(shiftRowsWert);
String[][] matrixStandard = getHexMatrixAusBitMatrix(getMatrixAusKey(mixColumns));
String[][] keyRunde = getHexMatrixAusBitMatrix(getMatrixAusKey(keyKriegen(key, runde)));
String[][] ausgabeMatrix = addRoundKey(matrixStandard, keyRunde);
String ausgabe = matrixZuKey(ausgabeMatrix);
return ausgabe;
}
public String AESDreiRunden(String hexBlock, String key, String keyRoom) {
String[][] hexBlockMatrix = getHexMatrixAusBitMatrix(getMatrixAusKey(hexBlock));
String[][] keyMatrix = getHexMatrixAusBitMatrix(getMatrixAusKey(key));
/*
System.out.println("key");
System.out.println(Arrays.toString(keyMatrix[0]));
System.out.println(Arrays.toString(keyMatrix[1]));
System.out.println(Arrays.toString(keyMatrix[2]));
System.out.println(Arrays.toString(keyMatrix[3]));*/
String[][] hh = addRoundKey(hexBlockMatrix, keyMatrix);
String ausgabeInitialize = matrixZuKey(hh);
//System.out.println("initiale: " + ausgabeInitialize);
String ausgabeRunde1 = standardRunde(ausgabeInitialize, key, 1);
//System.out.println("r1: " + ausgabeRunde1);
String ausgabeRunde2 = standardRunde(ausgabeRunde1, key, 2);
//System.out.println("r2: " + ausgabeRunde2);
String finalausgabe = ausgabeInitialize + "_" + ausgabeRunde1 + "_" + ausgabeRunde2;
return finalausgabe;
}
public String keyKriegen(String hexaKey, int runde){
// hexaKey = "0cb4da23cab44ec34543b4293990be63";
//Runde 1:
String[][] MatrixAusKex_1 = getMatrixAusKey(hexaKey);
String[][] original_1Kopie = getMatrixAusKey(hexaKey);
String[][] rotWordMatrix_1 = rotateWord(MatrixAusKex_1);
String[][] aftersBoxMatrix_1 = sBoxAnwenden(rotWordMatrix_1);
String[][] afterRcon_1 = neueMatrixgenerieren(aftersBoxMatrix_1, original_1Kopie, 0);
String keyBit1 = matrixZuKey(afterRcon_1);
String keyHex1 = keyzuHexKey(keyBit1);
//Runde 2:
String[][] MatrixAusKex_2 = getMatrixAusKey(keyHex1);
String[][] original_2Kopie = getMatrixAusKey(keyHex1);
String[][] rotWordMatrix_2 = rotateWord(MatrixAusKex_2);
String[][] aftersBoxMatrix_2 = sBoxAnwenden(rotWordMatrix_2);
String[][] afterRcon_2 = neueMatrixgenerieren(aftersBoxMatrix_2, original_2Kopie, 1);
String keyBit2 = matrixZuKey(afterRcon_2);
String keyHex2 = keyzuHexKey(keyBit2);
//Falls mehr gefordert einfach erweitern!
//Runde 3:
String[][] MatrixAusKex_3 = getMatrixAusKey(keyHex2);
String[][] original_3Kopie = getMatrixAusKey(keyHex2);
String[][] rotWordMatrix_3 = rotateWord(MatrixAusKex_3);
String[][] aftersBoxMatrix_3 = sBoxAnwenden(rotWordMatrix_3);
String[][] afterRcon_3 = neueMatrixgenerieren(aftersBoxMatrix_3, original_3Kopie, 2);
String keyBit3 = matrixZuKey(afterRcon_3);
String keyHex3 = keyzuHexKey(keyBit3);
String lösung = hexaKey + "_" + keyHex1 + "_" + keyHex2;
// System.out.println("Lösung " + lösung);
switch (runde) {
case 0: return hexaKey;
case 1: return keyHex1;
case 2: return keyHex2;
case 3: return keyHex3;
default: return "";
}
}
public String RC4Loop(String stateTable, String klarText){
int[] key = stringInArrayOhneUnterzeichen(stateTable);
//System.out.println(stateTable);
key = rundeGenerieren(key, klarText.length());
//System.out.println(Arrays.toString(key));
String output = intArrayInStringUmwandeln(key);
return output;
}
public int[] stringInArrayOhneUnterzeichen(String stateTable) {
String[] strings = stateTable.split("_");
int[] stringIntOhneUntenstrich = new int[strings.length];
for(int i = 0; i<strings.length; i++) {
stringIntOhneUntenstrich[i] = Integer.parseInt(strings[i]);
}
//System.out.println(Arrays.toString(stringIntOhneUntenstrich));
return stringIntOhneUntenstrich;
}
public int[] rundeGenerieren(int[] schluessel, int wiederholungen) {
int[] result = new int[wiederholungen];
int i = 0;
int j = 0;
for (int h = 0; h < result.length; h++) {
i = (i+1)%schluessel.length;
j = (j + schluessel[i]) % schluessel.length;
tauscheStatesUm(schluessel, schluessel[i], i, j);
result[h] = schluessel[(schluessel[i] + schluessel[j]) % schluessel.length];
}
return result;
}
public String intArrayInStringUmwandeln(int[] currentArray) {
String output = "";
for(int i = 0; i<currentArray.length; i++) {
output += String.valueOf(currentArray[i]);
}
return output;
}
public String intArrayInStringUmwandelnMitUntenstrich(int[] currentArray) {
String output = "";
for(int i = 0; i<currentArray.length; i++) {
if(i == currentArray.length-1) {
output += String.valueOf(currentArray[i]);
} else {
output += String.valueOf(currentArray[i]) + "_";
}
}
return output;
}
public void tauscheStatesUm(int[] schluessel, int zuMerkendeState, int ersteState, int zweiteState) {
schluessel[ersteState] = schluessel[zweiteState];
schluessel[zweiteState] = zuMerkendeState;
}
public String RC4KeySchedule(String key){
int[] keySchedule = stringInArrayOhneUnterzeichen(key);
//System.out.println(key);
String result = intArrayInStringUmwandelnMitUntenstrich(sBoxHandling(keySchedule));
//System.out.println("Result: " + result);
return result;
}
public int[] sBoxHandling(int[] key) {
int[] sBox = new int[key.length];
for (int i = 0; i < key.length; i++) {
sBox[i] = i;
}
int j = 0;
for (int i = 0; i < key.length; i++) {
j = (j + key[i % key.length] + sBox[i]) % key.length;
tauscheStatesUm(sBox, sBox[i], i, j);
}
return sBox;
}
public String RC4Verschluesselung(String key, String klarText){
int[] sBox = stringInArrayOhneUnterzeichen(key);
sBox = sBoxHandling(sBox);
sBox = rundeGenerieren(sBox, klarText.length());
String result = "";
for (int i = 0; i < klarText.length(); i++) {
String currentKey = dezimalInByte(sBox[i]);
String currentText = buchstabeToBinaer(Character.toString(klarText.charAt(i)));
//System.out.println(currentKey + " currentKey" + " - " + sBox[i]);
//System.out.println(currentText + " currentText" + " - " + Character.toString(klarText.charAt(i)));
String xored = XORBits(currentKey, currentText);
//System.out.println("X_ " + xored);
result += xored;
}
//System.out.println(result);
return result.toString();
}
public String buchstabeToBinaer(String currentBuchstabe) {
String[][] BuchstabenInBinaer = new String[][] {
{ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C",
"D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
"P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a",
"b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y",
"z" },
{ "110000", "110001", "110010", "110011", "110100", "110101",
"110110", "110111", "111000", "111001", "1000001",
"1000010", "1000011", "1000100", "1000101", "1000110",
"1000111", "1001000", "1001001", "1001010", "1001011",
"1001100", "1001101", "1001110", "1001111", "1010000",
"1010001", "1010010", "1010011", "1010100", "1010101",
"1010110", "1010111", "1011000", "1011111", "1100000",
"1100001", "1100010", "1100011", "1100100", "1100101",
"1100110", "1100111", "1101000", "1101001", "1101010",
"1101011", "1101100", "1101101", "1101110", "1101111",
"1110000", "1110001", "1110010", "1110011", "1110100",
"1110101", "1110110", "1110111", "1111000", "1111001",
"1111010" }
};
String result = "";
for(int i = 0; i<BuchstabenInBinaer[0].length; i++) {
if(BuchstabenInBinaer[0][i].equals(currentBuchstabe)) {
result = BuchstabenInBinaer[1][i];
}
}
String echterResult = "0" + result;
return echterResult;
}
public String dezimalInByte(int zahl) {
String result = "";
while(zahl >= 1) {
if(zahl%2 == 0) {
result+="0";
zahl = zahl/2;
} else {
result+="1";
zahl = zahl/2;
}
}
return byteAuffüllenUndUmdrehen(result);
}
public String byteAuffüllenUndUmdrehen(String bits){
while(bits.length() < 8) {
bits += "0";
}
//System.out.println(bits);
String result = "";
for(int i = bits.length()-1; i>=0; i--) {
result += Character.toString(bits.charAt(i));
}
return result;
}
}
| [
"cyberfacilitygroup@gmail.com"
] | cyberfacilitygroup@gmail.com |
8934d7dd979d6844ac2289e0e436b38ed3510b3b | 4b2b6fe260ba39f684f496992513cb8bc07dfcbc | /com/planet_ink/coffee_mud/WebMacros/HTTPstatusInfo.java | 3219d0deafa0d08d3243faa753b028ec917912ed | [
"Apache-2.0"
] | permissive | vjanmey/EpicMudfia | ceb26feeac6f5b3eb48670f81ea43d8648314851 | 63c65489c673f4f8337484ea2e6ebfc11a09364c | refs/heads/master | 2021-01-18T20:12:08.160733 | 2014-06-22T04:38:14 | 2014-06-22T04:38:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,801 | java | package com.planet_ink.coffee_mud.WebMacros;
import com.planet_ink.miniweb.interfaces.*;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2000-2014 Bo Zimmerman
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.
*/
public class HTTPstatusInfo extends StdWebMacro
{
@Override public String name() {return "HTTPstatusInfo";}
@Override
public String runMacro(HTTPRequest httpReq, String parm)
{
if(httpReq.getRequestObjects().get("SYSTEM_HTTP_STATUS_INFO")!=null)
return (String)httpReq.getRequestObjects().get("SYSTEM_HTTP_STATUS_INFO");
return "";
}
}
| [
"vjanmey@gmail.com"
] | vjanmey@gmail.com |
62516b7af8e070463128b0e9d4faa568df914d48 | 1f51141924941ec36c21e5a9188388e12bbb2004 | /src/main/java/www/mansung/com/util/StringUtil.java | 105a01f4169a1735450e1e5904e73d9edc82d220 | [] | no_license | quirinal36/Mansung.com | f0798f84d37f744d388305af629585af222814c4 | 89d27231a1032418ec213b8424b38408f7a4fe7b | refs/heads/master | 2022-12-22T10:59:53.484997 | 2020-03-09T10:33:09 | 2020-03-09T10:33:09 | 231,184,747 | 0 | 0 | null | 2022-12-16T08:52:09 | 2020-01-01T06:50:45 | Java | UTF-8 | Java | false | false | 1,951 | java | package www.mansung.com.util;
import java.lang.reflect.Array;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.TextStyle;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
public class StringUtil {
private final static String[] days = {"일","월","화","수","목","금","토"};
/**
* 모든 HTML 태그를 제거하고 반환한다.
*
* @param html
* @throws Exception
*/
public static String removeTag(String html) throws Exception {
return html.replaceAll("<(/)?([a-zA-Z]*)(\\s[a-zA-Z]*=[^>]*)?(\\s)*(/)?>", "");
}
public static String phone(String src) {
if (src == null) {
return "";
}
if (src.length() == 8) {
return src.replaceFirst("^([0-9]{4})([0-9]{4})$", "$1-$2");
} else if (src.length() == 12) {
return src.replaceFirst("(^[0-9]{4})([0-9]{4})([0-9]{4})$", "$1-$2-$3");
}
return src.replaceFirst("(^02|[0-9]{3})([0-9]{3,4})([0-9]{4})$", "$1-$2-$3");
}
public static String getDayOfWeek(String input) throws ParseException {
Date date = new SimpleDateFormat("yyyy-MM-dd").parse(input);
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
return localDate.getDayOfWeek().getDisplayName(TextStyle.NARROW, Locale.getDefault());
}
public static Boolean empty(Object obj) {
if (obj instanceof String) return obj == null || "".equals(obj.toString().trim());
else if (obj instanceof List)return obj == null || ((List<?>) obj).isEmpty();
else if (obj instanceof Map) return obj == null || ((Map<?, ?>) obj).isEmpty();
else if (obj instanceof Object[]) return obj == null || Array.getLength(obj) == 0;
else return obj == null;
}
public static Boolean notEmpty(Object obj) {
return !empty(obj);
}
}
| [
"turboguy36@gmail.com"
] | turboguy36@gmail.com |
69a27154e406732bd7838af2383d767ebc91ae0c | ae1d95b11d775cb1ab105cc7662c237e3482b860 | /common/config/src/main/java/io/helidon/common/config/spi/ConfigProvider.java | 37e84552c073a93033d2420f91081b13373b8fc3 | [
"Apache-2.0",
"APSL-1.0",
"LicenseRef-scancode-protobuf",
"GPL-1.0-or-later",
"LGPL-2.1-only",
"LicenseRef-scancode-unknown-license-reference",
"CC-PDDC",
"LicenseRef-scancode-generic-export-compliance",
"LicenseRef-scancode-unicode",
"EPL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL... | permissive | barchetta/helidon | 7a517cbf36e0a3c908bb269d9a92446a507332ce | e8bf60e64e3510df66569688fe1172981766f729 | refs/heads/main | 2023-09-03T20:19:30.214812 | 2023-08-11T22:39:16 | 2023-08-11T22:39:16 | 165,092,426 | 3 | 0 | Apache-2.0 | 2019-01-10T16:21:59 | 2019-01-10T16:21:58 | null | UTF-8 | Java | false | false | 1,014 | java | /*
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
*
* 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.helidon.common.config.spi;
import io.helidon.common.config.Config;
/**
* Service loader provider interface to discover config implementation that would be used to
* obtain a default configuration instance.
*/
public interface ConfigProvider {
/**
* Create the default configuration instance.
*
* @return a new configuration
*/
Config create();
}
| [
"noreply@github.com"
] | barchetta.noreply@github.com |
686e2f3afe8976acbac34839c5ebc0048c8a102b | 6306781b5fdcff81d4934a376aa722530c7ec0c2 | /app/src/test/java/com/example/apprenti/quetesimpleui/ExampleUnitTest.java | 2750573296b68d2b14f168ec6ca0418aaddc5454 | [] | no_license | IsoyaKureno/QueteSimpleUI | d35c813da41a460f39f4617814d86da73c02581c | 91dc7a8b3ec2990ce8631c6b5ace9a45ab944446 | refs/heads/master | 2021-01-23T19:34:31.795786 | 2017-09-07T15:11:49 | 2017-09-07T15:11:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package com.example.apprenti.quetesimpleui;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"g.caule31@outlook.fr"
] | g.caule31@outlook.fr |
78e71444330e7a6aef8954cfbf0adce5c2a63fbd | 4eb7d6ddfcd45c4453b6b2e180359ca02976d777 | /src/main/java/notaql/parser/OutputPathVisitor.java | cacb99d20a61b0bcfeb727dcd607d6bef701f301 | [
"Apache-2.0"
] | permissive | Cobbe/notaql | 428421e47536ef5491dac71757dee36fc2e912e9 | 8f43ecc207ffc63356f6de86c1998f7266630220 | refs/heads/master | 2021-07-15T11:51:14.456357 | 2017-10-17T12:53:17 | 2017-10-17T12:53:17 | 106,414,184 | 0 | 0 | null | 2017-10-10T12:28:18 | 2017-10-10T12:28:18 | null | UTF-8 | Java | false | false | 1,650 | java | /*
* Copyright 2015 by Thomas Lottermann
*
* 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 notaql.parser;
import notaql.model.path.OutputPath;
import notaql.parser.antlr.NotaQL2BaseVisitor;
import notaql.parser.antlr.NotaQL2Parser;
import org.antlr.v4.runtime.misc.NotNull;
/**
* This class forwards the calls to the appropriate output engines specific input parser
*/
public class OutputPathVisitor extends NotaQL2BaseVisitor<OutputPath> {
private final TransformationParser transformationParser;
public OutputPathVisitor(TransformationParser transformationParser) {
this.transformationParser = transformationParser;
}
@Override
public OutputPath visitAbsoluteOutputPath(@NotNull NotaQL2Parser.AbsoluteOutputPathContext ctx) {
return transformationParser.getOutEngineEvaluator().getOutputPathParser().parse(ctx.path().getText(), false);
}
@Override
public OutputPath visitRelativeOutputPath(@NotNull NotaQL2Parser.RelativeOutputPathContext ctx) {
return transformationParser.getOutEngineEvaluator().getOutputPathParser().parse(ctx.path().getText(), true);
}
}
| [
"tomlottermann@googlemail.com"
] | tomlottermann@googlemail.com |
cb3c096a100ca46c1de47a66f82c7fa2e2977691 | cdf4aa7d980d9768df50f4a48bda4b360ca7a156 | /src/main/java/com/normanrz/SearchEngine/Query/SnippetGenerator.java | b687788d09e410daf65c4160d9f295f541887c67 | [] | no_license | normanrz/information-retrieval | ebaf9209f7ea02f8b5863890babde44c1e5085dd | b26c10782a986f84a8729080bade55a97be1595b | refs/heads/master | 2021-01-10T05:44:58.065346 | 2016-02-18T22:16:34 | 2016-02-18T22:16:34 | 44,244,042 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,558 | java | package com.normanrz.SearchEngine.Query;
import com.normanrz.SearchEngine.Import.PatentDocumentPreprocessor;
import com.normanrz.SearchEngine.PatentDocument;
import com.normanrz.SearchEngine.utils.ArrayUtils;
import org.apache.commons.collections.primitives.ArrayIntList;
import org.apache.commons.collections.primitives.IntList;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* Created by norman on 26.11.15.
*/
public class SnippetGenerator {
private static final int defaultTokenMargin = 5;
private SnippetGenerator() {
}
private static int[][] partitionPositions(int[] source, int minOffset) {
List<IntList> output = new ArrayList<>();
IntList currentPartition = null;
int lastPos = Integer.MIN_VALUE;
for (int pos : source) {
if (lastPos + minOffset < pos) {
if (currentPartition != null) {
output.add(currentPartition);
}
currentPartition = new ArrayIntList();
currentPartition.add(pos);
} else {
if (currentPartition == null) {
currentPartition = new ArrayIntList();
}
currentPartition.add(pos);
}
lastPos = pos;
}
if (currentPartition != null && currentPartition.size() > 0) {
output.add(currentPartition);
}
return output.stream().map(IntList::toArray).toArray(size -> new int[size][]);
}
private static boolean containsQueryToken(List<String> tokens, List<String> queryTokens) {
return tokens.stream()
.map(PatentDocumentPreprocessor::stem)
.filter(token -> queryTokens.contains(token))
.count() > 0;
}
private static String shortenSnippetByPunctuation(String snippet, List<String> queryTokens, int tokenMargin) {
String[] splitSnippet = snippet.split("[\\.!\\?]");
if (splitSnippet.length > 1) {
String firstSplit = ArrayUtils.first(splitSnippet);
String lastSplit = ArrayUtils.last(splitSnippet);
List<String> firstSplitTokens = PatentDocumentPreprocessor.tokenizeAsList(firstSplit);
List<String> lastSplitTokens = PatentDocumentPreprocessor.tokenizeAsList(lastSplit);
int startIndex = 0;
int endIndex = snippet.length();
if (firstSplitTokens.size() <= tokenMargin && !containsQueryToken(firstSplitTokens, queryTokens)) {
startIndex = firstSplit.length() + 1;
}
if (lastSplitTokens.size() <= tokenMargin && !containsQueryToken(lastSplitTokens, queryTokens)) {
endIndex = endIndex - lastSplit.length() + 1;
}
return snippet.substring(startIndex, endIndex).trim();
} else {
return snippet;
}
}
public static List<String> getSnippets(String body, List<String> queryTokens, int tokenMargin) {
List<Pair<Integer, String>> bodyTokens = PatentDocumentPreprocessor.tokenizeWithOffset(body)
.collect(Collectors.toList());
List<String> bodyStemmedTokens = bodyTokens.stream()
.map(Pair::getRight)
.map(String::toLowerCase)
.map(PatentDocumentPreprocessor::stem)
.collect(Collectors.toList());
int[][] partitions = partitionPositions(queryTokens.stream()
.flatMapToInt(queryToken ->
IntStream.range(0, bodyStemmedTokens.size())
.filter(i -> bodyStemmedTokens.get(i).equals(queryToken))
)
.flatMap(pos -> IntStream.range(pos - tokenMargin, pos + tokenMargin))
.distinct()
.sorted()
.filter(pos -> pos > 0 && pos < bodyStemmedTokens.size())
.toArray(), 1);
List<String> snippets = Arrays.stream(partitions)
.map(partition -> {
Pair<Integer, String> first = bodyTokens.get(ArrayUtils.first(partition));
Pair<Integer, String> last = bodyTokens.get(ArrayUtils.last(partition));
return body.substring(first.getLeft(), last.getLeft() + last.getRight().length());
})
.map(snippet -> shortenSnippetByPunctuation(snippet, queryTokens, tokenMargin))
.collect(Collectors.toList());
if (snippets.size() == 0) {
return Arrays.asList(body.substring(1, Math.min(body.length(), 1000)));
} else {
return snippets;
}
}
public static List<String> getSnippets(PatentDocument doc, List<String> queryTokens) {
return getSnippets(doc, queryTokens, defaultTokenMargin);
}
public static List<String> getSnippets(PatentDocument doc, List<String> queryTokens, int tokenMargin) {
return getSnippets(doc.getFulltext(), queryTokens, tokenMargin);
}
public static List<String> getSnippetsFromBody(PatentDocument doc, List<String> queryTokens) {
return getSnippetsFromBody(doc, queryTokens, defaultTokenMargin);
}
public static List<String> getSnippetsFromBody(PatentDocument doc, List<String> queryTokens, int tokenMargin) {
return getSnippets(doc.getBody(), queryTokens, tokenMargin);
}
}
| [
"code@normanrzepka.de"
] | code@normanrzepka.de |
a47cf19c832a952e7e2265f72f8fde8c99311afa | 2b3af4d261abb6092f5d079c7e94a46626e025ea | /app/src/main/java/com/lee/weatherdemo/WeatherActivity.java | b53e6984b2bdb5e8ba1c6782e9ae2d8d536465b2 | [] | no_license | LeeVanie/WeatherDemo | ce4e6a0e5d8c2c899aebd7fb7d15d2f3552de731 | 12c9660363db4fba02cd3347e9ef11d6c8cee2a2 | refs/heads/master | 2020-03-15T03:45:52.314950 | 2017-08-28T09:50:53 | 2017-08-28T09:50:53 | 131,950,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,722 | java | package com.lee.weatherdemo;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.lee.weatherdemo.Bean.Forecast;
import com.lee.weatherdemo.Bean.Hourly;
import com.lee.weatherdemo.Bean.Weather;
import com.lee.weatherdemo.service.AutoUpdataService;
import com.lee.weatherdemo.util.HttpUtils;
import com.lee.weatherdemo.util.Utility;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import lecho.lib.hellocharts.gesture.ZoomType;
import lecho.lib.hellocharts.model.Axis;
import lecho.lib.hellocharts.model.AxisValue;
import lecho.lib.hellocharts.model.Line;
import lecho.lib.hellocharts.model.LineChartData;
import lecho.lib.hellocharts.model.PointValue;
import lecho.lib.hellocharts.model.ValueShape;
import lecho.lib.hellocharts.model.Viewport;
import lecho.lib.hellocharts.view.LineChartView;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
/**
* @类名: ${type_name}
* @功能描述:
* @作者: ${user}
* @时间: ${date}
* @最后修改者:
* @最后修改内容:
*/
public class WeatherActivity extends AppCompatActivity {
@BindView(R.id.title_city)
TextView titleCity;
@BindView(R.id.title_updata_time)
TextView titleUpdataTime;
@BindView(R.id.degree_text)
TextView degreeText;
@BindView(R.id.weather_info_text)
TextView weatherInfoText;
@BindView(R.id.forecast_layout)
LinearLayout forecastLayout;
@BindView(R.id.aqi_text)
TextView aqiText;
@BindView(R.id.pm25_text)
TextView pm25Text;
@BindView(R.id.comfort_text)
TextView comfortText;
@BindView(R.id.car_wash_text)
TextView carWashText;
@BindView(R.id.sport_text)
TextView sportText;
@BindView(R.id.weather_layout)
ScrollView weatherLayout;
@BindView(R.id.bing_pic_img)
ImageView bingPicImg;
@BindView(R.id.swipe_refresh)
SwipeRefreshLayout swipeRefresh;
@BindView(R.id.nav_button)
Button navButton;
@BindView(R.id.drawer_layout)
DrawerLayout drawerLayout;
@BindView(R.id.weather_wind_sc)
TextView weatherWindSc;
@BindView(R.id.air_brf)
TextView airBrf;
@BindView(R.id.air_text)
TextView airText;
@BindView(R.id.comfort_brf)
TextView comfortBrf;
@BindView(R.id.car_wash_brf)
TextView carWashBrf;
@BindView(R.id.sport_brf)
TextView sportBrf;
@BindView(R.id.drsg_brf)
TextView drsgBrf;
@BindView(R.id.drsg_text)
TextView drsgText;
@BindView(R.id.flu_brf)
TextView fluBrf;
@BindView(R.id.flu_text)
TextView fluText;
@BindView(R.id.trav_brf)
TextView travBrf;
@BindView(R.id.trav_text)
TextView travText;
@BindView(R.id.uv_brf)
TextView uvBrf;
@BindView(R.id.uv_text)
TextView uvText;
@BindView(R.id.line_chart)
LineChartView lineChart;
@BindView(R.id.aqi_zhiliang)
TextView aqiZhiliang;
private List<PointValue> mPointValues = new ArrayList<PointValue>();
private List<AxisValue> mAxisXValues = new ArrayList<AxisValue>();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// if (Build.VERSION.SDK_INT >= 21) {
// View dicorView = getWindow().getDecorView();
// dicorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View
// .SYSTEM_UI_FLAG_LAYOUT_STABLE);
// getWindow().setStatusBarColor(Color.TRANSPARENT);
// }
setContentView(R.layout.activity_weather);
ButterKnife.bind(this);
initEvent();
}
public void initEvent() {
swipeRefresh.setColorSchemeResources(R.color.colorPrimary);
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
String bingPic = sp.getString("bing_pic", null);
if (null != bingPic) {
Glide.with(this).load(bingPic).into(bingPicImg);
} else {
loadingPicImg();
}
String weatherStr = sp.getString("weather", null);
final String weatherId;
if (null != weatherStr) {
//有缓存直接解析天气数据
Weather weather = Utility.handleWeatherResponse(weatherStr);
weatherId = weather.basic.weatherId;
showWeatherInfo(weather);
} else {
//无缓存通过服务器查询
weatherId = getIntent().getStringExtra("weather_id");
weatherLayout.setVisibility(View.INVISIBLE);
requestWeather(weatherId);
}
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
requestWeather(weatherId);
}
});
navButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
drawerLayout.openDrawer(GravityCompat.START);
}
});
}
public void loadingPicImg() {
String requestPicUrl = "http://guolin.tech/api/bing_pic";
HttpUtils.sendOkHttpRequest(requestPicUrl, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
e.printStackTrace();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
final String bingPic = response.body().string();
SharedPreferences.Editor sp = PreferenceManager.getDefaultSharedPreferences(WeatherActivity.this)
.edit();
sp.putString("bing_pic", bingPic);
sp.apply();
runOnUiThread(new Runnable() {
@Override
public void run() {
Glide.with(WeatherActivity.this).load(bingPic).into(bingPicImg);
}
});
}
});
}
public void requestWeather(final String weatherId) {
String weatherUrl = Common.URL_WEATHER_CODE + "weather?city=" + weatherId + "&key=" + Common.URL_KEY;
HttpUtils.sendOkHttpRequest(weatherUrl, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(WeatherActivity.this, "获取天气信息失败", Toast.LENGTH_SHORT).show();
swipeRefresh.setRefreshing(false);
}
});
}
@Override
public void onResponse(Call call, Response response) throws IOException {
final String responseText = response.body().string();
final Weather weather = Utility.handleWeatherResponse(responseText);
runOnUiThread(new Runnable() {
@Override
public void run() {
if (null != weather && "ok".equalsIgnoreCase(weather.status)) {
SharedPreferences.Editor sp = PreferenceManager.getDefaultSharedPreferences
(WeatherActivity.this).edit();
sp.putString("weather", responseText);
sp.apply();
showWeatherInfo(weather);
} else {
Toast.makeText(WeatherActivity.this, "获取天气信息失败", Toast.LENGTH_SHORT).show();
}
swipeRefresh.setRefreshing(false);
}
});
}
});
loadingPicImg();
}
/**
* 处理并显示数据
*/
public void showWeatherInfo(Weather weather) {
if (null != weather && "ok".equalsIgnoreCase(weather.status)) {
String cityName = weather.basic.cityName;
String degree = weather.now.temperature + "℃";
String weatherInfo = weather.now.more.info;
titleCity.setText(cityName);
degreeText.setText(degree);
weatherInfoText.setText(weatherInfo);
weatherWindSc.setText(weather.now.wind.sc);
forecastLayout.removeAllViews();
for (Forecast forecast : weather.forecastList) {
View view = LayoutInflater.from(this).inflate(R.layout.forcast_item, forecastLayout, false);
TextView dataText = (TextView) view.findViewById(R.id.data_text);
TextView infoText = (TextView) view.findViewById(R.id.info_text);
TextView maxText = (TextView) view.findViewById(R.id.max_text);
TextView windScText = (TextView) view.findViewById(R.id.wind_sc);
dataText.setText(forecast.data);
infoText.setText(forecast.more.info);
maxText.setText(forecast.temperature.max + "℃" + "/" + forecast.temperature.min + "℃");
windScText.setText(forecast.wind.sc);
forecastLayout.addView(view);
}
if (null != weather.aqi) {
aqiText.setText(weather.aqi.city.aqi);
pm25Text.setText(weather.aqi.city.pm25);
aqiZhiliang.setText(weather.aqi.city.qlty);
}
airBrf.setText(weather.suggestion.air.brf);
airText.setText(weather.suggestion.air.info);
comfortBrf.setText(weather.suggestion.comfort.brf);
comfortText.setText(weather.suggestion.comfort.info);
carWashBrf.setText(weather.suggestion.carWash.brf);
carWashText.setText(weather.suggestion.carWash.info);
sportBrf.setText(weather.suggestion.sport.brf);
sportText.setText(weather.suggestion.sport.info);
drsgBrf.setText(weather.suggestion.drsg.brf);
drsgText.setText(weather.suggestion.drsg.info);
fluBrf.setText(weather.suggestion.flu.brf);
fluText.setText(weather.suggestion.flu.info);
travBrf.setText(weather.suggestion.trav.brf);
travText.setText(weather.suggestion.trav.info);
uvBrf.setText(weather.suggestion.uv.brf);
uvText.setText(weather.suggestion.uv.info);
mPointValues.clear();
mAxisXValues.clear();
getAxisXLables(weather.hourly);//获取x轴的标注
getAxisPoints(weather.hourly);//获取坐标点
initLineChart();//初始化
Intent intent = new Intent(this, AutoUpdataService.class);
startService(intent);
} else {
Toast.makeText(this, "获取天气信息失败", Toast.LENGTH_SHORT).show();
}
}
/**
* 初始化LineChart的一些设置
*/
private void initLineChart() {
Line line = new Line(mPointValues).setColor(Color.parseColor("#FFCD41")); //折线的颜色
List<Line> lines = new ArrayList<Line>();
line.setShape(ValueShape.CIRCLE);//折线图上每个数据点的形状 这里是圆形 (有三种 :ValueShape.SQUARE ValueShape.CIRCLE ValueShape
// .SQUARE)
line.setCubic(false);//曲线是否平滑
line.setStrokeWidth(2);//线条的粗细,默认是3
line.setFilled(false);//是否填充曲线的面积
line.setHasLabels(true);//曲线的数据坐标是否加上备注
// line.setHasLabelsOnlyForSelected(true);//点击数据坐标提示数据(设置了这个line.setHasLabels(true);就无效)
line.setHasLines(true);//是否用直线显示。如果为false 则没有曲线只有点显示
line.setHasPoints(true);//是否显示圆点 如果为false 则没有原点只有点显示
lines.add(line);
LineChartData data = new LineChartData();
data.setLines(lines);
//坐标轴
Axis axisX = new Axis(); //X轴
axisX.setHasTiltedLabels(false); //X轴下面坐标轴字体是斜的显示还是直的,true是斜的显示
// axisX.setTextColor(Color.WHITE); //设置字体颜色
axisX.setTextColor(Color.parseColor("#D6D6D9"));//灰色
// axisX.setName("未来几天的天气"); //表格名称
axisX.setTextSize(11);//设置字体大小
axisX.setMaxLabelChars(5); //最多几个X轴坐标,意思就是你的缩放让X轴上数据的个数7<=x<=mAxisValues.length
axisX.setValues(mAxisXValues); //填充X轴的坐标名称
data.setAxisXBottom(axisX); //x 轴在底部
// data.setAxisXTop(axisX); //x 轴在顶部
axisX.setHasLines(true); //x 轴分割线
Axis axisY = new Axis(); //Y轴
axisY.setName("");//y轴标注
axisY.setTextSize(11);//设置字体大小
data.setAxisYLeft(axisY); //Y轴设置在左边
//data.setAxisYRight(axisY); //y轴设置在右边
//设置行为属性,支持缩放、滑动以及平移
lineChart.setInteractive(true);
lineChart.setZoomType(ZoomType.HORIZONTAL); //缩放类型,水平
lineChart.setMaxZoom((float) 3);//缩放比例
lineChart.setLineChartData(data);
lineChart.setVisibility(View.VISIBLE);
Viewport v = new Viewport(lineChart.getMaximumViewport());
v.left = 0;
v.right = 7;
lineChart.setCurrentViewport(v);
}
/**
* X 轴的显示
*/
private void getAxisXLables(List<Hourly> hourly) {
for (int i = 0; i < hourly.size(); i++) {
String[] strings = hourly.get(i).data.split(" ");
mAxisXValues.add(new AxisValue(i).setLabel(strings[1]));
}
}
/**
* 图表的每个点的显示
*/
private void getAxisPoints(List<Hourly> hourly) {
for (int i = 0; i < hourly.size(); i++) {
mPointValues.add(new PointValue(i, Float.valueOf(hourly.get(i).tmp)));
}
}
}
//jhfghfh | [
"410903739@qq.com"
] | 410903739@qq.com |
071f9796f4a3c9742e2c83c816fe14d5ad1f7057 | f993a504023ad1807ca0ff81d040047c75855700 | /Cars/src/model/dao/UserDAOImp.java | 77981e55ebdc564797cbc38513b6be63a078012f | [] | no_license | TengSir/car | 30e3a6c9aa0a894dda20bf90d5e415c02ce6c6e0 | ab75cb63178764d6456bb09c50bbca45065e3ca3 | refs/heads/master | 2020-08-11T17:25:39.253587 | 2019-12-09T07:57:20 | 2019-12-09T07:57:20 | 214,601,652 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,238 | java | package model.dao;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import model.javabean.User;
public class UserDAOImp extends BaseDAOImp implements UserDAO {
public boolean register(User user) {
PreparedStatement pre=getPreSta("insert into user(userid,username,password,nickname,sex,age,image) values(null,?,?,?,?,?,?)");
try {
pre.setString(1, user.getUsername());
pre.setString(2, user.getPassword());
pre.setString(3, user.getNickname());
pre.setInt(4, Integer.parseInt(user.getSex()));
pre.setInt(5, user.getAge());
pre.setString(6, user.getImage());
} catch (Exception e) {
}
try {
return pre.executeUpdate()>0?true:false;
} catch (SQLException e) {
e.printStackTrace();
}finally {
try {
pre.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return false;
}
public boolean deleteUser(User user) {
return false;
}
public boolean updateUser(User user) {
return false;
}
public User login(String username, String password) {
User user=null;//定义一个user类型的对象,准备存储登陆查询语句查出来的用户对象信息
PreparedStatement sta=getPreSta("select * from user where username=? and password=?");
//注入参数
try {
sta.setString(1, username);
sta.setString(2, password);
//4.执行sql语句
ResultSet rs=sta.executeQuery();
if(rs.next()) {
user=new User();
user.setAge(rs.getInt("age"));
user.setUserid(rs.getInt("userid"));
user.setUsername(rs.getString("username"));
user.setNickname(rs.getString("nickname"));
user.setImage(rs.getString("image"));
}
rs.close();
} catch (Exception e) {
e.printStackTrace();
}
finally {
try {
sta.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return user;
}
@Override
public boolean checkUsername(String username) {
boolean result=false;
PreparedStatement pre=getPreSta("select count(*) from user where username=?");
try {
pre.setString(1, username);
ResultSet rs=pre.executeQuery();
rs.next();
result=rs.getInt(1)>0?true:false;
} catch (SQLException e) {
e.printStackTrace();
}
return result ;
}
}
| [
"TengSir@live.cn"
] | TengSir@live.cn |
369f8044c364962f7e847367cfcc6745ae8e66ef | 5a1a017e13c8f9eda62962345f1377bcc3bda7f4 | /src/roman/TestRoman.java | e37b054f5e9891352e3acec837e3f36be0fde9b4 | [] | no_license | ramonchiara/RomanToArabicKata | 5f6096dfdc6296d9cda895408d7ab2200260326c | ec217234d2130f86229197bfcd0634e150388020 | refs/heads/master | 2020-06-08T22:34:30.986268 | 2014-03-09T23:18:58 | 2014-03-09T23:18:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,714 | java | package roman;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
public class TestRoman {
private Roman roman;
@Test
public void iShouldBeOne() {
roman = new Roman("I");
assertThat(roman.intValue(), is(1));
}
@Test
public void iiShouldBeTwo() {
roman = new Roman("II");
assertThat(roman.intValue(), is(2));
}
@Test
public void iiiShouldBeThree() {
roman = new Roman("III");
assertThat(roman.intValue(), is(3));
}
@Test
public void ivShouldBeFour() {
roman = new Roman("IV");
assertThat(roman.intValue(), is(4));
}
@Test
public void vShouldBeFive() {
roman = new Roman("V");
assertThat(roman.intValue(), is(5));
}
@Test
public void viShouldBeSix() {
roman = new Roman("VI");
assertThat(roman.intValue(), is(6));
}
@Test
public void viiShouldBeSeven() {
roman = new Roman("VII");
assertThat(roman.intValue(), is(7));
}
@Test
public void viiiShouldBeEight() {
roman = new Roman("VIII");
assertThat(roman.intValue(), is(8));
}
@Test
public void ixShouldBeNine() {
roman = new Roman("IX");
assertThat(roman.intValue(), is(9));
}
@Test
public void xShouldBeTen() {
roman = new Roman("X");
assertThat(roman.intValue(), is(10));
}
@Test
public void xiShouldBeEleven() {
roman = new Roman("XI");
assertThat(roman.intValue(), is(11));
}
@Test
public void xiiShouldBeTwelve() {
roman = new Roman("XII");
assertThat(roman.intValue(), is(12));
}
@Test
public void xiiiShouldBeThirteen() {
roman = new Roman("XIII");
assertThat(roman.intValue(), is(13));
}
@Test
public void xxxiShouldBeThirtyOne() {
roman = new Roman("XXXI");
assertThat(roman.intValue(), is(31));
}
@Test
public void xxivShouldBeTwentyFour() {
roman = new Roman("XXIV");
assertThat(roman.intValue(), is(24));
}
@Test
public void xlShouldBeFourty() {
roman = new Roman("XL");
assertThat(roman.intValue(), is(40));
}
@Test
public void lShouldBeFifty() {
roman = new Roman("L");
assertThat(roman.intValue(), is(50));
}
@Test
public void lxShouldBeSixty() {
roman = new Roman("LX");
assertThat(roman.intValue(), is(60));
}
@Test
public void lxxShouldBeSeventy() {
roman = new Roman("LXX");
assertThat(roman.intValue(), is(70));
}
@Test
public void lxxxShouldBeEighty() {
roman = new Roman("LXXX");
assertThat(roman.intValue(), is(80));
}
@Test
public void cShouldBeOneHundred() {
roman = new Roman("C");
assertThat(roman.intValue(), is(100));
}
@Test
public void xcShouldBeNinety() {
roman = new Roman("XC");
assertThat(roman.intValue(), is(90));
}
@Test
public void ccclxixShouldBeThreeHundredAndSixtyNine() {
roman = new Roman("CCCLXIX");
assertThat(roman.intValue(), is(369));
}
@Test
public void dShouldBeFiveHundred() {
roman = new Roman("D");
assertThat(roman.intValue(), is(500));
}
@Test
public void cdShouldBeFourHundred() {
roman = new Roman("CD");
assertThat(roman.intValue(), is(400));
}
@Test
public void cdxlviiiShouldBeFourHundred() {
roman = new Roman("CDXLVIII");
assertThat(roman.intValue(), is(448));
}
@Test
public void mShouldBeOneThousand() {
roman = new Roman("M");
assertThat(roman.intValue(), is(1000));
}
@Test
public void mcmxcviiiShouldBeOneThousand() {
roman = new Roman("MCMXCVIII");
assertThat(roman.intValue(), is(1998));
}
@Test
public void mmdccliShouldBeOneThousand() {
roman = new Roman("MMDCCLI");
assertThat(roman.intValue(), is(2751));
}
}
| [
"someemail"
] | someemail |
1fe6f7f9fc82145f84c121148013bb5884744cdd | 4312a71c36d8a233de2741f51a2a9d28443cd95b | /RawExperiments/Lang/Lang63/3/AstorMain-lang_63/src/variant-764/org/apache/commons/lang/time/DurationFormatUtils.java | acb658d21144e80bec17c97d533c022ccefdc30b | [] | no_license | SajjadZaidi/AutoRepair | 5c7aa7a689747c143cafd267db64f1e365de4d98 | e21eb9384197bae4d9b23af93df73b6e46bb749a | refs/heads/master | 2021-05-07T00:07:06.345617 | 2017-12-02T18:48:14 | 2017-12-02T18:48:14 | 112,858,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,094 | java | package org.apache.commons.lang.time;
public class DurationFormatUtils {
public DurationFormatUtils() {
super();
}
public static final java.lang.String ISO_EXTENDED_FORMAT_PATTERN = "'P'yyyy'Y'M'M'd'DT'H'H'm'M's.S'S'";
public static java.lang.String formatDurationHMS(long durationMillis) {
return org.apache.commons.lang.time.DurationFormatUtils.formatDuration(durationMillis, "H:mm:ss.SSS");
}
public static java.lang.String formatDurationISO(long durationMillis) {
return org.apache.commons.lang.time.DurationFormatUtils.formatDuration(durationMillis, org.apache.commons.lang.time.DurationFormatUtils.ISO_EXTENDED_FORMAT_PATTERN, false);
}
public static java.lang.String formatDuration(long durationMillis, java.lang.String format) {
return org.apache.commons.lang.time.DurationFormatUtils.formatDuration(durationMillis, format, true);
}
public static java.lang.String formatDuration(long durationMillis, java.lang.String format, boolean padWithZeros) {
org.apache.commons.lang.time.DurationFormatUtils.Token[] tokens = org.apache.commons.lang.time.DurationFormatUtils.lexx(format);
int days = 0;
int hours = 0;
int minutes = 0;
int seconds = 0;
int milliseconds = 0;
if (org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.d)) {
days = ((int)(durationMillis / (org.apache.commons.lang.time.DateUtils.MILLIS_PER_DAY)));
durationMillis = durationMillis - (days * (org.apache.commons.lang.time.DateUtils.MILLIS_PER_DAY));
}
if (org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.H)) {
hours = ((int)(durationMillis / (org.apache.commons.lang.time.DateUtils.MILLIS_PER_HOUR)));
durationMillis = durationMillis - (hours * (org.apache.commons.lang.time.DateUtils.MILLIS_PER_HOUR));
}
if (org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.m)) {
minutes = ((int)(durationMillis / (org.apache.commons.lang.time.DateUtils.MILLIS_PER_MINUTE)));
durationMillis = durationMillis - (minutes * (org.apache.commons.lang.time.DateUtils.MILLIS_PER_MINUTE));
}
if (org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.s)) {
seconds = ((int)(durationMillis / (org.apache.commons.lang.time.DateUtils.MILLIS_PER_SECOND)));
durationMillis = durationMillis - (seconds * (org.apache.commons.lang.time.DateUtils.MILLIS_PER_SECOND));
}
if (org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.S)) {
milliseconds = ((int)(durationMillis));
}
return org.apache.commons.lang.time.DurationFormatUtils.format(tokens, 0, 0, days, hours, minutes, seconds, milliseconds, padWithZeros);
}
public static java.lang.String formatDurationWords(long durationMillis, boolean suppressLeadingZeroElements, boolean suppressTrailingZeroElements) {
java.lang.String duration = org.apache.commons.lang.time.DurationFormatUtils.formatDuration(durationMillis, "d' days 'H' hours 'm' minutes 's' seconds'");
if (suppressLeadingZeroElements) {
duration = " " + duration;
java.lang.String tmp = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 0 days", "");
if ((tmp.length()) != (duration.length())) {
duration = tmp;
tmp = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 0 hours", "");
if ((tmp.length()) != (duration.length())) {
duration = tmp;
tmp = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 0 minutes", "");
duration = tmp;
if ((tmp.length()) != (duration.length())) {
duration = org.apache.commons.lang.StringUtils.replaceOnce(tmp, " 0 seconds", "");
}
}
}
if ((duration.length()) != 0) {
duration = duration.substring(1);
}
}
if (suppressTrailingZeroElements) {
java.lang.String tmp = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 0 seconds", "");
if ((tmp.length()) != (duration.length())) {
duration = tmp;
tmp = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 0 minutes", "");
if ((tmp.length()) != (duration.length())) {
duration = tmp;
tmp = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 0 hours", "");
if ((tmp.length()) != (duration.length())) {
duration = org.apache.commons.lang.StringUtils.replaceOnce(tmp, " 0 days", "");
}
}
}
}
duration = " " + duration;
duration = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 1 seconds", " 1 second");
duration = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 1 minutes", " 1 minute");
duration = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 1 hours", " 1 hour");
duration = org.apache.commons.lang.StringUtils.replaceOnce(duration, " 1 days", " 1 day");
return duration.trim();
}
public static java.lang.String formatPeriodISO(long startMillis, long endMillis) {
return org.apache.commons.lang.time.DurationFormatUtils.formatPeriod(startMillis, endMillis, org.apache.commons.lang.time.DurationFormatUtils.ISO_EXTENDED_FORMAT_PATTERN, false, java.util.TimeZone.getDefault());
}
public static java.lang.String formatPeriod(long startMillis, long endMillis, java.lang.String format) {
return org.apache.commons.lang.time.DurationFormatUtils.formatPeriod(startMillis, endMillis, format, true, java.util.TimeZone.getDefault());
}
public static java.lang.String formatPeriod(long startMillis, long endMillis, java.lang.String format, boolean padWithZeros, java.util.TimeZone timezone) {
long millis = endMillis - startMillis;
if (millis < (28 * (org.apache.commons.lang.time.DateUtils.MILLIS_PER_DAY))) {
return org.apache.commons.lang.time.DurationFormatUtils.formatDuration(millis, format, padWithZeros);
}
org.apache.commons.lang.time.DurationFormatUtils.Token[] tokens = org.apache.commons.lang.time.DurationFormatUtils.lexx(format);
java.util.Calendar start = java.util.Calendar.getInstance(timezone);
start.setTime(new java.util.Date(startMillis));
java.util.Calendar end = java.util.Calendar.getInstance(timezone);
end.setTime(new java.util.Date(endMillis));
int milliseconds = (end.get(java.util.Calendar.MILLISECOND)) - (start.get(java.util.Calendar.MILLISECOND));
int seconds = (end.get(java.util.Calendar.SECOND)) - (start.get(java.util.Calendar.SECOND));
int minutes = (end.get(java.util.Calendar.MINUTE)) - (start.get(java.util.Calendar.MINUTE));
int hours = (end.get(java.util.Calendar.HOUR_OF_DAY)) - (start.get(java.util.Calendar.HOUR_OF_DAY));
int days = (end.get(java.util.Calendar.DAY_OF_MONTH)) - (start.get(java.util.Calendar.DAY_OF_MONTH));
int months = (end.get(java.util.Calendar.MONTH)) - (start.get(java.util.Calendar.MONTH));
int years = (end.get(java.util.Calendar.YEAR)) - (start.get(java.util.Calendar.YEAR));
while (milliseconds < 0) {
milliseconds += 1000;
seconds -= 1;
}
while (seconds < 0) {
seconds += 60;
minutes -= 1;
}
while (minutes < 0) {
minutes += 60;
hours -= 1;
}
while (hours < 0) {
hours += 24;
days -= 1;
}
while (days < 0) {
days += 31;
months -= 1;
}
while (months < 0) {
months += 12;
years -= 1;
}
milliseconds -= org.apache.commons.lang.time.DurationFormatUtils.reduceAndCorrect(start, end, java.util.Calendar.MILLISECOND, milliseconds);
seconds -= org.apache.commons.lang.time.DurationFormatUtils.reduceAndCorrect(start, end, java.util.Calendar.SECOND, seconds);
minutes -= org.apache.commons.lang.time.DurationFormatUtils.reduceAndCorrect(start, end, java.util.Calendar.MINUTE, minutes);
hours -= org.apache.commons.lang.time.DurationFormatUtils.reduceAndCorrect(start, end, java.util.Calendar.HOUR_OF_DAY, hours);
days -= org.apache.commons.lang.time.DurationFormatUtils.reduceAndCorrect(start, end, java.util.Calendar.DAY_OF_MONTH, days);
months -= org.apache.commons.lang.time.DurationFormatUtils.reduceAndCorrect(start, end, java.util.Calendar.MONTH, months);
years -= org.apache.commons.lang.time.DurationFormatUtils.reduceAndCorrect(start, end, java.util.Calendar.YEAR, years);
if (!(org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.y))) {
if (org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.M)) {
months += 12 * years;
years = 0;
} else {
days += 365 * years;
years = 0;
}
}
if (!(org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.M))) {
days += (end.get(java.util.Calendar.DAY_OF_YEAR)) - (start.get(java.util.Calendar.DAY_OF_YEAR));
months = 0;
}
if (!(org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.d))) {
hours += 24 * days;
days = 0;
}
if (!(org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.H))) {
minutes += 60 * hours;
hours = 0;
}
if (!(org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.m))) {
seconds += 60 * minutes;
minutes = 0;
}
if (!(org.apache.commons.lang.time.DurationFormatUtils.Token.containsTokenWithValue(tokens, org.apache.commons.lang.time.DurationFormatUtils.s))) {
milliseconds += 1000 * seconds;
seconds = 0;
}
return org.apache.commons.lang.time.DurationFormatUtils.format(tokens, years, months, days, hours, minutes, seconds, milliseconds, padWithZeros);
}
static java.lang.String format(org.apache.commons.lang.time.DurationFormatUtils.Token[] tokens, int years, int months, int days, int hours, int minutes, int seconds, int milliseconds, boolean padWithZeros) {
java.lang.StringBuffer buffer = new java.lang.StringBuffer();
boolean lastOutputSeconds = false;
int sz = tokens.length;
for (int i = 0 ; i < sz ; i++) {
org.apache.commons.lang.time.DurationFormatUtils.Token token = tokens[i];
java.lang.Object value = token.getValue();
int count = token.getCount();
if (value instanceof java.lang.StringBuffer) {
buffer.append(value.toString());
} else {
if (value == (org.apache.commons.lang.time.DurationFormatUtils.y)) {
buffer.append((padWithZeros ? org.apache.commons.lang.StringUtils.leftPad(java.lang.Integer.toString(years), count, '0') : java.lang.Integer.toString(years)));
lastOutputSeconds = false;
} else {
if (value == (org.apache.commons.lang.time.DurationFormatUtils.M)) {
buffer.append((padWithZeros ? org.apache.commons.lang.StringUtils.leftPad(java.lang.Integer.toString(months), count, '0') : java.lang.Integer.toString(months)));
lastOutputSeconds = false;
} else {
if (value == (org.apache.commons.lang.time.DurationFormatUtils.d)) {
buffer.append((padWithZeros ? org.apache.commons.lang.StringUtils.leftPad(java.lang.Integer.toString(days), count, '0') : java.lang.Integer.toString(days)));
lastOutputSeconds = false;
} else {
if (value == (org.apache.commons.lang.time.DurationFormatUtils.H)) {
buffer.append((padWithZeros ? org.apache.commons.lang.StringUtils.leftPad(java.lang.Integer.toString(hours), count, '0') : java.lang.Integer.toString(hours)));
lastOutputSeconds = false;
} else {
if (value == (org.apache.commons.lang.time.DurationFormatUtils.m)) {
buffer.append((padWithZeros ? org.apache.commons.lang.StringUtils.leftPad(java.lang.Integer.toString(minutes), count, '0') : java.lang.Integer.toString(minutes)));
lastOutputSeconds = false;
} else {
if (value == (org.apache.commons.lang.time.DurationFormatUtils.s)) {
buffer.append((padWithZeros ? org.apache.commons.lang.StringUtils.leftPad(java.lang.Integer.toString(seconds), count, '0') : java.lang.Integer.toString(seconds)));
lastOutputSeconds = true;
} else {
if (value == (org.apache.commons.lang.time.DurationFormatUtils.S)) {
if (lastOutputSeconds) {
milliseconds += 1000;
java.lang.String str = padWithZeros ? org.apache.commons.lang.StringUtils.leftPad(java.lang.Integer.toString(milliseconds), count, '0') : java.lang.Integer.toString(milliseconds);
buffer.append(str.substring(1));
} else {
buffer.append((padWithZeros ? org.apache.commons.lang.StringUtils.leftPad(java.lang.Integer.toString(milliseconds), count, '0') : java.lang.Integer.toString(milliseconds)));
}
lastOutputSeconds = false;
}
}
}
}
}
}
}
}
}
return buffer.toString();
}
static int reduceAndCorrect(java.util.Calendar start, java.util.Calendar end, int field, int difference) {
end.add(field, ((-1) * difference));
int endValue = end.get(field);
int startValue = start.get(field);
if (endValue < startValue) {
int newdiff = startValue - endValue;
end.add(field, newdiff);
return newdiff;
} else {
return 0;
}
}
static final java.lang.Object y = "y";
static final java.lang.Object M = "M";
static final java.lang.Object d = "d";
static final java.lang.Object H = "H";
static final java.lang.Object m = "m";
static final java.lang.Object s = "s";
static final java.lang.Object S = "S";
static org.apache.commons.lang.time.DurationFormatUtils.Token[] lexx(java.lang.String format) {
char[] array = format.toCharArray();
java.util.ArrayList list = new java.util.ArrayList(array.length);
java.lang.StringBuffer buffer = null;
org.apache.commons.lang.time.DurationFormatUtils.Token previous = null;
int sz = array.length;
for (int i = 0 ; i < sz ; i++) {
char ch = array[i];
if (inLiteral && (ch != '\'')) {
buffer.append(ch);
continue;
}
java.lang.Object value = null;
switch (ch) {
case '\'' :
if (inLiteral) {
buffer = null;
inLiteral = false;
} else {
buffer = new java.lang.StringBuffer();
list.add(new org.apache.commons.lang.time.DurationFormatUtils.Token(buffer));
inLiteral = true;
}
break;
case 'y' :
value = org.apache.commons.lang.time.DurationFormatUtils.y;
break;
case 'M' :
value = org.apache.commons.lang.time.DurationFormatUtils.M;
break;
case 'd' :
value = org.apache.commons.lang.time.DurationFormatUtils.d;
break;
case 'H' :
value = org.apache.commons.lang.time.DurationFormatUtils.H;
break;
case 'm' :
value = org.apache.commons.lang.time.DurationFormatUtils.m;
break;
case 's' :
value = org.apache.commons.lang.time.DurationFormatUtils.s;
break;
case 'S' :
value = org.apache.commons.lang.time.DurationFormatUtils.S;
break;
default :
if (buffer == null) {
buffer = new java.lang.StringBuffer();
list.add(new org.apache.commons.lang.time.DurationFormatUtils.Token(buffer));
}
buffer.append(ch);
}
if (value != null) {
if ((previous != null) && ((previous.getValue()) == value)) {
previous.increment();
} else {
org.apache.commons.lang.time.DurationFormatUtils.Token token = new org.apache.commons.lang.time.DurationFormatUtils.Token(value);
list.add(token);
previous = token;
}
buffer = null;
}
}
return ((org.apache.commons.lang.time.DurationFormatUtils.Token[])(list.toArray(new org.apache.commons.lang.time.DurationFormatUtils.Token[0])));
}
static class Token {
static boolean containsTokenWithValue(org.apache.commons.lang.time.DurationFormatUtils.Token[] tokens, java.lang.Object value) {
int sz = tokens.length;
for (int i = 0 ; i < sz ; i++) {
if ((tokens[i].getValue()) == value) {
return true;
}
}
return false;
}
private java.lang.Object value;
private int count;
Token(java.lang.Object value) {
org.apache.commons.lang.time.DurationFormatUtils.Token.this.value = value;
org.apache.commons.lang.time.DurationFormatUtils.Token.this.count = 1;
}
Token(java.lang.Object value ,int count) {
org.apache.commons.lang.time.DurationFormatUtils.Token.this.value = value;
org.apache.commons.lang.time.DurationFormatUtils.Token.this.count = count;
}
void increment() {
(count)++;
}
int getCount() {
return count;
}
java.lang.Object getValue() {
return value;
}
public boolean equals(java.lang.Object obj2) {
if (obj2 instanceof org.apache.commons.lang.time.DurationFormatUtils.Token) {
org.apache.commons.lang.time.DurationFormatUtils.Token tok2 = ((org.apache.commons.lang.time.DurationFormatUtils.Token)(obj2));
if ((org.apache.commons.lang.time.DurationFormatUtils.Token.this.value.getClass()) != (tok2.value.getClass())) {
return false;
}
if ((org.apache.commons.lang.time.DurationFormatUtils.Token.this.count) != (tok2.count)) {
return false;
}
if ((org.apache.commons.lang.time.DurationFormatUtils.Token.this.value) instanceof java.lang.StringBuffer) {
return org.apache.commons.lang.time.DurationFormatUtils.Token.this.value.toString().equals(tok2.value.toString());
} else {
if ((org.apache.commons.lang.time.DurationFormatUtils.Token.this.value) instanceof java.lang.Number) {
return org.apache.commons.lang.time.DurationFormatUtils.Token.this.value.equals(tok2.value);
} else {
return (org.apache.commons.lang.time.DurationFormatUtils.Token.this.value) == (tok2.value);
}
}
} else {
return false;
}
}
public int hashCode() {
return org.apache.commons.lang.time.DurationFormatUtils.Token.this.value.hashCode();
}
public java.lang.String toString() {
return org.apache.commons.lang.StringUtils.repeat(org.apache.commons.lang.time.DurationFormatUtils.Token.this.value.toString(), org.apache.commons.lang.time.DurationFormatUtils.Token.this.count);
}
}
}
| [
"sajjad.syed@ucalgary.ca"
] | sajjad.syed@ucalgary.ca |
cbf68f5327d6152915c981d232d634d6c59f69e3 | 0dd6326cc1b96dfec99e68475c1259404da1f1a5 | /library/src/main/java/com/mainaer/wjoklib/okhttp/download/dao/DownloadDao.java | 0a87c8a417b9d9a71dffc613fd8be936ad56005b | [] | no_license | liyimeifeng/Duandianxuchuan | dec0e99db63741975f8b4450299d64e07cb0e64b | 140163f4ef0cccb42673d8d0417d4cc1f06e325c | refs/heads/master | 2021-01-19T23:19:06.658834 | 2017-04-21T08:06:19 | 2017-04-21T08:06:19 | 88,957,824 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,055 | java | package com.mainaer.wjoklib.okhttp.download.dao;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.DaoConfig;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "download".
*/
public class DownloadDao extends AbstractDao<DownloadEntity, String> {
public static final String TABLENAME = "download";
/**
* Properties of entity DownloadEntity.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property DownloadId = new Property(0, String.class, "downloadId", true, "DOWNLOAD_ID");
public final static Property ToolSize = new Property(1, Long.class, "toolSize", false, "TOOL_SIZE");
public final static Property CompletedSize = new Property(2, Long.class, "completedSize", false, "COMPLETED_SIZE");
public final static Property Url = new Property(3, String.class, "url", false, "URL");
public final static Property SaveDirPath = new Property(4, String.class, "saveDirPath", false, "SAVE_DIR_PATH");
public final static Property FileName = new Property(5, String.class, "fileName", false, "FILE_NAME");
public final static Property DownloadStatus = new Property(6, Integer.class, "downloadStatus", false, "DOWNLOAD_STATUS");
};
public DownloadDao(DaoConfig config) {
super(config);
}
public DownloadDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"download\" (" + //
"\"DOWNLOAD_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: downloadId
"\"TOOL_SIZE\" INTEGER," + // 1: toolSize
"\"COMPLETED_SIZE\" INTEGER," + // 2: completedSize
"\"URL\" TEXT," + // 3: url
"\"SAVE_DIR_PATH\" TEXT," + // 4: saveDirPath
"\"FILE_NAME\" TEXT," + // 5: fileName
"\"DOWNLOAD_STATUS\" INTEGER);"); // 6: downloadStatus
}
/** Drops the underlying database table. */
public static void dropTable(SQLiteDatabase db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"download\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, DownloadEntity entity) {
stmt.clearBindings();
String downloadId = entity.getDownloadId();
if (downloadId != null) {
stmt.bindString(1, downloadId);
}
Long toolSize = entity.getToolSize();
if (toolSize != null) {
stmt.bindLong(2, toolSize);
}
Long completedSize = entity.getCompletedSize();
if (completedSize != null) {
stmt.bindLong(3, completedSize);
}
String url = entity.getUrl();
if (url != null) {
stmt.bindString(4, url);
}
String saveDirPath = entity.getSaveDirPath();
if (saveDirPath != null) {
stmt.bindString(5, saveDirPath);
}
String fileName = entity.getFileName();
if (fileName != null) {
stmt.bindString(6, fileName);
}
Integer downloadStatus = entity.getDownloadStatus();
if (downloadStatus != null) {
stmt.bindLong(7, downloadStatus);
}
}
/** @inheritdoc */
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
}
/** @inheritdoc */
@Override
public DownloadEntity readEntity(Cursor cursor, int offset) {
DownloadEntity entity = new DownloadEntity( //
cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // downloadId
cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1), // toolSize
cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2), // completedSize
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // url
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // saveDirPath
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // fileName
cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6) // downloadStatus
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, DownloadEntity entity, int offset) {
entity.setDownloadId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
entity.setToolSize(cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1));
entity.setCompletedSize(cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2));
entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setSaveDirPath(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setFileName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setDownloadStatus(cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6));
}
/** @inheritdoc */
@Override
protected String updateKeyAfterInsert(DownloadEntity entity, long rowId) {
return entity.getDownloadId();
}
/** @inheritdoc */
@Override
public String getKey(DownloadEntity entity) {
if(entity != null) {
return entity.getDownloadId();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}
| [
"liyi@dftcmedia.com"
] | liyi@dftcmedia.com |
749aa38c28f803849588fd6a8377de385ddb4868 | f48811b965d3f95a53aac356a0ca525b0c42ddde | /src/lab6_denisgallegos/Principal.java | a7d67b592afb9ff311a9a404013dfeea20ac6f4e | [] | no_license | D3nisGallegos/Lab5_DenisGallegos | 3a71e9bb80beafded3593c001744a332ce7bd857 | bf9a326942f548a2a06ba25d1762dab0a8af9e31 | refs/heads/master | 2023-01-21T21:35:58.912714 | 2020-11-21T02:22:56 | 2020-11-21T02:22:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 61,126 | java | /*
*/
package lab6_denisgallegos;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import java.util.Random;
public class Principal extends javax.swing.JFrame {
public Principal() {
initComponents();
this.setLocationRelativeTo(null);
}
ArrayList clasesguardadas = new ArrayList();
ArrayList cuentas = new ArrayList();
ArrayList maestros = new ArrayList();
ArrayList clases = new ArrayList();
int indiceclases = 0;
int indice = 0;
public boolean validar(String n){
boolean v = true;
try{
double valor = Double.parseDouble(n);
if (valor < 0){
v = false;
JOptionPane.showMessageDialog(null, "Entrada no valida", "ERROR DE ENTRADA", 0);
}
}catch (Exception e){
JOptionPane.showMessageDialog(null, "entrada no valida.", "Error.", 0);
v = false;
}
return v;
}//Fin del metodo validar.
public boolean validarint(String n){
boolean v = true;
try{
int valor = Integer.parseInt(n);
if (valor < 0){
v = false;
JOptionPane.showMessageDialog(null, "Entrada no valida", "ERROR DE ENTRADA", 0);
}
}catch (Exception e){
JOptionPane.showMessageDialog(null, "entrada no valida.", "Error.", 0);
v = false;
}
return v;
}//Fin del metodo validar.
public void llenarcombobox(){
ArrayList lic = new ArrayList();
lic.add("Finanzas");
lic.add("Derecho");
lic.add("Admin. Empresas");
lic.add("Disenio Grafico");
lic.add("Mercadotecnia");
ArrayList ing = new ArrayList();
ing.add("Sistemas Comp.");
ing.add("Industrial");
ing.add("Mecatronica");
ing.add("Biomedica");
ing.add("Energia");
ArrayList doc = new ArrayList();
doc.add("Medicina");
doc.add("Odontologia");
doc.add("Nutricion");
doc.add("Terapia");
if (jComboBox4.getSelectedItem().equals("Licenciaturas")){
for (int c = 0; c < lic.size();c++){
jComboBox5.addItem(lic.get(c) +"");
}
}else if (jComboBox4.getSelectedItem().equals("Ingenierias")){
for (int c = 0; c < ing.size();c++){
jComboBox5.addItem(ing.get(c) +"");
}
}else {
for (int c = 0; c < doc.size();c++){
jComboBox5.addItem(doc.get(c) +"");
}
}
}
public int generarcenta(){
boolean v = false;
String cuenta = "";
while (v == false){
cuenta = "";
for (int c = 0; c < 5;c++){
Random aleatorio = new Random();
cuenta += 1+aleatorio.nextInt(9) + "";
}
int num = Integer.parseInt(cuenta);
if (cuentas.contains(num)){
v = false;
}else{
v = true;
}
}
return Integer.parseInt(cuenta);
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPopupMenu1 = new javax.swing.JPopupMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
jMenuItem5 = new javax.swing.JMenuItem();
jPopupMenu2 = new javax.swing.JPopupMenu();
jMenuItem3 = new javax.swing.JMenuItem();
jMenuItem4 = new javax.swing.JMenuItem();
jMenuItem6 = new javax.swing.JMenuItem();
jPopupMenu3 = new javax.swing.JPopupMenu();
jMenuItem7 = new javax.swing.JMenuItem();
jMenuItem8 = new javax.swing.JMenuItem();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jSpinner1 = new javax.swing.JSpinner();
jComboBox1 = new javax.swing.JComboBox<>();
jLabel6 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList<>();
jScrollPane2 = new javax.swing.JScrollPane();
jList2 = new javax.swing.JList<>();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jLabel11 = new javax.swing.JLabel();
jTextField5 = new javax.swing.JTextField();
jLabel12 = new javax.swing.JLabel();
jTextField6 = new javax.swing.JTextField();
jTextField7 = new javax.swing.JTextField();
jLabel13 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox<>();
jLabel14 = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
panel1 = new java.awt.Panel();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jTextField8 = new javax.swing.JTextField();
jLabel17 = new javax.swing.JLabel();
jTextField9 = new javax.swing.JTextField();
jLabel18 = new javax.swing.JLabel();
jSpinner2 = new javax.swing.JSpinner();
jLabel19 = new javax.swing.JLabel();
jComboBox3 = new javax.swing.JComboBox<>();
jButton3 = new javax.swing.JButton();
jLabel20 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
jComboBox4 = new javax.swing.JComboBox<>();
jLabel23 = new javax.swing.JLabel();
jComboBox5 = new javax.swing.JComboBox<>();
jTextField11 = new javax.swing.JTextField();
jLabel24 = new javax.swing.JLabel();
jLabel25 = new javax.swing.JLabel();
jTextField12 = new javax.swing.JTextField();
jButton4 = new javax.swing.JButton();
jLabel26 = new javax.swing.JLabel();
jScrollPane3 = new javax.swing.JScrollPane();
jList3 = new javax.swing.JList<>();
jLabel27 = new javax.swing.JLabel();
jScrollPane4 = new javax.swing.JScrollPane();
jList4 = new javax.swing.JList<>();
panel2 = new java.awt.Panel();
jScrollPane5 = new javax.swing.JScrollPane();
jTree1 = new javax.swing.JTree();
jPopupMenu1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPopupMenu1MouseClicked(evt);
}
});
jMenuItem1.setText("Modificar");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jPopupMenu1.add(jMenuItem1);
jMenuItem2.setText("Eliminar");
jMenuItem2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jMenuItem2MouseClicked(evt);
}
});
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jPopupMenu1.add(jMenuItem2);
jMenuItem5.setText("Asignar clases guardadas");
jPopupMenu1.add(jMenuItem5);
jPopupMenu2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPopupMenu2MouseClicked(evt);
}
});
jMenuItem3.setText("Modificar");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jPopupMenu2.add(jMenuItem3);
jMenuItem4.setText("Eliminar");
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jPopupMenu2.add(jMenuItem4);
jMenuItem6.setText("Guardar clase");
jMenuItem6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jMenuItem6MouseClicked(evt);
}
});
jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jPopupMenu2.add(jMenuItem6);
jPopupMenu3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPopupMenu3MouseClicked(evt);
}
});
jMenuItem7.setText("Modificar");
jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem7ActionPerformed(evt);
}
});
jPopupMenu3.add(jMenuItem7);
jMenuItem8.setText("Eliminar");
jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem8ActionPerformed(evt);
}
});
jPopupMenu3.add(jMenuItem8);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(153, 153, 255));
jLabel1.setForeground(new java.awt.Color(0, 0, 0));
jLabel1.setText("Ingrese maestro: ");
jLabel2.setForeground(new java.awt.Color(0, 0, 0));
jLabel2.setText("Nombre: ");
jLabel3.setForeground(new java.awt.Color(0, 0, 0));
jLabel3.setText("Apellido: ");
jLabel4.setForeground(new java.awt.Color(0, 0, 0));
jLabel4.setText("Edad: ");
jTextField3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField3ActionPerformed(evt);
}
});
jLabel5.setForeground(new java.awt.Color(0, 0, 0));
jLabel5.setText("Salario: ");
jButton1.setText("Agregar profesor");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jSpinner1.setModel(new javax.swing.SpinnerNumberModel(0, 0, 130, 1));
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Masculino", "Femenino" }));
jLabel6.setForeground(new java.awt.Color(0, 0, 0));
jLabel6.setText("Genero: ");
jList1.setModel(new DefaultListModel());
jList1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jList1MouseClicked(evt);
}
});
jScrollPane1.setViewportView(jList1);
jList2.setModel(new DefaultListModel());
jList2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jList2MouseClicked(evt);
}
});
jScrollPane2.setViewportView(jList2);
jLabel7.setForeground(new java.awt.Color(0, 0, 0));
jLabel7.setText("Maestros: ");
jLabel8.setForeground(new java.awt.Color(0, 0, 0));
jLabel8.setText("Todas las clases:");
jLabel9.setForeground(new java.awt.Color(0, 0, 0));
jLabel9.setText("Agregar una clase:");
jLabel10.setForeground(new java.awt.Color(0, 0, 0));
jLabel10.setText("Nombre:");
jLabel11.setForeground(new java.awt.Color(0, 0, 0));
jLabel11.setText("Seccion: ");
jLabel12.setForeground(new java.awt.Color(0, 0, 0));
jLabel12.setText("Edificio:");
jLabel13.setForeground(new java.awt.Color(0, 0, 0));
jLabel13.setText("Salon: ");
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SI", "NO" }));
jLabel14.setForeground(new java.awt.Color(0, 0, 0));
jLabel14.setText("Aire: ");
jButton2.setText("Agregar clase");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton5.setText("Modificar");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jButton6.setText("Modificar");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 593, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 615, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBox1, 0, 122, Short.MAX_VALUE)
.addComponent(jTextField3)
.addComponent(jTextField1)
.addComponent(jTextField2)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(130, 130, 130)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel10)
.addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton1)
.addGap(18, 18, 18)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(81, 81, 81)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(99, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(67, 67, 67)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBox2, 0, 120, Short.MAX_VALUE)
.addComponent(jTextField7)
.addComponent(jTextField6)
.addComponent(jLabel9)
.addComponent(jTextField4)
.addComponent(jTextField5))
.addGap(117, 117, 117))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel9))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel10)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(27, 27, 27)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(23, 23, 23)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton5))
.addGap(15, 15, 15)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12)
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel5))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13))))
.addGap(27, 27, 27)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2)
.addComponent(jButton6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)))
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(17, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Menu Maestros", jPanel1);
panel1.setBackground(new java.awt.Color(153, 255, 153));
jLabel15.setForeground(new java.awt.Color(0, 0, 0));
jLabel15.setText("Ingrese estudiante: ");
jLabel16.setForeground(new java.awt.Color(0, 0, 0));
jLabel16.setText("Nombre: ");
jLabel17.setForeground(new java.awt.Color(0, 0, 0));
jLabel17.setText("Apellido: ");
jLabel18.setForeground(new java.awt.Color(0, 0, 0));
jLabel18.setText("Edad: ");
jSpinner2.setModel(new javax.swing.SpinnerNumberModel(0, 0, 130, 1));
jLabel19.setForeground(new java.awt.Color(0, 0, 0));
jLabel19.setText("Genero: ");
jComboBox3.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Masculino", "Femenino" }));
jButton3.setText("Agregar Estudiante");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jLabel20.setForeground(new java.awt.Color(0, 0, 0));
jLabel20.setText("Agregar carrera: ");
jLabel22.setForeground(new java.awt.Color(0, 0, 0));
jLabel22.setText("Facultad: ");
jComboBox4.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Licenciaturas", "Ingenierias", "Ciencias de la Salud" }));
jComboBox4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox4ActionPerformed(evt);
}
});
jLabel23.setForeground(new java.awt.Color(0, 0, 0));
jLabel23.setText("Carrera:");
jLabel24.setForeground(new java.awt.Color(0, 0, 0));
jLabel24.setText("Costo: ");
jLabel25.setForeground(new java.awt.Color(0, 0, 0));
jLabel25.setText("Jefe");
jTextField12.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField12ActionPerformed(evt);
}
});
jButton4.setText("Agregar Carrera");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jLabel26.setForeground(new java.awt.Color(0, 0, 0));
jLabel26.setText("Estudiantes: ");
jList3.setModel(new DefaultListModel());
jScrollPane3.setViewportView(jList3);
jLabel27.setForeground(new java.awt.Color(0, 0, 0));
jLabel27.setText("Todas las carreras: ");
jList4.setModel(new DefaultListModel());
jList4.setEnabled(false);
jScrollPane4.setViewportView(jList4);
javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1);
panel1.setLayout(panel1Layout);
panel1Layout.setHorizontalGroup(
panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel1Layout.createSequentialGroup()
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel17, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(panel1Layout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField8)
.addComponent(jTextField9, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE)
.addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE))
.addGroup(panel1Layout.createSequentialGroup()
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel15)
.addGroup(panel1Layout.createSequentialGroup()
.addGap(2, 2, 2)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton3)
.addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(0, 0, Short.MAX_VALUE)))
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel1Layout.createSequentialGroup()
.addGap(194, 194, 194)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel1Layout.createSequentialGroup()
.addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, panel1Layout.createSequentialGroup()
.addComponent(jLabel24)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, panel1Layout.createSequentialGroup()
.addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(panel1Layout.createSequentialGroup()
.addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(12, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel1Layout.createSequentialGroup()
.addComponent(jLabel20)
.addGap(120, 120, 120))))
.addGroup(panel1Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 641, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 637, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
);
panel1Layout.setVerticalGroup(
panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel1Layout.createSequentialGroup()
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel1Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel15)
.addGap(18, 18, 18)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel16)
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(20, 20, 20)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel17)
.addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(34, 34, 34)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel18)
.addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(panel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel20)
.addGap(48, 48, 48)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel22)
.addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel23)
.addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel24)
.addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(24, 24, 24)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel19)
.addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel25))
.addGap(31, 31, 31)
.addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton3)
.addComponent(jButton4))
.addGap(26, 26, 26)
.addComponent(jLabel26)
.addGap(18, 18, 18)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel27)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(39, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Menu Estudiantes", panel1);
panel2.setBackground(new java.awt.Color(255, 153, 153));
javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("JTree");
javax.swing.tree.DefaultMutableTreeNode treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Facultades");
javax.swing.tree.DefaultMutableTreeNode treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Ingenieria");
javax.swing.tree.DefaultMutableTreeNode treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Sistemas. comp");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Energia");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Industrial");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Mecatronica");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Biomedica");
treeNode3.add(treeNode4);
treeNode2.add(treeNode3);
treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Licenciatura");
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Derecho");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Finanzas");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Admin.Empresas");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Mercadotecnia");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Disenio Grafico");
treeNode3.add(treeNode4);
treeNode2.add(treeNode3);
treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Salud");
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Medicina");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Odontologia");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Terapia");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Nutricion");
treeNode3.add(treeNode4);
treeNode2.add(treeNode3);
treeNode1.add(treeNode2);
jTree1.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
jTree1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTree1MouseClicked(evt);
}
});
jScrollPane5.setViewportView(jTree1);
javax.swing.GroupLayout panel2Layout = new javax.swing.GroupLayout(panel2);
panel2.setLayout(panel2Layout);
panel2Layout.setHorizontalGroup(
panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel2Layout.createSequentialGroup()
.addGap(73, 73, 73)
.addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 561, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(101, Short.MAX_VALUE))
);
panel2Layout.setVerticalGroup(
panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel2Layout.createSequentialGroup()
.addGap(74, 74, 74)
.addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 451, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(75, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Arbol", panel2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField3ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
String n = jTextField3.getText();
boolean v = validar(n);
if (v == true){
String nombre = jTextField1.getText();
String apellido = jTextField2.getText();
int edad = Integer.parseInt(jSpinner1.getValue().toString());
double salario = Double.parseDouble(n);
String genero = jComboBox1.getSelectedItem()+ "";
Maestros maestro = new Maestros(salario, nombre, apellido, edad, genero);
maestros.add(maestro);
indice = maestros.indexOf(maestro);
DefaultListModel modelo = (DefaultListModel) jList1.getModel();
modelo.addElement(maestro.toStringMaestros());
jList1.setModel(modelo);
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jComboBox1.setSelectedIndex(0);
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
String n = jTextField6.getText();
String n2 = jTextField7.getText();
boolean v = validarint(n);
boolean v2 = validarint(n2);
if (v == true && v2 == true){
String nombre = jTextField4.getText();
String seccion = jTextField5.getText();
String aire = jComboBox2.getSelectedItem() + "";
int edificio = Integer.parseInt(n);
int salon = Integer.parseInt(n2);
Clases clase = new Clases(nombre, seccion, edificio, salon, aire);
clases.add(clase);
indiceclases = clases.indexOf(clase);
DefaultListModel modelo = (DefaultListModel) jList2.getModel();
modelo.addElement(clase.toStringClases());
jList2.setModel(modelo);
jTextField6.setText("");
jTextField7.setText("");
jTextField4.setText("");
jTextField5.setText("");
jComboBox2.setSelectedIndex(0);
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jList1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList1MouseClicked
if (jList1.getSelectedIndex() >= 0){
if (evt.isMetaDown() == true){
jPopupMenu1.show(evt.getComponent(), evt.getX(), evt.getY());
}
}
}//GEN-LAST:event_jList1MouseClicked
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
if (jList1.getSelectedIndex() >= 0){
DefaultListModel modelo = (DefaultListModel) jList1.getModel();
Maestros objeto2 = new Maestros();
for (int c = 0; c < maestros.size();c++){
Maestros objeto = (Maestros) maestros.get(c);
if (objeto.toStringMaestros().equals(modelo.getElementAt(jList1.getSelectedIndex()))){
objeto2 = objeto;
}
}
jTextField1.setText(objeto2.getNombre() +"");
jTextField2.setText(objeto2.getApellido()+"");
jTextField3.setText(objeto2.getSalario()+"");
jSpinner1.setValue(objeto2.getEdad());
jComboBox1.setSelectedItem(objeto2.getGenero());
}
}//GEN-LAST:event_jMenuItem1ActionPerformed
private void jPopupMenu1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPopupMenu1MouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_jPopupMenu1MouseClicked
private void jMenuItem2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuItem2MouseClicked
}//GEN-LAST:event_jMenuItem2MouseClicked
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
if (jList1.getSelectedIndex() >= 0){
DefaultListModel modelo = (DefaultListModel) jList1.getModel();
modelo.removeElementAt(jList1.getSelectedIndex());
jList1.setModel(modelo);
}
}//GEN-LAST:event_jMenuItem2ActionPerformed
private void jPopupMenu2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPopupMenu2MouseClicked
}//GEN-LAST:event_jPopupMenu2MouseClicked
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
if (jList2.getSelectedIndex() >= 0){
DefaultListModel modelo = (DefaultListModel) jList2.getModel();
Clases objeto2 = new Clases();
for (int c = 0; c < clases.size();c++){
Clases objeto = (Clases) clases.get(c);
if (objeto.toStringClases().equals(modelo.getElementAt(jList2.getSelectedIndex()))){
objeto2 = objeto;
}
}
jTextField4.setText(objeto2.getNombre() +"");
jTextField5.setText(objeto2.getSeccion()+"");
jTextField6.setText(objeto2.getEdificio()+"");
jTextField7.setText(objeto2.getSalon()+"");
jComboBox2.setSelectedItem(objeto2.getAire());
}
}//GEN-LAST:event_jMenuItem3ActionPerformed
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
if (jList2.getSelectedIndex() >= 0){
DefaultListModel modelo = (DefaultListModel) jList2.getModel();
modelo.removeElementAt(jList2.getSelectedIndex());
jList2.setModel(modelo);
}
}//GEN-LAST:event_jMenuItem4ActionPerformed
private void jList2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList2MouseClicked
if (jList2.getSelectedIndex() >= 0){
if (evt.isMetaDown() == true){
jPopupMenu2.show(evt.getComponent(), evt.getX(), evt.getY());
}
}
}//GEN-LAST:event_jList2MouseClicked
private void jMenuItem6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuItem6MouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_jMenuItem6MouseClicked
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
if (jList2.getSelectedIndex() >= 0){
int y = jList2.getSelectedIndex();
DefaultListModel modelo = (DefaultListModel) jList2.getModel();
Clases objeto = (Clases) modelo.getElementAt(y);
clasesguardadas.add(objeto);
}
}//GEN-LAST:event_jMenuItem6ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
if (jList4.isEnabled() ){
String nombre = jTextField8.getText();
String apellido = jTextField9.getText();
int edad = Integer.parseInt(jSpinner2.getValue()+"");
int numcuenta = generarcenta();
String genero = jComboBox3.getSelectedItem().toString();
Estudiantes objeto = new Estudiantes(numcuenta, nombre, apellido, edad, genero);
DefaultListModel mode = (DefaultListModel) jList3.getModel();
mode.addElement(objeto.toStringEstudiantes2());
jList3.setModel(mode);
jTextField8.setText("");
jTextField9.setText("");
jComboBox3.setSelectedIndex(0);
}else {
JOptionPane.showMessageDialog(null, "No hay carreras ingresadas aun.", "Error", 0);
}
}//GEN-LAST:event_jButton3ActionPerformed
private void jComboBox4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox4ActionPerformed
jComboBox5.removeAllItems();
llenarcombobox();
}//GEN-LAST:event_jComboBox4ActionPerformed
private void jTextField12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField12ActionPerformed
}//GEN-LAST:event_jTextField12ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
String n = jTextField11.getText()+"";
boolean v = validar(n);
if (v == true){
jList4.setEnabled(true);
String facultad = jComboBox4.getSelectedItem().toString();
String carrera = jComboBox5.getSelectedItem().toString();
String jefe = jTextField12.getText()+"";
double num = Double.parseDouble(n);
Carreras lic = new Carreras(carrera, facultad, num, jefe);
DefaultListModel mode = (DefaultListModel) jList4.getModel();
mode.addElement(lic.toStringCarreras());
jList4.setModel(mode);
jTextField12.setText("");
jTextField11.setText("");
jComboBox4.setSelectedIndex(0);
}
}//GEN-LAST:event_jButton4ActionPerformed
private void jPopupMenu3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPopupMenu3MouseClicked
//
}//GEN-LAST:event_jPopupMenu3MouseClicked
private void jTree1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTree1MouseClicked
if (evt.isMetaDown() == true){
jPopupMenu3.show(evt.getComponent(), evt.getX(), evt.getY());
}
}//GEN-LAST:event_jTree1MouseClicked
private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
// MODIFICAR ESTUDIANTE
}//GEN-LAST:event_jMenuItem7ActionPerformed
private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
if (jList3.getSelectedIndex() >= 0){
DefaultListModel modelo = (DefaultListModel) jList3.getModel();
modelo.removeElementAt(jList4.getSelectedIndex());
jList3.setModel(modelo);
}
}//GEN-LAST:event_jMenuItem8ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
String n = jTextField3.getText();
boolean v = validar(n);
if (v == true){
String nombre = jTextField1.getText();
String apellido = jTextField2.getText();
int edad = Integer.parseInt(jSpinner1.getValue().toString());
double salario = Double.parseDouble(n);
String genero = jComboBox1.getSelectedItem()+ "";
Maestros maestro = new Maestros(salario, nombre, apellido, edad, genero);
for (int c = 0; c < maestros.size();c++){
Maestros objeto = (Maestros) maestros.get(c);
if (objeto.toStringMaestros().equals(jList1.getSelectedValue())){
maestros.set(c, maestro);
indice = c;
}
}
DefaultListModel modelo = (DefaultListModel) jList1.getModel();
modelo.setElementAt(maestro.toStringMaestros(), indice);
jList1.setModel(modelo);
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jComboBox1.setSelectedIndex(0);
}
}//GEN-LAST:event_jButton5ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
String n = jTextField6.getText();
String n2 = jTextField7.getText();
boolean v = validarint(n);
boolean v2 = validarint(n2);
if (v == true && v2 == true){
String nombre = jTextField4.getText();
String seccion = jTextField5.getText();
String aire = jComboBox2.getSelectedItem() + "";
int edificio = Integer.parseInt(n);
int salon = Integer.parseInt(n2);
Clases clase = new Clases(nombre, seccion, edificio, salon, aire);
for (int c = 0; c < clases.size();c++){
Clases objeto = (Clases) clases.get(c);
if (objeto.toStringClases().equals(jList2.getSelectedValue())){
clases.set(c, clase);
indiceclases = c;
}
}
DefaultListModel modelo = (DefaultListModel) jList2.getModel();
modelo.setElementAt(clase.toStringClases(), indiceclases);
jList2.setModel(modelo);
jTextField6.setText("");
jTextField7.setText("");
jTextField4.setText("");
jTextField5.setText("");
jComboBox2.setSelectedIndex(0);
}
}//GEN-LAST:event_jButton6ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Principal().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JComboBox<String> jComboBox2;
private javax.swing.JComboBox<String> jComboBox3;
private javax.swing.JComboBox<String> jComboBox4;
private javax.swing.JComboBox<String> jComboBox5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel27;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JList<String> jList1;
private javax.swing.JList<String> jList2;
private javax.swing.JList<String> jList3;
private javax.swing.JList<String> jList4;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JMenuItem jMenuItem7;
private javax.swing.JMenuItem jMenuItem8;
private javax.swing.JPanel jPanel1;
private javax.swing.JPopupMenu jPopupMenu1;
private javax.swing.JPopupMenu jPopupMenu2;
private javax.swing.JPopupMenu jPopupMenu3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JSpinner jSpinner1;
private javax.swing.JSpinner jSpinner2;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField11;
private javax.swing.JTextField jTextField12;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField6;
private javax.swing.JTextField jTextField7;
private javax.swing.JTextField jTextField8;
private javax.swing.JTextField jTextField9;
private javax.swing.JTree jTree1;
private java.awt.Panel panel1;
private java.awt.Panel panel2;
// End of variables declaration//GEN-END:variables
}
| [
"denisj.gallegos@unitec.edu"
] | denisj.gallegos@unitec.edu |
5fd7d9436fd9509bc863a1211ad62477e4078e31 | 7f20b1bddf9f48108a43a9922433b141fac66a6d | /cytoscape/tags/Cyto-2.6.0-beta1/src/cytoscape/data/webservice/DatabaseSearchResult.java | 8b47f6d31960bf940e3e025234502ea68bae72f9 | [] | no_license | ahdahddl/cytoscape | bf783d44cddda313a5b3563ea746b07f38173022 | a3df8f63dba4ec49942027c91ecac6efa920c195 | refs/heads/master | 2020-06-26T16:48:19.791722 | 2013-08-28T04:08:31 | 2013-08-28T04:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | package cytoscape.data.webservice;
import cytoscape.data.webservice.CyWebServiceEvent.WSEventType;
public class DatabaseSearchResult {
private final Integer resultSize;
private final Object resultObject;
private final WSEventType nextMove;
public DatabaseSearchResult(Integer resultSize, Object resultObject, WSEventType nextMove) {
this.resultSize = resultSize;
this.resultObject = resultObject;
this.nextMove = nextMove;
}
public Object getResult() {
return resultObject;
}
public Integer getResultSize() {
return resultSize;
}
public WSEventType getNextMove() {
return nextMove;
}
}
| [
"mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] | mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5 |
52f5c9eb3fef8dd00d35221b449010f578fab712 | 8ece0bcc1f85a8723101f8c82400623294580842 | /src/main/java/org/kelompokFPJ2EE/FPJ2EE/MemberLikeQuestionController.java | 45ca6b06b3a3e1170cd66cd00fd14c3e9d80842c | [] | no_license | sagungw/tchat | 0eb126c4679db8c917135f281c8d17807b7c6ae6 | 4bd6221ec376d4585367e762eee941a823d62ff8 | refs/heads/master | 2020-05-29T08:47:23.258162 | 2015-02-17T00:55:28 | 2015-02-17T00:55:28 | 69,148,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,445 | java | package org.kelompokFPJ2EE.FPJ2EE;
import javax.servlet.http.HttpSession;
import org.kelompokFPJ2EE.domain.Member;
import org.kelompokFPJ2EE.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class MemberLikeQuestionController {
@Autowired
private QuestionService questionServ;
@RequestMapping(value="/post/likesQuestionAction/{idQuestion}", method = RequestMethod.GET)
public ModelAndView likesQuestionAction(HttpSession session, @PathVariable Integer idQuestion){
ModelAndView mav = new ModelAndView();
questionServ.likesQuestionAction((Member)session.getAttribute("memberSession"), idQuestion);
mav.setViewName("redirect:/post/" + idQuestion);
return mav;
}
@RequestMapping(value="/post/dislikesQuestionAction/{idQuestion}", method = RequestMethod.GET)
public ModelAndView dislikesQuestionAction(HttpSession session, @PathVariable Integer idQuestion){
ModelAndView mav = new ModelAndView();
questionServ.dislikesQuestionAction((Member)session.getAttribute("memberSession"), idQuestion);
mav.setViewName("redirect:/post/" + idQuestion);
return mav;
}
}
| [
"agung.wijaya11@mhs.if.its.ac.id"
] | agung.wijaya11@mhs.if.its.ac.id |
337b344a4595f49ed0845ef75355fb29afe2c200 | 06b634ff12a752eb77f8239b7501063dc52978de | /src/main/java/entity/Term.java | cfe01b5c905cbb2c25f48f492a74faedc37e1948 | [] | no_license | EvgeniyBudaev/JavaWebProject | ec8036ba614dc4a1f9b876c6be519fac4893d174 | 7b81c77eb085862f5f3f1dd4e2e42a14c562f371 | refs/heads/master | 2022-07-11T03:42:00.515278 | 2019-08-18T16:19:13 | 2019-08-18T16:19:13 | 200,339,616 | 0 | 0 | null | 2022-06-21T01:35:33 | 2019-08-03T06:15:12 | Java | UTF-8 | Java | false | false | 2,252 | java | package entity;
import java.util.ArrayList;
import java.util.Objects;
public class Term {
private int id;
private String term;
private String duration;
private int status;
private ArrayList<Discipline> disciplines = new ArrayList<>();
public Term() {
}
public Term(int id, String term, String duration, int status, ArrayList<Discipline> disciplines) {
this.id = id;
this.term = term;
this.duration = duration;
this.status = status;
this.disciplines = disciplines;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTerm() {
return term;
}
public void setTerm(String term) {
this.term = term;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public ArrayList<Discipline> getDisciplines() {
return disciplines;
}
public void setDisciplines(ArrayList<Discipline> disciplines) {
this.disciplines = disciplines;
}
public void addDiscipline(Discipline discipline){
disciplines.add(discipline);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Term term1 = (Term) o;
return id == term1.id &&
status == term1.status &&
Objects.equals(term, term1.term) &&
Objects.equals(duration, term1.duration) &&
Objects.equals(disciplines, term1.disciplines);
}
@Override
public int hashCode() {
return Objects.hash(id, term, duration, status, disciplines);
}
@Override
public String toString() {
return "Term{" +
"id=" + id +
", term='" + term + '\'' +
", duration='" + duration + '\'' +
", status=" + status +
", disciplines=" + disciplines +
'}';
}
}
| [
"budaev.e@gmail.com"
] | budaev.e@gmail.com |
47cdb2ee83d31e3dd62ce942fdfcbad730673eed | 626a7ccdcf21d2deded7e068662fd6368151bd2a | /classmanager/src/main/java/com/just/manager/domain/Score.java | a7692540ade2250eb37f8b490695cfb7ca9a2dca | [] | no_license | Moon-Light0/classmanager | 6bc71c628c8fbaecd4c51720d2101c54dd5edf57 | 184fe215ca030c46c7ed68deecbb87dd98eda0e2 | refs/heads/master | 2022-12-26T02:35:31.086836 | 2019-11-06T18:15:45 | 2019-11-06T18:15:45 | 220,043,342 | 1 | 0 | null | 2022-12-15T23:32:56 | 2019-11-06T16:37:38 | JavaScript | UTF-8 | Java | false | false | 1,040 | java | package com.just.manager.domain;
import java.util.List;
public class Score {
private String cId; //课程id
private String stuNo; //学号
private Integer score; //成绩
private Course course;
public Score(){}
public void setCourse(Course course) {
this.course = course;
}
public Course getCourse() {
return course;
}
public String getcId() {
return cId;
}
public void setcId(String cId) {
this.cId = cId;
}
public String getStuNo() {
return stuNo;
}
public void setStuNo(String stuNo) {
this.stuNo = stuNo;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
@Override
public String toString() {
return "Score{" +
"cId='" + cId + '\'' +
", stuNo='" + stuNo + '\'' +
", score=" + score +
", course=" + course +
'}';
}
}
| [
"1442433867@qq.com"
] | 1442433867@qq.com |
e9e87c7bd22355611a7e2aa75ed4aceeb3f2a153 | 4c2e83907706317c147433e4560a49d431badf1b | /app/src/main/java/org/apache/http/client/protocol/RequestExpectContinue.java | 7d9a0ccd281cec98f20dea0e06a05d0a431f6d18 | [
"Unlicense"
] | permissive | renyuanceshi/KingKingRE | 92c80328556853029eb5b7bbf3a48a19182cf056 | b15295bec2cee47867b786dbe0841c1a4edaff5e | refs/heads/master | 2020-12-13T14:41:26.365794 | 2020-01-17T04:27:21 | 2020-01-17T04:27:21 | 234,442,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,361 | java | package org.apache.http.client.protocol;
import java.io.IOException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.HttpVersion;
import org.apache.http.ProtocolVersion;
import org.apache.http.annotation.Immutable;
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.Args;
@Immutable
public class RequestExpectContinue implements HttpRequestInterceptor {
public void process(HttpRequest httpRequest, HttpContext httpContext) throws HttpException, IOException {
Args.notNull(httpRequest, "HTTP request");
if (!httpRequest.containsHeader("Expect") && (httpRequest instanceof HttpEntityEnclosingRequest)) {
ProtocolVersion protocolVersion = httpRequest.getRequestLine().getProtocolVersion();
HttpEntity entity = ((HttpEntityEnclosingRequest) httpRequest).getEntity();
if (entity != null && entity.getContentLength() != 0 && !protocolVersion.lessEquals(HttpVersion.HTTP_1_0) && HttpClientContext.adapt(httpContext).getRequestConfig().isExpectContinueEnabled()) {
httpRequest.addHeader("Expect", HTTP.EXPECT_CONTINUE);
}
}
}
}
| [
"lewis@spectratech.com"
] | lewis@spectratech.com |
0996a37c1e09a035109d3bbbcb0aac27248459c0 | 3a39a61b90a218c7c352d694b1e1a251d83f4b01 | /app/src/main/java/com/bryontaylor/scanlist/ListItem.java | 8b21d04da5ea0add85a6656e02ff2414286f752e | [] | no_license | gig6/ScanList | fc1636fe0efd0ec501ba22c204f4bffc5ca2b7bf | 320195d95bfe515eb939022923430fdd2be03d54 | refs/heads/master | 2023-03-04T02:52:40.949883 | 2021-02-09T18:12:27 | 2021-02-09T18:12:27 | 337,527,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,247 | java | package com.bryontaylor.scanlist;
import androidx.annotation.Nullable;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity(tableName = "list_item_table")
public class ListItem {
@PrimaryKey(autoGenerate = true)
private long id;
private String itemName;
private boolean isChecked;
private double positionInList;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public void setChecked(boolean isChecked) {
this.isChecked = isChecked;
}
public boolean getIsChecked() {
return isChecked;
}
public void setPositionInList(double positionInList) {
this.positionInList = positionInList;
}
public double getPositionInList() {
return positionInList;
}
@Override
public boolean equals(@Nullable Object obj) {
ListItem item = new ListItem();
if(obj instanceof ListItem) {
item = (ListItem) obj;
}
return this.getItemName().equals(item.getItemName()) &&
this.getIsChecked() == item.getIsChecked() &&
this.getPositionInList() == item.getPositionInList();
}
}
| [
"taylor.bryon@gmail.com"
] | taylor.bryon@gmail.com |
f85facb41f2bb71cf15732baca820da93f18f5d2 | ea65723f33c64378a76e0fb611c0318214e6aaf6 | /Ejercicio0312/src/ejercicio0312/Ejercicio0312.java | 1f0071b8a8f8645e3633d46e03f1b65a4d4b55ea | [] | no_license | smontironi/EjerciciosJava | 662a891945345c7a601f668935c714c78f17691f | 96a04eb0ac05bb0d31330cb187c71eaf2cdb54fb | refs/heads/master | 2023-05-11T16:42:23.307387 | 2021-06-05T16:03:16 | 2021-06-05T16:03:16 | 269,787,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,349 | java | /*
Utilizaremos una bandera para controlar si entre los alumnos existe al menos uno con una
asignatura suspensa (nota menor que 5). Una bandera es una variable, normalmente
booleana, que indica, mediante sus valores, alguna situacion o estado. En este caso
suspenso = false, significa que no existe ninguna nota suspensa
suspenso = true, significa que existe, al menos, un alumno suspenso
Hay que tener cuidado, cuando se activa una bandera, en no volver a desactivarla, ya
que entonces no refleja lo que intentamos evaluar, sino la ultima situacion ocurrida
*/
package ejercicio0312;
import java.util.Scanner;
/**
*
* @author Seba
*/
public class Ejercicio0312 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
boolean suspensos = false; // suponemos que en principio no hay ningun suspenso
for (int i= 0; i<5; i++){
System.out.print("Introduzca nota (de 0 a 10): ");
int notas = sc.nextInt();
if (notas < 5) { //si la nota corresponde a un suspenso
suspensos = true; //activamos la bandera a cierto
}
}
if (suspensos) {
System.out.println("Hay alumnos suspensos");
} else {
System.out.println("No hay alumnos suspensos");
}
}
}
| [
"Seba@192.168.0.92"
] | Seba@192.168.0.92 |
9af1ffd88a0b3f605a39e6c088b96722aefca028 | 7dcb5c0b68531715a0734ef442f227b72ae169ad | /rabbitmq-demo/src/main/java/com/example/demo/message/ToDoProducer.java | 8f29bb32a00cd50a48c35ac1b23afed9f3953eeb | [] | no_license | truth/ProSpringBoot2 | 989d05cc12e4e23adeaaf7b76150ec7888724194 | e57cac5c0d71774c4166b2ed7307e80a27c453ef | refs/heads/master | 2023-06-21T15:07:49.581388 | 2021-07-25T09:00:10 | 2021-07-25T09:00:10 | 381,326,721 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 663 | java | package com.example.demo.message;
import com.example.demo.entity.ToDo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
@Component
public class ToDoProducer {
private static final Logger log = LoggerFactory.getLogger(ToDoProducer.
class);
private RabbitTemplate template;
public ToDoProducer(RabbitTemplate template){
this.template = template;
}
public void sendTo(String queue, ToDo toDo){
this.template.convertAndSend("amq.topic",queue,toDo);
log.info("Producer> Message Sent");
}
} | [
"wzl@gkmobile.tv"
] | wzl@gkmobile.tv |
d41a047edab895063e6b38a4c95e74bdd2c002ac | bde68e154a1050662095762e13e9b5fde670b1ca | /FTL/argumentationMeaning/sandboxes/SandboxABUI.java | 9fac587ac2fee8d25ac533e1e2cd9b3daba722f4 | [
"BSD-3-Clause"
] | permissive | KemAdrian/CSetAlign | 0e476898d7caa4a347a9ccee6d0f2342aec9e670 | f2b8d1b8ddd86376e7aaeb0847455e9cebbb4970 | refs/heads/master | 2020-07-29T11:16:08.200324 | 2019-10-22T10:15:45 | 2019-10-22T10:15:45 | 209,778,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,124 | java | package sandboxes;
import csic.iiia.ftl.argumentation.core.*;
import csic.iiia.ftl.base.core.*;
import csic.iiia.ftl.learning.core.Rule;
import csic.iiia.ftl.learning.core.RuleHypothesis;
import csic.iiia.ftl.learning.core.TrainingSetProperties;
import csic.iiia.ftl.learning.core.TrainingSetUtils;
import tools.LPkg;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
public class SandboxABUI {
public static void main(String[] args) throws Exception {
// Opening of the Cases Set
int TEST = TrainingSetUtils.SEAT_TEST;
Ontology base_ontology;
Ontology o = new Ontology();
base_ontology = new BaseOntology();
o.uses(base_ontology);
FTKBase dm = new FTKBase();
FTKBase case_base = new FTKBase();
case_base.uses(dm);
dm.create_boolean_objects(o);
TrainingSetProperties training_set = TrainingSetUtils.loadTrainingSet(TEST, o, dm, case_base);
List<List<FeatureTerm>> training_tests = new ArrayList<>();
// To use when we have the seat data set in input
for (int i = 0; i < 3; i++) {
ArrayList<FeatureTerm> hey = new ArrayList<>();
training_tests.add(hey);
}
assert training_set != null;
for (FeatureTerm e : training_set.cases) {
if (Integer.parseInt(e.getName().toString().replace("e", "")) < 50) {
training_tests.get(0).add(e);
} else if (Integer.parseInt(e.getName().toString().replace("e", "")) < 100) {
training_tests.get(1).add(e);
} else {
training_tests.get(2).add(e);
}
}
ABUI learner = new ABUI();
ABUI.ABUI_VERSION = 2;
TermFeatureTerm g = (TermFeatureTerm) training_set.cases.get(0).clone(o);
g.setName(null);
g.defineFeatureValue(training_set.description_path, null);
g.defineFeatureValue(training_set.solution_path, null);
LPkg.initialize(g, o, dm, training_set.description_path, training_set.solution_path, new HashSet<>(training_set.differentSolutions()));
System.out.println(training_set.description_path);
ArgumentAcceptability aa = new LaplaceArgumentAcceptability(training_tests.get(0), training_set.solution_path, training_set.description_path, (float)0.75);
ArgumentAcceptability aa2 = new LaplaceArgumentAcceptability(training_tests.get(0), training_set.solution_path, training_set.description_path, (float)0.75);
ArgumentationBasedLearning abl1 = new ArgumentationBasedLearning();
ArgumentationBasedLearning abl2 = new ArgumentationBasedLearning();
List<ArgumentationBasedLearning> l_abl = new ArrayList<>();
l_abl.add(abl1);
l_abl.add(abl2);
List<ArgumentAcceptability> l_a = new ArrayList<>();
l_a.add(aa);
l_a.add(aa2);
// Hypothesis
RuleHypothesis h1 = learner.learnConceptABUI(training_tests.get(0), training_set.differentSolutions(),
new ArrayList<>(), aa, training_set.description_path, training_set.solution_path, o, dm);
RuleHypothesis h2 = learner.learnConceptABUI(training_tests.get(2), training_set.differentSolutions(),
new ArrayList<>(), aa, training_set.description_path, training_set.solution_path, o, dm);
for(Rule r : h1.getRules()) {
System.out.println(r.pattern.toStringNOOS(dm));
}
}
}
| [
"shibbi@hotmail.fr"
] | shibbi@hotmail.fr |
20a1a120e271937b08318d2db57219ef3ddc7cc0 | 55dca62e858f1a44c2186774339823a301b48dc7 | /code/my-app/functions/12/readAttributes_NationSummary.java | a4d45a3dec55321408202dc75a401cc5ab3e7b60 | [] | no_license | jwiszowata/code_reaper | 4fff256250299225879d1412eb1f70b136d7a174 | 17dde61138cec117047a6ebb412ee1972886f143 | refs/heads/master | 2022-12-15T14:46:30.640628 | 2022-02-10T14:02:45 | 2022-02-10T14:02:45 | 84,747,455 | 0 | 0 | null | 2022-12-07T23:48:18 | 2017-03-12T18:26:11 | Java | UTF-8 | Java | false | false | 631 | java | protected void readAttributes(FreeColXMLReader xr) throws XMLStreamException {
super.readAttributes(xr);
stance = xr.getAttribute(STANCE_TAG, Stance.class, Stance.PEACE);
numberOfSettlements = xr.getAttribute(NUMBER_OF_SETTLEMENTS_TAG, -1);
numberOfUnits = xr.getAttribute(NUMBER_OF_UNITS_TAG, -1);
militaryStrength = xr.getAttribute(MILITARY_STRENGTH_TAG, -1);
navalStrength = xr.getAttribute(NAVAL_STRENGTH_TAG, -1);
gold = xr.getAttribute(GOLD_TAG, -1);
soL = xr.getAttribute(SOL_TAG, -1);
foundingFathers = xr.getAttribute(FOUNDING_FATHERS_TAG, -1);
tax = xr.getAttribute(TAX_TAG, -1);
} | [
"wiszowata.joanna@gmail.com"
] | wiszowata.joanna@gmail.com |
c58309c6491bbf3afa5d7c284184cfb63c8c11cc | bd229dba36bcdc500c90200037467d2ddf0181c6 | /hello_world.java | 92d29a5b60beac91daf7ab43a6d5b49c4ace46c8 | [] | no_license | KISHOREPRAKASH96/kishore96 | c97b05aeb92ca38b4258abcae2ceda1373bdf9a6 | d13fb424bbf12811bd55a71195bce6a88c5183a6 | refs/heads/master | 2021-01-25T04:43:11.298236 | 2019-02-26T03:27:45 | 2019-02-26T03:27:45 | 93,475,245 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | import java.io.*;
import java.util.*;
class hello_world
{
public static void main(String args[])
{
int n=5;
for(int i=0;i<n;i++)
{
System.out.println("HELLO");
}
}
}
| [
"noreply@github.com"
] | KISHOREPRAKASH96.noreply@github.com |
8c4343ac60fc2919a8c51b654647c30158bd4dc4 | 51ab3d482958bddd7393d0a5d7acd3e0b5da6cda | /src/main/java/com/example/Gamesite/service/FileService.java | 8716c539da464d9424f0708f50493e89451492ee | [] | no_license | ionaxiong/gaming-platform | 4f73c89e1c63892b1ba5e6c4775e97e950113d3b | d7d1f81640339a407f0515ab895f0f0106311c55 | refs/heads/master | 2023-04-18T04:14:30.675827 | 2021-05-02T21:18:28 | 2021-05-02T21:18:28 | 345,655,447 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,304 | java | package com.example.Gamesite.service;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import com.example.Gamesite.model.FileEntity;
import com.example.Gamesite.repository.FileRepository;
@Service
public class FileService {
private final FileRepository fileRepository;
@Autowired
public FileService(FileRepository fileRepository) {
this.fileRepository = fileRepository;
}
// Save uploaded file (transform MultipartFile object into FileEntity)
public FileEntity save(MultipartFile file) throws IOException{
FileEntity fileEntity = new FileEntity();
fileEntity.setName(StringUtils.cleanPath(file.getOriginalFilename()));
fileEntity.setContentType(file.getContentType());
fileEntity.setData(file.getBytes());
fileEntity.setSize(file.getSize());
return fileRepository.save(fileEntity);
}
// get a single file by provided id
public Optional<FileEntity> getFile(String id) {
return fileRepository.findById(id);
}
// return a list of uploaded files
public List<FileEntity> getAllFiles(){
return fileRepository.findAll();
}
}
| [
"bgm182@myy.haaga-helia.fi"
] | bgm182@myy.haaga-helia.fi |
65a8d30593d952a8ce21357e3c924fbca200a5e1 | 76512d142a0be0d71c3af625a3e246057b234600 | /src/test/java/com/devcamp/health/service/AuditEventServiceIT.java | d20bb7a97ac7980a53e656749df008713c08e8c5 | [] | no_license | javacamp/21-points | b842623c358cc0a4db24e84839cef26b98399cf2 | 430eb7f876a42366f5af42b80974ef775af710c2 | refs/heads/master | 2023-07-20T22:47:37.743018 | 2020-05-25T22:53:14 | 2020-05-25T22:53:14 | 238,742,743 | 0 | 0 | null | 2020-02-06T17:17:39 | 2020-02-06T17:15:40 | Java | UTF-8 | Java | false | false | 2,985 | java | package com.devcamp.health.service;
import com.devcamp.health.domain.PersistentAuditEvent;
import com.devcamp.health.repository.PersistenceAuditEventRepository;
import com.devcamp.health.TwentyOnePointsApp;
import io.github.jhipster.config.JHipsterProperties;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.transaction.annotation.Transactional;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for {@link AuditEventService}.
*/
@SpringBootTest(classes = TwentyOnePointsApp.class)
@Transactional
public class AuditEventServiceIT {
@Autowired
private AuditEventService auditEventService;
@Autowired
private PersistenceAuditEventRepository persistenceAuditEventRepository;
@Autowired
private JHipsterProperties jHipsterProperties;
private PersistentAuditEvent auditEventOld;
private PersistentAuditEvent auditEventWithinRetention;
private PersistentAuditEvent auditEventNew;
@BeforeEach
public void init() {
auditEventOld = new PersistentAuditEvent();
auditEventOld.setAuditEventDate(Instant.now().minus(jHipsterProperties.getAuditEvents().getRetentionPeriod() + 1, ChronoUnit.DAYS));
auditEventOld.setPrincipal("test-user-old");
auditEventOld.setAuditEventType("test-type");
auditEventWithinRetention = new PersistentAuditEvent();
auditEventWithinRetention.setAuditEventDate(Instant.now().minus(jHipsterProperties.getAuditEvents().getRetentionPeriod() - 1, ChronoUnit.DAYS));
auditEventWithinRetention.setPrincipal("test-user-retention");
auditEventWithinRetention.setAuditEventType("test-type");
auditEventNew = new PersistentAuditEvent();
auditEventNew.setAuditEventDate(Instant.now());
auditEventNew.setPrincipal("test-user-new");
auditEventNew.setAuditEventType("test-type");
}
@Test
@Transactional
public void verifyOldAuditEventsAreDeleted() {
persistenceAuditEventRepository.deleteAll();
persistenceAuditEventRepository.save(auditEventOld);
persistenceAuditEventRepository.save(auditEventWithinRetention);
persistenceAuditEventRepository.save(auditEventNew);
persistenceAuditEventRepository.flush();
auditEventService.removeOldAuditEvents();
persistenceAuditEventRepository.flush();
assertThat(persistenceAuditEventRepository.findAll().size()).isEqualTo(2);
assertThat(persistenceAuditEventRepository.findByPrincipal("test-user-old")).isEmpty();
assertThat(persistenceAuditEventRepository.findByPrincipal("test-user-retention")).isNotEmpty();
assertThat(persistenceAuditEventRepository.findByPrincipal("test-user-new")).isNotEmpty();
}
}
| [
"biosis.lanjanirina@gmail.com"
] | biosis.lanjanirina@gmail.com |
975bb79976b753351ea308414eec5adc3a52782d | 52c42b02b49468aeff5775a664f33fe030744b12 | /src/main/java/de/tondorf/scubybot/Main.java | 57d7fdd3d8c86e314089724bb2355f324bb67efe | [] | no_license | foxplus/ScubyBot | b79166c8dd37850170c77513540be39b9dd839a7 | 09f6a0a55c4b85270ec7f1e9e3f08003ea83986e | refs/heads/master | 2021-01-19T22:33:21.925523 | 2011-03-07T18:47:04 | 2011-03-07T18:47:04 | 1,451,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package de.tondorf.scubybot;
/**
*
* @author FoXPlus
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
frmHelloSwing.main(args);
}
}
| [
"foxplus@gmx.net"
] | foxplus@gmx.net |
17fab4dd203ee440c3c17c2ef2da2bcec0d72265 | 79595075622ded0bf43023f716389f61d8e96e94 | /app/src/main/java/org/apache/http/client/methods/HttpHead.java | bac992612579d65f2451ad54dfd6b213a29b4693 | [] | no_license | dstmath/OppoR15 | 96f1f7bb4d9cfad47609316debc55095edcd6b56 | b9a4da845af251213d7b4c1b35db3e2415290c96 | refs/heads/master | 2020-03-24T16:52:14.198588 | 2019-05-27T02:24:53 | 2019-05-27T02:24:53 | 142,840,716 | 7 | 4 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package org.apache.http.client.methods;
import java.net.URI;
@Deprecated
public class HttpHead extends HttpRequestBase {
public static final String METHOD_NAME = "HEAD";
public HttpHead(URI uri) {
setURI(uri);
}
public HttpHead(String uri) {
setURI(URI.create(uri));
}
public String getMethod() {
return METHOD_NAME;
}
}
| [
"toor@debian.toor"
] | toor@debian.toor |
8ecc715e6dbadf4fdf719392169170e00e2c9dca | e6e99443edec0d59ba6bece1f8812163767bb139 | /apps-db/src/main/java/com/aibyd/apps/db/domain/MallFootprintExample.java | e20a60012412a0dfbf29a193dd08eab974bcfaad | [
"Apache-2.0"
] | permissive | sunvangvang/apps | ef4f4c4de166becbb343f579eae8f233f56fddac | c350e6d2fe93e0e6a7677e302229109ec59d52e1 | refs/heads/master | 2020-03-30T03:07:44.897600 | 2019-01-07T05:36:50 | 2019-01-07T05:36:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 42,266 | java | package com.aibyd.apps.db.domain;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
public class MallFootprintExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table mall_footprint
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table mall_footprint
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table mall_footprint
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public MallFootprintExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MallFootprintExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MallFootprintExample orderBy(String ... orderByClauses) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < orderByClauses.length; i++) {
sb.append(orderByClauses[i]);
if (i < orderByClauses.length - 1) {
sb.append(" , ");
}
}
this.setOrderByClause(sb.toString());
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
MallFootprintExample example = new MallFootprintExample();
return example.createCriteria();
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table mall_footprint
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Integer value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Integer value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdNotEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Integer value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Integer value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThan(Integer value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Integer value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdIn(List<Integer> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Integer> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Integer value1, Integer value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Integer value1, Integer value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andGoodsIdIsNull() {
addCriterion("goods_id is null");
return (Criteria) this;
}
public Criteria andGoodsIdIsNotNull() {
addCriterion("goods_id is not null");
return (Criteria) this;
}
public Criteria andGoodsIdEqualTo(Integer value) {
addCriterion("goods_id =", value, "goodsId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andGoodsIdEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("goods_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andGoodsIdNotEqualTo(Integer value) {
addCriterion("goods_id <>", value, "goodsId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andGoodsIdNotEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("goods_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andGoodsIdGreaterThan(Integer value) {
addCriterion("goods_id >", value, "goodsId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andGoodsIdGreaterThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("goods_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andGoodsIdGreaterThanOrEqualTo(Integer value) {
addCriterion("goods_id >=", value, "goodsId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andGoodsIdGreaterThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("goods_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andGoodsIdLessThan(Integer value) {
addCriterion("goods_id <", value, "goodsId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andGoodsIdLessThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("goods_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andGoodsIdLessThanOrEqualTo(Integer value) {
addCriterion("goods_id <=", value, "goodsId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andGoodsIdLessThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("goods_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andGoodsIdIn(List<Integer> values) {
addCriterion("goods_id in", values, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotIn(List<Integer> values) {
addCriterion("goods_id not in", values, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdBetween(Integer value1, Integer value2) {
addCriterion("goods_id between", value1, value2, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotBetween(Integer value1, Integer value2) {
addCriterion("goods_id not between", value1, value2, "goodsId");
return (Criteria) this;
}
public Criteria andAddTimeIsNull() {
addCriterion("add_time is null");
return (Criteria) this;
}
public Criteria andAddTimeIsNotNull() {
addCriterion("add_time is not null");
return (Criteria) this;
}
public Criteria andAddTimeEqualTo(LocalDateTime value) {
addCriterion("add_time =", value, "addTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddTimeEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("add_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddTimeNotEqualTo(LocalDateTime value) {
addCriterion("add_time <>", value, "addTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddTimeNotEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("add_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddTimeGreaterThan(LocalDateTime value) {
addCriterion("add_time >", value, "addTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddTimeGreaterThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("add_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("add_time >=", value, "addTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddTimeGreaterThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("add_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddTimeLessThan(LocalDateTime value) {
addCriterion("add_time <", value, "addTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddTimeLessThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("add_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("add_time <=", value, "addTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddTimeLessThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("add_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddTimeIn(List<LocalDateTime> values) {
addCriterion("add_time in", values, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeNotIn(List<LocalDateTime> values) {
addCriterion("add_time not in", values, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("add_time between", value1, value2, "addTime");
return (Criteria) this;
}
public Criteria andAddTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("add_time not between", value1, value2, "addTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(LocalDateTime value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(LocalDateTime value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(LocalDateTime value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<LocalDateTime> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<LocalDateTime> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andDeletedIsNull() {
addCriterion("deleted is null");
return (Criteria) this;
}
public Criteria andDeletedIsNotNull() {
addCriterion("deleted is not null");
return (Criteria) this;
}
public Criteria andDeletedEqualTo(Boolean value) {
addCriterion("deleted =", value, "deleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeletedEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("deleted = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeletedNotEqualTo(Boolean value) {
addCriterion("deleted <>", value, "deleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeletedNotEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("deleted <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeletedGreaterThan(Boolean value) {
addCriterion("deleted >", value, "deleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeletedGreaterThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("deleted > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) {
addCriterion("deleted >=", value, "deleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeletedGreaterThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("deleted >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeletedLessThan(Boolean value) {
addCriterion("deleted <", value, "deleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeletedLessThanColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("deleted < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeletedLessThanOrEqualTo(Boolean value) {
addCriterion("deleted <=", value, "deleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDeletedLessThanOrEqualToColumn(MallFootprint.Column column) {
addCriterion(new StringBuilder("deleted <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDeletedIn(List<Boolean> values) {
addCriterion("deleted in", values, "deleted");
return (Criteria) this;
}
public Criteria andDeletedNotIn(List<Boolean> values) {
addCriterion("deleted not in", values, "deleted");
return (Criteria) this;
}
public Criteria andDeletedBetween(Boolean value1, Boolean value2) {
addCriterion("deleted between", value1, value2, "deleted");
return (Criteria) this;
}
public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) {
addCriterion("deleted not between", value1, value2, "deleted");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table mall_footprint
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private MallFootprintExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(MallFootprintExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MallFootprintExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) {
add.add(this);
}
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andLogicalDeleted(boolean deleted) {
return deleted ? andDeletedEqualTo(MallFootprint.IS_DELETED) : andDeletedNotEqualTo(MallFootprint.IS_DELETED);
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaAdd {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table mall_footprint
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria add(Criteria add);
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table mall_footprint
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"sunyy2012@sina.com"
] | sunyy2012@sina.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.