hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
1 value
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
5
1.02k
max_stars_repo_name
stringlengths
4
126
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
list
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
5
1.02k
max_issues_repo_name
stringlengths
4
114
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
list
max_issues_count
float64
1
92.2k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
5
1.02k
max_forks_repo_name
stringlengths
4
136
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
list
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
avg_line_length
float64
2.55
99.9
max_line_length
int64
3
1k
alphanum_fraction
float64
0.25
1
index
int64
0
1M
content
stringlengths
3
1.05M
3e13f397929e894c467d360bd67e78395c291448
1,436
java
Java
src/main/java/org/springframework/data/solr/VersionUtil.java
bquintanajm/spring-data-solr
ba51ee79e71f7e890b72b3a8b448c2f5094caeb3
[ "Apache-2.0" ]
null
null
null
src/main/java/org/springframework/data/solr/VersionUtil.java
bquintanajm/spring-data-solr
ba51ee79e71f7e890b72b3a8b448c2f5094caeb3
[ "Apache-2.0" ]
null
null
null
src/main/java/org/springframework/data/solr/VersionUtil.java
bquintanajm/spring-data-solr
ba51ee79e71f7e890b72b3a8b448c2f5094caeb3
[ "Apache-2.0" ]
null
null
null
33.395349
120
0.752089
8,437
/* * Copyright 2012 - 2018 the original author or authors. * * 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.springframework.data.solr; import org.springframework.util.ClassUtils; /** * Version util uses {@link org.springframework.util.ClassUtils#isPresent(String, ClassLoader)} to determine presence of * certain classes that are unique to some libraries, which allows to en-/disable some of the features in eg. * {@link org.springframework.data.solr.core.DefaultQueryParser}. * * @author Christoph Strobl */ public final class VersionUtil { private VersionUtil() { // hide utility class constructor } private static final boolean IS_JODATIME_AVAILABLE = ClassUtils.isPresent("org.joda.time.DateTime", VersionUtil.class.getClassLoader()); /** * @return true if {@code org.joda.time.DateTime} is in path */ public static boolean isJodaTimeAvailable() { return IS_JODATIME_AVAILABLE; } }
3e13f41f3f4e23d31a0dafa1e691a31c2c108aef
3,030
java
Java
talos/talos-brave/src/main/java/com/kxd/talos/trace/core/sampler/CountingSampler.java
kplxq/talos
510075f8acf3d09f6e7ba63183efd9197361ff6f
[ "Apache-2.0" ]
49
2017-12-21T06:58:25.000Z
2020-11-13T06:42:12.000Z
talos/talos-brave/src/main/java/com/kxd/talos/trace/core/sampler/CountingSampler.java
kplxq/talos
510075f8acf3d09f6e7ba63183efd9197361ff6f
[ "Apache-2.0" ]
1
2018-03-10T18:06:12.000Z
2018-03-19T01:51:47.000Z
talos/talos-brave/src/main/java/com/kxd/talos/trace/core/sampler/CountingSampler.java
kplxq/talos
510075f8acf3d09f6e7ba63183efd9197361ff6f
[ "Apache-2.0" ]
14
2017-12-22T09:58:58.000Z
2020-08-07T08:00:55.000Z
32.956522
100
0.679749
8,438
/** * Copyright 2013 <ychag@example.com> * * 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.kxd.talos.trace.core.sampler; import java.util.BitSet; import java.util.Random; import static com.kxd.talos.trace.core.utils.Util.*; /** * This sampler is appropriate for low-traffic instrumentation (ex servers that each receive <100K * requests), or those who do not provision random trace ids. It not appropriate for collectors as * the sampling decision isn't idempotent (consistent based on trace id). * * <h3>Implementation</h3> * * <p>This initializes a random bitset of size 100 (corresponding to 1% granularity). This means * that it is accurate in units of 100 traces. At runtime, this loops through the bitset, returning * the value according to a counter. */ public final class CountingSampler extends Sampler { /** * @param rate 0 means never sample, 1 means always sample. Otherwise minimum sample rate is 0.01, * or 1% of traces */ public static Sampler create(final float rate) { if (rate == 0) return NEVER_SAMPLE; if (rate == 1.0) return ALWAYS_SAMPLE; checkArgument(rate >= 0.01f && rate < 1, "rate should be between 0.01 and 1: was %s", rate); return new CountingSampler(rate); } private int i; // guarded by this private final BitSet sampleDecisions; /** Fills a bitset with decisions according to the supplied rate. */ CountingSampler(float rate) { int outOf100 = (int) (rate * 100.0f); this.sampleDecisions = randomBitSet(100, outOf100, new Random()); } /** loops over the pre-canned decisions, resetting to zero when it gets to the end. */ @Override public synchronized boolean isSampled(String traceIdIgnored) { boolean result = sampleDecisions.get(i++); if (i == 100) i = 0; return result; } @Override public String toString() { return "CountingSampler()"; } /** * Reservoir sampling algorithm borrowed from Stack Overflow. * * http://stackoverflow.com/questions/12817946/generate-a-random-bitset-with-n-1s */ static BitSet randomBitSet(int size, int cardinality, Random rnd) { BitSet result = new BitSet(size); int[] chosen = new int[cardinality]; int i; for (i = 0; i < cardinality; ++i) { chosen[i] = i; result.set(i); } for (; i < size; ++i) { int j = rnd.nextInt(i + 1); if (j < cardinality) { result.clear(chosen[j]); result.set(i); chosen[j] = i; } } return result; } }
3e13f462d583084608cfac379473510f0cb483a2
1,588
java
Java
study-notes/j2ee-collection/architecture/01-项目实战/01-RBAC/src/com/coderZsq/rbac/web/controller/DepartmentController.java
coderZsq/coderZsq.practice.server
f789ee4b43b4a8dee5d8872e86c04ca2fe139b68
[ "MIT" ]
1
2020-06-14T12:43:47.000Z
2020-06-14T12:43:47.000Z
study-notes/j2ee-collection/architecture/01-项目实战/01-RBAC/src/com/coderZsq/rbac/web/controller/DepartmentController.java
coderZsq/coderZsq.practice.server
f789ee4b43b4a8dee5d8872e86c04ca2fe139b68
[ "MIT" ]
88
2020-03-03T15:16:28.000Z
2022-01-04T16:44:37.000Z
study-notes/j2ee-collection/architecture/01-项目实战/01-RBAC/src/com/coderZsq/rbac/web/controller/DepartmentController.java
coderZsq/coderZsq.practice.server
f789ee4b43b4a8dee5d8872e86c04ca2fe139b68
[ "MIT" ]
1
2021-09-08T06:34:11.000Z
2021-09-08T06:34:11.000Z
31.76
76
0.719144
8,439
package com.coderZsq.rbac.web.controller; import com.coderZsq.rbac.domain.Department; import com.coderZsq.rbac.utils.PageResult; import com.coderZsq.rbac.query.QueryObject; import com.coderZsq.rbac.service.IDepartmentService; import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequestMapping("department") public class DepartmentController { @Autowired private IDepartmentService departmentService; @RequestMapping("queryAll") // /department/queryAll public PageResult<List<Department>> queryAll() { return PageResult.success(departmentService.selectAll()); } @RequestMapping("query") public PageResult<PageInfo<Department>> query(QueryObject queryObject) { // 查询 PageInfo<Department> page = departmentService.query(queryObject); return PageResult.success(page); } @RequestMapping("delete") public PageResult<Boolean> delete(Long id) { departmentService.delete(id); return PageResult.success(true); } @RequestMapping("saveOrUpdate") public PageResult<Boolean> saveOrUpdate(Department department) { // 是否存在Id Long id = department.getId(); if (id == null) { // 新增操作 departmentService.insert(department); } else { departmentService.update(department); } return PageResult.success(true); } }
3e13f48f63f91a09ce3ce957131fe9ceb2e4522c
886
java
Java
source/com.microsoft.tfs.client.common.ui.teambuild/src/com/microsoft/tfs/client/common/ui/teambuild/teamexplorer/actions/OpenBuildDefinitionVNextAction.java
benzman81/team-explorer-everywhere
eb3985c7cb629af9b0ff1c3678403f5c910b7d06
[ "MIT" ]
86
2019-05-13T02:21:26.000Z
2022-02-06T17:43:29.000Z
source/com.microsoft.tfs.client.common.ui.teambuild/src/com/microsoft/tfs/client/common/ui/teambuild/teamexplorer/actions/OpenBuildDefinitionVNextAction.java
benzman81/team-explorer-everywhere
eb3985c7cb629af9b0ff1c3678403f5c910b7d06
[ "MIT" ]
82
2019-05-14T06:34:16.000Z
2022-03-23T20:20:19.000Z
source/com.microsoft.tfs.client.common.ui.teambuild/src/com/microsoft/tfs/client/common/ui/teambuild/teamexplorer/actions/OpenBuildDefinitionVNextAction.java
benzman81/team-explorer-everywhere
eb3985c7cb629af9b0ff1c3678403f5c910b7d06
[ "MIT" ]
61
2019-05-10T19:34:33.000Z
2022-03-18T06:29:06.000Z
35.44
97
0.741535
8,440
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See License.txt in the repository root. package com.microsoft.tfs.client.common.ui.teambuild.teamexplorer.actions; import org.eclipse.jface.action.IAction; import com.microsoft.alm.teamfoundation.build.webapi.DefinitionReference; import com.microsoft.tfs.client.common.ui.tasks.OpenBuildDefinitionVNextTask; public class OpenBuildDefinitionVNextAction extends BuildDefinitionVNextAction { /** * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ @Override public void doRun(final IAction action) { final DefinitionReference buildDefinition = getSelectedBuildDefinition(); if (buildDefinition != null) { new OpenBuildDefinitionVNextTask(getShell(), getConnection(), buildDefinition).run(); ; } } }
3e13f4b6c78402f6d3b6db655b88bfd084e9df48
4,438
java
Java
biblio-client/biblio-client-consumer/src/main/java/oc/projet/biblio/client/consumer/ws/RelanceClient.java
Mathprog/JavaEE_Spring_SOA_2
e0a1d419e909f728a034051d726b13469a2eb746
[ "MIT" ]
null
null
null
biblio-client/biblio-client-consumer/src/main/java/oc/projet/biblio/client/consumer/ws/RelanceClient.java
Mathprog/JavaEE_Spring_SOA_2
e0a1d419e909f728a034051d726b13469a2eb746
[ "MIT" ]
null
null
null
biblio-client/biblio-client-consumer/src/main/java/oc/projet/biblio/client/consumer/ws/RelanceClient.java
Mathprog/JavaEE_Spring_SOA_2
e0a1d419e909f728a034051d726b13469a2eb746
[ "MIT" ]
null
null
null
48.769231
135
0.700991
8,441
package oc.projet.biblio.client.consumer.ws; import oc.projet.biblio.client.consumer.generated.*; import org.springframework.cglib.core.Local; import org.springframework.ws.client.core.support.WebServiceGatewaySupport; import org.springframework.ws.soap.client.core.SoapActionCallback; import java.time.LocalDate; import java.util.List; public class RelanceClient extends WebServiceGatewaySupport { public List<RelanceWS> getRelanceClientResponse(){ GetRelanceRequest relanceRequest = new GetRelanceRequest(); GetRelanceResponse relanceResponse = (GetRelanceResponse) getWebServiceTemplate() .marshalSendAndReceive("http://localhost:8080/soapws/bibliosoap", relanceRequest, new SoapActionCallback( "http://biblio.io/api/biblio-web-service/GetRelanceRequest")); return relanceResponse.getRelance(); } public RelanceWS getRelanceByIdClientRequest (int id){ GetRelanceByIdRequest relanceByIdRequest = new GetRelanceByIdRequest(); relanceByIdRequest.setId(id); GetRelanceByIdResponse relanceByIdResponse = (GetRelanceByIdResponse) getWebServiceTemplate() .marshalSendAndReceive("http://localhost:8080/soapws/bibliosoap", relanceByIdRequest, new SoapActionCallback( "http://biblio.io/api/biblio-web-service/GetRelanceByIdRequest")); return relanceByIdResponse.getRelance(); } public RelanceWS getRelanceCreateClientRequest (PretWS pretWS, LocalDate datFin){ GetRelanceCreateRequest relanceCreateRequest = new GetRelanceCreateRequest(); relanceCreateRequest.setPret(pretWS); relanceCreateRequest.setDateFin(datFin); GetRelanceCreateResponse relanceCreateResponse = (GetRelanceCreateResponse) getWebServiceTemplate() .marshalSendAndReceive("http://localhost:8080/soapws/bibliosoap", relanceCreateRequest, new SoapActionCallback( "http://biblio.io/api/biblio-web-service/GetRelanceCreateRequest")); return relanceCreateResponse.getRelance(); } public List<RelanceWS> relanceByUsagerClientRequest (UsagerWS usagerWS){ GetRelanceByUsagerRequest relanceByUsagerRequest = new GetRelanceByUsagerRequest(); relanceByUsagerRequest.setUsager(usagerWS); GetRelanceByUsagerResponse relanceByUsagerResponse = (GetRelanceByUsagerResponse) getWebServiceTemplate() .marshalSendAndReceive("http://localhost:8080/soapws/bibliosoap", relanceByUsagerRequest, new SoapActionCallback( "http://biblio.io/api/biblio-web-service/GetRelanceByUsagerRequest")); return relanceByUsagerResponse.getRelance(); } public RelanceWS getRelanceByPretClientRequest(PretWS pretWS){ GetRelanceByPretRequest relanceByPretRequest = new GetRelanceByPretRequest(); relanceByPretRequest.setPret(pretWS); GetRelanceByPretResponse relanceByPretResponse = (GetRelanceByPretResponse) getWebServiceTemplate() .marshalSendAndReceive("http://localhost:8080/soapws/bibliosoap", relanceByPretRequest, new SoapActionCallback( "http://biblio.io/api/biblio-web-service/GetRelanceByPretRequest")); return relanceByPretResponse.getRelance(); } public List<RelanceWS> getAllRelanceByUsagerAndDate(UsagerWS usagerWS, LocalDate date){ GetRelanceByUsagerAndDateRequest relanceByUsagerAndDateRequest = new GetRelanceByUsagerAndDateRequest(); relanceByUsagerAndDateRequest.setUsager(usagerWS); relanceByUsagerAndDateRequest.setDate(date); GetRelanceByUsagerAndDateResponse relanceByUsagerAndDateResponse = (GetRelanceByUsagerAndDateResponse) getWebServiceTemplate() .marshalSendAndReceive("http://localhost:8080/soapws/bibliosoap", relanceByUsagerAndDateRequest, new SoapActionCallback( "http://biblio.io/api/biblio-web-service/GetRelanceByPretRequest")); return relanceByUsagerAndDateResponse.getRelance(); } /* public List<RelanceWS> getAllRelanceByusagerAndDate(UsagerWS usagerWS, LocalDate date){ }*/ }
3e13f4b7d56d74324e89414a2332dbacf0748508
2,642
java
Java
app/src/main/java/hw04/Player.java
Team-MHS/cs2263_project
95a5926d21447cff5222cf91afceef260f75eb26
[ "MIT" ]
null
null
null
app/src/main/java/hw04/Player.java
Team-MHS/cs2263_project
95a5926d21447cff5222cf91afceef260f75eb26
[ "MIT" ]
null
null
null
app/src/main/java/hw04/Player.java
Team-MHS/cs2263_project
95a5926d21447cff5222cf91afceef260f75eb26
[ "MIT" ]
null
null
null
28.408602
123
0.680924
8,442
/* * MIT License * * Copyright (c) 2022 Team-MHS * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * @author Michael Esquivias */ package hw04; import java.util.List; import java.util.Objects; public class Player { private String name; private TileList tileList; private List<Share> playerShares; private int money; public Player(String name) { this.name = name; this.tileList = new TileList(); this.money = 6000; } public void addMoney(int amount) { this.money += amount; } public void removeMoney(int amount) { this.money -= amount; } public String getName() { return this.name; } public int getMoney() { return this.money; } public TileList getTileList() { return this.tileList; } public void addTile(Tile t) { this.tileList.add(t); } public void removeTile(int n) { this.tileList.remove(n); } public void buyShares(Share s) { this.playerShares.add(s);} public void sellShares(Share s) { this.playerShares.remove(s);} public List<Share> getPlayerShares() {return this.playerShares;} @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Player)) return false; Player player = (Player) o; return Objects.equals(getName(), player.getName()); } //&& Objects.equals(getTileList(), player.getTileList()) && Objects.equals(getPlayerShares(), player.getPlayerShares()) @Override public int hashCode() { return Objects.hash(getName()); } }
3e13f5470227182164d10e1e262096f086da6f93
1,190
java
Java
src/main/java/io/domisum/lib/youtubeapilib/reporting/report/ReportDownloader.java
domisum/YouTubeReportingApiLib
d1413fcbf95568a4103e5f3baf5b595ba60ec61c
[ "MIT" ]
null
null
null
src/main/java/io/domisum/lib/youtubeapilib/reporting/report/ReportDownloader.java
domisum/YouTubeReportingApiLib
d1413fcbf95568a4103e5f3baf5b595ba60ec61c
[ "MIT" ]
null
null
null
src/main/java/io/domisum/lib/youtubeapilib/reporting/report/ReportDownloader.java
domisum/YouTubeReportingApiLib
d1413fcbf95568a4103e5f3baf5b595ba60ec61c
[ "MIT" ]
null
null
null
33.055556
99
0.828571
8,443
package io.domisum.lib.youtubeapilib.reporting.report; import com.google.api.client.http.GenericUrl; import com.google.common.base.Charsets; import com.google.inject.Inject; import io.domisum.lib.youtubeapilib.YouTubeApiCredentials; import io.domisum.lib.youtubeapilib.reporting.AuthorizedYouTubeReportingApiClientSource; import io.domisum.lib.youtubeapilib.reporting.report.model.DownloadableReport; import lombok.RequiredArgsConstructor; import java.io.ByteArrayOutputStream; import java.io.IOException; @RequiredArgsConstructor(onConstructor = @__(@Inject)) public class ReportDownloader { // DEPENDENCIES private final AuthorizedYouTubeReportingApiClientSource authorizedYouTubeReportingApiClientSource; // DOWNLOAD public String download(YouTubeApiCredentials credentials, DownloadableReport report) throws IOException { var reporting = authorizedYouTubeReportingApiClientSource.getFor(credentials); var downloadUrl = new GenericUrl(report.getDownloadUrl()); var outputStream = new ByteArrayOutputStream(); reporting.media().download("").getMediaHttpDownloader().download(downloadUrl, outputStream); return outputStream.toString(Charsets.UTF_8); } }
3e13f60e324d8588fd50caa82923065726ccf139
871
java
Java
src/main/java/com/ims/sampleproject/dto/request/InstructorRequest.java
HarshaInduil/ims-api
86855e0d37e4cceabbc38d069e84b318d3cf3b05
[ "Apache-2.0" ]
null
null
null
src/main/java/com/ims/sampleproject/dto/request/InstructorRequest.java
HarshaInduil/ims-api
86855e0d37e4cceabbc38d069e84b318d3cf3b05
[ "Apache-2.0" ]
null
null
null
src/main/java/com/ims/sampleproject/dto/request/InstructorRequest.java
HarshaInduil/ims-api
86855e0d37e4cceabbc38d069e84b318d3cf3b05
[ "Apache-2.0" ]
null
null
null
24.885714
53
0.641791
8,444
package com.ims.sampleproject.dto.request; import com.ims.sampleproject.dto.enumtype.Experience; import com.ims.sampleproject.model.Instructor; import lombok.Data; import java.math.BigDecimal; import java.util.Date; @Data public class InstructorRequest { private Long id; private String name; private String address; private String email; private String contactNumber; private Date joinedDate; private Experience experience; private BigDecimal salary; private String instructorCode; public Instructor getInstructorObject() { return new Instructor( this.name, this.address, this.email, this.contactNumber, this.joinedDate, this.experience, this.salary, this.instructorCode ); } }
3e13f79076d9438cfd3538b1cb5e940512913175
1,125
java
Java
G4CentralBank-main/javasource/businessbankmodule/proxies/TransferMessageType.java
One-E2-Team/mendix-business-informatics
b49c9707795470216aa86e95634f5234f86ae411
[ "MIT" ]
null
null
null
G4CentralBank-main/javasource/businessbankmodule/proxies/TransferMessageType.java
One-E2-Team/mendix-business-informatics
b49c9707795470216aa86e95634f5234f86ae411
[ "MIT" ]
null
null
null
G4CentralBank-main/javasource/businessbankmodule/proxies/TransferMessageType.java
One-E2-Team/mendix-business-informatics
b49c9707795470216aa86e95634f5234f86ae411
[ "MIT" ]
null
null
null
32.142857
82
0.702222
8,445
// This file was generated by Mendix Studio Pro. // // WARNING: Code you write here will be lost the next time you deploy the project. package businessbankmodule.proxies; public enum TransferMessageType { MT102(new java.lang.String[][] { new java.lang.String[] { "en_US", "102" } }), MT103(new java.lang.String[][] { new java.lang.String[] { "en_US", "103" } }), MT900(new java.lang.String[][] { new java.lang.String[] { "en_US", "900" } }), MT910(new java.lang.String[][] { new java.lang.String[] { "en_US", "910" } }); private java.util.Map<java.lang.String, java.lang.String> captions; private TransferMessageType(java.lang.String[][] captionStrings) { this.captions = new java.util.HashMap<java.lang.String, java.lang.String>(); for (java.lang.String[] captionString : captionStrings) captions.put(captionString[0], captionString[1]); } public java.lang.String getCaption(java.lang.String languageCode) { if (captions.containsKey(languageCode)) return captions.get(languageCode); return captions.get("en_US"); } public java.lang.String getCaption() { return captions.get("en_US"); } }
3e13f7abd0f5384f5c14ba178306774b54520d8c
524
java
Java
eureka-server-security/src/main/java/cn/com/xuxiaowei/EurekaServerSecurityApplication.java
xuxiaowei-com-cn/spring-boot-docker
e951c51e15f825956de46fc9717126c90b2ae160
[ "Apache-2.0" ]
null
null
null
eureka-server-security/src/main/java/cn/com/xuxiaowei/EurekaServerSecurityApplication.java
xuxiaowei-com-cn/spring-boot-docker
e951c51e15f825956de46fc9717126c90b2ae160
[ "Apache-2.0" ]
null
null
null
eureka-server-security/src/main/java/cn/com/xuxiaowei/EurekaServerSecurityApplication.java
xuxiaowei-com-cn/spring-boot-docker
e951c51e15f825956de46fc9717126c90b2ae160
[ "Apache-2.0" ]
null
null
null
22.782609
75
0.784351
8,446
package cn.com.xuxiaowei; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * 程序执行入口 * <p> * Eureka Server Security 注册中心 * * @author xuxiaowei */ @EnableEurekaServer @SpringBootApplication public class EurekaServerSecurityApplication { public static void main(String[] args) { SpringApplication.run(EurekaServerSecurityApplication.class, args); } }
3e13f7e7b0b63916c7fad3f286e3745991f99c93
1,692
java
Java
src/main/java/io/kestra/plugin/fs/ftp/Downloads.java
kestra-io/plugin-fs
c2b6ffe6ac5bdb20f849986d8095defb606983a7
[ "Apache-2.0" ]
null
null
null
src/main/java/io/kestra/plugin/fs/ftp/Downloads.java
kestra-io/plugin-fs
c2b6ffe6ac5bdb20f849986d8095defb606983a7
[ "Apache-2.0" ]
13
2021-04-19T18:42:18.000Z
2022-03-31T16:22:07.000Z
src/main/java/io/kestra/plugin/fs/ftp/Downloads.java
kestra-io/plugin-fs
c2b6ffe6ac5bdb20f849986d8095defb606983a7
[ "Apache-2.0" ]
null
null
null
27.737705
121
0.660165
8,447
package io.kestra.plugin.fs.ftp; import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.annotations.Example; import io.kestra.core.models.annotations.Plugin; import io.kestra.core.runners.RunContext; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import lombok.experimental.SuperBuilder; import org.apache.commons.vfs2.FileSystemOptions; import java.io.IOException; import java.net.Proxy; @SuperBuilder @ToString @EqualsAndHashCode @Getter @NoArgsConstructor @Schema( title = "Download multiple files from FTP server" ) @Plugin( examples = { @Example( title = "Download a list of files and move it to an archive folders", code = { "host: localhost", "port: 21", "username: foo", "password: pass", "from: \"/in/\"", "interval: PT10S", "action: MOVE", "moveDirectory: \"/archive/\"", } ) } ) public class Downloads extends io.kestra.plugin.fs.vfs.Downloads implements FtpInterface { protected String proxyHost; protected String proxyPort; protected Proxy.Type proxyType; @Builder.Default protected Boolean rootDir = true; @Builder.Default protected String port = "21"; @Builder.Default protected Boolean passiveMode = true; @Override protected FileSystemOptions fsOptions(RunContext runContext) throws IllegalVariableEvaluationException, IOException { return FtpService.fsOptions(runContext, this); } @Override protected String scheme() { return "ftp"; } }
3e13f807b9e86a9cacfc268142146b21efa9738e
7,774
java
Java
src/main/java/view/data/TradeoffDataUtility.java
eddietseng/floorplan
21b6656af12155593316a59327ca4a58f092a37c
[ "MIT" ]
null
null
null
src/main/java/view/data/TradeoffDataUtility.java
eddietseng/floorplan
21b6656af12155593316a59327ca4a58f092a37c
[ "MIT" ]
null
null
null
src/main/java/view/data/TradeoffDataUtility.java
eddietseng/floorplan
21b6656af12155593316a59327ca4a58f092a37c
[ "MIT" ]
1
2021-10-02T20:31:33.000Z
2021-10-02T20:31:33.000Z
29.44697
124
0.66195
8,448
package view.data; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import javax.xml.transform.stream.StreamSource; import view.data.model.HeatPump; import view.data.model.ScatterPlotDataModel; import model.floorplan.City; import model.floorplan.FloorplanResultModel; public class TradeoffDataUtility { public static final String HEATPUMP_LOC = "xmlData/heatpumps.xml"; public static final boolean COST_AVG = false; public static final boolean PV = true; public static final double ENERGY_COST_AVG = 0.1253; public static final double YEARS = 18.4; public static final double RATE = 0.04; protected static ArrayList<HeatPump> heatPumpDB = new ArrayList<HeatPump>(); static { try { JAXBContext jc = JAXBContext.newInstance(XmlWrapper.class, HeatPump.class ); // Unmarshal Unmarshaller unmarshaller = jc.createUnmarshaller(); List<HeatPump> heatpumps = unmarshal(unmarshaller, HeatPump.class, HEATPUMP_LOC ); for( HeatPump heatpump : heatpumps ) { heatPumpDB.add( heatpump ); System.out.println( heatpump.toString() ); } } catch( JAXBException e ) { System.out.println("Import Xml failed" + e ); } } public static void test(){} /** * Unmarshal XML to Wrapper and return List value. */ private static <T> List<T> unmarshal(Unmarshaller unmarshaller, Class<T> clazz, String xmlLocation) throws JAXBException { StreamSource xml = new StreamSource(xmlLocation); XmlWrapper<T> wrapper = (XmlWrapper<T>) unmarshaller.unmarshal(xml, XmlWrapper.class).getValue(); return wrapper.getItems(); } public static ArrayList<ScatterPlotDataModel> getEnergyComsumptionData( FloorplanResultModel model ) { ArrayList<HeatPump> zone1Hps = getHeatPumps( model.getCoolingLoadZone1() ); ArrayList<HeatPump> zone2Hps = getHeatPumps( model.getCoolingLoadZone2() ); ArrayList<HeatPump> wholeHps = getHeatPumps( model.getCoolingLoadWhole() ); ArrayList<ScatterPlotDataModel> list = new ArrayList<ScatterPlotDataModel>(); for( HeatPump z1hp : zone1Hps ) { ScatterPlotDataModel data = calculateEnergyComsumptionFomula( model.getCity(), z1hp ); data.setAreaSize( model.getZone1Area() ); list.add( data ); } for( HeatPump z2hp : zone2Hps ) { ScatterPlotDataModel data = calculateEnergyComsumptionFomula( model.getCity(), z2hp ); data.setAreaSize( model.getZone2Area() ); list.add( data ); } for( HeatPump whhp : wholeHps ) { ScatterPlotDataModel data = calculateEnergyComsumptionFomula( model.getCity(), whhp ); data.setAreaSize( model.getUsableArea() ); list.add( data ); } return list; } protected static ArrayList<HeatPump> getHeatPumps( double tons ) { ArrayList<HeatPump> heatpumps = new ArrayList<HeatPump>(); if( tons == 4.5 ) // No 4.5 tons Heat pump model tons = 5; for( HeatPump hp : heatPumpDB ) { if( hp.getTons() == tons ) heatpumps.add( hp ); } return heatpumps; } protected static ScatterPlotDataModel calculateEnergyComsumptionFomula( City city, HeatPump hp ) { double consumption = hp.getTons() * HeatPump.TONS_TO_BTU / 1000 * ( ( city.getSummerUsage() / hp.getSeer() ) + ( city.getWinterUsage() / hp.getHspf() ) ); ScatterPlotDataModel data = new ScatterPlotDataModel( city, hp ); double cost = 0; if( PV ) { if( COST_AVG ) cost = calculatePresentValue( consumption, ENERGY_COST_AVG, YEARS, RATE ) + hp.getPrice(); else cost = calculatePresentValue( consumption, city.getEnergyCost(), YEARS, RATE ) + hp.getPrice(); } else { if( COST_AVG ) cost = consumption * ENERGY_COST_AVG * YEARS + hp.getPrice(); else cost = consumption * city.getEnergyCost() * YEARS + hp.getPrice(); } data.setCity( city ); data.setHeatPump( hp ); data.setEnergyConsumption( consumption ); data.setCost( cost ); return data; } public static City findCity( String name ) { if( name.equals( City.SEATTLE.getLocation() ) ) return City.SEATTLE; else if( name.equals( City.LOS_ANGLES.getLocation() ) ) return City.LOS_ANGLES; else if( name.equals( City.WASHINGTON.getLocation() ) ) return City.WASHINGTON; else if( name.equals( City.MIAMI.getLocation() ) ) return City.MIAMI; else if( name.equals( City.DALLAS.getLocation() ) ) return City.DALLAS; else return null; } /** * Annually recurring uniform amounts * @param consumption * @param energycost * @param years * @return the present value of the energy consumption cost */ private static double calculatePresentValue( double consumption, double energycost, double years, double rate ) { double pv = ( consumption * energycost ) * ( Math.pow( ( 1 + rate ), years ) - 1 ) / ( rate * Math.pow( ( 1 + rate ), years ) ); return pv; } /** * Returns data for city based electricity trend heat pump comparison * @return list of electricity/heat pump/city datum */ public static HashMap<String,ArrayList<ScatterPlotDataModel>> getElectricityData() { HashMap<String,ArrayList<ScatterPlotDataModel>> map = new HashMap<String,ArrayList<ScatterPlotDataModel>>(); ArrayList<HeatPump> hps = getHeatPumps( 3 ); for( int i = 0; i < hps.size(); i++ ) { if( hps.get( i ).getSeer() == 14 ) hps.remove( i ); } ArrayList<City> cities = City.getDefaultCities(); for( City city : cities ) { ArrayList<ScatterPlotDataModel> data = new ArrayList<ScatterPlotDataModel>(); for( HeatPump hp : hps ) { for( int i = 0; i <= 50 ; i ++ ) { ScatterPlotDataModel datum = calculateElectricityDatum( city, hp, i * 0.01 ); data.add( datum ); } } map.put( city.getLocation(), data ); } return map; } protected static ScatterPlotDataModel calculateElectricityDatum( City city, HeatPump hp, double electricity ) { double consumption = hp.getTons() * HeatPump.TONS_TO_BTU / 1000 * ( ( city.getSummerUsage() / hp.getSeer() ) + ( city.getWinterUsage() / hp.getHspf() ) ); //System.out.println( "City: " + city.getLocation() + " , HP SEER: " + hp.getSeer() + " , Consumption : " + consumption ); ScatterPlotDataModel data = new ScatterPlotDataModel( city, hp ); data.setElectricityCost( electricity ); data.setCost( consumption * electricity + hp.getPrice() ); return data; } //TEST public static void main( String arg[] ) { double a = 10, b = 10; double c = 5, d = 0.03; double pv = calculatePresentValue(a, b, c, d); System.out.println( "PV = " + pv ); System.out.println( "========================" ); ArrayList<City> cities = City.getDefaultCities(); HeatPump hp13 = new HeatPump(); HeatPump hp16 = new HeatPump(); for( HeatPump hp : heatPumpDB ) { if( hp.getTons() == 3.0 && hp.getSeer() == 13 ) hp13 = hp; else if( hp.getTons() == 3.0 && hp.getSeer() == 16 ) hp16 = hp; } for( City city : cities ) { double consumption13 = 3 * 12000 / 1000 * ( ( city.getSummerUsage() / hp13.getSeer() ) + ( city.getWinterUsage() / hp13.getHspf() ) ); System.out.println("City: " + city.getLocation() + " HP13 consumption: " + consumption13 ); double consumption16 = 3 * 12000 / 1000 * ( ( city.getSummerUsage() / hp16.getSeer() ) + ( city.getWinterUsage() / hp16.getHspf() ) ); System.out.println("City: " + city.getLocation() + " HP16 consumption: " + consumption16 ); double x = ( 1100 - 1600 )/( consumption16 - consumption13 ); System.out.println("Point: " + x ); } } }
3e13f861cc2f6a6f2307d51710b2fd22f3a0f9d0
6,071
java
Java
app/src/main/java/com/lts/movie/util/ViewUtil.java
TangBeiLiu/MovieNews
4f13b7524e627ba2a352c1d72a798b4bcda36bcc
[ "Unlicense" ]
28
2017-09-19T01:23:05.000Z
2021-08-20T13:48:04.000Z
app/src/main/java/com/lts/movie/util/ViewUtil.java
TangBeiLiu/MovieNews
4f13b7524e627ba2a352c1d72a798b4bcda36bcc
[ "Unlicense" ]
1
2017-09-26T08:56:56.000Z
2017-09-26T08:56:56.000Z
app/src/main/java/com/lts/movie/util/ViewUtil.java
TangBeiLiu/MovieNews
4f13b7524e627ba2a352c1d72a798b4bcda36bcc
[ "Unlicense" ]
2
2017-11-03T03:02:51.000Z
2018-08-07T12:11:53.000Z
35.273256
210
0.627163
8,449
package com.lts.movie.util; import android.app.Activity; import android.content.Context; import android.content.pm.ActivityInfo; import android.content.res.ColorStateList; import android.graphics.drawable.Drawable; import android.support.design.widget.TabLayout; import android.support.v4.graphics.drawable.DrawableCompat; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.widget.LinearLayout; import java.lang.reflect.Field; /** * ClassName: ViewUtil<p> * Author: oubowu<p> * Fuction: 处理屏幕啥的工具<p> * CreateDate: 2016/2/17 21:39<p> * UpdateUser: <p> * UpdateDate: <p> */ public class ViewUtil { // 隐藏状态栏 public static void hideStatusBar(Activity activity) { WindowManager.LayoutParams attrs = activity.getWindow().getAttributes(); attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; activity.getWindow().setAttributes(attrs); } // 显示状态栏 public static void showStatusBar(Activity activity) { WindowManager.LayoutParams attrs = activity.getWindow().getAttributes(); attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN; activity.getWindow().setAttributes(attrs); } /** * 生成一个和状态栏大小相同的矩形条 * * @param activity 需要设置的activity * @param color 状态栏颜色值 * @return 状态栏矩形条 */ public static View createStatusView(Activity activity, int color) { // 获得状态栏高度 int resourceId = activity.getResources() .getIdentifier("status_bar_height", "dimen", "android"); int statusBarHeight = activity.getResources().getDimensionPixelSize(resourceId); // 绘制一个和状态栏一样高的矩形 View statusView = new View(activity); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, statusBarHeight); statusView.setLayoutParams(params); statusView.setBackgroundColor(color); return statusView; } /** * Drawable 着色的后向兼容方案 * * @param drawable Drawable * @param colors 颜色状态列表 * @return Drawable */ public static Drawable tintDrawable(Drawable drawable, ColorStateList colors) { final Drawable wrappedDrawable = DrawableCompat.wrap(drawable); DrawableCompat.setTintList(wrappedDrawable, colors); return wrappedDrawable; } public static void rotateScreen(Activity activity) { if (activity.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } } public static void setFullScreen(Activity activity, boolean full) { if (full) { setFullScreen(activity); } else { quitFullScreen(activity); } } public static void setFullScreen(Activity activity) { activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } public static void quitFullScreen(Activity activity) { final WindowManager.LayoutParams attrs = activity.getWindow().getAttributes(); attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN); activity.getWindow().setAttributes(attrs); activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); } /** * 根据Tab合起来的长度动态修改tab的模式 * * @param tabLayout TabLayout */ public static void dynamicSetTabLayoutMode(TabLayout tabLayout) { int tabTotalWidth = 0; for (int i = 0; i < tabLayout.getChildCount(); i++) { final View view = tabLayout.getChildAt(i); view.measure(0, 0); tabTotalWidth += view.getMeasuredWidth(); } if (tabTotalWidth <= MeasureUtil.getScreenSize(tabLayout.getContext()).x) { tabLayout.setTabGravity(TabLayout.GRAVITY_FILL); tabLayout.setTabMode(TabLayout.MODE_FIXED); } else { tabLayout.setTabGravity(TabLayout.GRAVITY_CENTER); tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE); } } /** * 解决InputMethodManager内存泄露现象 * * @param destContext 上下文 */ public static void fixInputMethodManagerLeak(Context destContext) { if (destContext == null) { return; } InputMethodManager imm = (InputMethodManager) destContext .getSystemService(Context.INPUT_METHOD_SERVICE); if (imm == null) { return; } String[] arr = new String[]{"mCurRootView", "mServedView", "mNextServedView"}; Field f = null; Object obj_get = null; for (String param : arr) { try { f = imm.getClass().getDeclaredField(param); if (!f.isAccessible()) { f.setAccessible(true); } // author: sodino mail:lyhxr@example.com obj_get = f.get(imm); if (obj_get != null && obj_get instanceof View) { View v_get = (View) obj_get; if (v_get .getContext() == destContext) { // 被InputMethodManager持有引用的context是想要目标销毁的 f.set(imm, null); // 置空,破坏掉path to gc节点 } else { // 不是想要目标销毁的,即为又进了另一层界面了,不要处理,避免影响原逻辑,也就不用继续for循环了 /*if (QLog.isColorLevel()) { QLog.d(ReflecterHelper.class.getSimpleName(), QLog.CLR, "fixInputMethodManagerLeak break, context is not suitable, get_context=" + v_get.getContext()+" dest_context=" + destContext); }*/ break; } } } catch (Throwable t) { t.printStackTrace(); } } } }
3e13f879c0e12b0d14f1e8acc36db77b5188c502
469
java
Java
tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/applicability/CodeApplicability.java
chirrindul/tcMenu
65350d69873e30d3f8bdae842ab7f630c112c25f
[ "Apache-2.0" ]
160
2018-06-09T12:03:04.000Z
2022-03-22T11:04:59.000Z
tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/applicability/CodeApplicability.java
chirrindul/tcMenu
65350d69873e30d3f8bdae842ab7f630c112c25f
[ "Apache-2.0" ]
173
2018-05-04T06:44:47.000Z
2022-03-20T13:49:12.000Z
tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/applicability/CodeApplicability.java
chirrindul/tcMenu
65350d69873e30d3f8bdae842ab7f630c112c25f
[ "Apache-2.0" ]
16
2018-12-13T19:33:28.000Z
2022-02-09T21:56:28.000Z
29.3125
101
0.791045
8,450
/* * Copyright (c) 2016-2020 https://www.thecoderscorner.com (Nutricherry LTD). * This product is licensed under an Apache license, see the LICENSE file in the top-level directory. * */ package com.thecoderscorner.menu.editorui.generator.applicability; import com.thecoderscorner.menu.editorui.generator.core.CreatorProperty; import java.util.Collection; public interface CodeApplicability { boolean isApplicable(Collection<CreatorProperty> properties); }
3e13f955a93995e6a5bea81e7a7251f8da1883bb
2,802
java
Java
rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/KeyOperation.java
sho25/cxf
4e2e93d8335f22575bf366df2a1b6cde681ad0ec
[ "Apache-2.0" ]
null
null
null
rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/KeyOperation.java
sho25/cxf
4e2e93d8335f22575bf366df2a1b6cde681ad0ec
[ "Apache-2.0" ]
5
2021-02-03T19:35:39.000Z
2022-03-31T20:59:21.000Z
rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/KeyOperation.java
sho25/cxf
4e2e93d8335f22575bf366df2a1b6cde681ad0ec
[ "Apache-2.0" ]
null
null
null
18.313725
810
0.797645
8,451
begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1 begin_comment comment|/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * 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. */ end_comment begin_package package|package name|org operator|. name|apache operator|. name|cxf operator|. name|rs operator|. name|security operator|. name|jose operator|. name|jwk package|; end_package begin_enum specifier|public enum|enum name|KeyOperation block|{ name|SIGN parameter_list|( name|JsonWebKey operator|. name|KEY_OPER_SIGN parameter_list|) operator|, constructor|VERIFY(JsonWebKey.KEY_OPER_VERIFY block|) enum|, name|ENCRYPT argument_list|( name|JsonWebKey operator|. name|KEY_OPER_ENCRYPT argument_list|) operator|, name|DECRYPT argument_list|( name|JsonWebKey operator|. name|KEY_OPER_DECRYPT argument_list|) operator|, name|WRAPKEY argument_list|( name|JsonWebKey operator|. name|KEY_OPER_WRAP_KEY argument_list|) operator|, name|UNWRAPKEY argument_list|( name|JsonWebKey operator|. name|KEY_OPER_UNWRAP_KEY argument_list|) operator|, name|DERIVEKEY argument_list|( name|JsonWebKey operator|. name|KEY_OPER_DERIVE_KEY argument_list|) operator|, name|DERIVEBITS argument_list|( name|JsonWebKey operator|. name|KEY_OPER_DERIVE_BITS argument_list|) enum|; end_enum begin_decl_stmt specifier|private specifier|final name|String name|oper decl_stmt|; end_decl_stmt begin_expr_stmt name|KeyOperation argument_list|( name|String name|oper argument_list|) block|{ name|this operator|. name|oper operator|= name|oper block|; } specifier|public specifier|static name|KeyOperation name|getKeyOperation argument_list|( name|String name|oper argument_list|) block|{ if|if condition|( name|oper operator|== literal|null condition|) block|{ return|return literal|null return|; block|} end_expr_stmt begin_return return|return name|valueOf argument_list|( name|oper operator|. name|toUpperCase argument_list|() argument_list|) return|; end_return begin_function unit|} public name|String name|toString parameter_list|() block|{ return|return name|oper return|; block|} end_function unit|} end_unit
3e13fa2239f7947a360907b8384ed2737483c43f
3,410
java
Java
indexing-hadoop/src/test/java/org/apache/druid/indexer/partitions/HashedPartitionsSpecTest.java
xvrl/druid
1054d8517150c2fa1062608726ea9fd4c7912de3
[ "ECL-2.0", "Apache-2.0" ]
4
2019-03-07T10:26:08.000Z
2019-03-07T10:26:11.000Z
indexing-hadoop/src/test/java/org/apache/druid/indexer/partitions/HashedPartitionsSpecTest.java
xvrl/druid
1054d8517150c2fa1062608726ea9fd4c7912de3
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
indexing-hadoop/src/test/java/org/apache/druid/indexer/partitions/HashedPartitionsSpecTest.java
xvrl/druid
1054d8517150c2fa1062608726ea9fd4c7912de3
[ "ECL-2.0", "Apache-2.0" ]
1
2019-11-27T10:11:55.000Z
2019-11-27T10:11:55.000Z
29.396552
106
0.686217
8,452
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * 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.apache.druid.indexer.partitions; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; /** */ public class HashedPartitionsSpecTest { private static final ObjectMapper JSON_MAPPER = new DefaultObjectMapper(); @Test public void testHashedPartitionsSpec() { { final PartitionsSpec partitionsSpec = jsonReadWriteRead( "{" + " \"targetPartitionSize\":100," + " \"type\":\"hashed\"" + "}", PartitionsSpec.class ); Assert.assertTrue("partitionsSpec", partitionsSpec instanceof HashedPartitionsSpec); final HashedPartitionsSpec hadoopHashedPartitionsSpec = (HashedPartitionsSpec) partitionsSpec; Assert.assertEquals( "isDeterminingPartitions", hadoopHashedPartitionsSpec.needsDeterminePartitions(true), true ); Assert.assertEquals( "getTargetPartitionSize", hadoopHashedPartitionsSpec.getMaxRowsPerSegment().intValue(), 100 ); Assert.assertEquals( "getPartitionDimensions", hadoopHashedPartitionsSpec.getPartitionDimensions(), ImmutableList.of() ); } } @Test public void testHashedPartitionsSpecShardCount() { final PartitionsSpec partitionsSpec = jsonReadWriteRead( "{" + " \"type\":\"hashed\"," + " \"numShards\":2" + "}", PartitionsSpec.class ); Assert.assertTrue("partitionsSpec", partitionsSpec instanceof HashedPartitionsSpec); final HashedPartitionsSpec hadoopHashedPartitionsSpec = (HashedPartitionsSpec) partitionsSpec; Assert.assertEquals( "isDeterminingPartitions", hadoopHashedPartitionsSpec.needsDeterminePartitions(true), false ); Assert.assertNull( "getTargetPartitionSize", hadoopHashedPartitionsSpec.getMaxRowsPerSegment() ); Assert.assertEquals( "shardCount", hadoopHashedPartitionsSpec.getNumShards().intValue(), 2 ); Assert.assertEquals( "getPartitionDimensions", hadoopHashedPartitionsSpec.getPartitionDimensions(), ImmutableList.of() ); } private <T> T jsonReadWriteRead(String s, Class<T> klass) { try { return JSON_MAPPER.readValue(JSON_MAPPER.writeValueAsBytes(JSON_MAPPER.readValue(s, klass)), klass); } catch (Exception e) { throw new RuntimeException(e); } } }
3e13fb4847e6af22da20a2e1e822b439426774bb
1,483
java
Java
xml/xml-structure-view-impl/src/com/intellij/ide/structureView/impl/xml/AbstractXmlTagTreeElement.java
dunno99/intellij-community
aa656a5d874b947271b896b2105e4370827b9149
[ "Apache-2.0" ]
1
2019-08-28T13:18:50.000Z
2019-08-28T13:18:50.000Z
xml/xml-structure-view-impl/src/com/intellij/ide/structureView/impl/xml/AbstractXmlTagTreeElement.java
dunno99/intellij-community
aa656a5d874b947271b896b2105e4370827b9149
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
xml/xml-structure-view-impl/src/com/intellij/ide/structureView/impl/xml/AbstractXmlTagTreeElement.java
dunno99/intellij-community
aa656a5d874b947271b896b2105e4370827b9149
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
42.371429
140
0.783547
8,453
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.structureView.impl.xml; import com.intellij.ide.structureView.StructureViewTreeElement; import com.intellij.ide.structureView.impl.common.PsiTreeElementBase; import com.intellij.ide.structureView.xml.XmlStructureViewElementProvider; import com.intellij.openapi.extensions.Extensions; import com.intellij.psi.xml.XmlElement; import com.intellij.psi.xml.XmlTag; import com.intellij.util.containers.ContainerUtil; import java.util.Collection; public abstract class AbstractXmlTagTreeElement<T extends XmlElement> extends PsiTreeElementBase<T> { protected AbstractXmlTagTreeElement(final T psiElement) { super(psiElement); } protected static Collection<StructureViewTreeElement> getStructureViewTreeElements(XmlTag[] subTags) { final XmlStructureViewElementProvider[] providers = (XmlStructureViewElementProvider[])Extensions.getRootArea().getExtensionPoint(XmlStructureViewElementProvider.EXTENSION_POINT_NAME) .getExtensions(); return ContainerUtil.map2List(subTags, xmlTag -> { for (final XmlStructureViewElementProvider provider : providers) { final StructureViewTreeElement element = provider.createCustomXmlTagTreeElement(xmlTag); if (element != null) { return element; } } return new XmlTagTreeElement(xmlTag); }); } }
3e13fc9c360a03d5f70c20e582616fb4839ed808
9,586
java
Java
src/main/java/uk/co/pervasive_intelligence/vmv/cryptography/nizkp/ChaumPedersenAlgorithmHelper.java
saschneider/VMV
3c96d3b463d93c09260f60fb1aa3547248ffd8d4
[ "MIT" ]
1
2021-07-06T00:23:52.000Z
2021-07-06T00:23:52.000Z
src/main/java/uk/co/pervasive_intelligence/vmv/cryptography/nizkp/ChaumPedersenAlgorithmHelper.java
saschneider/VMV
3c96d3b463d93c09260f60fb1aa3547248ffd8d4
[ "MIT" ]
null
null
null
src/main/java/uk/co/pervasive_intelligence/vmv/cryptography/nizkp/ChaumPedersenAlgorithmHelper.java
saschneider/VMV
3c96d3b463d93c09260f60fb1aa3547248ffd8d4
[ "MIT" ]
null
null
null
41.141631
172
0.714897
8,454
/* * Trusted and Transparent Voting Systems: Verify My Vote Demonstrator * * (c) University of Surrey 2019 */ package uk.co.pervasive_intelligence.vmv.cryptography.nizkp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.co.pervasive_intelligence.vmv.cryptography.AlgorithmHelper; import uk.co.pervasive_intelligence.vmv.cryptography.BaseHelper; import uk.co.pervasive_intelligence.vmv.cryptography.CryptographyException; import uk.co.pervasive_intelligence.vmv.cryptography.data.*; import java.math.BigInteger; import java.security.SecureRandom; import java.util.ArrayList; import java.util.List; /** * Chaum-Pedersen NIZKP implementation of the {@link AlgorithmHelper}. * * @author Matthew Casey, Pervasive Intelligence Ltd */ public class ChaumPedersenAlgorithmHelper extends BaseHelper implements AlgorithmHelper { /** Logger. */ private static final Logger LOG = LoggerFactory.getLogger(ChaumPedersenAlgorithmHelper.class); /** * Uses the algorithm to create keys. * * @param random Source of randomness. * @param parameters The created algorithm parameters. * @return The created keys. * @throws CryptographyException if the cryptographic operation could not be completed. */ @Override public KeyPair createKeys(final SecureRandom random, final Parameters parameters) throws CryptographyException { throw new CryptographyException("Chaum-Pedersen algorithm cannot be used to create keys"); } /** * Creates parameters for the algorithm. * * @param random Source of randomness. * @param values Specific values of parameters to be used. * @return The corresponding algorithm parameters. * @throws CryptographyException if the cryptographic operation could not be completed. */ @Override public Parameters createParameters(final SecureRandom random, final Object... values) throws CryptographyException { throw new CryptographyException("Chaum-Pedersen algorithm cannot be used to create parameters"); } /** * Decrypts the ciphertext data using the parameters and key pair. Only relevant if the algorithm can be used to encrypt/decrypt. * * @param parameters The created algorithm parameters. * @param keyPair The created algorithm key pair for the parameters. * @param data The data which has been encrypted. * @return The decrypted plaintext. * @throws CryptographyException if the cryptographic operation could not be completed. */ @Override public byte[] decrypt(final Parameters parameters, final KeyPair keyPair, final byte[] data) throws CryptographyException { throw new CryptographyException("Chaum-Pedersen algorithm cannot be used for encryption/decryption"); } /** * Encrypts the plaintext data using the parameters and key pair. Only relevant if the algorithm can be used to encrypt/decrypt. * * @param random Source of randomness. * @param parameters The created algorithm parameters. * @param keyPair The created algorithm key pair for the parameters. * @param data The data to sign. * @return The ciphertext for the plaintext together with any other values. * @throws CryptographyException if the cryptographic operation could not be completed. */ @Override public byte[][] encrypt(final SecureRandom random, final Parameters parameters, final KeyPair keyPair, final byte[] data) throws CryptographyException { throw new CryptographyException("Chaum-Pedersen algorithm cannot be used for encryption/decryption"); } /** * Generates a non-interactive zero-knowledge proof of knowledge of the witness and one or more statements. * * @param random Source of randomness. * @param parameters The created algorithm parameters. * @param witness The (private) witness of the statement. * @param statements The statements being proved. * @return The corresponding proof. * @throws CryptographyException if the cryptographic operation could not be completed. */ @Override public Proof generateProof(final SecureRandom random, final Parameters parameters, final BigInteger witness, final Statement... statements) throws CryptographyException { // Make sure we have a witness and one or more statements. if (witness == null) { throw new CryptographyException("Missing witness"); } if ((statements == null) || (statements.length < 1)) { throw new CryptographyException("Must have at least one statement"); } try { LOG.debug("Generate proof"); final DHParametersWrapper dhParametersWrapper = (DHParametersWrapper) parameters; final BigInteger p = dhParametersWrapper.getP(); final BigInteger q = dhParametersWrapper.getQ(); // Generate a random number in the range 1 to q-1. final BigInteger k = this.generateRandom(random, q); // Calculate t_n = statement_n(rhs)^k mod p. final List<BigInteger> tn = new ArrayList<>(); for (final Statement statement : statements) { tn.add(statement.getRightHandSide().modPow(k, p)); } // Calculate c = H(t_1, ... , statement_1(rhs), statement_1(lhs), ... , p, q). final List<BigInteger> values = new ArrayList<>(tn); for (final Statement statement : statements) { values.add(statement.getRightHandSide()); values.add(statement.getLeftHandSide()); } values.add(p); values.add(q); final BigInteger c = this.hash(q.bitLength(), values.toArray(new BigInteger[0])); // Calculate r = k + cx mod q. final BigInteger r = k.add(c.multiply(witness)).mod(q); return new Proof(c, r); } catch (final Exception e) { throw new CryptographyException("Could not generate proof", e); } } /** * @return The class used for the parameters. */ @Override public Class<? extends Parameters> getParametersClass() { return null; } /** * Signs the specified data using the parameters and key pair. Only relevant if the algorithm can be used to sign/verify. * * @param parameters The created algorithm parameters. * @param keyPair The created algorithm key pair for the parameters. * @param data The data to sign. * @return The signature for the data. * @throws CryptographyException if the cryptographic operation could not be completed. */ @Override public byte[] sign(final Parameters parameters, final KeyPair keyPair, final byte[] data) throws CryptographyException { throw new CryptographyException("Chaum-Pedersen algorithm cannot be used for sign/verify"); } /** * Verifies the signature of the data using the parameters and key pair. Only relevant if the algorithm can be used to sign/verify. * * @param parameters The created algorithm parameters. * @param keyPair The created algorithm key pair for the parameters. * @param data The data which has been signed. * @param signature The signature to verify. * @return True if the signature matches, false otherwise. * @throws CryptographyException if the cryptographic operation could not be completed. */ @Override public boolean verify(final Parameters parameters, final KeyPair keyPair, final byte[] data, final byte[] signature) throws CryptographyException { throw new CryptographyException("Chaum-Pedersen algorithm cannot be used for sign/verify"); } /** * Verifies a non-interactive zero-knowledge proof of knowledge of one or more statements given their proof. * * @param parameters The created algorithm parameters. * @param proof The proof of knowledge to verify. * @param statements The statements being proved. * @return True if the proof of knowledge is verified, false otherwise. * @throws CryptographyException if the cryptographic operation could not be completed. */ @Override public boolean verifyProof(final Parameters parameters, final Proof proof, final Statement... statements) throws CryptographyException { // Make sure we have one or more statements and a proof. if (proof == null) { throw new CryptographyException("Missing proof"); } if ((statements == null) || (statements.length < 1)) { throw new CryptographyException("Must have at least one statement"); } try { LOG.debug("Verify proof"); final DHParametersWrapper dhParametersWrapper = (DHParametersWrapper) parameters; final BigInteger p = dhParametersWrapper.getP(); final BigInteger q = dhParametersWrapper.getQ(); // Calculate t_n = statement_n(rhs)^proof(signature) * statement_n(lhs)^-proof(hash) mod p. final List<BigInteger> tn = new ArrayList<>(); for (final Statement statement : statements) { final BigInteger first = statement.getRightHandSide().modPow(proof.getSignature(), p); final BigInteger second = statement.getLeftHandSide().modPow(proof.getHash().negate(), p); tn.add(first.multiply(second).mod(p)); } // Calculate c = H(t_1, ... , statement_1(rhs), statement_1(lhs), ... , p, q). final List<BigInteger> values = new ArrayList<>(tn); for (final Statement statement : statements) { values.add(statement.getRightHandSide()); values.add(statement.getLeftHandSide()); } values.add(p); values.add(q); final BigInteger c = this.hash(q.bitLength(), values.toArray(new BigInteger[0])); return proof.getHash().equals(c); } catch (final Exception e) { throw new CryptographyException("Could not verify proof", e); } } }
3e13fd9db154d62e8cd1aa6eb90b40d6041dbd8f
553
java
Java
Java/Exception Handling/Java Exception Handling (Try-catch)/Solution.java
dmverner/HackerRank_Solutions
1df6f4b477014021d8276d954f6af9517a069ba3
[ "MIT" ]
2
2018-02-11T17:42:12.000Z
2018-05-31T18:30:39.000Z
Java/Exception Handling/Java Exception Handling (Try-catch)/Solution.java
dmverner/HackerRank_Solutions
1df6f4b477014021d8276d954f6af9517a069ba3
[ "MIT" ]
null
null
null
Java/Exception Handling/Java Exception Handling (Try-catch)/Solution.java
dmverner/HackerRank_Solutions
1df6f4b477014021d8276d954f6af9517a069ba3
[ "MIT" ]
1
2019-09-15T15:22:04.000Z
2019-09-15T15:22:04.000Z
24.043478
54
0.549729
8,455
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); try{ int a = scan.nextInt(); int b = scan.nextInt(); System.out.println(a / b); } catch(ArithmeticException e){ System.out.println(e); } catch(InputMismatchException e){ System.out.println(e.getClass().getName()); } } }
3e13fde63edc0894fcc0ebaa2f67a093b6c712eb
3,416
java
Java
streams-contrib/streams-persist-filebuffer/src/main/java/org/apache/streams/filebuffer/FileBufferPersistWriter.java
jfrazee/incubator-streams
4feff372e83fd71657c63c2edf123b30a27cd149
[ "Apache-2.0" ]
49
2015-03-30T10:37:05.000Z
2021-11-16T10:57:35.000Z
streams-contrib/streams-persist-filebuffer/src/main/java/org/apache/streams/filebuffer/FileBufferPersistWriter.java
jfrazee/incubator-streams
4feff372e83fd71657c63c2edf123b30a27cd149
[ "Apache-2.0" ]
62
2017-08-26T19:11:13.000Z
2020-08-24T18:34:41.000Z
streams-contrib/streams-persist-filebuffer/src/main/java/org/apache/streams/filebuffer/FileBufferPersistWriter.java
jfrazee/incubator-streams
4feff372e83fd71657c63c2edf123b30a27cd149
[ "Apache-2.0" ]
42
2015-03-30T17:01:04.000Z
2022-02-09T03:03:33.000Z
28.231405
94
0.742389
8,456
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * * 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.apache.streams.filebuffer; import org.apache.streams.config.ComponentConfigurator; import org.apache.streams.config.StreamsConfigurator; import org.apache.streams.core.StreamsDatum; import org.apache.streams.core.StreamsPersistWriter; import org.apache.streams.util.GuidUtils; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Preconditions; import com.squareup.tape.QueueFile; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.io.Serializable; import java.util.Objects; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; /** * Writes data to a buffer stored on the file-system. */ public class FileBufferPersistWriter implements StreamsPersistWriter, Serializable { private static final String STREAMS_ID = "FileBufferPersistWriter"; private static final Logger LOGGER = LoggerFactory.getLogger(FileBufferPersistWriter.class); private volatile Queue<StreamsDatum> persistQueue; private ObjectMapper mapper; private FileBufferConfiguration config; private QueueFile queueFile; public FileBufferPersistWriter() { this(new ComponentConfigurator<>(FileBufferConfiguration.class).detectConfiguration()); } public FileBufferPersistWriter(FileBufferConfiguration config) { this.config = config; } @Override public String getId() { return STREAMS_ID; } @Override public void write(StreamsDatum entry) { String key = entry.getId() != null ? entry.getId() : GuidUtils.generateGuid("filewriter"); Preconditions.checkArgument(StringUtils.isNotBlank(key)); Preconditions.checkArgument(entry.getDocument() instanceof String); Preconditions.checkArgument(StringUtils.isNotBlank((String) entry.getDocument())); byte[] item = ((String)entry.getDocument()).getBytes(); try { queueFile.add(item); } catch (IOException ex) { ex.printStackTrace(); } } @Override public void prepare(Object configurationObject) { mapper = new ObjectMapper(); File file = new File( config.getBuffer() ); try { queueFile = new QueueFile(file); } catch (IOException ex) { ex.printStackTrace(); } Preconditions.checkArgument(file.exists()); Preconditions.checkArgument(file.canWrite()); Objects.requireNonNull(queueFile); this.persistQueue = new ConcurrentLinkedQueue<>(); } @Override public void cleanUp() { try { queueFile.close(); } catch (IOException ex) { ex.printStackTrace(); } finally { queueFile = null; } } }
3e13ffd48cfad96909e5173f1d93955d64b54473
714
java
Java
farmsim/src/test/java/farmsim/util/console/ConsoleHandlerExceptionTest.java
UQdeco2800/farmsim
d89ea5a7d424ff4e60ce8739f91a7735c09aeea4
[ "MIT" ]
17
2016-01-05T08:40:48.000Z
2022-03-27T10:17:34.000Z
farmsim/src/test/java/farmsim/util/console/ConsoleHandlerExceptionTest.java
UQdeco2800/farmsim
d89ea5a7d424ff4e60ce8739f91a7735c09aeea4
[ "MIT" ]
1
2022-01-15T14:16:30.000Z
2022-01-17T06:15:14.000Z
farmsim/src/test/java/farmsim/util/console/ConsoleHandlerExceptionTest.java
UQdeco2800/farmsim
d89ea5a7d424ff4e60ce8739f91a7735c09aeea4
[ "MIT" ]
5
2017-08-12T14:12:09.000Z
2021-05-14T14:44:05.000Z
23.8
76
0.644258
8,457
package farmsim.util.console; import org.junit.Test; /** * Tests for the custom command handler exception. */ public class ConsoleHandlerExceptionTest { /** * Tests creating an empty Console Handler Exception. */ @Test(expected = ConsoleHandlerException.class) public void createException() { throw new ConsoleHandlerException(); } /** * Tests creating an Console Handler Exception with a passing Exception. */ @Test(expected = ConsoleHandlerException.class) public void createExceptionFromError() { try { int setToFail = 9001 / 0; } catch (Exception e) { throw new ConsoleHandlerException(e); } } }
3e1400defe9ae2c1838e40a5caa34f5f032286d9
368
java
Java
mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/mapper/OrderItemMapper.java
wuchunfu/youlai-mall
6a810f4bac713bee9b14af41bd2fa3555598d482
[ "Apache-2.0" ]
227
2022-01-16T15:17:11.000Z
2022-03-30T01:35:35.000Z
mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/mapper/OrderItemMapper.java
wuchunfu/youlai-mall
6a810f4bac713bee9b14af41bd2fa3555598d482
[ "Apache-2.0" ]
4
2022-01-18T02:18:45.000Z
2022-03-04T02:49:02.000Z
mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/mapper/OrderItemMapper.java
wuchunfu/youlai-mall
6a810f4bac713bee9b14af41bd2fa3555598d482
[ "Apache-2.0" ]
62
2022-01-16T18:49:49.000Z
2022-03-31T09:10:09.000Z
20.555556
67
0.764865
8,458
package com.youlai.mall.oms.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.youlai.mall.oms.pojo.entity.OmsOrderItem; import org.apache.ibatis.annotations.Mapper; /** * 订单商品明细表 * * @author huawei * @email dycjh@example.com * @date 2020-12-30 22:31:10 */ @Mapper public interface OrderItemMapper extends BaseMapper<OmsOrderItem> { }
3e1401b0fc3cb9d34be9978877def2b724dffff8
416
java
Java
app/src/main/java/com/base/basemodule/utils/formValidation/annotation/NumberSize.java
lvzesong/basemodule
72332db670461898c967f484ee0168c74820648e
[ "Apache-2.0" ]
1
2020-08-11T02:08:42.000Z
2020-08-11T02:08:42.000Z
app/src/main/java/com/base/basemodule/utils/formValidation/annotation/NumberSize.java
lvzesong/basemodule
72332db670461898c967f484ee0168c74820648e
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/base/basemodule/utils/formValidation/annotation/NumberSize.java
lvzesong/basemodule
72332db670461898c967f484ee0168c74820648e
[ "Apache-2.0" ]
null
null
null
27.733333
60
0.786058
8,459
package com.base.basemodule.utils.formValidation.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface NumberSize { String message(); int minvalue() default 0; //最小长度 int maxvalue() default 0; //最大长度 }
3e140256af8d23d88a0294af84db5d7da0308df1
976
java
Java
src/main/java/pl/lodz/p/aurora/mus/web/dto/DutyDto.java
mswitalski/aurora-spring
b29401d72a05516dd20095958fac96603ad025e2
[ "MIT" ]
null
null
null
src/main/java/pl/lodz/p/aurora/mus/web/dto/DutyDto.java
mswitalski/aurora-spring
b29401d72a05516dd20095958fac96603ad025e2
[ "MIT" ]
null
null
null
src/main/java/pl/lodz/p/aurora/mus/web/dto/DutyDto.java
mswitalski/aurora-spring
b29401d72a05516dd20095958fac96603ad025e2
[ "MIT" ]
null
null
null
20.765957
52
0.637295
8,460
package pl.lodz.p.aurora.mus.web.dto; import org.hibernate.validator.constraints.NotEmpty; import pl.lodz.p.aurora.msh.validator.NoHtml; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.HashSet; import java.util.Set; public class DutyDto { private Long id; @NoHtml @NotEmpty(message = "{Default.NotEmpty}") @NotNull(message = "{Default.NotNull}") @Size(max = 100, message = "{Default.Size.Max}") private String name; private Set<UserDto> users = new HashSet<>(); public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Set<UserDto> getUsers() { return new HashSet<>(users); } public void setUsers(Set<UserDto> users) { this.users = new HashSet<>(users); } }
3e140418b77fcba1a9199d99b93d2912fd2ef494
2,216
java
Java
tddl-manager/src/main/java/com/alibaba/cobar/manager/dao/CobarAdapterDAO.java
loye168/tddl5
fd1972bd3acf090c8d7580ab0f7c2bb837ab3c41
[ "Apache-2.0" ]
19
2017-07-17T02:21:28.000Z
2021-07-19T02:23:06.000Z
tddl-manager/src/main/java/com/alibaba/cobar/manager/dao/CobarAdapterDAO.java
loye168/tddl5
fd1972bd3acf090c8d7580ab0f7c2bb837ab3c41
[ "Apache-2.0" ]
null
null
null
tddl-manager/src/main/java/com/alibaba/cobar/manager/dao/CobarAdapterDAO.java
loye168/tddl5
fd1972bd3acf090c8d7580ab0f7c2bb837ab3c41
[ "Apache-2.0" ]
46
2017-03-23T12:24:11.000Z
2021-12-20T09:59:52.000Z
33.19403
83
0.706385
8,461
package com.alibaba.cobar.manager.dao; import java.util.List; import com.alibaba.cobar.manager.dataobject.cobarnode.CommandStatus; import com.alibaba.cobar.manager.dataobject.cobarnode.ConnectionStatus; import com.alibaba.cobar.manager.dataobject.cobarnode.DataNodesStatus; import com.alibaba.cobar.manager.dataobject.cobarnode.DataSources; import com.alibaba.cobar.manager.dataobject.cobarnode.ProcessorStatus; import com.alibaba.cobar.manager.dataobject.cobarnode.ServerStatus; import com.alibaba.cobar.manager.dataobject.cobarnode.ThreadPoolStatus; import com.alibaba.cobar.manager.dataobject.cobarnode.TimeStamp; import com.alibaba.cobar.manager.util.Pair; /** * (created at 2010-7-26) * * @author <a href="mailto:dycjh@example.com">QIU Shuo</a> * @author haiqing.zhuhq 2011-9-1 */ public interface CobarAdapterDAO { /** * @return true if success. never throw Exception */ boolean setCobarStatus(boolean status); TimeStamp getCurrentTime(); // show @@time.current TimeStamp getStartUpTime(); // show @@time.startup String getVersion(); // show @@version; ServerStatus getServerStatus(); // show @@server; List<ProcessorStatus> listProccessorStatus(); // show @@processor List<ThreadPoolStatus> listThreadPoolStatus(); // show @@threadpool List<String> listDataBases(); // show @@databases List<DataNodesStatus> listDataNodes(); // show @@dataNodes List<DataSources> listDataSources(); // show @@dataSources List<ConnectionStatus> listConnectionStatus(); // show @@connection List<CommandStatus> listCommandStatus(); // show @@command Pair<Long, Long> getCurrentTimeMillis(); int switchDataNode(String datanodes, int index); // switch @@datasource // datanodes:index int stopHeartbeat(String datanodes, int hour_time); // stop @@heartbeat // datanodes:hour_time*3600 int killConnection(long id); // kill @@connection id boolean reloadConfig();// reload @@config boolean rollbackConfig();// rollback @@config boolean checkConnection(); // use show @@version to check cobar connection }
3e1404bf94f7debacdd889d206f6f08318caa708
598
java
Java
springboot_mybatis/src/test/java/com/cc/MybatisTest.java
cc-djy/JWLT
7de5cff976cd55cc349aacb6a95506e518f436b8
[ "MIT" ]
null
null
null
springboot_mybatis/src/test/java/com/cc/MybatisTest.java
cc-djy/JWLT
7de5cff976cd55cc349aacb6a95506e518f436b8
[ "MIT" ]
8
2020-03-04T23:13:43.000Z
2021-01-21T00:30:09.000Z
springboot_mybatis/src/test/java/com/cc/MybatisTest.java
cc-djy/JWLT
7de5cff976cd55cc349aacb6a95506e518f436b8
[ "MIT" ]
null
null
null
28.47619
62
0.789298
8,462
package com.cc; import com.cc.mapper.ManagerMapper; import com.cc.pojo.Manager; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest(classes = SpringbootMybatisApplication.class) public class MybatisTest { @Autowired private ManagerMapper managerMapper; @Test public void test(){ System.out.println(managerMapper.queryManagers()); } }
3e1404c3f4882ab7f2fda291a8fca2ec7681451f
3,417
java
Java
pxf/pxf-jdbc/src/main/java/org/apache/hawq/pxf/plugins/jdbc/writercallable/BatchWriterCallable.java
pidefrem/hawq
b82d9410f890b41d4cf608f8bfbac84db75f232e
[ "Apache-2.0" ]
450
2015-09-05T09:12:51.000Z
2018-08-30T01:45:36.000Z
pxf/pxf-jdbc/src/main/java/org/apache/hawq/pxf/plugins/jdbc/writercallable/BatchWriterCallable.java
pidefrem/hawq
b82d9410f890b41d4cf608f8bfbac84db75f232e
[ "Apache-2.0" ]
1,274
2015-09-22T20:06:16.000Z
2018-08-31T22:14:00.000Z
pxf/pxf-jdbc/src/main/java/org/apache/hawq/pxf/plugins/jdbc/writercallable/BatchWriterCallable.java
pidefrem/hawq
b82d9410f890b41d4cf608f8bfbac84db75f232e
[ "Apache-2.0" ]
278
2015-09-21T19:15:06.000Z
2018-08-31T00:36:51.000Z
31.063636
107
0.649985
8,463
package org.apache.hawq.pxf.plugins.jdbc.writercallable; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * 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. */ import org.apache.hawq.pxf.api.OneRow; import org.apache.hawq.pxf.plugins.jdbc.JdbcResolver; import org.apache.hawq.pxf.plugins.jdbc.JdbcPlugin; import java.util.LinkedList; import java.util.List; import java.io.IOException; import java.sql.PreparedStatement; import java.sql.SQLException; /** * This writer makes batch INSERTs. * * A call() is required after a certain number of supply() calls */ class BatchWriterCallable implements WriterCallable { @Override public void supply(OneRow row) throws IllegalStateException { if ((batchSize > 0) && (rows.size() >= batchSize)) { throw new IllegalStateException("Trying to supply() a OneRow object to a full WriterCallable"); } if (row == null) { throw new IllegalArgumentException("Trying to supply() a null OneRow object"); } rows.add(row); } @Override public boolean isCallRequired() { return (batchSize > 0) && (rows.size() >= batchSize); } @Override public SQLException call() throws IOException, SQLException, ClassNotFoundException { if (rows.isEmpty()) { return null; } boolean statementMustBeDeleted = false; if (statement == null) { statement = plugin.getPreparedStatement(plugin.getConnection(), query); statementMustBeDeleted = true; } for (OneRow row : rows) { JdbcResolver.decodeOneRowToPreparedStatement(row, statement); statement.addBatch(); } try { statement.executeBatch(); } catch (SQLException e) { return e; } finally { rows.clear(); if (statementMustBeDeleted) { JdbcPlugin.closeStatement(statement); statement = null; } } return null; } /** * Construct a new batch writer */ BatchWriterCallable(JdbcPlugin plugin, String query, PreparedStatement statement, int batchSize) { if (plugin == null || query == null) { throw new IllegalArgumentException("The provided JdbcPlugin or SQL query is null"); } this.plugin = plugin; this.query = query; this.statement = statement; this.batchSize = batchSize; rows = new LinkedList<>(); } private final JdbcPlugin plugin; private final String query; private PreparedStatement statement; private List<OneRow> rows; private final int batchSize; }
3e1404e7415058625afb07af02de2d553d1c522c
4,259
java
Java
src/test/java/org/hitzoft/xml/test/SignWithKeyFileslTest.java
Chuy288/simple-xml-signer
11943513515b7ca9c6f8ce3ae66b5cbfaa4ebc9a
[ "Apache-2.0" ]
null
null
null
src/test/java/org/hitzoft/xml/test/SignWithKeyFileslTest.java
Chuy288/simple-xml-signer
11943513515b7ca9c6f8ce3ae66b5cbfaa4ebc9a
[ "Apache-2.0" ]
null
null
null
src/test/java/org/hitzoft/xml/test/SignWithKeyFileslTest.java
Chuy288/simple-xml-signer
11943513515b7ca9c6f8ce3ae66b5cbfaa4ebc9a
[ "Apache-2.0" ]
1
2021-12-09T19:33:52.000Z
2021-12-09T19:33:52.000Z
32.022556
95
0.62456
8,464
package org.hitzoft.xml.test; import java.io.File; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import org.hitzoft.xml.DigestMethodAlgorithm; import org.hitzoft.xml.SignatureMethodAlgorithm; import org.hitzoft.xml.XMLSigner; import org.hitzoft.xml.XMLSignerValidationException; import org.hitzoft.xml.keypair.KeyFilesImpl; import org.hitzoft.xml.keypair.KeyPairHolder; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.w3c.dom.Document; /** * * @author jesus.espinoza */ public class SignWithKeyFileslTest { private Document unsignedXML; private Document signedXML; private XMLSigner signer; @Before public void setup() { try { File unsigned = new File("src/main/resources/example.xml"); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = dbf.newDocumentBuilder(); unsignedXML = builder.parse(unsigned); signedXML = builder.newDocument(); signer = new XMLSigner(); } catch (Exception ex) { ex.printStackTrace(); Assert.fail(ex.getMessage()); } } @After public void drop() { signedXML = null; signer = null; } private boolean valid(Document signedXML) { try { return signer.valid(signedXML); } catch (XMLSignerValidationException ex) { System.out.println(ex.getValidationMessages()); return false; } catch (Exception ex) { return false; } } @Test public void signXMLSHA1WithRSA() { try { // Load Keystore String privateKeyPath = "src/main/resources/AAA010101AAA_FIEL.key"; String password = "12345678a"; String certificate = "src/main/resources/aaa010101aaa_FIEL.cer"; KeyPairHolder keyHolder = new KeyFilesImpl(privateKeyPath, password, certificate); signer.setDigestMethodAlgorithm(DigestMethodAlgorithm.SHA1); signer.setSignatureMethodAlgorithm(SignatureMethodAlgorithm.RSA_SHA1); signer.setKeyPairProvider(keyHolder); signedXML = signer.sign(unsignedXML); } catch (Exception ex) { ex.printStackTrace(); Assert.fail(ex.getMessage()); } Assert.assertTrue(valid(signedXML)); } @Test public void signXMLSHA256WithRSA() { try { // Load Keystore String privateKeyPath = "src/main/resources/AAA010101AAA_FIEL.key"; String password = "12345678a"; String certificate = "src/main/resources/aaa010101aaa_FIEL.cer"; KeyPairHolder keyHolder = new KeyFilesImpl(privateKeyPath, password, certificate); signer.setDigestMethodAlgorithm(DigestMethodAlgorithm.SHA256); signer.setSignatureMethodAlgorithm(SignatureMethodAlgorithm.RSA_SHA256); signer.setKeyPairProvider(keyHolder); signedXML = signer.sign(unsignedXML); } catch (Exception ex) { ex.printStackTrace(); Assert.fail(ex.getMessage()); } Assert.assertTrue(valid(signedXML)); } @Test public void signXMLSHA512WithRSA() { try { // Load Keystore String privateKeyPath = "src/main/resources/AAA010101AAA_FIEL.key"; String password = "12345678a"; String certificate = "src/main/resources/aaa010101aaa_FIEL.cer"; KeyPairHolder keyHolder = new KeyFilesImpl(privateKeyPath, password, certificate); signer.setDigestMethodAlgorithm(DigestMethodAlgorithm.SHA512); signer.setSignatureMethodAlgorithm(SignatureMethodAlgorithm.RSA_SHA512); signer.setKeyPairProvider(keyHolder); signedXML = signer.sign(unsignedXML); } catch (Exception ex) { ex.printStackTrace(); Assert.fail(ex.getMessage()); } Assert.assertTrue(valid(signedXML)); } }
3e14054001717d7aeb3a33c8af023810e9a55a9b
188
java
Java
dagger2/src/main/java/com/example/hades/dagger2/_14_not_support_static_injectons/Cat.java
YingVickyCao/test-Dragger
38732623085aab9e1dabf4c67a32d11452ef347c
[ "Apache-2.0" ]
null
null
null
dagger2/src/main/java/com/example/hades/dagger2/_14_not_support_static_injectons/Cat.java
YingVickyCao/test-Dragger
38732623085aab9e1dabf4c67a32d11452ef347c
[ "Apache-2.0" ]
null
null
null
dagger2/src/main/java/com/example/hades/dagger2/_14_not_support_static_injectons/Cat.java
YingVickyCao/test-Dragger
38732623085aab9e1dabf4c67a32d11452ef347c
[ "Apache-2.0" ]
null
null
null
23.5
67
0.734043
8,465
package com.example.hades.dagger2._14_not_support_static_injectons; public class Cat implements IAnimal { public String getName() { return getClass().getSimpleName(); } }
3e1407f90c2f139b54ef3405babb709369db87da
4,168
java
Java
src/plantuml-asl/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileDiamondInside.java
SandraBSofiaH/Final-UMldoclet
e27bef0356cecaf6bad55bd41d3a6a1ba943e0a2
[ "Apache-2.0" ]
174
2016-03-02T20:22:19.000Z
2022-03-18T09:28:05.000Z
src/plantuml-asl/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileDiamondInside.java
SandraBSofiaH/Final-UMldoclet
e27bef0356cecaf6bad55bd41d3a6a1ba943e0a2
[ "Apache-2.0" ]
314
2016-03-01T06:59:04.000Z
2022-03-21T19:59:08.000Z
src/plantuml-asl/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileDiamondInside.java
SandraBSofiaH/Final-UMldoclet
e27bef0356cecaf6bad55bd41d3a6a1ba943e0a2
[ "Apache-2.0" ]
29
2017-04-29T06:52:27.000Z
2022-02-22T01:52:16.000Z
37.54955
112
0.738004
8,466
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2020, Arnaud Roques * * Project Info: https://plantuml.com * * If you like this project or if you find it useful, you can support us at: * * https://plantuml.com/patreon (only 1$ per month!) * https://plantuml.com/paypal * * This file is part of PlantUML. * * 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. * * * Original Author: Arnaud Roques */ package net.sourceforge.plantuml.activitydiagram3.gtile; import java.awt.geom.Dimension2D; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; public class GtileDiamondInside extends AbstractGtile { protected final HColor backColor; protected final HColor borderColor; protected final TextBlock label; protected final Dimension2D dimLabel; protected final double shadowing; final public StyleSignature getDefaultStyleDefinition() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } // FtileDiamondInside public GtileDiamondInside(StringBounder stringBounder, TextBlock label, ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane) { super(stringBounder, skinParam, swimlane); if (UseStyle.useBetaStyle()) { Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.shadowing = style.value(PName.Shadowing).asDouble(); } else { this.backColor = backColor; this.borderColor = borderColor; this.shadowing = skinParam().shadowing(null) ? 3 : 0; } this.label = label; this.dimLabel = label.calculateDimension(stringBounder); } @Override public Dimension2D calculateDimension(StringBounder stringBounder) { final Dimension2D dim; if (dimLabel.getWidth() == 0 || dimLabel.getHeight() == 0) { dim = new Dimension2DDouble(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2); } else { dim = Dimension2DDouble.delta( Dimension2DDouble.atLeast(dimLabel, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2), Hexagon.hexagonHalfSize * 2, 0); } return dim; } @Override public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); final Dimension2D dimTotal = calculateDimension(stringBounder); ug = ug.apply(borderColor).apply(getThickness()).apply(backColor.bg()); ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight())); final double lx = (dimTotal.getWidth() - dimLabel.getWidth()) / 2; final double ly = (dimTotal.getHeight() - dimLabel.getHeight()) / 2; label.drawU(ug.apply(new UTranslate(lx, ly))); } }
3e14080bfe49f20a14f736c2aec4d16707ed51f4
10,185
java
Java
src/main/java/com/realtimetech/kson/test/TestObject.java
vm2303/kson
8ece1da5ee89940e1928c625c3c076aea050e3ce
[ "Apache-2.0" ]
null
null
null
src/main/java/com/realtimetech/kson/test/TestObject.java
vm2303/kson
8ece1da5ee89940e1928c625c3c076aea050e3ce
[ "Apache-2.0" ]
null
null
null
src/main/java/com/realtimetech/kson/test/TestObject.java
vm2303/kson
8ece1da5ee89940e1928c625c3c076aea050e3ce
[ "Apache-2.0" ]
null
null
null
24.781022
116
0.660481
8,467
package com.realtimetech.kson.test; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import com.realtimetech.kson.annotation.Ignore; import com.realtimetech.reflection.access.ArrayAccessor; public class TestObject { private Test test; private TestEnum enumType1; private TestEnum enumType2; private String[] emptyArray; @Ignore private byte[] bytes; private Test[] testArray; private int[] intArray; private String[] stringArray; private int integer; private String string; private TestInterfaceImpl testInterfaceImpl; private TestAbstractImpl testAbstractImpl; private TestInterface testInterface; private TestAbstract testAbstract; private TestInterfaceImpl[] testInterfaceImplArray; private TestAbstractImpl[] testAbstractImplArray; private TestInterface[] testInterfaceArray; private TestAbstract[] testAbstractArray; private Date date; private Date[] dateArray; private ArrayList<String> stringArrayList; private List<String> stringList; private ArrayList<Date> dateArrayList; private List<Date> dateList; private LinkedList<Double> doubleLinkedList; private List<Double> doubleList; private LinkedList<TestSingle> testSingleList; private HashMap<String, String> stringMap; private HashMap<String, Date> dateMap; private HashMap<HashMap<String, String>, HashMap<String, String>> mapMap; public String validationObject(TestObject collectObject) throws IllegalArgumentException, IllegalAccessException { for (Field field : collectObject.getClass().getDeclaredFields()) { if (!field.isAnnotationPresent(Ignore.class)) { Object originalObject = field.get(this); Object targetObject = field.get(collectObject); if (!validation(originalObject, targetObject)) { return field.getName(); } } } return null; } private boolean validation(Object originalObject, Object targetObject) { if (originalObject.getClass() == targetObject.getClass()) { if (originalObject.getClass().isArray() && targetObject.getClass().isArray()) { int originalLength = Array.getLength(originalObject); int targetLength = Array.getLength(targetObject); if (originalLength == targetLength) { for (int index = 0; index < originalLength; index++) { Object originalElementObject = ArrayAccessor.get(originalObject, index); Object targetElementObject = ArrayAccessor.get(targetObject, index); if (originalElementObject.getClass() != targetElementObject.getClass()) { return false; } } } else { return false; } } else if (originalObject instanceof Map && targetObject instanceof Map) { Map<?, ?> originalMap = (Map<?, ?>) originalObject; Map<?, ?> targetMap = (Map<?, ?>) targetObject; if (originalMap.keySet().size() == targetMap.keySet().size()) { for (Object originalKeyObject : originalMap.keySet()) { if (targetMap.containsKey(originalKeyObject)) { Object originalValueObject = originalMap.get(originalKeyObject); Object targetValueObject = targetMap.get(originalKeyObject); if (!validation(originalValueObject, targetValueObject)) { return false; } } else { return false; } } } else { return false; } } else if (originalObject instanceof List && targetObject instanceof List) { List<?> originalList = (List<?>) originalObject; List<?> targetList = (List<?>) targetObject; if (originalList.size() == targetList.size()) { for (int i = 0; i < originalList.size(); i++) { if (!validation(originalList.get(i), targetList.get(i))) { return false; } } } else { return false; } } else { if (!originalObject.toString().contains("@")) { if (!originalObject.toString().contentEquals(targetObject.toString())) { return false; } } } } else { return false; } return true; } public TestObject(Test test) { this.test = test; this.testArray = new Test[] { test, test }; this.enumType1 = TestEnum.TYPE_1; this.enumType2 = TestEnum.TYPE_2; this.intArray = new int[] { 1, 2, 3, 4 }; this.integer = 1; this.emptyArray = new String[0]; this.stringArray = new String[] { "A", "B", "C" }; this.string = "ABC"; this.testInterfaceImpl = new TestInterfaceImpl(); this.testAbstractImpl = new TestAbstractImpl(); this.testInterface = new TestInterfaceImpl(); this.testAbstract = new TestAbstractImpl(); this.bytes = new byte[255]; { for (byte i = -128; i < Byte.MAX_VALUE; i++) { this.bytes[i + 128] = i; } } this.testInterfaceImplArray = new TestInterfaceImpl[2]; { this.testInterfaceImplArray[0] = new TestInterfaceImpl(); this.testInterfaceImplArray[1] = new TestInterfaceImpl(); } this.testAbstractImplArray = new TestAbstractImpl[2]; { this.testAbstractImplArray[0] = new TestAbstractImpl(); this.testAbstractImplArray[1] = new TestAbstractImpl(); } this.testInterfaceArray = new TestInterface[2]; { this.testInterfaceArray[0] = new TestInterfaceImpl(); this.testInterfaceArray[1] = new TestInterfaceImpl(); } this.testAbstractArray = new TestAbstract[2]; { this.testAbstractArray[0] = new TestAbstractImpl(); this.testAbstractArray[1] = new TestAbstractImpl(); } this.date = new Date(); this.dateArray = new Date[2]; { this.dateArray[0] = new Date(); this.dateArray[1] = new Date(); } this.stringArrayList = new ArrayList<String>(); { this.stringArrayList.add("ABC"); this.stringArrayList.add("ABC"); this.stringArrayList.add("ABC"); this.stringArrayList.add("ABC"); } this.stringList = new ArrayList<String>(); { this.stringList.add("ABC"); this.stringList.add("ABC"); this.stringList.add("ABC"); this.stringList.add("ABC"); } this.dateArrayList = new ArrayList<Date>(); { this.dateArrayList.add(new Date()); this.dateArrayList.add(new Date()); this.dateArrayList.add(new Date()); this.dateArrayList.add(new Date()); } this.dateList = new ArrayList<Date>(); { this.dateList.add(new Date()); this.dateList.add(new Date()); this.dateList.add(new Date()); this.dateList.add(new Date()); } this.stringMap = new HashMap<String, String>(); { this.stringMap.put("A", "ABC"); this.stringMap.put("B", "ABC"); } this.dateMap = new HashMap<String, Date>(); { this.dateMap.put("A", new Date()); this.dateMap.put("B", new Date()); } this.doubleLinkedList = new LinkedList<Double>(); { this.doubleLinkedList.add(0d); this.doubleLinkedList.add(1d); this.doubleLinkedList.add(2d); } this.doubleList = new LinkedList<Double>(); { this.doubleList.add(0d); this.doubleList.add(1d); this.doubleList.add(2d); } this.testSingleList = new LinkedList<TestSingle>(); { this.testSingleList.add(new TestSingle()); this.testSingleList.add(new TestSingle()); this.testSingleList.add(new TestSingle()); } this.mapMap = new HashMap<HashMap<String, String>, HashMap<String, String>>(); { { HashMap<String, String> keyMap = new HashMap<String, String>(); HashMap<String, String> valueMap = new HashMap<String, String>(); keyMap.put("A", "ABC"); keyMap.put("B", "ABC"); valueMap.put("A", "ABC"); valueMap.put("B", "ABC"); this.mapMap.put(keyMap, valueMap); } { HashMap<String, String> keyMap = new HashMap<String, String>(); HashMap<String, String> valueMap = new HashMap<String, String>(); keyMap.put("C", "ABC"); keyMap.put("D", "ABC"); valueMap.put("C", "ABC"); valueMap.put("D", "ABC"); this.mapMap.put(keyMap, valueMap); } } } public Test getTest() { return test; } public int[] getIntArray() { return intArray; } public int getInteger() { return integer; } public String[] getEmptyArray() { return emptyArray; } public String[] getStringArray() { return stringArray; } public String getString() { return string; } public Test[] getTestArray() { return testArray; } public TestAbstract getTestAbstract() { return testAbstract; } public TestAbstract[] getTestAbstractArray() { return testAbstractArray; } public TestAbstractImpl getTestAbstractImpl() { return testAbstractImpl; } public TestAbstractImpl[] getTestAbstractImplArray() { return testAbstractImplArray; } public TestInterface getTestInterface() { return testInterface; } public TestInterface[] getTestInterfaceArray() { return testInterfaceArray; } public TestInterfaceImpl getTestInterfaceImpl() { return testInterfaceImpl; } public TestInterfaceImpl[] getTestInterfaceImplArray() { return testInterfaceImplArray; } public Date getDate() { return date; } public Date[] getDateArray() { return dateArray; } public ArrayList<Date> getDateArrayList() { return dateArrayList; } public List<Date> getDateList() { return dateList; } public ArrayList<String> getStringArrayList() { return stringArrayList; } public List<String> getStringList() { return stringList; } public HashMap<String, Date> getDateMap() { return dateMap; } public HashMap<HashMap<String, String>, HashMap<String, String>> getMapMap() { return mapMap; } public HashMap<String, String> getStringMap() { return stringMap; } public byte[] getBytes() { return bytes; } public LinkedList<Double> getDoubleLinkedList() { return doubleLinkedList; } public List<Double> getDoubleList() { return doubleList; } public TestEnum getEnumType1() { return enumType1; } public TestEnum getEnumType2() { return enumType2; } }
3e140842955009e789e32339d06306a1cc646c55
37,299
java
Java
tourismwork-master/src/apps/report/src/main/java/com/opentravelsoft/report/action/FopReportAction.java
xiaosongdeyx001/shujuku-----123
a0a009a732d74bf601f9d4ebccfb8d42c8a9b7d9
[ "Apache-2.0" ]
3
2019-06-18T16:12:33.000Z
2021-12-09T07:39:15.000Z
tourismwork-master/src/apps/report/src/main/java/com/opentravelsoft/report/action/FopReportAction.java
xiaosongdeyx001/shujuku-----123
a0a009a732d74bf601f9d4ebccfb8d42c8a9b7d9
[ "Apache-2.0" ]
12
2020-11-16T20:38:06.000Z
2022-03-31T20:10:58.000Z
tourismwork-master/src/apps/report/src/main/java/com/opentravelsoft/report/action/FopReportAction.java
xiaosongdeyx001/shujuku-----123
a0a009a732d74bf601f9d4ebccfb8d42c8a9b7d9
[ "Apache-2.0" ]
1
2019-06-21T07:44:03.000Z
2019-06-21T07:44:03.000Z
30.902237
80
0.638328
8,468
package com.opentravelsoft.report.action; import java.io.File; import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.sax.SAXResult; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; import org.apache.struts2.ServletActionContext; import org.springframework.beans.factory.annotation.Autowired; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import org.efs.openreports.ORStatics; import org.efs.openreports.ReportConstants.ExportType; import org.efs.openreports.objects.Report; import org.efs.openreports.objects.ReportUser; import org.efs.openreports.providers.ProviderException; import org.efs.openreports.providers.ReportProvider; import com.opentravelsoft.util.LabelValueBean; import com.opentravelsoft.util.XMLUtility; import com.opentravelsoft.common.KeyParams; import com.opentravelsoft.common.SessionKeyParams; import com.opentravelsoft.entity.Booking; import com.opentravelsoft.entity.City; import com.opentravelsoft.entity.Employee; import com.opentravelsoft.entity.Line; import com.opentravelsoft.entity.Plan; import com.opentravelsoft.entity.TourCost; import com.opentravelsoft.entity.TourOutBound; import com.opentravelsoft.entity.finance.Outcome; import com.opentravelsoft.entity.finance.Reckoning; import com.opentravelsoft.entity.finance.ReckoningAcct; import com.opentravelsoft.service.operator.TourService; import com.opentravelsoft.service.order.BookingService; import com.opentravelsoft.providers.CityDao; import com.opentravelsoft.providers.ListDao; import com.opentravelsoft.providers.PlanDao; import com.opentravelsoft.providers.ReckoningDao; import com.opentravelsoft.providers.TouristDao; import com.opentravelsoft.providers.product.LineDao; import com.opentravelsoft.providers.product.LineScheduleDao; import com.opentravelsoft.providers.product.LineTraitDao; import com.opentravelsoft.service.finance.OutcomeService; import com.opentravelsoft.service.finance.ReckoningService; import com.opentravelsoft.report.util.Parameter; import com.opentravelsoft.report.view.ApacheFopFactory; public class FopReportAction extends ActionSupport { private static final long serialVersionUID = 6410639554914300771L; private String separator = System.getProperty("file.separator"); private BookingService bookingService; private ReckoningService reckoningMakeService; private OutcomeService outcomeService; private TourService tourService; private LineDao lineDao; private PlanDao planDao; private CityDao cityDao; private ListDao listDao; private ReckoningDao reckoningDao; private LineScheduleDao routeScheduleDao; private LineTraitDao routeTraitDao; private TouristDao touristDao; protected SimpleDateFormat SDF = new SimpleDateFormat("yyyy年MM月dd日"); protected SimpleDateFormat SDF1 = new SimpleDateFormat("yyyy/MM/dd"); protected SimpleDateFormat SDF2 = new SimpleDateFormat("yyyy  MM  dd   "); protected SimpleDateFormat SDF3 = new SimpleDateFormat("  MM  dd  "); // 保留两位小数点 protected DecimalFormat df = new DecimalFormat("#.00"); private ReportProvider reportProvider; private Date date1; private Date date2; private Date date3; private Date arrHKdate; private Date arrMCdate; private Date leaveHKdate; private Date leaveMCdate; private String[] tourNum; private String userId; private Booking book = new Booking(); private String reserveNo; private int reckoningId; private int reportId; // 应收账款查询条件 private String proCd; private String cityCd; private Date stDate; private Date endDate; private List<Parameter> parameters = new ArrayList<Parameter>(); @Autowired public void setRouteDao(LineDao routeDao) { this.lineDao = routeDao; } @Autowired public void setRouteTraitDao(LineTraitDao routeTraitDao) { this.routeTraitDao = routeTraitDao; } @Autowired public void setRouteScheduleDao(LineScheduleDao routeScheduleDao) { this.routeScheduleDao = routeScheduleDao; } @Autowired public void setReckoningDao(ReckoningDao reckoningDao) { this.reckoningDao = reckoningDao; } @Autowired public void setBookingService(BookingService bookingService) { this.bookingService = bookingService; } @Autowired public void setReckoningMakeService(ReckoningService reckoningMakeService) { this.reckoningMakeService = reckoningMakeService; } @Autowired public void setOutcomeService(OutcomeService outcomeService) { this.outcomeService = outcomeService; } @Autowired public void setTourService(TourService tourService) { this.tourService = tourService; } public void setReportProvider(ReportProvider reportProvider) { this.reportProvider = reportProvider; } // public void setDirectoryProvider(DirectoryProvider directoryProvider) // { // this.directoryProvider = directoryProvider; // } @Autowired public void setPlanDao(PlanDao tourDao) { this.planDao = tourDao; } @Autowired public void setCityDao(CityDao cityDao) { this.cityDao = cityDao; } @Autowired public void setListDao(ListDao birthplaceDao) { this.listDao = birthplaceDao; } @Override public String execute() throws Exception { ReportUser user = (ReportUser) ActionContext.getContext().getSession() .get(ORStatics.REPORT_USER); Report report = (Report) ActionContext.getContext().getSession() .get(ORStatics.REPORT); // int exportTypeCode = // Integer.parseInt( // (String) // ActionContext.getContext().getSession().get(ORStatics.EXPORT_TYPE)); ExportType exportType = ExportType.PDF; try { report = reportProvider.getReport(reportId); } catch (ProviderException e1) { e1.printStackTrace(); } HttpServletResponse response = ServletActionContext.getResponse(); // set headers to disable caching response.setHeader("Pragma", "public"); response.setHeader("Cache-Control", "max-age=0"); ServletOutputStream out = response.getOutputStream(); // Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = null; Source src = null; switch (reportId) { case 2: { // 旅游线路明细 String routeName = null; for (Parameter param : parameters) { if (param.getName().equals("ROUTE_NO")) routeName = param.getData(); } Line route = lineDao.get(routeName); route.setSchedule(routeScheduleDao.getLineSchedule(routeName)); route.setExpenseIn(routeTraitDao.getLineTrait(routeName, KeyParams.EBIZ_TYPE_EXPENSE_INC)); // Setup input for XSLT transformation src = route.getSource(); } break; case 3: { // 简单打印 String tourNo = null; String simplePrint = null; for (Parameter param : parameters) { if (param.getName().equals("TOUR_NO")) tourNo = param.getData(); if (param.getName().equals("SIMPLE_PRINT")) simplePrint = param.getData(); } // 取得团信息,客人名单 Plan tour = planDao.getTourInfo(tourNo, true, false); tour.setSimpleReport(simplePrint); src = tour.getSource(); } break; case 4: { // 打印客人名单 String tourNo = null; String title = null; String remark = null; String reserve = null; String send = null; String fileTitle = null; String printName = null; String printPinyin = null; String printSex = null; String printAge = null; String printAgent = null; String printIdcard = null; String printPassportType = null; String printPassportNo = null; String printPassportDate = null; String printPassportExpiry = null; String printPassportPla = null; String printPassportAnnotation = null; for (Parameter param : parameters) { if (param.getName().equals("TOUR_NO")) tourNo = param.getData(); if (param.getName().equals("TITLE")) title = param.getData(); if (param.getName().equals("REMARK")) remark = param.getData(); if (param.getName().equals("RECEIVE")) reserve = param.getData(); if (param.getName().equals("SEND")) send = param.getData(); if (param.getName().equals("FILETITLE")) fileTitle = param.getData(); if (param.getName().equals("PRINTNAME")) printName = param.getData(); if (param.getName().equals("PRINTPINYIN")) printPinyin = param.getData(); if (param.getName().equals("PRINTSEX")) printSex = param.getData(); if (param.getName().equals("PRINTAGE")) printAge = param.getData(); if (param.getName().equals("PRINTAGENT")) printAgent = param.getData(); if (param.getName().equals("PRINTIDCARD")) printIdcard = param.getData(); if (param.getName().equals("PRINTPASSPORTTYPE")) printPassportType = param.getData(); if (param.getName().equals("PRINTPASSPORTNO")) printPassportNo = param.getData(); if (param.getName().equals("PRINTPASSPORTDATE")) printPassportDate = param.getData(); // 是否打印护照有效期 if (param.getName().equals("PRINTPASSPORTEXPIRY")) printPassportExpiry = param.getData(); if (param.getName().equals("PRINTPASSPORTPLA")) printPassportPla = param.getData(); if (param.getName().equals("PRINTPASSPORTANNOTATION")) printPassportAnnotation = param.getData(); } // 取得团信息,客人名单 Plan tour = planDao.getTourInfo(tourNo, true, false); List<LabelValueBean> passportPlace = new ArrayList<LabelValueBean>(); passportPlace = listDao.getList("Homeplace"); for (int m = 0; m < tour.getCustomerList().size(); m++) { for (int l = 0; l < passportPlace.size(); l++) { if (tour.getCustomerList().get(m).getPassportPlace() != null && (tour.getCustomerList().get(m).getPassportPlace()).trim() .equals(passportPlace.get(l).getLabel())) tour.getCustomerList().get(m) .setPassportPlace(passportPlace.get(l).getValue()); } } tour.setTitle(title); tour.setRemarks(remark); tour.setReceive(reserve); tour.setSend(send); tour.setFileTitle(fileTitle); tour.setPrintName(printName); tour.setPrintPinyin(printPinyin); tour.setPrintSex(printSex); tour.setPrintAge(printAge); tour.setPrintAgent(printAgent); tour.setPrintIdcard(printIdcard); tour.setPrintPassportType(printPassportType); tour.setPrintPassportNo(printPassportNo); tour.setPrintPassportDate(printPassportDate); tour.setPrintPassportExpiry(printPassportExpiry); tour.setPrintPassportPla(printPassportPla); tour.setPrintPassportAnnotation(printPassportAnnotation); src = tour.getSource(); } break; case 5: { // 境外报团名单 String tourNo = null; String objectType = null; String userName = null; String label1 = null; String label2 = null; String label3 = null; for (Parameter param : parameters) { if (param.getName().equals("TOUR_NO")) tourNo = param.getData(); if (param.getName().equals("LABEL_ONE")) label1 = param.getData(); if (param.getName().equals("LABEL_TWO")) label2 = param.getData(); if (param.getName().equals("LABEL_THREE")) label3 = param.getData(); if (param.getName().equals("OBJECT_TYPE")) objectType = param.getData(); if (param.getName().equals("USER_NAME")) userName = param.getData(); } Plan tour = planDao.getTourInfo(tourNo, true, false); if (null != objectType && !objectType.equals("")) { TourOutBound outBandObject = new TourOutBound(); outBandObject.setTourNo(tourNo); outBandObject.setType(objectType); outBandObject.setText1(label1); outBandObject.setText2(label2); outBandObject.setText3(label3); outBandObject.setOpUserName(userName); tourService.txSaveOutBandObject(outBandObject); } tour.setLabel1(label1); tour.setLabel2(label2); tour.setLabel3(label3); src = tour.getSource(); } break; case 6: { // 同行名单表打印 String tourNo = null; for (Parameter param : parameters) { if (param.getName().equals("TOUR_NO")) tourNo = param.getData(); } Plan tour = planDao.getTourInfo(tourNo, true, false); List<LabelValueBean> birthCitys = new ArrayList<LabelValueBean>(); List<LabelValueBean> passportPlace = new ArrayList<LabelValueBean>(); birthCitys = listDao.getList("Homeplace"); passportPlace = listDao.getList("Homeplace"); for (int m = 0; m < tour.getCustomerList().size(); m++) { for (int n = 0; n < birthCitys.size(); n++) { if (tour.getCustomerList().get(m).getBirthplace() != null && ((tour.getCustomerList().get(m).getBirthplace()).trim()) .equals(birthCitys.get(n).getLabel())) tour.getCustomerList().get(m) .setBirthplace(birthCitys.get(n).getValue()); } for (int l = 0; l < passportPlace.size(); l++) { if (tour.getCustomerList().get(m).getPassportPlace() != null && (tour.getCustomerList().get(m).getPassportPlace()).trim() .equals(passportPlace.get(l).getLabel())) tour.getCustomerList().get(m) .setPassportPlace(passportPlace.get(l).getValue()); } } src = tour.getSource(); } break; case 7: { // 出境游客人名单表打印 String tourSerialNumber = null; String tourNo = null; String year = null; String routeName = null; String pax = null; String malePax = null; String femalePax = null; String localTname = null; String localEcontact = null; String receptionTname = null; String receptionEcontact = null; String leader = null; String leaderKey = null; String outDate = null; String outCity = null; String inDate = null; String inCity = null; String outInKey = null; for (Parameter param : parameters) { if (param.getName().equals("TOURSERIALNUMBER")) tourSerialNumber = param.getData(); if (param.getName().equals("TOUR_NO")) tourNo = param.getData(); if (param.getName().equals("YEAR")) year = param.getData(); if (param.getName().equals("ROUTENAME")) routeName = param.getData(); if (param.getName().equals("PAX")) pax = param.getData(); if (param.getName().equals("MALEPAX")) malePax = param.getData(); if (param.getName().equals("FEMALEPAX")) femalePax = param.getData(); if (param.getName().equals("LOCALTNAME")) localTname = param.getData(); if (param.getName().equals("LOCALECONTACT")) localEcontact = param.getData(); if (param.getName().equals("RECEPTIONTOUR")) receptionTname = param.getData(); if (param.getName().equals("RECEPTIONCONNECTER")) receptionEcontact = param.getData(); if (param.getName().equals("LEADER")) leader = param.getData(); if (param.getName().equals("LEADERKEY")) leaderKey = param.getData(); if (param.getName().equals("OUTDATE")) outDate = param.getData(); if (param.getName().equals("OUTCITY")) outCity = param.getData(); if (param.getName().equals("INDATE")) inDate = param.getData(); if (param.getName().equals("INCITY")) inCity = param.getData(); if (param.getName().equals("OUTINKEY")) outInKey = param.getData(); } Plan tour = new Plan(); tour.setCustomerList(touristDao.findByNmno(tourNum)); tour.setTourSerialNumber(tourSerialNumber); tour.setTourNo(tourNo); tour.setYear(year); tour.getLine().setLineName(routeName); tour.setPrintPax(pax); tour.setPrintMalePax(malePax); tour.setPrintFemalePax(femalePax); tour.setLocalTname(localTname); tour.setLocalEcontact(localEcontact); tour.setReceptionTname(receptionTname); tour.setReceptionEcontact(receptionEcontact); tour.setLeader(leader); tour.setLeaderKey(leaderKey); tour.setPrintOutDate(outDate); tour.getLine().getOutCity().setCitycd(outCity); tour.setPrintInDate(inDate); tour.setInCity(inCity); tour.setOutInKey(outInKey); List<LabelValueBean> birthCitys = new ArrayList<LabelValueBean>(); List<LabelValueBean> passportPlace = new ArrayList<LabelValueBean>(); birthCitys = listDao.getList("Homeplace"); passportPlace = listDao.getList("Homeplace"); List<City> citys = new ArrayList<City>(); citys = cityDao.getAllCity(); int lea = 0; for (int m = 0; m < tour.getCustomerList().size(); m++) { for (int n = 0; n < birthCitys.size(); n++) { if (((tour.getCustomerList().get(m).getPrintBirPla()).trim()) .equals(birthCitys.get(n).getLabel())) tour.getCustomerList().get(m) .setPrintBirPla(birthCitys.get(n).getValue()); } for (int l = 0; l < passportPlace.size(); l++) { if ((tour.getCustomerList().get(m).getPrintPassportPla()).trim() .equals(passportPlace.get(l).getLabel())) { String str = passportPlace.get(l).getValue(); if (str.length() > 4) str = str.substring(0, 4); tour.getCustomerList().get(m).setPrintPassportPla(str); } } if ((tour.getCustomerList().get(m).getNmno().trim()).equals(leader .trim())) { tour.setLeader(tour.getCustomerList().get(m).getPrintName()); if ("True".equals(leaderKey.trim())) { tour.setLeaderPrintName(tour.getCustomerList().get(m) .getPrintName()); tour.setLeaderPrintPinyin(tour.getCustomerList().get(m) .getPrintPinyin()); tour.setLeaderPrintSex(tour.getCustomerList().get(m).getPrintSex()); if (null == tour.getCustomerList().get(m).getPrintBirthday()) tour.setLeaderPrintBirthday(""); else tour.setLeaderPrintBirthday(SDF1.format(tour.getCustomerList() .get(m).getPrintBirthday())); tour.setLeaderPrintBirPla(tour.getCustomerList().get(m) .getPrintBirPla()); tour.setLeaderPrintPassportNo(tour.getCustomerList().get(m) .getPrintPassportNo()); tour.setLeaderPrintPassportPla(tour.getCustomerList().get(m) .getPrintPassportPla()); tour.setLeaderPrintPassportDate(tour.getCustomerList().get(m) .getPrintPassportDate()); lea = m; } } } tour.getCustomerList().remove(lea); // for (int i = 0; i < citys.size(); i++) // { // if ((tour.getInCity().trim()).equals(citys.get(i).getCitycd())) // tour.setInCity(citys.get(i).getCitynm()); // if ((tour.getOutCity().trim()).equals(citys.get(i).getCitycd())) // tour.setOutCity(citys.get(i).getCitynm()); // } // tour. src = tour.getSource(); } break; case 8: { // 港澳游客人名单表打印 String tourNo = null; String pla1 = null; String pass1 = null; String end1 = null; String pla2 = null; String pass2 = null; String end2 = null; String pla3 = null; String pass3 = null; String end3 = null; String arrHKtime = null; String arrHKvehicle = null; String leaveHKtime = null; String leaveHKvehicle = null; String arrMCtime = null; String arrMCvehicle = null; String leaveMCtime = null; String leaveMCvehicle = null; String localTname = null; String HKTname = null; String MCTname = null; String localEcontact = null; String HKEcontact = null; String MCEcontact = null; String gapax = null; String gamalePax = null; String gafemalePax = null; String gachildPax = null; String leader = null; String leadnum = null; for (Parameter param : parameters) { if (param.getName().equals("TOUR_NO")) tourNo = param.getData(); if (param.getName().equals("PLA1")) pla1 = param.getData(); if (param.getName().equals("PASS1")) pass1 = param.getData(); if (param.getName().equals("END1")) end1 = param.getData(); if (param.getName().equals("PLA2")) pla2 = param.getData(); if (param.getName().equals("PASS2")) pass2 = param.getData(); if (param.getName().equals("END2")) end2 = param.getData(); if (param.getName().equals("PLA3")) pla3 = param.getData(); if (param.getName().equals("PASS3")) pass3 = param.getData(); if (param.getName().equals("END3")) end3 = param.getData(); if (param.getName().equals("ARRHKTIME")) arrHKtime = param.getData(); if (param.getName().equals("ARRHKVEHICLE")) arrHKvehicle = param.getData(); if (param.getName().equals("LEAVEHKTIME")) leaveHKtime = param.getData(); if (param.getName().equals("LEAVEHKVEHICLE")) leaveHKvehicle = param.getData(); if (param.getName().equals("ARRMCTIME")) arrMCtime = param.getData(); if (param.getName().equals("ARRMCVEHICLE")) arrMCvehicle = param.getData(); if (param.getName().equals("LEAVEMCTIME")) leaveMCtime = param.getData(); if (param.getName().equals("LEAVEMCVEHICLE")) leaveMCvehicle = param.getData(); if (param.getName().equals("LOCALTNAME")) localTname = param.getData(); if (param.getName().equals("HKTNAME")) HKTname = param.getData(); if (param.getName().equals("MCTNAME")) MCTname = param.getData(); if (param.getName().equals("LOCALECON")) localEcontact = param.getData(); if (param.getName().equals("HKECON")) HKEcontact = param.getData(); if (param.getName().equals("MCECON")) MCEcontact = param.getData(); if (param.getName().equals("MALEPAX")) gamalePax = param.getData(); if (param.getName().equals("FEMALEPAX")) gafemalePax = param.getData(); if (param.getName().equals("CHILDPAX")) gachildPax = param.getData(); if (param.getName().equals("PAX")) gapax = param.getData(); if (param.getName().equals("TNUM")) tourNo = param.getData(); if (param.getName().equals("LEADER")) leader = param.getData(); if (param.getName().equals("LEADNUM")) leadnum = param.getData(); } Plan tour = new Plan(); tour.setCustomerList(touristDao.findByNmno(tourNum)); List<LabelValueBean> birthCitys = new ArrayList<LabelValueBean>(); birthCitys = listDao.getList("Homeplace"); List<City> citys = new ArrayList<City>(); citys = cityDao.getAllCity(); for (int m = 0; m < tour.getCustomerList().size(); m++) { for (int n = 0; n < birthCitys.size(); n++) { if (((tour.getCustomerList().get(m).getPrintBirPla()).trim()) .equals(birthCitys.get(n).getLabel())) tour.getCustomerList().get(m) .setPrintBirPla(birthCitys.get(n).getValue()); if ((tour.getCustomerList().get(m).getPrintPassportPla()).trim() .equals(birthCitys.get(n).getLabel())) tour.getCustomerList().get(m) .setPrintPassportPla(birthCitys.get(n).getValue()); } } tour.setTourNo(tourNo); tour.setLeader(leader); tour.setLeadnum(leadnum); if (null != arrHKdate) tour.setArrHKdate(SDF3.format(arrHKdate)); else tour.setArrHKdate(""); tour.setArrHKtime(arrHKtime); tour.setArrHKvehicle(arrHKvehicle); if (null != arrMCdate) tour.setArrMCdate(SDF3.format(arrMCdate)); else tour.setArrMCdate(""); tour.setArrMCtime(arrMCtime); tour.setArrMCvehicle(arrMCvehicle); if (null != leaveHKdate) tour.setLeaveHKdate(SDF3.format(leaveHKdate)); else tour.setLeaveHKdate(""); tour.setLeaveHKtime(leaveHKtime); tour.setLeaveHKvehicle(leaveHKvehicle); if (null != leaveMCdate) tour.setLeaveMCdate(SDF3.format(leaveMCdate)); else tour.setLeaveMCdate(""); tour.setLeaveMCtime(leaveMCtime); tour.setLeaveMCvehicle(leaveMCvehicle); tour.setGapax(gapax); tour.setGamalePax(gamalePax); tour.setGafemalePax(gafemalePax); tour.setGachildPax(gachildPax); if (null != date1) tour.setDate1(SDF2.format(date1)); else tour.setDate1(""); tour.setPla1(pla1); tour.setPass1(pass1); tour.setEnd1(end1); if (null != date2) tour.setDate2(SDF2.format(date2)); else tour.setDate2(""); tour.setPla2(pla2); tour.setPass2(pass2); tour.setEnd2(end2); if (null != date3) tour.setDate3(SDF2.format(date3)); else tour.setDate3(""); tour.setPla3(pla3); tour.setPass3(pass3); tour.setEnd3(end3); tour.setLocalTname(localTname); tour.setLocalEcontact(localEcontact); tour.setHKTname(HKTname); tour.setHKEcontact(HKEcontact); tour.setMCTname(MCTname); tour.setMCEcontact(MCEcontact); src = tour.getSource(); } break; case 9: { // 记录打印状态 int ret = reckoningMakeService.txSetPrint(reckoningId); Reckoning reckoning = new Reckoning(); List<ReckoningAcct> reckoningAcctList = new ArrayList<ReckoningAcct>(); book = bookingService.roGetReserve(reserveNo); reckoning = reckoningDao.getReckoningInfo(reckoningId); Plan tour = reckoningMakeService .roGetTourInfo(book.getPlan().getTourNo()); if (null != tour) reckoning.setLeaderPax(tour.getLeaderPax()); BigDecimal amount1 = new BigDecimal(0); for (int i = 0; i < reckoning.getReckoningAcctList().size(); i++) { amount1 = amount1.add(reckoning.getReckoningAcctList().get(i) .getAmount()); } reckoning.setAmount(amount1); reckoning.setClient(book.getCustomer().getName()); reckoning.setOutDate(book.getPlan().getOutDate()); reckoning.setRouteName(book.getPlan().getLine().getLineName()); reckoning.setTourNo(book.getPlan().getTourNo()); reckoning.setPax(book.getPax()); src = reckoning.getSource(); } break; case 10: { // 记录打印状态 int ret = reckoningMakeService.txSetPrint(reckoningId); Reckoning reckoning = new Reckoning(); List<ReckoningAcct> reckoningAcctList = new ArrayList<ReckoningAcct>(); book = bookingService.roGetReserve(reserveNo); reckoning = reckoningDao.getReckoningInfo(reckoningId); reckoningAcctList = reckoningMakeService.roGetCustomerList(reserveNo); if (!(reckoningAcctList.isEmpty())) { BigDecimal amount = new BigDecimal(0); for (ReckoningAcct obj : reckoningAcctList) { amount = amount.add(obj.getAmount()); } reckoning.setAmount(amount); } reckoning.setClient(book.getCustomer().getName()); reckoning.setOutDate(book.getPlan().getOutDate()); reckoning.setRouteName(book.getPlan().getLine().getLineName()); reckoning.setTourNo(book.getPlan().getTourNo()); reckoning.setPax(book.getPax()); reckoning.setReckoningAcctList(reckoningAcctList); src = reckoning.getSource(); } break; case 11: { // 记录打印状态 int ret = reckoningMakeService.txSetPrint(reckoningId); } break; case 12: { // 付款申请书打印 int outcomeId = 0; for (Parameter param : parameters) { if (param.getName().equals("OUTCOME_ID")) outcomeId = new Integer(param.getData()); } Outcome billhead = outcomeService.roGetBillhead(outcomeId); List<LabelValueBean> payModeList = new ArrayList<LabelValueBean>(); payModeList = getCodeList("ebiz_pay_mode"); for (LabelValueBean labelValueBean : payModeList) { if (labelValueBean.getValue().toString() .equals(billhead.getPayMode().toString())) { billhead.setPayModeName(labelValueBean.getLabel()); break; } } src = billhead.getSource(); } break; case 13: { // 单团核算表打印 String tourNo = ""; for (Parameter param : parameters) { if (param.getName().equals("TOUR_NO")) tourNo = param.getData(); } // 取用户信息 Employee suser = (Employee) ServletActionContext.getRequest() .getSession().getAttribute(SessionKeyParams.EBIZ_USER); List<TourCost> costList = new ArrayList<TourCost>(); Plan tour = tourService.roGetTourInfo(tourNo, false, true); // List<Customer> supplierList = customerService.getUsableSupplier(0); // for (TourCost costAcct : tour.getCostList()) { // for (Customer supplier : supplierList) { // if (costAcct.getCustomer().getCustomerId() == supplier // .getSupplierId()) { // costAcct.getCustomer().setName(supplier.getSupplierName()); // break; // } // } // } List<Booking> bookList = tourService.roGetBookList(tourNo); if (!bookList.isEmpty()) { tour.setBookList(bookList); } BigDecimal amount = new BigDecimal(0); BigDecimal payCosts = new BigDecimal(0); int pax = 0; String str = new String(); for (Booking book : bookList) { amount = amount.add(book.getDbamt()).add(book.getFinalExpense()); payCosts = payCosts.add(book.getPayCosts()); pax += book.getPax(); if (null != book.getLeaders() && !"".equals(book.getLeaders())) str = str + book.getLeaders(); } tour.setLeaderName(str); tour.setTotalPax(pax); if (null != tour && null != tour) { tour.setTourNo(tour.getTourNo()); tour.setLine(tour.getLine()); tour.setOutDate(tour.getOutDate()); tour.setPax(tour.getPax()); tour.setLeaderPax(tour.getLeaderPax()); tour.setDoubleRoom(tour.getDoubleRoom()); tour.setSingleRoom(tour.getSingleRoom()); tour.setExtraBedRoom(tour.getExtraBedRoom()); tour.setMuAmount(amount); tour.setAlAmount(payCosts); tour.setWiAmount(amount.subtract(payCosts)); tour.setRemarks(tour.getRemarks()); tour.setTeam(tour.getTeam()); if (null != suser) { tour.setOprateUserName(suser.getUserName()); } tour.setGrossAmount(tour.getTourAmount().subtract(tour.getCost())); // 计算毛利率 BigDecimal grossAmountRate = new BigDecimal(0); if (tour.getTourAmount().doubleValue() != 0) grossAmountRate = tour.getGrossAmount().divide(tour.getTourAmount()) .multiply(new BigDecimal(100)); tour.setGrossAmountRate(grossAmountRate); costList = tour.getCostList(); } BigDecimal grossAmountAverage = tour.getGrossAmount().divide( new BigDecimal(tour.getPax())); tour.setGrossAmountAverage(grossAmountAverage); if (costList.isEmpty()) { costList.add(new TourCost()); } src = tour.getSource(); } break; default: break; } Result res = null; if (exportType == ExportType.PDF) { FopFactory fopFactory = ApacheFopFactory.instance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); // Allows/disallows copy/paste of content foUserAgent.getRendererOptions().put("nocopy", true); // Allows/disallows printing of the PDF // foUserAgent.getRendererOptions().put("noprint", "FALSE"); // Allows/disallows editing of content foUserAgent.getRendererOptions().put("noedit", true); // Allows/disallows editing of annotations foUserAgent.getRendererOptions().put("noannotations", true); // Construct fop with desired output format Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); String path = ServletActionContext.getServletContext().getRealPath(""); path = path + separator + "WEB-INF" + separator + "reports" + separator; // String baseDir = directoryProvider.getReportDirectory(); File file = new File(path + report.getFile()); transformer = factory.newTransformer(new StreamSource(file)); // Resulting SAX events (the generated FO) must be piped through to // FOP res = new SAXResult(fop.getDefaultHandler()); } else if (exportType == ExportType.XML) { transformer = factory.newTransformer(); res = new StreamResult(out); } // Start XSLT transformation and FOP processing transformer.transform(src, res); // fopFactory. return NONE; } /** * 取xml配置文件的值 * * @param argKey * @return */ protected List<LabelValueBean> getCodeList(String argKey) { ArrayList<LabelValueBean> msgList = new ArrayList<LabelValueBean>(); String XML_PATH = "WEB-INF/ebizConfig.xml"; XMLUtility m_res_Config = null; try { if (null == m_res_Config) { m_res_Config = XMLUtility.getInstance(ServletActionContext .getServletContext().getRealPath(XML_PATH)); } } catch (Exception pce) { pce.printStackTrace(); } List temp = m_res_Config.getData(argKey, "OPTION"); String[] listValue = null; for (int i = 0; i < temp.size(); i++) { listValue = ((String) temp.get(i)).split(","); msgList.add(new LabelValueBean(listValue[1], listValue[0])); } return msgList; } public void setReportId(int reportId) { this.reportId = reportId; } public int getReportId() { return reportId; } public List<Parameter> getParameters() { return parameters; } public void setParameters(List<Parameter> parameters) { this.parameters = parameters; } public String[] getTourNum() { return tourNum; } public void setTourNum(String[] tourNum) { this.tourNum = tourNum; } public Date getArrHKdate() { return arrHKdate; } public void setArrHKdate(Date arrHKdate) { this.arrHKdate = arrHKdate; } public Date getArrMCdate() { return arrMCdate; } public void setArrMCdate(Date arrMCdate) { this.arrMCdate = arrMCdate; } public Date getDate1() { return date1; } public void setDate1(Date date1) { this.date1 = date1; } public Date getDate2() { return date2; } public void setDate2(Date date2) { this.date2 = date2; } public Date getDate3() { return date3; } public void setDate3(Date date3) { this.date3 = date3; } public Date getLeaveHKdate() { return leaveHKdate; } public void setLeaveHKdate(Date leaveHKdate) { this.leaveHKdate = leaveHKdate; } public Date getLeaveMCdate() { return leaveMCdate; } public void setLeaveMCdate(Date leaveMCdate) { this.leaveMCdate = leaveMCdate; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getReserveNo() { return reserveNo; } public void setReserveNo(String reserveNo) { this.reserveNo = reserveNo; } public int getReckoningId() { return reckoningId; } public void setReckoningId(int reckoningId) { this.reckoningId = reckoningId; } public Booking getBook() { return book; } public void setBook(Booking book) { this.book = book; } public String getProCd() { return proCd; } public void setProCd(String proCd) { this.proCd = proCd; } public String getCityCd() { return cityCd; } public void setCityCd(String cityCd) { this.cityCd = cityCd; } public Date getStDate() { return stDate; } public void setStDate(Date stDate) { this.stDate = stDate; } public Date getEndDate() { return endDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } }
3e140873d81585144669721950c4d2ef96aa9754
213
java
Java
src/main/java/org/har01d/crawler/service/Downloader.java
power721/zhihu-crawler-v2
31de418f22b7132ab409b830d755e0c2f8c50e3c
[ "Apache-2.0" ]
null
null
null
src/main/java/org/har01d/crawler/service/Downloader.java
power721/zhihu-crawler-v2
31de418f22b7132ab409b830d755e0c2f8c50e3c
[ "Apache-2.0" ]
null
null
null
src/main/java/org/har01d/crawler/service/Downloader.java
power721/zhihu-crawler-v2
31de418f22b7132ab409b830d755e0c2f8c50e3c
[ "Apache-2.0" ]
null
null
null
19.363636
53
0.769953
8,469
package org.har01d.crawler.service; import java.io.IOException; import org.har01d.crawler.domain.Image; public interface Downloader { boolean download(Image image) throws IOException; int getCount(); }
3e1409584919a56c33ca7da50ff6b277a4e61dc9
1,171
java
Java
src/main/java/com/aoizz/communitymarket/common/config/MbpConfig.java
chenimin/springboot-shiro-jtw
9720e94496595847bf6202ad8d613a4e3bcff5c3
[ "Apache-2.0" ]
null
null
null
src/main/java/com/aoizz/communitymarket/common/config/MbpConfig.java
chenimin/springboot-shiro-jtw
9720e94496595847bf6202ad8d613a4e3bcff5c3
[ "Apache-2.0" ]
null
null
null
src/main/java/com/aoizz/communitymarket/common/config/MbpConfig.java
chenimin/springboot-shiro-jtw
9720e94496595847bf6202ad8d613a4e3bcff5c3
[ "Apache-2.0" ]
null
null
null
37.774194
89
0.819812
8,470
package com.aoizz.communitymarket.common.config; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.transaction.annotation.EnableTransactionManagement; /** * @version 1.0 * @description MyBatisPlus配置 */ @Configuration @EnableTransactionManagement @MapperScan("com.aoizz.communitymarket.mapper") public class MbpConfig { @Bean public MybatisPlusInterceptor mybatisPlusInterceptor() { MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2)); return interceptor; } public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() { return new OptimisticLockerInnerInterceptor(); } }
3e1409b35df23248035fa1b3f1d2b97908600ead
1,563
java
Java
src/main/java/za/co/technoris/swingy/Models/Characters/Character.java
mmbatha/Java_Swing
90b0718731348e00ea7df221996033df67fbe081
[ "MIT" ]
1
2019-11-07T13:41:15.000Z
2019-11-07T13:41:15.000Z
src/main/java/za/co/technoris/swingy/Models/Characters/Character.java
mmbatha/Java_Swing
90b0718731348e00ea7df221996033df67fbe081
[ "MIT" ]
null
null
null
src/main/java/za/co/technoris/swingy/Models/Characters/Character.java
mmbatha/Java_Swing
90b0718731348e00ea7df221996033df67fbe081
[ "MIT" ]
null
null
null
22.652174
62
0.706974
8,471
/* * @Author: mmbatha * @Date: 2019-07-04 10:57:54 * @Last Modified by: mmbatha * @Last Modified time: 2019-07-04 10:57:54 */ package za.co.technoris.swingy.Models.Characters; import lombok.Getter; import lombok.Setter; import za.co.technoris.swingy.Helpers.ArtifactsHelper; import za.co.technoris.swingy.Models.Artifacts.Armor; import za.co.technoris.swingy.Models.Artifacts.Artifact; import za.co.technoris.swingy.Models.Artifacts.Helm; import za.co.technoris.swingy.Models.Artifacts.Weapon; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @Getter @Setter public abstract class Character { @NotNull @Size(min = 2, max = 20) protected String name; protected String type; protected int attack; protected int defense; protected int HP; protected int level; protected int x; protected int y; protected Weapon weapon; protected Armor armor; protected Helm helm; abstract public void attack(Character character); abstract public void defend(Character character, int damage); public void suitUp(Artifact artifact, ArtifactsHelper type) { switch (type) { case WEAPON: if (weapon != null) { attack -= weapon.getAttack(); } weapon = (Weapon) artifact; attack += weapon.getAttack(); break; case ARMOR: if (armor != null) { defense -= armor.getDefense(); } armor = (Armor) artifact; defense += armor.getDefense(); break; case HELM: if (helm != null) { HP -= helm.getHP(); } helm = (Helm) artifact; HP += helm.getHP(); break; } } }
3e140a6cafdd3ac54c4ed65b3948accd2d486935
968
java
Java
AtcSwing/src/main/java/org/mmarini/atc/sim/InfoMessage.java
m-marini/atc
61c546af2e8656384f68b39a79f39f857c2c06f4
[ "MIT" ]
null
null
null
AtcSwing/src/main/java/org/mmarini/atc/sim/InfoMessage.java
m-marini/atc
61c546af2e8656384f68b39a79f39f857c2c06f4
[ "MIT" ]
53
2020-09-24T13:48:16.000Z
2021-01-12T18:40:48.000Z
AtcSwing/src/main/java/org/mmarini/atc/sim/InfoMessage.java
m-marini/atc
61c546af2e8656384f68b39a79f39f857c2c06f4
[ "MIT" ]
null
null
null
16.525424
79
0.578462
8,472
/* * InfoMessage.java * * $Id: InfoMessage.java,v 1.2 2008/02/15 18:06:58 marco Exp $ * * 06/gen/08 * * Copyright notice */ package org.mmarini.atc.sim; /** * @author kenaa@example.com * @version $Id: InfoMessage.java,v 1.2 2008/02/15 18:06:58 marco Exp $ */ public class InfoMessage implements Message { private String message; /** * * */ public InfoMessage() { } /** * * @param message */ public InfoMessage(String message) { this.message = message; } /** * @see org.mmarini.atc.sim.Message#apply(org.mmarini.atc.sim.MessageVisitor) */ @Override public void apply(MessageVisitor visitor) { visitor.visit(this); } /** * @return the message */ public String getMessage() { return message; } /** * @param message * the message to set */ public void setMessage(String message) { this.message = message; } }
3e140ac273510c89bb177be7f7f883a463f18f75
1,520
java
Java
web/src/main/java/org/apache/ki/web/attr/WebAttribute.java
isabella232/jsecurity
2084c4c8c063e61fa2d11adcea8113c3611229d7
[ "Apache-2.0" ]
2
2015-07-29T23:05:50.000Z
2021-11-10T16:05:10.000Z
web/src/main/java/org/apache/ki/web/attr/WebAttribute.java
apache/jsecurity
2084c4c8c063e61fa2d11adcea8113c3611229d7
[ "Apache-2.0" ]
1
2021-11-04T12:36:45.000Z
2021-11-04T12:36:45.000Z
web/src/main/java/org/apache/ki/web/attr/WebAttribute.java
isabella232/jsecurity
2084c4c8c063e61fa2d11adcea8113c3611229d7
[ "Apache-2.0" ]
12
2015-05-08T19:18:13.000Z
2021-11-10T16:05:03.000Z
35.348837
117
0.753947
8,473
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * 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.apache.ki.web.attr; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; /** * A <tt>WebAttribute</tt> is a storage mechanism for a single object accessible during a web request. * * <p>It is used to make objects associated with the transient request persistent beyond the request so that they can * be retrieved at a later time. * * @author Les Hazlewood * @since 0.2 */ public interface WebAttribute<T> { //TODO - complete JavaDoc T retrieveValue(ServletRequest request, ServletResponse response); void storeValue(T value, ServletRequest request, ServletResponse response); void removeValue(ServletRequest request, ServletResponse response); }
3e140ad8975a5394ac2acb4bc6cb4144141e8a19
4,579
java
Java
modules/base/lang-impl-testing/src/main/java/com/intellij/FileSetTestCase.java
MC-JY/consulo
ebd31008fcfd03e144b46a9408d2842d0b06ffc8
[ "Apache-2.0" ]
634
2015-01-01T19:14:25.000Z
2022-03-22T11:42:50.000Z
modules/base/lang-impl-testing/src/main/java/com/intellij/FileSetTestCase.java
MC-JY/consulo
ebd31008fcfd03e144b46a9408d2842d0b06ffc8
[ "Apache-2.0" ]
410
2015-01-19T09:57:51.000Z
2022-03-22T16:24:59.000Z
modules/base/lang-impl-testing/src/main/java/com/intellij/FileSetTestCase.java
MC-JY/consulo
ebd31008fcfd03e144b46a9408d2842d0b06ffc8
[ "Apache-2.0" ]
50
2015-03-10T04:14:49.000Z
2022-03-22T07:08:45.000Z
25.870056
140
0.655165
8,474
/* * Created by IntelliJ IDEA. * User: user * Date: Sep 22, 2002 * Time: 2:45:20 PM * To change template for new class use * Code Style | Class Templates options (Tools | IDE Options). */ package com.intellij; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.testFramework.LightPlatformTestCase; import com.intellij.util.ArrayUtil; import consulo.ui.annotation.RequiredUIAccess; import junit.framework.TestSuite; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; public abstract class FileSetTestCase extends TestSuite { private final File[] myFiles; protected Project myProject; private Pattern myPattern; public FileSetTestCase(String path) { File f = new File(path); if (f.isDirectory()) { myFiles = f.listFiles(); } else if (f.exists()) { myFiles = new File[] {f}; } else { throw new IllegalArgumentException("invalid path: " + path); } final String pattern = System.getProperty("fileset.pattern"); myPattern = pattern != null ? Pattern.compile(pattern) : null; addAllTests(); } protected void setUp() { } protected void tearDown() { } private void addAllTests() { for (File file : myFiles) { if (file.isFile()) { addFileTest(file); } } } public abstract String transform(String testName, String[] data) throws Exception; protected FileSetTestCase(File[] files) { myFiles = files; addAllTests(); } @Override public String getName() { return getClass().getName(); } private void addFileTest(File file) { if (!StringUtil.startsWithChar(file.getName(), '_') && !"CVS".equals(file.getName())) { if (myPattern != null && !myPattern.matcher(file.getPath()).matches()){ return; } final ActualTest t = new ActualTest(file, createTestName(file)); addTest(t); } } protected String getDelimiter() { return "---"; } private static String createTestName(File testFile) { return testFile.getName(); } private class ActualTest extends LightPlatformTestCase { private final File myTestFile; private final String myTestName; public ActualTest(File testFile, String testName) { myTestFile = testFile; myTestName = testName; } @RequiredUIAccess @Override protected void setUp() throws Exception { super.setUp(); FileSetTestCase.this.setUp(); } @Override protected void tearDown() throws Exception { FileSetTestCase.this.tearDown(); super.tearDown(); } @Override public int countTestCases() { return 1; } @Override protected void runTest() throws Throwable { String content = FileUtil.loadFile(myTestFile); assertNotNull(content); List<String> input = new ArrayList<String>(); int separatorIndex; content = StringUtil.replace(content, "\r", ""); while ((separatorIndex = content.indexOf(getDelimiter())) >= 0) { input.add(content.substring(0, separatorIndex)); content = content.substring(separatorIndex); while (StringUtil.startsWithChar(content, '-') || StringUtil.startsWithChar(content, '\n')) content = content.substring(1); } String result = content; assertTrue("No data found in source file", input.size() > 0); while (StringUtil.startsWithChar(result, '-') || StringUtil.startsWithChar(result, '\n') || StringUtil.startsWithChar(result, '\r')) { result = result.substring(1); } final String transformed; FileSetTestCase.this.myProject = getProject(); String testName = myTestFile.getName(); final int dotIdx = testName.indexOf('.'); if (dotIdx >= 0) { testName = testName.substring(0, dotIdx); } transformed = StringUtil.replace(transform(testName, ArrayUtil.toStringArray(input)), "\r", ""); result = StringUtil.replace(result, "\r", ""); assertEquals(result.trim(),transformed.trim()); } @Override protected String getTestName(final boolean lowercaseFirstLetter) { return ""; } public String toString() { return myTestFile.getAbsolutePath() + " "; } @Override protected void resetAllFields() { // Do nothing otherwise myTestFile will be nulled out before getName() is called. } @Override public String getName() { return myTestName; } } }
3e140b7e01dfc56e5c83f0a2a05ee1aa578afa22
5,158
java
Java
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rql/resource/DataSourceQueryResultSet.java
Liangda-w/shardingsphere
add0363c328960a71f918e5e85a75474d1cd5ab9
[ "Apache-2.0" ]
1
2021-06-11T10:22:16.000Z
2021-06-11T10:22:16.000Z
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rql/resource/DataSourceQueryResultSet.java
Liangda-w/shardingsphere
add0363c328960a71f918e5e85a75474d1cd5ab9
[ "Apache-2.0" ]
null
null
null
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rql/resource/DataSourceQueryResultSet.java
Liangda-w/shardingsphere
add0363c328960a71f918e5e85a75474d1cd5ab9
[ "Apache-2.0" ]
1
2022-01-05T15:24:29.000Z
2022-01-05T15:24:29.000Z
47.321101
160
0.740791
8,475
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * 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.apache.shardingsphere.proxy.backend.text.distsql.rql.resource; import com.google.gson.Gson; import org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowResourcesStatement; import org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration; import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSourcePoolCreatorUtil; import org.apache.shardingsphere.infra.database.metadata.DataSourceMetaData; import org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.resource.ShardingSphereResource; import org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService; import org.apache.shardingsphere.proxy.backend.context.ProxyContext; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; /** * Result set for show data source. */ public final class DataSourceQueryResultSet implements DistSQLResultSet { private ShardingSphereResource resource; private Map<String, DataSourceConfiguration> dataSourceConfigs; private Iterator<String> dataSourceNames; @Override public void init(final ShardingSphereMetaData metaData, final SQLStatement sqlStatement) { resource = metaData.getResource(); Optional<MetaDataPersistService> persistService = ProxyContext.getInstance().getContextManager().getMetaDataContexts().getMetaDataPersistService(); dataSourceConfigs = persistService.isPresent() ? persistService.get().getDataSourceService().load(metaData.getName()) : DataSourcePoolCreatorUtil.getDataSourceConfigurationMap(metaData.getResource().getDataSources()); dataSourceNames = dataSourceConfigs.keySet().iterator(); } @Override public Collection<String> getColumnNames() { return Arrays.asList("name", "type", "host", "port", "db", "attribute"); } @Override public boolean next() { return dataSourceNames.hasNext(); } @Override public Collection<Object> getRowData() { String dataSourceName = dataSourceNames.next(); DataSourceMetaData metaData = resource.getDataSourcesMetaData().getDataSourceMetaData(dataSourceName); return Arrays.asList(dataSourceName, resource.getDatabaseType().getName(), metaData.getHostname(), metaData.getPort(), metaData.getCatalog(), (new Gson()).toJson(getAttributeMap(dataSourceConfigs.get(dataSourceName)))); } private Map<String, Object> getAttributeMap(final DataSourceConfiguration dataSourceConfig) { Map<String, Object> result = new LinkedHashMap<>(7, 1); result.put("connectionTimeoutMilliseconds", getProperty(dataSourceConfig, "connectionTimeoutMilliseconds", "connectionTimeout")); result.put("idleTimeoutMilliseconds", getProperty(dataSourceConfig, "idleTimeoutMilliseconds", "idleTimeout")); result.put("maxLifetimeMilliseconds", getProperty(dataSourceConfig, "maxLifetimeMilliseconds", "maxLifetime")); result.put("maxPoolSize", getProperty(dataSourceConfig, "maxPoolSize", "maximumPoolSize")); result.put("minPoolSize", getProperty(dataSourceConfig, "minPoolSize", "minimumIdle")); result.put("readOnly", getProperty(dataSourceConfig, "readOnly")); if (!dataSourceConfig.getCustomPoolProps().isEmpty()) { result.put(DataSourceConfiguration.CUSTOM_POOL_PROPS_KEY, dataSourceConfig.getCustomPoolProps()); } return result; } private Object getProperty(final DataSourceConfiguration dataSourceConfig, final String key, final String... synonym) { if (dataSourceConfig.getProps().containsKey(key)) { return dataSourceConfig.getProps().get(key); } for (String each : synonym) { if (dataSourceConfig.getProps().containsKey(each)) { return dataSourceConfig.getProps().get(each); } } return null; } @Override public String getType() { return ShowResourcesStatement.class.getCanonicalName(); } }
3e140bf6bca0162fcae1fc3fd9edfca35f72d716
946
java
Java
test/twg2/collections/buffers/test/DummyWritableByteChannel.java
TeamworkGuy2/JBuffers
a85d42da6ebf4fd8ef99eb7b3e58e65839c58b1d
[ "MIT" ]
null
null
null
test/twg2/collections/buffers/test/DummyWritableByteChannel.java
TeamworkGuy2/JBuffers
a85d42da6ebf4fd8ef99eb7b3e58e65839c58b1d
[ "MIT" ]
null
null
null
test/twg2/collections/buffers/test/DummyWritableByteChannel.java
TeamworkGuy2/JBuffers
a85d42da6ebf4fd8ef99eb7b3e58e65839c58b1d
[ "MIT" ]
null
null
null
18.54902
70
0.733615
8,476
package twg2.collections.buffers.test; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.WritableByteChannel; import java.nio.charset.Charset; /** * @author TeamworkGuy2 * @since 2016-07-01 */ public class DummyWritableByteChannel implements WritableByteChannel { private StringBuilder buf; private Charset charset; private boolean isOpen; public DummyWritableByteChannel(Charset charset) { this.charset = charset; this.isOpen = true; this.buf = new StringBuilder(); } public String getString() { return this.buf.toString(); } @Override public boolean isOpen() { return this.isOpen; } @Override public void close() throws IOException { this.isOpen = false; } @Override public int write(ByteBuffer src) throws IOException { byte[] bytes = new byte[src.remaining()]; src.get(bytes); this.buf.append(new String(bytes, this.charset.name())); return bytes.length; } }
3e140d9651d617f05715fe9153d88f8fca8e532e
5,800
java
Java
src/test/java/com/fuzzylimes/jsr/clients/RunsClientTest.java
fuzzylimes/jSR
0628006e5748b35ccaafc2ea1c67f8fe60700f81
[ "MIT" ]
null
null
null
src/test/java/com/fuzzylimes/jsr/clients/RunsClientTest.java
fuzzylimes/jSR
0628006e5748b35ccaafc2ea1c67f8fe60700f81
[ "MIT" ]
null
null
null
src/test/java/com/fuzzylimes/jsr/clients/RunsClientTest.java
fuzzylimes/jSR
0628006e5748b35ccaafc2ea1c67f8fe60700f81
[ "MIT" ]
null
null
null
42.335766
134
0.720862
8,477
package com.fuzzylimes.jsr.clients; import com.fuzzylimes.jsr.query_parameters.RunsQuery; import com.fuzzylimes.jsr.query_parameters.sorting.Direction; import com.fuzzylimes.jsr.query_parameters.sorting.RunsOrderBy; import com.fuzzylimes.jsr.query_parameters.sorting.Sorting; import com.fuzzylimes.jsr.resources.PagedResponse; import com.fuzzylimes.jsr.resources.Run; import com.fuzzylimes.jsr.util.UnexpectedResponseException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import java.io.IOException; import static com.fuzzylimes.jsr.JacksonTests.util.ClientTestUtil.MockJsrClientUrlAndQueryParams; class RunsClientTest { @Test void getRuns_ParamsAndSortingEmbedTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/Runs_Embed.json"); RunsQuery query = RunsQuery.builder().build(); Sorting<RunsOrderBy> order = Sorting.<RunsOrderBy>builder().direction(Direction.ASCCENDING).orderBy(RunsOrderBy.GAME).build(); PagedResponse<Run> var = RunsClient.getRuns(query, order, true); getRunsVerifyEmbed(var); } @Test void getRuns_ParamsAndSortingdTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/Runs.json"); RunsQuery query = RunsQuery.builder().build(); Sorting<RunsOrderBy> order = Sorting.<RunsOrderBy>builder().direction(Direction.ASCCENDING).orderBy(RunsOrderBy.GAME).build(); PagedResponse<Run> var = RunsClient.getRuns(query, order); getRunsVerify(var); } @Test void getRuns_EmbedTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/Runs_Embed.json"); PagedResponse<Run> var = RunsClient.getRuns(true); getRunsVerifyEmbed(var); } @Test void getRuns_OrderTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/Runs.json"); Sorting<RunsOrderBy> order = Sorting.<RunsOrderBy>builder().direction(Direction.ASCCENDING).orderBy(RunsOrderBy.GAME).build(); PagedResponse<Run> var = RunsClient.getRuns(order); getRunsVerify(var); } @Test void getRuns_QueryTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/Runs.json"); RunsQuery query = RunsQuery.builder().emulated(false).build(); PagedResponse<Run> var = RunsClient.getRuns(query); getRunsVerify(var); } @Test void getRuns_QueryEmbedTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/Runs_Embed.json"); RunsQuery query = RunsQuery.builder().emulated(false).build(); PagedResponse<Run> var = RunsClient.getRuns(query, true); getRunsVerifyEmbed(var); } @Test void getRuns_OrderEmbedTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/Runs_Embed.json"); Sorting<RunsOrderBy> order = Sorting.<RunsOrderBy>builder().direction(Direction.ASCCENDING).orderBy(RunsOrderBy.GAME).build(); PagedResponse<Run> var = RunsClient.getRuns(order, true); getRunsVerifyEmbed(var); } @Test void getRunsTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/Runs.json"); PagedResponse<Run> var = RunsClient.getRuns(); getRunsVerify(var); } private void getRunsVerifyEmbed(PagedResponse<Run> var) { Assertions.assertEquals(20, var.getResourceList().size()); Assertions.assertEquals(20, var.getPagination().getSize()); Assertions.assertEquals("next", var.getPagination().getLinks().get(0).getRel()); Assertions.assertEquals("opydqjmn", var.getResourceList().get(1).getId()); Assertions.assertEquals("nj1ne1p4", var.getResourceList().get(1).getGame().getGameEmbed().getId()); Assertions.assertEquals("kv813xp5", var.getResourceList().get(1).getPlayers().getPlayersEmbed().getUserList().get(0).getId()); } private void getRunsVerify(PagedResponse<Run> var) { Assertions.assertEquals(20, var.getResourceList().size()); Assertions.assertEquals(20, var.getPagination().getSize()); Assertions.assertEquals("next", var.getPagination().getLinks().get(0).getRel()); Assertions.assertEquals("opydqjmn", var.getResourceList().get(1).getId()); Assertions.assertEquals("prklq2n9", var.getResourceList().get(1).getCategory().getId()); Assertions.assertEquals("w89rwelk", var.getResourceList().get(1).getSystem().getPlatform()); } @Test void getRunByIdTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/RunsById.json"); Run var = RunsClient.getRunById("1wzpqgyq"); Assertions.assertEquals("1wzpqgyq", var.getId()); Assertions.assertEquals("PT21M52S", var.getTimes().getPrimary()); Assertions.assertEquals("w89rwelk", var.getSystem().getPlatform()); } @Test void getRunById_EmbedTest() throws IOException, UnexpectedResponseException { MockJsrClientUrlAndQueryParams("/responses/RunsById_Embed.json"); Run var = RunsClient.getRunById("1wzpqgyq", true); Assertions.assertEquals("1wzpqgyq", var.getId()); Assertions.assertEquals("PT21M52S", var.getTimes().getPrimary()); Assertions.assertEquals("w89rwelk", var.getSystem().getPlatform()); Assertions.assertEquals("w89rwelk", var.getGame().getGameEmbed().getPlatforms().getIds().get(0)); Assertions.assertEquals("prklq2n9", var.getCategory().getCategoryEmbed().getId()); } }
3e140dc1307c3be58f9319c5f18c47a4b326e2d2
1,635
java
Java
src/main/java/pl/tobo/ISS/servlets/IndexServlet.java
iss-deweloper/iss
8d11964a1527e81fd1008c520e94b50e7a5f8bb4
[ "MIT" ]
1
2015-07-06T20:33:58.000Z
2015-07-06T20:33:58.000Z
src/main/java/pl/tobo/ISS/servlets/IndexServlet.java
iss-deweloper/iss
8d11964a1527e81fd1008c520e94b50e7a5f8bb4
[ "MIT" ]
30
2015-04-29T20:55:49.000Z
2015-12-06T23:38:52.000Z
src/main/java/pl/tobo/ISS/servlets/IndexServlet.java
iss-deweloper/iss
8d11964a1527e81fd1008c520e94b50e7a5f8bb4
[ "MIT" ]
null
null
null
31.442308
120
0.735168
8,478
/** * Copyright (C) 2014,2015 Tomasz Bosak. **/ package pl.tobo.ISS.servlets; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import pl.tobo.ISS.utils.StringConstants; /** * Servlet implementation class IndexServlet */ @WebServlet("/index") public class IndexServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getSession().getAttribute(StringConstants.REQUEST_ATTR_LOGGED_USER) == null) { System.out.println("User not logged."); request.getRequestDispatcher(StringConstants.ISS_VIEW_PATH+"login.jsp").forward( request, response); } else { String ipAddress = request.getHeader("X-FORWARDED-FOR"); if (ipAddress == null) { ipAddress = request.getRemoteAddr(); } System.out.println("Request from: "+ipAddress); request.getRequestDispatcher(StringConstants.ISS_VIEW_PATH+"index.jsp").forward( request, response); } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
3e140e3aeb78811efcb2b2b185d32b5a7d04a251
1,683
java
Java
auth0/src/main/java/com/auth0/android/provider/IdTokenVerificationOptions.java
ontoshgo/Auth0.Android
07c5435b8d33f50ee3612e8073bb17549450d4d7
[ "MIT" ]
131
2016-10-09T20:34:46.000Z
2022-03-29T07:37:44.000Z
auth0/src/main/java/com/auth0/android/provider/IdTokenVerificationOptions.java
ontoshgo/Auth0.Android
07c5435b8d33f50ee3612e8073bb17549450d4d7
[ "MIT" ]
251
2016-07-13T16:06:56.000Z
2022-03-25T13:33:47.000Z
auth0/src/main/java/com/auth0/android/provider/IdTokenVerificationOptions.java
ontoshgo/Auth0.Android
07c5435b8d33f50ee3612e8073bb17549450d4d7
[ "MIT" ]
117
2016-08-08T17:48:16.000Z
2022-02-18T22:00:08.000Z
20.035714
119
0.637552
8,479
package com.auth0.android.provider; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Date; class IdTokenVerificationOptions { private final String issuer; private final String audience; private final SignatureVerifier verifier; private String organization; private String nonce; private Integer maxAge; private Integer clockSkew; private Date clock; IdTokenVerificationOptions(@NonNull String issuer, @NonNull String audience, @NonNull SignatureVerifier verifier) { this.issuer = issuer; this.audience = audience; this.verifier = verifier; } void setNonce(@Nullable String nonce) { this.nonce = nonce; } void setMaxAge(@Nullable Integer maxAge) { this.maxAge = maxAge; } void setClockSkew(@Nullable Integer clockSkew) { this.clockSkew = clockSkew; } void setClock(@Nullable Date now) { this.clock = now; } void setOrganization(@Nullable String organization) { this.organization = organization; } @NonNull String getIssuer() { return issuer; } @NonNull String getAudience() { return audience; } @NonNull SignatureVerifier getSignatureVerifier() { return verifier; } @Nullable String getNonce() { return nonce; } @Nullable Integer getMaxAge() { return maxAge; } @Nullable Integer getClockSkew() { return clockSkew; } @Nullable Date getClock() { return clock; } @Nullable String getOrganization() { return organization; } }
3e140fa5fbaeeb4eced7be8885ca344c2adda681
256
java
Java
src/com/winningsmiledental/InvalidSSNException.java
mjpan/jdentpro
42f7f0e55145f78c9a6b61a69cd62899fdb1ebef
[ "BSD-3-Clause" ]
null
null
null
src/com/winningsmiledental/InvalidSSNException.java
mjpan/jdentpro
42f7f0e55145f78c9a6b61a69cd62899fdb1ebef
[ "BSD-3-Clause" ]
null
null
null
src/com/winningsmiledental/InvalidSSNException.java
mjpan/jdentpro
42f7f0e55145f78c9a6b61a69cd62899fdb1ebef
[ "BSD-3-Clause" ]
null
null
null
23.272727
61
0.753906
8,480
package com.winningsmiledental; public class InvalidSSNException extends JDentProException { public InvalidSSNException(String message) { super(message); } public InvalidSSNException(String message, Throwable e) { super(message, e); } }
3e141063dd4f9a3054027b6975f6b92577c973aa
4,291
java
Java
SeirMeng-parent/SeriMeng-service/SeirMeng_processCenter/src/test/java/com/haidong/SeirMeng/service/processCenter/test/CodeGen.java
XieHaidong-SeirMeng/XieHaidong-SeirMeng
a0ec0af6328988e025a4b72fd7679a77782273f7
[ "MulanPSL-1.0" ]
null
null
null
SeirMeng-parent/SeriMeng-service/SeirMeng_processCenter/src/test/java/com/haidong/SeirMeng/service/processCenter/test/CodeGen.java
XieHaidong-SeirMeng/XieHaidong-SeirMeng
a0ec0af6328988e025a4b72fd7679a77782273f7
[ "MulanPSL-1.0" ]
null
null
null
SeirMeng-parent/SeriMeng-service/SeirMeng_processCenter/src/test/java/com/haidong/SeirMeng/service/processCenter/test/CodeGen.java
XieHaidong-SeirMeng/XieHaidong-SeirMeng
a0ec0af6328988e025a4b72fd7679a77782273f7
[ "MulanPSL-1.0" ]
null
null
null
38.3125
113
0.678863
8,481
package com.haidong.SeirMeng.service.processCenter.test; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.config.DataSourceConfig; import com.baomidou.mybatisplus.generator.config.GlobalConfig; import com.baomidou.mybatisplus.generator.config.PackageConfig; import com.baomidou.mybatisplus.generator.config.StrategyConfig; import com.baomidou.mybatisplus.generator.config.po.TableFill; import com.baomidou.mybatisplus.generator.config.rules.DateType; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import org.junit.Test; import java.util.ArrayList; public class CodeGen { @Test public void genCode() { /* * 预检数据库是否开启 * 预检数据库是否存在表 * 预检数据库是否可用 * */ //数据库开头:项目名 String prefix = "seirmeng_";//用来拼接连接数据库的url地址数据库名称的、根据实际修改 // 数据库项目模块路径名 String mdelForDB = "haidong_"; // 数据库ModelName 用来拼接包名,当前模块名 String moduleName = "process_center"; // 数据库用户名 String Username = "root"; // 数据库密码 String password = "123456"; // 设置文件签名的作者名 String Author = "XieHaidong"; // 1、创建代码生成器 AutoGenerator mpg = new AutoGenerator(); // 2、全局配置 GlobalConfig gc = new GlobalConfig(); // 通用的:获取项目路径,不写死 D:\code\seir-meng\SeirMeng-parent\SeriMeng-service\XXXX String projectPath = System.getProperty("user.dir");//工作所在的项目路径,可以使用绝对路径 // 保存Java代码的路径 gc.setOutputDir(projectPath + "/src/main/java"); // 设置文件签名的作者名 gc.setAuthor(Author); //生成后是否打开资源管理器 gc.setOpen(false); // ④ 第一次的时候不打开,第二次的时候可以打开 重新生成时文件是否覆盖 gc.setFileOverride(true); gc.setServiceName("%sService");//默认Service接口会使用I开头,去掉首字母I gc.setIdType(IdType.ASSIGN_ID); //主键策略 使用雪花算法 gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型使用java.util.Date // 自动在Javabean上生成文档 gc.setSwagger2(true);//开启Swagger2模式:自动生成swagger注解 mpg.setGlobalConfig(gc); // 3、数据源配置 DataSourceConfig dsc = new DataSourceConfig(); dsc.setUrl("jdbc:mysql://localhost:3306/" + prefix + mdelForDB + moduleName + "?serverTimezone=GMT%2B8"); dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setUsername(Username); dsc.setPassword(password); dsc.setDbType(DbType.MYSQL);//数据库类型 mpg.setDataSource(dsc); // 4、包配置 PackageConfig pc = new PackageConfig(); pc.setModuleName(moduleName); //模块名 pc.setParent("com.haidong.SeirMeng.service"); pc.setController("controller"); pc.setEntity("entity"); pc.setService("service"); pc.setMapper("mapper"); mpg.setPackageInfo(pc); // 5、策略配置 StrategyConfig strategy = new StrategyConfig(); strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 strategy.setTablePrefix(moduleName + "_");//设置表前缀不生成 strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 // set方法发挥的仍然是obj对象 strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 strategy.setLogicDeleteFieldName("is_deleted");//逻辑删除字段名 strategy.setEntityBooleanColumnRemoveIsPrefix(true);//去掉布尔值的is_前缀 //自动填充 TableFill gmtCreate = new TableFill("gmt_create", FieldFill.INSERT); TableFill gmtModified = new TableFill("gmt_modified", FieldFill.INSERT_UPDATE); ArrayList<TableFill> tableFills = new ArrayList<>(); tableFills.add(gmtCreate); tableFills.add(gmtModified); strategy.setTableFillList(tableFills); strategy.setRestControllerStyle(true); //restful api风格控制器 strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 //设置BaseEntity strategy.setSuperEntityClass("com.haidong.SeirMeng.service.base.model.BaseEntity"); // 填写BaseEntity中的公共字段 strategy.setSuperEntityColumns("id", "gmt_create", "gmt_modified"); mpg.setStrategy(strategy); // 6、执行 mpg.execute(); } }
3e1411180b7d8b0133432af8c94e7cbda496b296
341
java
Java
src/main/java/com/knox/aurora/model/vo/FileVO.java
1020317774/buefy-admin
fbf3e485b0a693ae22035a58b5ca33ecc828fe71
[ "Apache-2.0" ]
20
2021-02-11T06:15:37.000Z
2021-04-19T15:57:19.000Z
src/main/java/com/knox/aurora/model/vo/FileVO.java
1020317774/buefy-admin
fbf3e485b0a693ae22035a58b5ca33ecc828fe71
[ "Apache-2.0" ]
13
2021-11-30T02:05:13.000Z
2022-03-02T02:08:26.000Z
src/main/java/com/knox/aurora/model/vo/FileVO.java
hubery-code/letao
fbf3e485b0a693ae22035a58b5ca33ecc828fe71
[ "Apache-2.0" ]
5
2021-02-18T06:17:12.000Z
2021-04-10T05:47:20.000Z
12.178571
33
0.513196
8,482
package com.knox.aurora.model.vo; import lombok.Data; /** * Vditor文件上传返回 * * @author Knox * @date 2020/11/29 */ @Data public class FileVO { // msg: '', // code: 0, // data : { // originalURL: '', // url: '' // } private Integer code; private String msg; private Object data; }
3e1411431230f87ee6768954d2647c9f36932963
1,150
java
Java
app/src/main/java/com/ty/dagger2project/rxjava/SchedulerProvider.java
LavenderTY/Dagger2Project
7617c8b5876158e80022f1eb88fc9818a5128b23
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/ty/dagger2project/rxjava/SchedulerProvider.java
LavenderTY/Dagger2Project
7617c8b5876158e80022f1eb88fc9818a5128b23
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/ty/dagger2project/rxjava/SchedulerProvider.java
LavenderTY/Dagger2Project
7617c8b5876158e80022f1eb88fc9818a5128b23
[ "Apache-2.0" ]
null
null
null
23.469388
77
0.753913
8,483
package com.ty.dagger2project.rxjava; import android.support.annotation.NonNull; import com.ty.dagger2project.base.BaseSchedulerProvider; import javax.inject.Inject; import dagger.Reusable; import io.reactivex.Scheduler; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; /** * Created by Lavender on 2018/1/11. * @Reusable绑定,不像其他的Scope——它不和任何单独的component关联,而是实际使用绑定的component缓存返回或初始化的实例。 * 如果你在组件中引入一个有@Reusable绑定的模块,但是只有一个子组件实际用到这个绑定,那么只有这个 * 子组件会缓存这个绑定。如果共享祖先的两个子组件各自使用到这个绑定,那它们各自都会缓存自己的对象。 * 如果一个组件的祖先已经缓存了这个对象,子组件会直接使用它。因为无法保证组件只会调用这个绑定一次, * 所以应用@Reusable到返回易变对象的绑定中,或者必须要使用相同实例的对象上,是很危险的。 * 如果不用关心实例化次数的话,在unscope对象上用@Reusable是安全的。 */ @Reusable public class SchedulerProvider implements BaseSchedulerProvider { @Inject public SchedulerProvider() { } @Override @NonNull public Scheduler computation() { return Schedulers.computation(); } @Override @NonNull public Scheduler io() { return Schedulers.io(); } @Override @NonNull public Scheduler ui() { return AndroidSchedulers.mainThread(); } }
3e1411c0b3e17b3c6996537c29060ebfce85e983
7,122
java
Java
src/main/java/test/service/impl/streamservice/GetEffortStreamsTest.java
danshannon/javastrava-test
f9babdb9affe8dcf03f2731bdafce0dec5d94b7e
[ "Apache-2.0" ]
1
2019-05-10T14:36:40.000Z
2019-05-10T14:36:40.000Z
src/main/java/test/service/impl/streamservice/GetEffortStreamsTest.java
danshannon/javastrava-test
f9babdb9affe8dcf03f2731bdafce0dec5d94b7e
[ "Apache-2.0" ]
1
2015-03-02T00:49:11.000Z
2015-03-22T11:45:23.000Z
src/main/java/test/service/impl/streamservice/GetEffortStreamsTest.java
danshannon/javastrava-test
f9babdb9affe8dcf03f2731bdafce0dec5d94b7e
[ "Apache-2.0" ]
8
2015-10-21T11:19:40.000Z
2020-06-12T07:23:49.000Z
28.261905
185
0.730974
8,484
package test.service.impl.streamservice; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; import java.util.List; import org.junit.Test; import javastrava.model.StravaStream; import javastrava.model.reference.StravaStreamResolutionType; import javastrava.model.reference.StravaStreamSeriesDownsamplingType; import javastrava.model.reference.StravaStreamType; import javastrava.service.Strava; import test.service.standardtests.ListMethodTest; import test.service.standardtests.callbacks.ListCallback; import test.service.standardtests.data.SegmentEffortDataUtils; import test.service.standardtests.data.StreamDataUtils; import test.utils.RateLimitedTestRunner; import test.utils.TestUtils; /** * <p> * Specific tests for {@link Strava#getEffortStreams(Long)} * </p> * * @author Dan Shannon * */ public class GetEffortStreamsTest extends ListMethodTest<StravaStream, Long> { @Override protected Class<StravaStream> classUnderTest() { return StravaStream.class; } @Override protected Long idInvalid() { return SegmentEffortDataUtils.SEGMENT_EFFORT_INVALID_ID; } @Override protected Long idPrivate() { return SegmentEffortDataUtils.SEGMENT_EFFORT_PRIVATE_ID; } @Override protected Long idPrivateBelongsToOtherUser() { return SegmentEffortDataUtils.SEGMENT_EFFORT_OTHER_USER_PRIVATE_ID; } @Override protected Long idValidWithEntries() { return SegmentEffortDataUtils.SEGMENT_EFFORT_VALID_ID; } @Override protected Long idValidWithoutEntries() { return null; } @Override protected ListCallback<StravaStream, Long> lister() { return ((strava, id) -> strava.getEffortStreams(id)); } /** * <p> * Downsampled by distance * </p> * * @throws Exception * if the test fails in an unexpected way */ @Test public void testGetEffortStreams_downsampledByDistance() throws Exception { RateLimitedTestRunner.run(() -> { for (final StravaStreamResolutionType resolutionType : StravaStreamResolutionType.values()) { if ((resolutionType != StravaStreamResolutionType.UNKNOWN) && (resolutionType != null)) { final List<StravaStream> streams = TestUtils.strava().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_VALID_ID, resolutionType, StravaStreamSeriesDownsamplingType.DISTANCE); validateList(streams); } } }); } /** * <p> * Downsampled by time * </p> * * @throws Exception * if the test fails in an unexpected way */ @Test public void testGetEffortStreams_downsampledByTime() throws Exception { RateLimitedTestRunner.run(() -> { for (final StravaStreamResolutionType resolutionType : StravaStreamResolutionType.values()) { if (resolutionType != StravaStreamResolutionType.UNKNOWN) { final List<StravaStream> streams = TestUtils.strava().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_VALID_ID, resolutionType, StravaStreamSeriesDownsamplingType.TIME); validateList(streams); } } }); } /** * <p> * Invalid downsample resolution * </p> * * @throws Exception * if the test fails in an unexpected way */ @SuppressWarnings("static-method") @Test public void testGetEffortStreams_invalidDownsampleResolution() throws Exception { RateLimitedTestRunner.run(() -> { try { TestUtils.strava().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_VALID_ID, StravaStreamResolutionType.UNKNOWN, null); } catch (final IllegalArgumentException e) { // Expected return; } fail("Didn't throw an exception when asking for an invalid downsample resolution"); //$NON-NLS-1$ }); } /** * <p> * invalid downsample type * </p> * * @throws Exception * if the test fails in an unexpected way */ @SuppressWarnings("static-method") @Test public void testGetEffortStreams_invalidDownsampleType() throws Exception { RateLimitedTestRunner.run(() -> { try { TestUtils.strava().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_VALID_ID, StravaStreamResolutionType.LOW, StravaStreamSeriesDownsamplingType.UNKNOWN); } catch (final IllegalArgumentException e) { // Expected return; } fail("Didn't throw an exception when asking for an invalid downsample type"); //$NON-NLS-1$ }); } /** * <p> * Invalid effort * </p> * * @throws Exception * if the test fails in an unexpected way */ @SuppressWarnings("static-method") @Test public void testGetEffortStreams_invalidEffort() throws Exception { RateLimitedTestRunner.run(() -> { final List<StravaStream> streams = TestUtils.strava().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_INVALID_ID); assertNull(streams); }); } /** * <p> * Invalid stream type * </p> * * @throws Exception * if the test fails in an unexpected way */ @SuppressWarnings("static-method") @Test public void testGetEffortStreams_invalidStreamType() throws Exception { RateLimitedTestRunner.run(() -> { try { TestUtils.strava().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_VALID_ID, null, null, StravaStreamType.UNKNOWN); } catch (final IllegalArgumentException e) { // Expected return; } fail("Should have got an IllegalArgumentException, but didn't"); //$NON-NLS-1$ }); } /** * <p> * Only one stream type * </p> * * @throws Exception * if the test fails in an unexpected way */ @Test public void testGetEffortStreams_oneStreamType() throws Exception { RateLimitedTestRunner.run(() -> { final List<StravaStream> streams = TestUtils.strava().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_VALID_ID, null, null, StravaStreamType.DISTANCE); assertNotNull(streams); assertEquals(1, streams.size()); assertEquals(StravaStreamType.DISTANCE, streams.get(0).getType()); validateList(streams); }); } /** * <p> * Effort for a private activity * </p> * * @throws Exception * if the test fails in an unexpected way */ @SuppressWarnings("static-method") @Test public void testGetEffortStreams_privateActivityWithViewPrivate() throws Exception { RateLimitedTestRunner.run(() -> { final List<StravaStream> streams = TestUtils.stravaWithViewPrivate().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_PRIVATE_ACTIVITY_ID); assertNotNull(streams); assertFalse(streams.isEmpty()); }); } /** * <p> * Effort for the authenticated user * </p> * * @throws Exception * if the test fails in an unexpected way */ // 1. Valid effort for the authenticated user @Test public void testGetEffortStreams_validEffortAuthenticatedUser() throws Exception { RateLimitedTestRunner.run(() -> { final List<StravaStream> streams = TestUtils.strava().getEffortStreams(SegmentEffortDataUtils.SEGMENT_EFFORT_VALID_ID); validateList(streams); }); } @Override protected void validate(StravaStream object) { StreamDataUtils.validateStream(object); } }
3e1411ce73f4f7cf8373abd9806d1f775aab1ed8
113
java
Java
lib-kabuyoho/src/main/java/moe/pine/stkrep/kabuyoho/UserAgentSupplier.java
pine/stkrep
07dfdf2a0bdf9e183329140d28883d23c016f1ab
[ "MIT" ]
null
null
null
lib-kabuyoho/src/main/java/moe/pine/stkrep/kabuyoho/UserAgentSupplier.java
pine/stkrep
07dfdf2a0bdf9e183329140d28883d23c016f1ab
[ "MIT" ]
null
null
null
lib-kabuyoho/src/main/java/moe/pine/stkrep/kabuyoho/UserAgentSupplier.java
pine/stkrep
07dfdf2a0bdf9e183329140d28883d23c016f1ab
[ "MIT" ]
null
null
null
16.142857
36
0.778761
8,485
package moe.pine.stkrep.kabuyoho; @FunctionalInterface public interface UserAgentSupplier { String get(); }
3e1411d2378deda88b3227691cdae97dbee02b2c
1,558
java
Java
recommendation-service/src/main/java/com/stackroute/neo4j/entity/SupplierOrder.java
NilakshiS/BackupRepo
56e29b80de47622000606465f6e52572ffc49d9a
[ "Apache-2.0" ]
null
null
null
recommendation-service/src/main/java/com/stackroute/neo4j/entity/SupplierOrder.java
NilakshiS/BackupRepo
56e29b80de47622000606465f6e52572ffc49d9a
[ "Apache-2.0" ]
9
2020-03-04T22:15:30.000Z
2022-03-02T05:36:40.000Z
recommendation-service/src/main/java/com/stackroute/neo4j/entity/SupplierOrder.java
NilakshiS/BackupRepo
56e29b80de47622000606465f6e52572ffc49d9a
[ "Apache-2.0" ]
null
null
null
20.5
56
0.555199
8,486
package com.stackroute.neo4j.entity; import org.neo4j.ogm.annotation.Id; public class SupplierOrder { @Id private String id; private Designer designer; private Material material; private double quantity; private String orderStatus; private String tagId; public String getTagId() { return tagId; } public void setTagId(String tagId) { this.tagId = tagId; } public String getOrderStatus() { return orderStatus; } public void setOrderStatus(String orderStatus) { this.orderStatus = orderStatus; } public String getId() { return id; } public void setId(String id) { this.id = id; } public Designer getDesigner() { return designer; } public void setDesigner(Designer designer) { this.designer = designer; } public Material getMaterial() { return material; } public void setMaterial(Material material) { this.material = material; } public double getQuantity() { return quantity; } public void setQuantity(double quantity) { this.quantity = quantity; } @Override public String toString() { return "SupplierOrder{" + "id='" + id + '\'' + ", designer=" + designer + ", material=" + material + ", quantity=" + quantity + ", orderStatus='" + orderStatus + '\'' + ", tagId='" + tagId + '\'' + '}'; } }
3e14165858961ed26c9b80ecb1a69d250675ffda
3,209
java
Java
vraptor-core/src/main/java/br/com/caelum/vraptor/validator/DefaultValidator.java
dgomesbr/vraptor
079b6a71f13a98408c83663f1edc5c2412e205f5
[ "Apache-2.0" ]
1
2018-01-11T11:49:42.000Z
2018-01-11T11:49:42.000Z
vraptor-core/src/main/java/br/com/caelum/vraptor/validator/DefaultValidator.java
dgomesbr/vraptor
079b6a71f13a98408c83663f1edc5c2412e205f5
[ "Apache-2.0" ]
null
null
null
vraptor-core/src/main/java/br/com/caelum/vraptor/validator/DefaultValidator.java
dgomesbr/vraptor
079b6a71f13a98408c83663f1edc5c2412e205f5
[ "Apache-2.0" ]
null
null
null
30.273585
181
0.729199
8,487
/*** * Copyright (c) 2009 Caelum - www.caelum.com.br/opensource * All rights reserved. * * 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 br.com.caelum.vraptor.validator; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import br.com.caelum.vraptor.Result; import br.com.caelum.vraptor.View; import br.com.caelum.vraptor.core.Localization; import br.com.caelum.vraptor.ioc.RequestScoped; import br.com.caelum.vraptor.proxy.Proxifier; import br.com.caelum.vraptor.util.test.MockResult; import br.com.caelum.vraptor.view.ValidationViewsFactory; /** * The default validator implementation. * * @author Guilherme Silveira */ @RequestScoped public class DefaultValidator extends AbstractValidator { private static final Logger logger = LoggerFactory.getLogger(DefaultValidator.class); private final Result result; private final List<Message> errors = new ArrayList<Message>(); private final ValidationViewsFactory viewsFactory; private final List<BeanValidator> beanValidators; //registered bean-validators private final Outjector outjector; private final Proxifier proxifier; private final Localization localization; public DefaultValidator(Result result, ValidationViewsFactory factory, Outjector outjector, Proxifier proxifier, List<BeanValidator> beanValidators, Localization localization) { this.result = result; this.viewsFactory = factory; this.outjector = outjector; this.proxifier = proxifier; this.beanValidators = beanValidators; this.localization = localization; } public void checking(Validations validations) { addAll(validations.getErrors(localization.getBundle())); } public void validate(Object object) { if (beanValidators == null || beanValidators.isEmpty()) { logger.warn("has no validators registered"); } else { for (BeanValidator validator : beanValidators) { addAll(validator.validate(object)); } } } public <T extends View> T onErrorUse(Class<T> view) { if (!hasErrors()) { return new MockResult(proxifier).use(view); //ignore anything, no errors occurred } result.include("errors", errors); outjector.outjectRequestMap(); return viewsFactory.instanceFor(view, errors); } public void addAll(Collection<? extends Message> message) { this.errors.addAll(message); } public void add(Message message) { this.errors.add(message); } public boolean hasErrors() { return !errors.isEmpty(); } @Override public List<Message> getErrors() { return this.errors; } }
3e14169f537c31175e0a6bbcec988e394031d10e
41,870
java
Java
google-ads/src/main/java/com/google/ads/googleads/v3/common/TargetCpa.java
katka-h/google-ads-java
342a7cd4a213eb7106685e8dbbd91c2aabca84dc
[ "Apache-2.0" ]
3
2020-12-20T18:56:52.000Z
2021-07-29T12:12:02.000Z
google-ads/src/main/java/com/google/ads/googleads/v3/common/TargetCpa.java
katka-h/google-ads-java
342a7cd4a213eb7106685e8dbbd91c2aabca84dc
[ "Apache-2.0" ]
null
null
null
google-ads/src/main/java/com/google/ads/googleads/v3/common/TargetCpa.java
katka-h/google-ads-java
342a7cd4a213eb7106685e8dbbd91c2aabca84dc
[ "Apache-2.0" ]
1
2021-02-15T04:54:10.000Z
2021-02-15T04:54:10.000Z
35.303541
149
0.672749
8,488
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/ads/googleads/v3/common/bidding.proto package com.google.ads.googleads.v3.common; /** * <pre> * An automated bid strategy that sets bids to help get as many conversions as * possible at the target cost-per-acquisition (CPA) you set. * </pre> * * Protobuf type {@code google.ads.googleads.v3.common.TargetCpa} */ public final class TargetCpa extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.ads.googleads.v3.common.TargetCpa) TargetCpaOrBuilder { private static final long serialVersionUID = 0L; // Use TargetCpa.newBuilder() to construct. private TargetCpa(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private TargetCpa() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new TargetCpa(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private TargetCpa( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.google.protobuf.Int64Value.Builder subBuilder = null; if (targetCpaMicros_ != null) { subBuilder = targetCpaMicros_.toBuilder(); } targetCpaMicros_ = input.readMessage(com.google.protobuf.Int64Value.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(targetCpaMicros_); targetCpaMicros_ = subBuilder.buildPartial(); } break; } case 18: { com.google.protobuf.Int64Value.Builder subBuilder = null; if (cpcBidCeilingMicros_ != null) { subBuilder = cpcBidCeilingMicros_.toBuilder(); } cpcBidCeilingMicros_ = input.readMessage(com.google.protobuf.Int64Value.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(cpcBidCeilingMicros_); cpcBidCeilingMicros_ = subBuilder.buildPartial(); } break; } case 26: { com.google.protobuf.Int64Value.Builder subBuilder = null; if (cpcBidFloorMicros_ != null) { subBuilder = cpcBidFloorMicros_.toBuilder(); } cpcBidFloorMicros_ = input.readMessage(com.google.protobuf.Int64Value.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(cpcBidFloorMicros_); cpcBidFloorMicros_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.ads.googleads.v3.common.BiddingProto.internal_static_google_ads_googleads_v3_common_TargetCpa_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.ads.googleads.v3.common.BiddingProto.internal_static_google_ads_googleads_v3_common_TargetCpa_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.ads.googleads.v3.common.TargetCpa.class, com.google.ads.googleads.v3.common.TargetCpa.Builder.class); } public static final int TARGET_CPA_MICROS_FIELD_NUMBER = 1; private com.google.protobuf.Int64Value targetCpaMicros_; /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> * @return Whether the targetCpaMicros field is set. */ @java.lang.Override public boolean hasTargetCpaMicros() { return targetCpaMicros_ != null; } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> * @return The targetCpaMicros. */ @java.lang.Override public com.google.protobuf.Int64Value getTargetCpaMicros() { return targetCpaMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : targetCpaMicros_; } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> */ @java.lang.Override public com.google.protobuf.Int64ValueOrBuilder getTargetCpaMicrosOrBuilder() { return getTargetCpaMicros(); } public static final int CPC_BID_CEILING_MICROS_FIELD_NUMBER = 2; private com.google.protobuf.Int64Value cpcBidCeilingMicros_; /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> * @return Whether the cpcBidCeilingMicros field is set. */ @java.lang.Override public boolean hasCpcBidCeilingMicros() { return cpcBidCeilingMicros_ != null; } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> * @return The cpcBidCeilingMicros. */ @java.lang.Override public com.google.protobuf.Int64Value getCpcBidCeilingMicros() { return cpcBidCeilingMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : cpcBidCeilingMicros_; } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> */ @java.lang.Override public com.google.protobuf.Int64ValueOrBuilder getCpcBidCeilingMicrosOrBuilder() { return getCpcBidCeilingMicros(); } public static final int CPC_BID_FLOOR_MICROS_FIELD_NUMBER = 3; private com.google.protobuf.Int64Value cpcBidFloorMicros_; /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> * @return Whether the cpcBidFloorMicros field is set. */ @java.lang.Override public boolean hasCpcBidFloorMicros() { return cpcBidFloorMicros_ != null; } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> * @return The cpcBidFloorMicros. */ @java.lang.Override public com.google.protobuf.Int64Value getCpcBidFloorMicros() { return cpcBidFloorMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : cpcBidFloorMicros_; } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> */ @java.lang.Override public com.google.protobuf.Int64ValueOrBuilder getCpcBidFloorMicrosOrBuilder() { return getCpcBidFloorMicros(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (targetCpaMicros_ != null) { output.writeMessage(1, getTargetCpaMicros()); } if (cpcBidCeilingMicros_ != null) { output.writeMessage(2, getCpcBidCeilingMicros()); } if (cpcBidFloorMicros_ != null) { output.writeMessage(3, getCpcBidFloorMicros()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (targetCpaMicros_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getTargetCpaMicros()); } if (cpcBidCeilingMicros_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getCpcBidCeilingMicros()); } if (cpcBidFloorMicros_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getCpcBidFloorMicros()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.ads.googleads.v3.common.TargetCpa)) { return super.equals(obj); } com.google.ads.googleads.v3.common.TargetCpa other = (com.google.ads.googleads.v3.common.TargetCpa) obj; if (hasTargetCpaMicros() != other.hasTargetCpaMicros()) return false; if (hasTargetCpaMicros()) { if (!getTargetCpaMicros() .equals(other.getTargetCpaMicros())) return false; } if (hasCpcBidCeilingMicros() != other.hasCpcBidCeilingMicros()) return false; if (hasCpcBidCeilingMicros()) { if (!getCpcBidCeilingMicros() .equals(other.getCpcBidCeilingMicros())) return false; } if (hasCpcBidFloorMicros() != other.hasCpcBidFloorMicros()) return false; if (hasCpcBidFloorMicros()) { if (!getCpcBidFloorMicros() .equals(other.getCpcBidFloorMicros())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasTargetCpaMicros()) { hash = (37 * hash) + TARGET_CPA_MICROS_FIELD_NUMBER; hash = (53 * hash) + getTargetCpaMicros().hashCode(); } if (hasCpcBidCeilingMicros()) { hash = (37 * hash) + CPC_BID_CEILING_MICROS_FIELD_NUMBER; hash = (53 * hash) + getCpcBidCeilingMicros().hashCode(); } if (hasCpcBidFloorMicros()) { hash = (37 * hash) + CPC_BID_FLOOR_MICROS_FIELD_NUMBER; hash = (53 * hash) + getCpcBidFloorMicros().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.google.ads.googleads.v3.common.TargetCpa parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.ads.googleads.v3.common.TargetCpa parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.ads.googleads.v3.common.TargetCpa parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.ads.googleads.v3.common.TargetCpa prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * An automated bid strategy that sets bids to help get as many conversions as * possible at the target cost-per-acquisition (CPA) you set. * </pre> * * Protobuf type {@code google.ads.googleads.v3.common.TargetCpa} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.ads.googleads.v3.common.TargetCpa) com.google.ads.googleads.v3.common.TargetCpaOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.ads.googleads.v3.common.BiddingProto.internal_static_google_ads_googleads_v3_common_TargetCpa_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.ads.googleads.v3.common.BiddingProto.internal_static_google_ads_googleads_v3_common_TargetCpa_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.ads.googleads.v3.common.TargetCpa.class, com.google.ads.googleads.v3.common.TargetCpa.Builder.class); } // Construct using com.google.ads.googleads.v3.common.TargetCpa.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (targetCpaMicrosBuilder_ == null) { targetCpaMicros_ = null; } else { targetCpaMicros_ = null; targetCpaMicrosBuilder_ = null; } if (cpcBidCeilingMicrosBuilder_ == null) { cpcBidCeilingMicros_ = null; } else { cpcBidCeilingMicros_ = null; cpcBidCeilingMicrosBuilder_ = null; } if (cpcBidFloorMicrosBuilder_ == null) { cpcBidFloorMicros_ = null; } else { cpcBidFloorMicros_ = null; cpcBidFloorMicrosBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.ads.googleads.v3.common.BiddingProto.internal_static_google_ads_googleads_v3_common_TargetCpa_descriptor; } @java.lang.Override public com.google.ads.googleads.v3.common.TargetCpa getDefaultInstanceForType() { return com.google.ads.googleads.v3.common.TargetCpa.getDefaultInstance(); } @java.lang.Override public com.google.ads.googleads.v3.common.TargetCpa build() { com.google.ads.googleads.v3.common.TargetCpa result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.ads.googleads.v3.common.TargetCpa buildPartial() { com.google.ads.googleads.v3.common.TargetCpa result = new com.google.ads.googleads.v3.common.TargetCpa(this); if (targetCpaMicrosBuilder_ == null) { result.targetCpaMicros_ = targetCpaMicros_; } else { result.targetCpaMicros_ = targetCpaMicrosBuilder_.build(); } if (cpcBidCeilingMicrosBuilder_ == null) { result.cpcBidCeilingMicros_ = cpcBidCeilingMicros_; } else { result.cpcBidCeilingMicros_ = cpcBidCeilingMicrosBuilder_.build(); } if (cpcBidFloorMicrosBuilder_ == null) { result.cpcBidFloorMicros_ = cpcBidFloorMicros_; } else { result.cpcBidFloorMicros_ = cpcBidFloorMicrosBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.ads.googleads.v3.common.TargetCpa) { return mergeFrom((com.google.ads.googleads.v3.common.TargetCpa)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.ads.googleads.v3.common.TargetCpa other) { if (other == com.google.ads.googleads.v3.common.TargetCpa.getDefaultInstance()) return this; if (other.hasTargetCpaMicros()) { mergeTargetCpaMicros(other.getTargetCpaMicros()); } if (other.hasCpcBidCeilingMicros()) { mergeCpcBidCeilingMicros(other.getCpcBidCeilingMicros()); } if (other.hasCpcBidFloorMicros()) { mergeCpcBidFloorMicros(other.getCpcBidFloorMicros()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.ads.googleads.v3.common.TargetCpa parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.ads.googleads.v3.common.TargetCpa) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.google.protobuf.Int64Value targetCpaMicros_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> targetCpaMicrosBuilder_; /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> * @return Whether the targetCpaMicros field is set. */ public boolean hasTargetCpaMicros() { return targetCpaMicrosBuilder_ != null || targetCpaMicros_ != null; } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> * @return The targetCpaMicros. */ public com.google.protobuf.Int64Value getTargetCpaMicros() { if (targetCpaMicrosBuilder_ == null) { return targetCpaMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : targetCpaMicros_; } else { return targetCpaMicrosBuilder_.getMessage(); } } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> */ public Builder setTargetCpaMicros(com.google.protobuf.Int64Value value) { if (targetCpaMicrosBuilder_ == null) { if (value == null) { throw new NullPointerException(); } targetCpaMicros_ = value; onChanged(); } else { targetCpaMicrosBuilder_.setMessage(value); } return this; } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> */ public Builder setTargetCpaMicros( com.google.protobuf.Int64Value.Builder builderForValue) { if (targetCpaMicrosBuilder_ == null) { targetCpaMicros_ = builderForValue.build(); onChanged(); } else { targetCpaMicrosBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> */ public Builder mergeTargetCpaMicros(com.google.protobuf.Int64Value value) { if (targetCpaMicrosBuilder_ == null) { if (targetCpaMicros_ != null) { targetCpaMicros_ = com.google.protobuf.Int64Value.newBuilder(targetCpaMicros_).mergeFrom(value).buildPartial(); } else { targetCpaMicros_ = value; } onChanged(); } else { targetCpaMicrosBuilder_.mergeFrom(value); } return this; } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> */ public Builder clearTargetCpaMicros() { if (targetCpaMicrosBuilder_ == null) { targetCpaMicros_ = null; onChanged(); } else { targetCpaMicros_ = null; targetCpaMicrosBuilder_ = null; } return this; } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> */ public com.google.protobuf.Int64Value.Builder getTargetCpaMicrosBuilder() { onChanged(); return getTargetCpaMicrosFieldBuilder().getBuilder(); } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> */ public com.google.protobuf.Int64ValueOrBuilder getTargetCpaMicrosOrBuilder() { if (targetCpaMicrosBuilder_ != null) { return targetCpaMicrosBuilder_.getMessageOrBuilder(); } else { return targetCpaMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : targetCpaMicros_; } } /** * <pre> * Average CPA target. * This target should be greater than or equal to minimum billable unit based * on the currency for the account. * </pre> * * <code>.google.protobuf.Int64Value target_cpa_micros = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> getTargetCpaMicrosFieldBuilder() { if (targetCpaMicrosBuilder_ == null) { targetCpaMicrosBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>( getTargetCpaMicros(), getParentForChildren(), isClean()); targetCpaMicros_ = null; } return targetCpaMicrosBuilder_; } private com.google.protobuf.Int64Value cpcBidCeilingMicros_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> cpcBidCeilingMicrosBuilder_; /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> * @return Whether the cpcBidCeilingMicros field is set. */ public boolean hasCpcBidCeilingMicros() { return cpcBidCeilingMicrosBuilder_ != null || cpcBidCeilingMicros_ != null; } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> * @return The cpcBidCeilingMicros. */ public com.google.protobuf.Int64Value getCpcBidCeilingMicros() { if (cpcBidCeilingMicrosBuilder_ == null) { return cpcBidCeilingMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : cpcBidCeilingMicros_; } else { return cpcBidCeilingMicrosBuilder_.getMessage(); } } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> */ public Builder setCpcBidCeilingMicros(com.google.protobuf.Int64Value value) { if (cpcBidCeilingMicrosBuilder_ == null) { if (value == null) { throw new NullPointerException(); } cpcBidCeilingMicros_ = value; onChanged(); } else { cpcBidCeilingMicrosBuilder_.setMessage(value); } return this; } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> */ public Builder setCpcBidCeilingMicros( com.google.protobuf.Int64Value.Builder builderForValue) { if (cpcBidCeilingMicrosBuilder_ == null) { cpcBidCeilingMicros_ = builderForValue.build(); onChanged(); } else { cpcBidCeilingMicrosBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> */ public Builder mergeCpcBidCeilingMicros(com.google.protobuf.Int64Value value) { if (cpcBidCeilingMicrosBuilder_ == null) { if (cpcBidCeilingMicros_ != null) { cpcBidCeilingMicros_ = com.google.protobuf.Int64Value.newBuilder(cpcBidCeilingMicros_).mergeFrom(value).buildPartial(); } else { cpcBidCeilingMicros_ = value; } onChanged(); } else { cpcBidCeilingMicrosBuilder_.mergeFrom(value); } return this; } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> */ public Builder clearCpcBidCeilingMicros() { if (cpcBidCeilingMicrosBuilder_ == null) { cpcBidCeilingMicros_ = null; onChanged(); } else { cpcBidCeilingMicros_ = null; cpcBidCeilingMicrosBuilder_ = null; } return this; } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> */ public com.google.protobuf.Int64Value.Builder getCpcBidCeilingMicrosBuilder() { onChanged(); return getCpcBidCeilingMicrosFieldBuilder().getBuilder(); } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> */ public com.google.protobuf.Int64ValueOrBuilder getCpcBidCeilingMicrosOrBuilder() { if (cpcBidCeilingMicrosBuilder_ != null) { return cpcBidCeilingMicrosBuilder_.getMessageOrBuilder(); } else { return cpcBidCeilingMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : cpcBidCeilingMicros_; } } /** * <pre> * Maximum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> getCpcBidCeilingMicrosFieldBuilder() { if (cpcBidCeilingMicrosBuilder_ == null) { cpcBidCeilingMicrosBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>( getCpcBidCeilingMicros(), getParentForChildren(), isClean()); cpcBidCeilingMicros_ = null; } return cpcBidCeilingMicrosBuilder_; } private com.google.protobuf.Int64Value cpcBidFloorMicros_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> cpcBidFloorMicrosBuilder_; /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> * @return Whether the cpcBidFloorMicros field is set. */ public boolean hasCpcBidFloorMicros() { return cpcBidFloorMicrosBuilder_ != null || cpcBidFloorMicros_ != null; } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> * @return The cpcBidFloorMicros. */ public com.google.protobuf.Int64Value getCpcBidFloorMicros() { if (cpcBidFloorMicrosBuilder_ == null) { return cpcBidFloorMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : cpcBidFloorMicros_; } else { return cpcBidFloorMicrosBuilder_.getMessage(); } } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> */ public Builder setCpcBidFloorMicros(com.google.protobuf.Int64Value value) { if (cpcBidFloorMicrosBuilder_ == null) { if (value == null) { throw new NullPointerException(); } cpcBidFloorMicros_ = value; onChanged(); } else { cpcBidFloorMicrosBuilder_.setMessage(value); } return this; } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> */ public Builder setCpcBidFloorMicros( com.google.protobuf.Int64Value.Builder builderForValue) { if (cpcBidFloorMicrosBuilder_ == null) { cpcBidFloorMicros_ = builderForValue.build(); onChanged(); } else { cpcBidFloorMicrosBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> */ public Builder mergeCpcBidFloorMicros(com.google.protobuf.Int64Value value) { if (cpcBidFloorMicrosBuilder_ == null) { if (cpcBidFloorMicros_ != null) { cpcBidFloorMicros_ = com.google.protobuf.Int64Value.newBuilder(cpcBidFloorMicros_).mergeFrom(value).buildPartial(); } else { cpcBidFloorMicros_ = value; } onChanged(); } else { cpcBidFloorMicrosBuilder_.mergeFrom(value); } return this; } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> */ public Builder clearCpcBidFloorMicros() { if (cpcBidFloorMicrosBuilder_ == null) { cpcBidFloorMicros_ = null; onChanged(); } else { cpcBidFloorMicros_ = null; cpcBidFloorMicrosBuilder_ = null; } return this; } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> */ public com.google.protobuf.Int64Value.Builder getCpcBidFloorMicrosBuilder() { onChanged(); return getCpcBidFloorMicrosFieldBuilder().getBuilder(); } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> */ public com.google.protobuf.Int64ValueOrBuilder getCpcBidFloorMicrosOrBuilder() { if (cpcBidFloorMicrosBuilder_ != null) { return cpcBidFloorMicrosBuilder_.getMessageOrBuilder(); } else { return cpcBidFloorMicros_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : cpcBidFloorMicros_; } } /** * <pre> * Minimum bid limit that can be set by the bid strategy. * The limit applies to all keywords managed by the strategy. * </pre> * * <code>.google.protobuf.Int64Value cpc_bid_floor_micros = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> getCpcBidFloorMicrosFieldBuilder() { if (cpcBidFloorMicrosBuilder_ == null) { cpcBidFloorMicrosBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>( getCpcBidFloorMicros(), getParentForChildren(), isClean()); cpcBidFloorMicros_ = null; } return cpcBidFloorMicrosBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.ads.googleads.v3.common.TargetCpa) } // @@protoc_insertion_point(class_scope:google.ads.googleads.v3.common.TargetCpa) private static final com.google.ads.googleads.v3.common.TargetCpa DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.ads.googleads.v3.common.TargetCpa(); } public static com.google.ads.googleads.v3.common.TargetCpa getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<TargetCpa> PARSER = new com.google.protobuf.AbstractParser<TargetCpa>() { @java.lang.Override public TargetCpa parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new TargetCpa(input, extensionRegistry); } }; public static com.google.protobuf.Parser<TargetCpa> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<TargetCpa> getParserForType() { return PARSER; } @java.lang.Override public com.google.ads.googleads.v3.common.TargetCpa getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
3e1416fe1cd1ccae02618316b3a948171bdef639
8,893
java
Java
src/test/java/rummikub/core/plateau/SequenceCouleurTest.java
klaxonn/rummikub
eedbf946e3061be5552ec1b7b06044682bb09b1d
[ "MIT" ]
null
null
null
src/test/java/rummikub/core/plateau/SequenceCouleurTest.java
klaxonn/rummikub
eedbf946e3061be5552ec1b7b06044682bb09b1d
[ "MIT" ]
null
null
null
src/test/java/rummikub/core/plateau/SequenceCouleurTest.java
klaxonn/rummikub
eedbf946e3061be5552ec1b7b06044682bb09b1d
[ "MIT" ]
null
null
null
37.209205
99
0.652198
8,489
package rummikub.core.plateau; import static rummikub.core.pieces.Couleur.*; import rummikub.core.pieces.Jeton; import rummikub.core.pieces.JetonNormal; import rummikub.core.pieces.Joker; import java.util.Arrays; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.BeforeAll; public class SequenceCouleurTest { private static FabriqueSequence fabrique; @BeforeAll public static void initialisation() { fabrique = FabriqueSequence.obtenirFabrique(); } @Test public void nouvelleSequence() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, ROUGE); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1, jeton2), fabrique); assertEquals("1bleu 1rouge", sequence1.toString()); } @Test public void nouvelleSequenceDifferenteValeur() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(2, ROUGE); assertThrows(UnsupportedOperationException.class, () -> { new SequenceCouleur(Arrays.asList(jeton1, jeton2), fabrique); }); } @Test public void nouvelleSequenceDeuxJetonsMemeValeur() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, BLEU); assertThrows(UnsupportedOperationException.class, () -> { new SequenceCouleur(Arrays.asList(jeton1, jeton2), fabrique); }); } @Test public void nouvelleSequenceAvecJoker() { Jeton jeton1 = new JetonNormal(1, BLEU); Joker joker = new Joker(); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1, joker), fabrique); assertEquals("1bleu 1rouge*", sequence1.toString()); } @Test public void nouvelleSequenceFausseAvecJoker() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(2, ROUGE); Joker joker = new Joker(); assertThrows(UnsupportedOperationException.class, () -> { new SequenceCouleur(Arrays.asList(jeton1, jeton2, joker), fabrique); }); assertFalse(joker.isUtilise()); } @Test public void nouvelleSequenceAvecJokerAvecSequenceComplete() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, JAUNE); Jeton jeton3 = new JetonNormal(1, VERT); Jeton jeton4 = new JetonNormal(1, ROUGE); Joker joker = new Joker(); assertThrows(UnsupportedOperationException.class, () -> { new SequenceCouleur(Arrays.asList(jeton1, jeton2, jeton3, jeton4, joker), fabrique); }); assertFalse(joker.isUtilise()); } @Test public void newSequenceJoker() { Joker joker = new Joker(); assertThrows(UnsupportedOperationException.class, () -> { new SequenceCouleur(Arrays.asList(joker), fabrique); }); assertFalse(joker.isUtilise()); } @Test public void newSequence2Jokers() { Joker joker = new Joker(); Joker joker2 = new Joker(); assertThrows(UnsupportedOperationException.class, () -> { new SequenceCouleur(Arrays.asList(joker, joker2), fabrique); }); assertFalse(joker.isUtilise()); } @Test public void createWithEmptyCollection() { assertThrows(UnsupportedOperationException.class, () -> { new SequenceCouleur(Arrays.asList(), fabrique); }); } @Test public void fusion2ValidSequences() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, ROUGE); Jeton jeton3 = new JetonNormal(1, JAUNE); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1), fabrique); SequenceAbstraite sequence2 = new SequenceCouleur(Arrays.asList(jeton2, jeton3), fabrique); SequenceAbstraite sequence3 = sequence1.fusionnerSequence(sequence2); assertEquals("1bleu 1rouge 1jaune", sequence3.toString()); assertEquals(3, sequence3.longueur()); } @Test public void fusionCouleursCommunes() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, BLEU); Jeton jeton3 = new JetonNormal(1, JAUNE); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1), fabrique); SequenceAbstraite sequence2 = new SequenceCouleur(Arrays.asList(jeton2, jeton3), fabrique); assertThrows(UnsupportedOperationException.class, () -> { sequence1.fusionnerSequence(sequence2); }); assertEquals("1bleu", sequence1.toString()); assertEquals("1bleu 1jaune", sequence2.toString()); } @Test public void fusionValeursDifferentes() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(2, VERT); Jeton jeton3 = new JetonNormal(2, JAUNE); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1), fabrique); SequenceAbstraite sequence2 = new SequenceCouleur(Arrays.asList(jeton2, jeton3), fabrique); assertThrows(UnsupportedOperationException.class, () -> { sequence1.fusionnerSequence(sequence2); }); assertEquals("1bleu", sequence1.toString()); assertEquals("2vert 2jaune", sequence2.toString()); } @Test public void retirerJetonHorsIndex() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, ROUGE); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1, jeton2), fabrique); assertThrows(UnsupportedOperationException.class, () -> { sequence1.retirerJeton(0); }); assertThrows(UnsupportedOperationException.class, () -> { sequence1.retirerJeton(3); }); } @Test public void retirerJeton() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, ROUGE); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1, jeton2), fabrique); Jeton jeton3 = sequence1.retirerJeton(2); assertEquals("1bleu", sequence1.toString()); assertEquals("1rouge", jeton3.toString()); assertEquals(jeton3, jeton2); sequence1.retirerJeton(1); assertTrue(sequence1.isVide()); } @Test public void couperSequence() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, ROUGE); SequenceAbstraite suite1 = new SequenceCouleur(Arrays.asList(jeton1, jeton2), fabrique); SequenceAbstraite suite2 = suite1.couperSequence(2); assertEquals("1bleu", suite1.toString()); assertEquals("1rouge", suite2.toString()); assertThrows(UnsupportedOperationException.class, () -> { suite2.couperSequence(1); }); } @Test public void couperSequenceHorsLimites() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, ROUGE); SequenceAbstraite suite1 = new SequenceCouleur(Arrays.asList(jeton1, jeton2), fabrique); assertThrows(UnsupportedOperationException.class, () -> { suite1.couperSequence(0); }); assertThrows(UnsupportedOperationException.class, () -> { suite1.couperSequence(3); }); } @Test public void remplacerJoker() { Jeton jeton1 = new JetonNormal(1, BLEU); Joker joker = new Joker(); joker.setValeurAndCouleur(1, ROUGE); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1, joker), fabrique); assertEquals("1bleu 1rouge*", sequence1.toString()); Jeton jeton3 = new JetonNormal(1, ROUGE); Joker joker2 = sequence1.remplacerJoker(jeton3); assertEquals("1bleu 1rouge", sequence1.toString()); assertFalse(joker2.isUtilise()); } @Test public void remplacerJokerAvecValeurDifferente() { Jeton jeton1 = new JetonNormal(1, BLEU); Joker joker = new Joker(); joker.setValeurAndCouleur(1, ROUGE); SequenceAbstraite sequence1 = new SequenceCouleur(Arrays.asList(jeton1, joker), fabrique); Jeton jeton2 = new JetonNormal(1, VERT); assertThrows(UnsupportedOperationException.class, () -> { sequence1.remplacerJoker(jeton2); }); } @Test public void remplacerJokerQuandPasDeJOker() { Jeton jeton1 = new JetonNormal(1, BLEU); Jeton jeton2 = new JetonNormal(1, ROUGE); SequenceCouleur sequence1 = new SequenceCouleur(Arrays.asList(jeton1, jeton2), fabrique); Jeton jeton3 = new JetonNormal(1, BLEU); assertThrows(UnsupportedOperationException.class, () -> { sequence1.remplacerJoker(jeton3); }); } }
3e141735bc6e47dd20525401c88a9d79df898743
1,126
java
Java
gmall-pms/src/main/java/com/atguigu/gmall/pms/entity/SpuImagesEntity.java
faxiaozhi/gmall
e0aa040526214e3ee8e6c886eaa0291c4ea034a0
[ "Apache-2.0" ]
null
null
null
gmall-pms/src/main/java/com/atguigu/gmall/pms/entity/SpuImagesEntity.java
faxiaozhi/gmall
e0aa040526214e3ee8e6c886eaa0291c4ea034a0
[ "Apache-2.0" ]
1
2021-09-20T20:57:16.000Z
2021-09-20T20:57:16.000Z
gmall-pms/src/main/java/com/atguigu/gmall/pms/entity/SpuImagesEntity.java
faxiaozhi/gmall
e0aa040526214e3ee8e6c886eaa0291c4ea034a0
[ "Apache-2.0" ]
null
null
null
19.719298
55
0.697509
8,490
package com.atguigu.gmall.pms.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.util.Date; import lombok.Data; /** * spu图片 * * @author wenruo * @email ychag@example.com * @date 2020-03-31 13:38:57 */ @ApiModel @Data @TableName("pms_spu_images") public class SpuImagesEntity implements Serializable { private static final long serialVersionUID = 1L; /** * id */ @TableId @ApiModelProperty(name = "id",value = "id") private Long id; /** * spu_id */ @ApiModelProperty(name = "spuId",value = "spu_id") private Long spuId; /** * 图片名 */ @ApiModelProperty(name = "imgName",value = "图片名") private String imgName; /** * 图片地址 */ @ApiModelProperty(name = "imgUrl",value = "图片地址") private String imgUrl; /** * 顺序 */ @ApiModelProperty(name = "imgSort",value = "顺序") private Integer imgSort; /** * 是否默认图 */ @ApiModelProperty(name = "defaultImg",value = "是否默认图") private Integer defaultImg; }
3e141851f62ac1766cf5b9417f4d0fe132d6d053
1,151
java
Java
MrFlower/src/pot/servlet/android/getUserAndroid.java
lvsijian8/MrFlower_for_Web
4f5d45ab923a100005dccff7ea575f93faca0086
[ "Apache-2.0" ]
2
2019-04-24T03:10:44.000Z
2020-09-19T10:32:26.000Z
MrGarden/src/pot/servlet/android/getUserAndroid.java
lvsijian8/MrGarden_for_Web
ae81ffcdacd4745ec9b13e9cc8beaccf6d08ee2c
[ "Apache-2.0" ]
null
null
null
MrGarden/src/pot/servlet/android/getUserAndroid.java
lvsijian8/MrGarden_for_Web
ae81ffcdacd4745ec9b13e9cc8beaccf6d08ee2c
[ "Apache-2.0" ]
null
null
null
35.96875
122
0.750652
8,491
package pot.servlet.android; import pot.dao.web.getUserDaoWeb; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; /** * Created by lvsijian8 on 2017/5/9. */ @WebServlet("/getUserAndroid") public class getUserAndroid extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int user_id = Integer.parseInt(new String(request.getParameter("user_id").getBytes("ISO8859-1"), "UTF-8")); getUserDaoWeb getUser = new getUserDaoWeb(); response.setContentType("text/json;charset=UTF-8"); response.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.println(getUser.getUser(user_id)); out.close(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } }
3e14188a438dd65203d5668c7f1d63619b09868c
1,762
java
Java
api-service/src/main/java/com/bitmark/apiservice/response/GetTransactionsResponse.java
bitmark-inc/bitmark-sdk-java
d2c1b090805c7d7ff83b74acc522d4aad42ecd00
[ "0BSD" ]
1
2018-09-21T05:01:42.000Z
2018-09-21T05:01:42.000Z
api-service/src/main/java/com/bitmark/apiservice/response/GetTransactionsResponse.java
bitmark-inc/bitmark-sdk-java
d2c1b090805c7d7ff83b74acc522d4aad42ecd00
[ "0BSD" ]
8
2019-05-03T02:41:49.000Z
2019-11-05T02:51:31.000Z
api-service/src/main/java/com/bitmark/apiservice/response/GetTransactionsResponse.java
bitmark-inc/bitmark-sdk-java
d2c1b090805c7d7ff83b74acc522d4aad42ecd00
[ "0BSD" ]
3
2019-03-11T02:40:21.000Z
2019-09-26T03:03:19.000Z
26.69697
67
0.675369
8,492
/** * SPDX-License-Identifier: ISC * Copyright © 2014-2019 Bitmark. All rights reserved. * Use of this source code is governed by an ISC * license that can be found in the LICENSE file. */ package com.bitmark.apiservice.response; import com.bitmark.apiservice.utils.annotation.VisibleForTesting; import com.bitmark.apiservice.utils.record.AssetRecord; import com.bitmark.apiservice.utils.record.BlockRecord; import com.bitmark.apiservice.utils.record.TransactionRecord; import com.google.gson.annotations.SerializedName; import java.util.List; import java.util.Objects; public class GetTransactionsResponse implements Response { @SerializedName("txs") private List<TransactionRecord> transactions; private List<AssetRecord> assets; private List<BlockRecord> blocks; @VisibleForTesting public GetTransactionsResponse( List<TransactionRecord> transactions, List<AssetRecord> assets ) { this.transactions = transactions; this.assets = assets; } public List<TransactionRecord> getTransactions() { return transactions; } public List<AssetRecord> getAssets() { return assets; } public List<BlockRecord> getBlocks() { return blocks; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } GetTransactionsResponse that = (GetTransactionsResponse) o; return Objects.equals(transactions, that.transactions) && Objects.equals(assets, that.assets); } @Override public int hashCode() { return Objects.hash(transactions, assets); } }
3e1418f9f9b2b0c0cf4e5cbf336b9ecd67171504
1,228
java
Java
xcEdu_service/xc-framework-model/src/main/java/com/xuecheng/framework/domain/order/XcOrdersDetail.java
Atom-me/xcEdu
25e903731886ccddd99eca4fc1b0dc8fd29be5dc
[ "Apache-2.0" ]
null
null
null
xcEdu_service/xc-framework-model/src/main/java/com/xuecheng/framework/domain/order/XcOrdersDetail.java
Atom-me/xcEdu
25e903731886ccddd99eca4fc1b0dc8fd29be5dc
[ "Apache-2.0" ]
null
null
null
xcEdu_service/xc-framework-model/src/main/java/com/xuecheng/framework/domain/order/XcOrdersDetail.java
Atom-me/xcEdu
25e903731886ccddd99eca4fc1b0dc8fd29be5dc
[ "Apache-2.0" ]
null
null
null
17.295775
70
0.612378
8,493
package com.xuecheng.framework.domain.order; import lombok.Data; import lombok.ToString; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.io.Serializable; import java.util.Date; /** * 订单明细表 * 记录订单的明细信息 * * @author admin * @date 2018/2/10 */ @Data @ToString @Entity @Table(name = "xc_orders_detail") @GenericGenerator(name = "jpa-uuid", strategy = "uuid") public class XcOrdersDetail implements Serializable { private static final long serialVersionUID = -916357210051689789L; @Id @GeneratedValue(generator = "jpa-uuid") @Column(length = 32) private String id; /** * 订单号 */ @Column(name = "order_number") private String orderNumber; /** * 商品id */ @Column(name = "item_id") private String itemId; /** * 商品数量 */ @Column(name = "item_num") private Integer itemNum; /** * 金额 */ @Column(name = "item_price") private Float itemPrice; /** * 课程有效性 */ private String valid; /** * 课程开始时间 */ @Column(name = "start_time") private Date startTime; /** * 课程结束时间 */ @Column(name = "end_time") private Date endTime; }
3e14195802f41e3dc54aa54b9ec550934bbaef30
484
java
Java
sample/src/main/java/ke/tang/slidemenu/sample/fragment/BaseListFragment.java
alex-mamukashvili/SlideMenu
28c93121952bbc19020bb47cda3fec46a79a18e0
[ "Apache-2.0" ]
181
2015-01-02T02:21:01.000Z
2022-01-27T11:37:23.000Z
sample/src/main/java/ke/tang/slidemenu/sample/fragment/BaseListFragment.java
alex-mamukashvili/SlideMenu
28c93121952bbc19020bb47cda3fec46a79a18e0
[ "Apache-2.0" ]
5
2015-02-25T03:35:36.000Z
2018-04-16T21:29:42.000Z
sample/src/main/java/ke/tang/slidemenu/sample/fragment/BaseListFragment.java
alex-mamukashvili/SlideMenu
28c93121952bbc19020bb47cda3fec46a79a18e0
[ "Apache-2.0" ]
97
2015-01-05T08:26:45.000Z
2021-08-24T08:56:50.000Z
26.888889
63
0.816116
8,494
package ke.tang.slidemenu.sample.fragment; import android.os.Bundle; import android.widget.ArrayAdapter; import androidx.fragment.app.ListFragment; import ke.tang.slidemenu.sample.R; public class BaseListFragment extends ListFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setListAdapter(ArrayAdapter.createFromResource(getActivity(), R.array.data, android.R.layout.simple_list_item_1)); } }
3e141968baa1fa924665c0229d80971d365ecc52
11,265
java
Java
src/gr/scify/newsum/Utils.java
NaSOS/NewSumAndroid
b82c2f3424345a697b664c55c5aaed67f0e1a7ba
[ "Apache-2.0" ]
1
2015-01-20T12:37:23.000Z
2015-01-20T12:37:23.000Z
src/gr/scify/newsum/Utils.java
NaSOS/NewSumAndroid
b82c2f3424345a697b664c55c5aaed67f0e1a7ba
[ "Apache-2.0" ]
null
null
null
src/gr/scify/newsum/Utils.java
NaSOS/NewSumAndroid
b82c2f3424345a697b664c55c5aaed67f0e1a7ba
[ "Apache-2.0" ]
null
null
null
31.994318
100
0.681318
8,495
/* * Copyright 2013 SciFY NPO <nnheo@example.com>. * * This product is part of the NewSum Free Software. * For more information about NewSum visit * * http://www.scify.gr/site/en/our-projects/completed-projects/newsum-menu-en * * 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. * * If this code or its output is used, extended, re-engineered, integrated, * or embedded to any extent in another software or hardware, there MUST be * an explicit attribution to this work in the resulting source code, * the packaging (where such packaging exists), or user interface * (where such an interface exists). * The attribution must be of the form "Powered by NewSum, SciFY" */ package gr.scify.newsum; import gr.scify.newsum.structs.TopicInfo; import gr.scify.newsum.ui.NewSumServiceClient; import gr.scify.newsum.ui.NewSumUiActivity; import gr.scify.newsum.ui.R; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URI; import java.net.URL; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Calendar; import java.util.Comparator; import java.util.HashSet; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import com.google.analytics.tracking.android.EasyTracker; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Resources; public class Utils { private static int sTheme; private static java.util.Map<CharSequence, Integer> mThemesToIDs = null; private static java.util.Map<CharSequence, Integer> mThemesToResourceIDs = null; public static CharSequence getThemeFromThemeID(int iThemeID) { for (Map.Entry<CharSequence, Integer> eCur : getThemeMap().entrySet()) { if (eCur.getValue() == iThemeID) return eCur.getKey(); } return null; } public static void resetThemeMaps() { mThemesToIDs = null; mThemesToResourceIDs = null; } public static java.util.Map<CharSequence, Integer> getThemeMap() { if (mThemesToIDs == null) { mThemesToIDs = new java.util.TreeMap<CharSequence, Integer>(); Resources rRes = NewSumUiActivity.getAppContext().getResources(); mThemesToIDs.put(rRes.getString(R.string.theme_black_name), 0); mThemesToIDs.put(rRes.getString(R.string.theme_orange_name), 1); mThemesToIDs.put(rRes.getString(R.string.theme_blue_name), 2); } return mThemesToIDs; } public static java.util.Map<CharSequence, Integer> getThemesToResourceIDs() { if (mThemesToResourceIDs == null) { mThemesToResourceIDs = new java.util.TreeMap<CharSequence, Integer>(); Resources rRes = NewSumUiActivity.getAppContext().getResources(); mThemesToResourceIDs.put(rRes.getString(R.string.theme_black_name), R.style.Theme); mThemesToResourceIDs.put(rRes.getString(R.string.theme_orange_name), R.style.Theme_Orangesilver); mThemesToResourceIDs.put(rRes.getString(R.string.theme_blue_name), R.style.Theme_blue); } return mThemesToResourceIDs; } // public final static int THEME_DEFAULT = 0; // public final static int THEME_ORANGE_SILVER = 1; // public final static int THEME_BLUE = 2; /** * Set the theme of the Activity, and restart it by creating a new Activity * of the same type. */ public static void changeToTheme(Activity activity, int theme) { sTheme = theme; activity.finish(); activity.startActivity(new Intent(activity, activity.getClass())); } /** Set the theme of the activity, according to the configuration. * @param sTheme */ public static void onActivityCreateSetTheme(Activity activity, int iTheme) { try { activity.setTheme( getThemesToResourceIDs().get( getThemeFromThemeID(iTheme))); } catch (Exception e) { // Could not set theme System.err.println("Could not set theme... Continuing normally."); } } /** * * @param lhs First {@link #TopicInfo} object * @param rhs Second {@link #TopicInfo} object * @return The difference in days between the two {@link #TopicInfo} objects */ public static int getDiffInDays(TopicInfo early, TopicInfo late) { // Compare using formatted date return early.getSortableDate().compareTo(late.getSortableDate()); } /** * * @param lhs First Calendar date * @param rhs Second Calendar date * @return The difference in days between two Calendar dates */ @SuppressLint("SimpleDateFormat") public static int getDiffInDays(Calendar lhs, Calendar rhs) { // Compare using formatted date SimpleDateFormat df = new SimpleDateFormat(); df.applyPattern("yyyy-MM-dd"); String sLhs = df.format(lhs.getTime()); String sRhs = df.format(rhs.getTime()); // debug line // // System.out.println(sLhs + " : " + sRhs + " := " + sLhs.compareTo(sRhs)); // debug line // return sLhs.compareTo(sRhs); } /** * * @param tiTopics The array of {@link #TopicInfo} objects to Sort * @return The array sorted according to date and Topic sources count */ public static TopicInfo[] sortTopics(TopicInfo[] tiTopics) { // Sort topics Arrays.sort(tiTopics, new Comparator<TopicInfo>() { @Override public int compare(TopicInfo lhs, TopicInfo rhs) { // Get date difference in DAYS - Nice! :S int iDiff = -getDiffInDays(lhs, rhs); int iSourcesDiff = -(lhs.getSourceCount() - rhs.getSourceCount()); if (iDiff != 0) return iDiff; // If they share the exact same date, then compare their source count. if (iSourcesDiff != 0) return iSourcesDiff; // If they share the exact same date and source count, // then sort alphabetically return lhs.getTitle().compareTo(rhs.getTitle()); } }); return tiTopics; } /** * Counts the number of different Sources the Summary refers to * @param Summary The summary of interest * @return The number of different sources that the summary comes from */ public static int countDiffArticles(String[] Summary) { // Init string set for sources HashSet<String> hsSources = new HashSet<String>(); // Get first entry, i.e. links and labels String sAllLinksAndLabels = Summary[0]; // if only one link if (!sAllLinksAndLabels.contains(NewSumServiceClient.getSecondLevelSeparator())) { return 1; } else { // For every pair for (String sTmps : sAllLinksAndLabels.split(NewSumServiceClient.getSecondLevelSeparator())) { // Get the link (1st field out of 2) hsSources.add(sTmps.split(NewSumServiceClient.getThirdLevelSeparator())[0]); } } // Return unique sources return hsSources.size(); } /** * * @param sCustomUrl the URL to access data * @return the data processed from that URL */ public static String getFromHttp(String sCustomUrl, boolean getHeader) { String sRes = null; BufferedReader in = null; // if getHead is True, bring url head, else bring url text // return "this is a new String from the custom tab"; try { HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(); // set the url request.setURI(new URI(sCustomUrl)); HttpResponse response = client.execute(request); // init the reader in = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); StringBuffer sb = new StringBuffer(); String line = ""; while ((line = in.readLine()) != null) { // sb.append(Html.fromHtml(line).toString()); sb.append(line); } System.out.println(sb.toString()); in.close(); if (getHeader) { // fetch only header return getTitle(sb.toString(), "<title>(.*|\\\n*)</title>"); } sRes = sb.toString(); // System.out.println(page); } catch (Exception ex) { System.err.println("ERROR" + ex.getCause()); } return sRes; } public static String getTitle(String sContent, String sRegex) { Matcher m = Pattern.compile(sRegex).matcher(sContent); if (m.find()) { return m.group(1); } return "not found"; } // Using HTTP_NOT_MODIFIED public static boolean urlChanged(String url){ try { HttpURLConnection.setFollowRedirects(false); HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection(); con.setRequestMethod("HEAD"); return (con.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED); } catch (Exception e) { e.printStackTrace(); return false; } } /** * Returns the last modified HTTP property of a given URL. * @param url The url to examine * @return A long number indicating the modified header field * of the URL. * @throws IOException If the connection to the URL fails. */ public static long lastModified(URL url) throws IOException { HttpURLConnection.setFollowRedirects(true); HttpURLConnection con = (HttpURLConnection) url.openConnection(); long date = con.getLastModified(); return date; } public static String getHTMLfromURL(String uri) throws ClientProtocolException, IOException { HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(uri); HttpResponse response = client.execute(request); String html = ""; InputStream in = response.getEntity().getContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder str = new StringBuilder(); String line = null; while((line = reader.readLine()) != null) { str.append(line); } in.close(); html = str.toString(); return html; } /** * returns the substring of the given string from 0 to pattern match start * @param sText the given text * @param sRegex the matcher * @return the substring of the given string from 0 to pattern match start */ public static String removeSourcesParen(String sText) { String sRegex = "\\(\\d+\\)\\s*\\Z"; Matcher m = Pattern.compile(sRegex).matcher(sText); if (m.find()) { return sText.substring(0, m.start()); } return sText; } }
3e1419725165ebcb9a266b493252b586efa8ebfd
724
java
Java
src/main/java/com/nexuswhitelist/verification/Utils.java
zapdos26/Nexus-Minecraft-Account-Verification
723128b3b2490b341a349347f9463112c52914c7
[ "MIT" ]
null
null
null
src/main/java/com/nexuswhitelist/verification/Utils.java
zapdos26/Nexus-Minecraft-Account-Verification
723128b3b2490b341a349347f9463112c52914c7
[ "MIT" ]
null
null
null
src/main/java/com/nexuswhitelist/verification/Utils.java
zapdos26/Nexus-Minecraft-Account-Verification
723128b3b2490b341a349347f9463112c52914c7
[ "MIT" ]
null
null
null
25.857143
77
0.711326
8,496
package com.nexuswhitelist.verification; import net.md_5.bungee.api.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.plugin.Plugin; class Utils { private static FileConfiguration cfg; private static Plugin plugin; private static String token; static void readConfig(FileConfiguration cfg, Plugin plugin) { Utils.cfg = cfg; Utils.plugin = plugin; Utils.token = cfg.getString("token"); } static String getToken() { return Utils.token; } static void sendMsg(CommandSender player, String msg) { player.sendMessage(ChatColor.translateAlternateColorCodes('&', msg)); } }
3e141a49baa9392b0ae99b9ceb9fdab5871a9161
1,290
java
Java
src/main/java/com/nhl/link/rest/provider/LinkRestExceptionMapper.java
aveprev/link-rest
eb7d1e94a9112e104170ce42321190e996a3f92d
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
src/main/java/com/nhl/link/rest/provider/LinkRestExceptionMapper.java
aveprev/link-rest
eb7d1e94a9112e104170ce42321190e996a3f92d
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
src/main/java/com/nhl/link/rest/provider/LinkRestExceptionMapper.java
aveprev/link-rest
eb7d1e94a9112e104170ce42321190e996a3f92d
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
28.043478
93
0.744961
8,497
package com.nhl.link.rest.provider; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.nhl.link.rest.LinkRestException; import com.nhl.link.rest.SimpleResponse; @Provider public class LinkRestExceptionMapper implements ExceptionMapper<LinkRestException> { private static final Logger LOGGER = LoggerFactory.getLogger(LinkRestExceptionMapper.class); @Override public Response toResponse(LinkRestException exception) { String message = exception.getMessage(); Status status = exception.getStatus(); if (LOGGER.isInfoEnabled()) { StringBuilder log = new StringBuilder(); log.append(status.getStatusCode()).append(" ").append(status.getReasonPhrase()); if (message != null) { log.append(" (").append(message).append(")"); } // include stack trace in debug mode... if (LOGGER.isDebugEnabled()) { LOGGER.debug(log.toString(), exception); } else { LOGGER.info(log.toString()); } } SimpleResponse body = new SimpleResponse(false, message); return Response.status(status).entity(body).type(MediaType.APPLICATION_JSON_TYPE).build(); } }
3e141a6d72452c9a19b9c5388bc34467b8ee0445
1,201
java
Java
src/main/java/gmarcel/model/Land.java
gmarcel-dev/carbon-challenge
7f3a30e15922ec4163c6fa58cf5c24d2b1147ced
[ "MIT" ]
null
null
null
src/main/java/gmarcel/model/Land.java
gmarcel-dev/carbon-challenge
7f3a30e15922ec4163c6fa58cf5c24d2b1147ced
[ "MIT" ]
null
null
null
src/main/java/gmarcel/model/Land.java
gmarcel-dev/carbon-challenge
7f3a30e15922ec4163c6fa58cf5c24d2b1147ced
[ "MIT" ]
null
null
null
20.706897
79
0.693589
8,498
package gmarcel.model; /** * * This class implements the Cell interface to represent a land. * * A land is a board cell which can be accessed and may have treasures. If a * cell is occupied, it cannot be accessed until it is not occupied any longer. * When the treasures of a land are picked, there is not treasures on the land * any more afterwards. * * @see Cell * */ public class Land implements Cell { /** Number of treasures on the cell. */ private int nbTreasures; /** Flag indicating if the cell is occupied. */ private boolean occupied; /** * Constructs a Land with a given number of treasures. Default land is not * occupied. * * @param nbTreasures * The number of treasures on the land */ public Land(int nbTreasures) { this.nbTreasures = nbTreasures; this.occupied = false; } @Override public void setOccupied(boolean occupied) { this.occupied = occupied; } @Override public boolean isOccupied() { return this.occupied; } @Override public boolean hasTreasure() { return nbTreasures > 0; } @Override public int pickUpTreasure() { int treasures = this.nbTreasures; this.nbTreasures = 0; return treasures; } }
3e141acdf86bec9f620eab4f99f98dce02186731
42,423
java
Java
x-pack/plugin/repository-encrypted/src/internalClusterTest/java/org/elasticsearch/repositories/encrypted/EncryptedRepositorySecretIntegTests.java
jskrnbindra/elasticsearch
246cd030963845799850b449fcc213ebe7e5cbda
[ "Apache-2.0" ]
2
2021-02-05T14:31:20.000Z
2021-02-09T13:44:10.000Z
x-pack/plugin/repository-encrypted/src/internalClusterTest/java/org/elasticsearch/repositories/encrypted/EncryptedRepositorySecretIntegTests.java
mbelluzzo/elasticsearch-free
564d7575fc743c91b37d968cacb6f79da6a13918
[ "Apache-2.0" ]
null
null
null
x-pack/plugin/repository-encrypted/src/internalClusterTest/java/org/elasticsearch/repositories/encrypted/EncryptedRepositorySecretIntegTests.java
mbelluzzo/elasticsearch-free
564d7575fc743c91b37d968cacb6f79da6a13918
[ "Apache-2.0" ]
null
null
null
52.116708
140
0.674304
8,499
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ package org.elasticsearch.repositories.encrypted; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.action.ActionRunnable; import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse; import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.common.settings.MockSecureSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.license.License; import org.elasticsearch.license.LicenseService; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.repositories.RepositoryData; import org.elasticsearch.repositories.RepositoryException; import org.elasticsearch.repositories.RepositoryMissingException; import org.elasticsearch.repositories.RepositoryVerificationException; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.SnapshotMissingException; import org.elasticsearch.snapshots.SnapshotState; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.InternalTestCluster; import org.junit.BeforeClass; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Set; import java.util.stream.Collectors; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; import static org.elasticsearch.repositories.blobstore.BlobStoreRepository.READONLY_SETTING_KEY; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.mockito.Matchers.anyObject; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false) public final class EncryptedRepositorySecretIntegTests extends ESIntegTestCase { @BeforeClass public static void checkEnabled() { assumeFalse("Should only run when encrypted repo is enabled", EncryptedRepositoryPlugin.isDisabled()); } @Override protected Collection<Class<? extends Plugin>> nodePlugins() { return Arrays.asList(LocalStateEncryptedRepositoryPlugin.class); } @Override protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) .put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), License.LicenseType.TRIAL.getTypeName()) .build(); } public void testRepositoryCreationFailsForMissingPassword() throws Exception { // if the password is missing on the master node, the repository creation fails final String repositoryName = randomName(); MockSecureSettings secureSettingsWithPassword = new MockSecureSettings(); secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), randomAlphaOfLength(20) ); logger.info("--> start 3 nodes"); internalCluster().setBootstrapMasterNodeIndex(0); final String masterNodeName = internalCluster().startNode(); logger.info("--> started master node " + masterNodeName); ensureStableCluster(1); internalCluster().startNodes(2, Settings.builder().setSecureSettings(secureSettingsWithPassword).build()); logger.info("--> started two other nodes"); ensureStableCluster(3); assertThat(masterNodeName, equalTo(internalCluster().getMasterName())); final Settings repositorySettings = repositorySettings(repositoryName); RepositoryException e = expectThrows( RepositoryException.class, () -> client().admin() .cluster() .preparePutRepository(repositoryName) .setType(repositoryType()) .setVerify(randomBoolean()) .setSettings(repositorySettings) .get() ); assertThat(e.getMessage(), containsString("failed to create repository")); expectThrows(RepositoryMissingException.class, () -> client().admin().cluster().prepareGetRepositories(repositoryName).get()); if (randomBoolean()) { // stop the node with the missing password internalCluster().stopRandomNode(InternalTestCluster.nameFilter(masterNodeName)); ensureStableCluster(2); } else { // restart the node with the missing password internalCluster().restartNode(masterNodeName, new InternalTestCluster.RestartCallback() { @Override public Settings onNodeStopped(String nodeName) throws Exception { Settings.Builder newSettings = Settings.builder().put(super.onNodeStopped(nodeName)); newSettings.setSecureSettings(secureSettingsWithPassword); return newSettings.build(); } }); ensureStableCluster(3); } // repository creation now successful createRepository(repositoryName, repositorySettings, true); } public void testRepositoryVerificationFailsForMissingPassword() throws Exception { // if the password is missing on any non-master node, the repository verification fails final String repositoryName = randomName(); MockSecureSettings secureSettingsWithPassword = new MockSecureSettings(); secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), randomAlphaOfLength(20) ); logger.info("--> start 2 nodes"); internalCluster().setBootstrapMasterNodeIndex(0); final String masterNodeName = internalCluster().startNode(Settings.builder().setSecureSettings(secureSettingsWithPassword).build()); logger.info("--> started master node " + masterNodeName); ensureStableCluster(1); final String otherNodeName = internalCluster().startNode(); logger.info("--> started other node " + otherNodeName); ensureStableCluster(2); assertThat(masterNodeName, equalTo(internalCluster().getMasterName())); // repository create fails verification final Settings repositorySettings = repositorySettings(repositoryName); expectThrows( RepositoryVerificationException.class, () -> client().admin() .cluster() .preparePutRepository(repositoryName) .setType(repositoryType()) .setVerify(true) .setSettings(repositorySettings) .get() ); if (randomBoolean()) { // delete and recreate repo logger.debug("--> deleting repository [name: {}]", repositoryName); assertAcked(client().admin().cluster().prepareDeleteRepository(repositoryName)); assertAcked( client().admin() .cluster() .preparePutRepository(repositoryName) .setType(repositoryType()) .setVerify(false) .setSettings(repositorySettings) .get() ); } // test verify call fails expectThrows(RepositoryVerificationException.class, () -> client().admin().cluster().prepareVerifyRepository(repositoryName).get()); if (randomBoolean()) { // stop the node with the missing password internalCluster().stopRandomNode(InternalTestCluster.nameFilter(otherNodeName)); ensureStableCluster(1); // repository verification now succeeds VerifyRepositoryResponse verifyRepositoryResponse = client().admin().cluster().prepareVerifyRepository(repositoryName).get(); List<String> verifiedNodes = verifyRepositoryResponse.getNodes().stream().map(n -> n.getName()).collect(Collectors.toList()); assertThat(verifiedNodes, contains(masterNodeName)); } else { // restart the node with the missing password internalCluster().restartNode(otherNodeName, new InternalTestCluster.RestartCallback() { @Override public Settings onNodeStopped(String nodeName) throws Exception { Settings.Builder newSettings = Settings.builder().put(super.onNodeStopped(nodeName)); newSettings.setSecureSettings(secureSettingsWithPassword); return newSettings.build(); } }); ensureStableCluster(2); // repository verification now succeeds VerifyRepositoryResponse verifyRepositoryResponse = client().admin().cluster().prepareVerifyRepository(repositoryName).get(); List<String> verifiedNodes = verifyRepositoryResponse.getNodes().stream().map(n -> n.getName()).collect(Collectors.toList()); assertThat(verifiedNodes, containsInAnyOrder(masterNodeName, otherNodeName)); } } public void testRepositoryVerificationFailsForDifferentPassword() throws Exception { final String repositoryName = randomName(); final String repoPass1 = randomAlphaOfLength(20); final String repoPass2 = randomAlphaOfLength(19); // put a different repository password MockSecureSettings secureSettings1 = new MockSecureSettings(); secureSettings1.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), repoPass1 ); MockSecureSettings secureSettings2 = new MockSecureSettings(); secureSettings2.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), repoPass2 ); logger.info("--> start 2 nodes"); internalCluster().setBootstrapMasterNodeIndex(1); final String node1 = internalCluster().startNode(Settings.builder().setSecureSettings(secureSettings1).build()); final String node2 = internalCluster().startNode(Settings.builder().setSecureSettings(secureSettings2).build()); ensureStableCluster(2); // repository create fails verification Settings repositorySettings = repositorySettings(repositoryName); expectThrows( RepositoryVerificationException.class, () -> client().admin() .cluster() .preparePutRepository(repositoryName) .setType(repositoryType()) .setVerify(true) .setSettings(repositorySettings) .get() ); if (randomBoolean()) { // delete and recreate repo logger.debug("--> deleting repository [name: {}]", repositoryName); assertAcked(client().admin().cluster().prepareDeleteRepository(repositoryName)); assertAcked( client().admin() .cluster() .preparePutRepository(repositoryName) .setType(repositoryType()) .setVerify(false) .setSettings(repositorySettings) .get() ); } // test verify call fails expectThrows(RepositoryVerificationException.class, () -> client().admin().cluster().prepareVerifyRepository(repositoryName).get()); // restart one of the nodes to use the same password if (randomBoolean()) { secureSettings1.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), repoPass2 ); internalCluster().restartNode(node1, new InternalTestCluster.RestartCallback()); } else { secureSettings2.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), repoPass1 ); internalCluster().restartNode(node2, new InternalTestCluster.RestartCallback()); } ensureStableCluster(2); // repository verification now succeeds VerifyRepositoryResponse verifyRepositoryResponse = client().admin().cluster().prepareVerifyRepository(repositoryName).get(); List<String> verifiedNodes = verifyRepositoryResponse.getNodes().stream().map(n -> n.getName()).collect(Collectors.toList()); assertThat(verifiedNodes, containsInAnyOrder(node1, node2)); } public void testLicenseComplianceSnapshotAndRestore() throws Exception { final String repositoryName = randomName(); MockSecureSettings secureSettingsWithPassword = new MockSecureSettings(); secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), randomAlphaOfLength(20) ); logger.info("--> start 2 nodes"); internalCluster().setBootstrapMasterNodeIndex(1); internalCluster().startNodes(2, Settings.builder().setSecureSettings(secureSettingsWithPassword).build()); ensureStableCluster(2); logger.info("--> creating repo " + repositoryName); createRepository(repositoryName); final String indexName = randomName(); logger.info("--> create random index {} with {} records", indexName, 3); indexRandom( true, client().prepareIndex(indexName).setId("1").setSource("field1", "the quick brown fox jumps"), client().prepareIndex(indexName).setId("2").setSource("field1", "quick brown"), client().prepareIndex(indexName).setId("3").setSource("field1", "quick") ); assertHitCount(client().prepareSearch(indexName).setSize(0).get(), 3); final String snapshotName = randomName(); logger.info("--> create snapshot {}:{}", repositoryName, snapshotName); assertSuccessfulSnapshot( client().admin() .cluster() .prepareCreateSnapshot(repositoryName, snapshotName) .setIndices(indexName) .setWaitForCompletion(true) .get() ); // make license not accept encrypted snapshots EncryptedRepository encryptedRepository = (EncryptedRepository) internalCluster().getCurrentMasterNodeInstance( RepositoriesService.class ).repository(repositoryName); encryptedRepository.licenseStateSupplier = () -> { XPackLicenseState mockLicenseState = mock(XPackLicenseState.class); when(mockLicenseState.isAllowed(anyObject())).thenReturn(false); return mockLicenseState; }; // now snapshot is not permitted ElasticsearchSecurityException e = expectThrows( ElasticsearchSecurityException.class, () -> client().admin().cluster().prepareCreateSnapshot(repositoryName, snapshotName + "2").setWaitForCompletion(true).get() ); assertThat(e.getDetailedMessage(), containsString("current license is non-compliant for [encrypted snapshots]")); logger.info("--> delete index {}", indexName); assertAcked(client().admin().indices().prepareDelete(indexName)); // but restore is permitted logger.info("--> restore index from the snapshot"); assertSuccessfulRestore( client().admin().cluster().prepareRestoreSnapshot(repositoryName, snapshotName).setWaitForCompletion(true).get() ); ensureGreen(); assertHitCount(client().prepareSearch(indexName).setSize(0).get(), 3); // also delete snapshot is permitted logger.info("--> delete snapshot {}:{}", repositoryName, snapshotName); assertAcked(client().admin().cluster().prepareDeleteSnapshot(repositoryName, snapshotName).get()); } public void testSnapshotIsPartialForMissingPassword() throws Exception { final String repositoryName = randomName(); final Settings repositorySettings = repositorySettings(repositoryName); MockSecureSettings secureSettingsWithPassword = new MockSecureSettings(); secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), randomAlphaOfLength(20) ); logger.info("--> start 2 nodes"); internalCluster().setBootstrapMasterNodeIndex(0); // master has the password internalCluster().startNode(Settings.builder().setSecureSettings(secureSettingsWithPassword).build()); ensureStableCluster(1); final String otherNode = internalCluster().startNode(); ensureStableCluster(2); logger.debug("--> creating repository [name: {}, verify: {}, settings: {}]", repositoryName, false, repositorySettings); assertAcked( client().admin() .cluster() .preparePutRepository(repositoryName) .setType(repositoryType()) .setVerify(false) .setSettings(repositorySettings) ); // create an index with the shard on the node without a repository password final String indexName = randomName(); final Settings indexSettings = Settings.builder() .put(indexSettings()) .put("index.routing.allocation.include._name", otherNode) .put(SETTING_NUMBER_OF_SHARDS, 1) .build(); logger.info("--> create random index {}", indexName); createIndex(indexName, indexSettings); indexRandom( true, client().prepareIndex(indexName).setId("1").setSource("field1", "the quick brown fox jumps"), client().prepareIndex(indexName).setId("2").setSource("field1", "quick brown"), client().prepareIndex(indexName).setId("3").setSource("field1", "quick") ); assertHitCount(client().prepareSearch(indexName).setSize(0).get(), 3); // empty snapshot completes successfully because it does not involve data on the node without a repository password final String snapshotName = randomName(); logger.info("--> create snapshot {}:{}", repositoryName, snapshotName); CreateSnapshotResponse createSnapshotResponse = client().admin() .cluster() .prepareCreateSnapshot(repositoryName, snapshotName) .setIndices(indexName + "other*") .setWaitForCompletion(true) .get(); assertThat( createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()) ); assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(0)); assertThat( createSnapshotResponse.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_HASH_USER_METADATA_KEY)) ); assertThat( createSnapshotResponse.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_SALT_USER_METADATA_KEY)) ); // snapshot is PARTIAL because it includes shards on nodes with a missing repository password final String snapshotName2 = snapshotName + "2"; CreateSnapshotResponse incompleteSnapshotResponse = client().admin() .cluster() .prepareCreateSnapshot(repositoryName, snapshotName2) .setWaitForCompletion(true) .setIndices(indexName) .get(); assertThat(incompleteSnapshotResponse.getSnapshotInfo().state(), equalTo(SnapshotState.PARTIAL)); assertTrue( incompleteSnapshotResponse.getSnapshotInfo() .shardFailures() .stream() .allMatch(shardFailure -> shardFailure.reason().contains("[" + repositoryName + "] missing")) ); assertThat( incompleteSnapshotResponse.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_HASH_USER_METADATA_KEY)) ); assertThat( incompleteSnapshotResponse.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_SALT_USER_METADATA_KEY)) ); final Set<String> nodesWithFailures = incompleteSnapshotResponse.getSnapshotInfo() .shardFailures() .stream() .map(sf -> sf.nodeId()) .collect(Collectors.toSet()); assertThat(nodesWithFailures.size(), equalTo(1)); final ClusterStateResponse clusterState = client().admin().cluster().prepareState().clear().setNodes(true).get(); assertThat(clusterState.getState().nodes().get(nodesWithFailures.iterator().next()).getName(), equalTo(otherNode)); } public void testSnapshotIsPartialForDifferentPassword() throws Exception { final String repoName = randomName(); final Settings repoSettings = repositorySettings(repoName); final String repoPass1 = randomAlphaOfLength(20); final String repoPass2 = randomAlphaOfLength(19); MockSecureSettings secureSettingsMaster = new MockSecureSettings(); secureSettingsMaster.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repoName).getKey(), repoPass1 ); MockSecureSettings secureSettingsOther = new MockSecureSettings(); secureSettingsOther.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repoName).getKey(), repoPass2 ); final boolean putRepoEarly = randomBoolean(); logger.info("--> start 2 nodes"); internalCluster().setBootstrapMasterNodeIndex(0); final String masterNode = internalCluster().startNode(Settings.builder().setSecureSettings(secureSettingsMaster).build()); ensureStableCluster(1); if (putRepoEarly) { createRepository(repoName, repoSettings, true); } final String otherNode = internalCluster().startNode(Settings.builder().setSecureSettings(secureSettingsOther).build()); ensureStableCluster(2); if (false == putRepoEarly) { createRepository(repoName, repoSettings, false); } // create index with shards on both nodes final String indexName = randomName(); final Settings indexSettings = Settings.builder().put(indexSettings()).put(SETTING_NUMBER_OF_SHARDS, 5).build(); logger.info("--> create random index {}", indexName); createIndex(indexName, indexSettings); indexRandom( true, client().prepareIndex(indexName).setId("1").setSource("field1", "the quick brown fox jumps"), client().prepareIndex(indexName).setId("2").setSource("field1", "quick brown"), client().prepareIndex(indexName).setId("3").setSource("field1", "quick"), client().prepareIndex(indexName).setId("4").setSource("field1", "lazy"), client().prepareIndex(indexName).setId("5").setSource("field1", "dog") ); assertHitCount(client().prepareSearch(indexName).setSize(0).get(), 5); // empty snapshot completes successfully for both repos because it does not involve any data final String snapshotName = randomName(); logger.info("--> create snapshot {}:{}", repoName, snapshotName); CreateSnapshotResponse createSnapshotResponse = client().admin() .cluster() .prepareCreateSnapshot(repoName, snapshotName) .setIndices(indexName + "other*") .setWaitForCompletion(true) .get(); assertThat( createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()) ); assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(0)); assertThat( createSnapshotResponse.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_HASH_USER_METADATA_KEY)) ); assertThat( createSnapshotResponse.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_SALT_USER_METADATA_KEY)) ); // snapshot is PARTIAL because it includes shards on nodes with a different repository KEK final String snapshotName2 = snapshotName + "2"; CreateSnapshotResponse incompleteSnapshotResponse = client().admin() .cluster() .prepareCreateSnapshot(repoName, snapshotName2) .setWaitForCompletion(true) .setIndices(indexName) .get(); assertThat(incompleteSnapshotResponse.getSnapshotInfo().state(), equalTo(SnapshotState.PARTIAL)); assertTrue( incompleteSnapshotResponse.getSnapshotInfo() .shardFailures() .stream() .allMatch(shardFailure -> shardFailure.reason().contains("Repository password mismatch")) ); final Set<String> nodesWithFailures = incompleteSnapshotResponse.getSnapshotInfo() .shardFailures() .stream() .map(sf -> sf.nodeId()) .collect(Collectors.toSet()); assertThat(nodesWithFailures.size(), equalTo(1)); final ClusterStateResponse clusterState = client().admin().cluster().prepareState().clear().setNodes(true).get(); assertThat(clusterState.getState().nodes().get(nodesWithFailures.iterator().next()).getName(), equalTo(otherNode)); } public void testWrongRepositoryPassword() throws Exception { final String repositoryName = randomName(); final Settings repositorySettings = repositorySettings(repositoryName); final String goodPassword = randomAlphaOfLength(20); final String wrongPassword = randomAlphaOfLength(19); MockSecureSettings secureSettingsWithPassword = new MockSecureSettings(); secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), goodPassword ); logger.info("--> start 2 nodes"); internalCluster().setBootstrapMasterNodeIndex(1); internalCluster().startNodes(2, Settings.builder().setSecureSettings(secureSettingsWithPassword).build()); ensureStableCluster(2); createRepository(repositoryName, repositorySettings, true); // create empty smapshot final String snapshotName = randomName(); logger.info("--> create empty snapshot {}:{}", repositoryName, snapshotName); CreateSnapshotResponse createSnapshotResponse = client().admin() .cluster() .prepareCreateSnapshot(repositoryName, snapshotName) .setWaitForCompletion(true) .get(); assertThat( createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()) ); assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(0)); assertThat( createSnapshotResponse.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_HASH_USER_METADATA_KEY)) ); assertThat( createSnapshotResponse.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_SALT_USER_METADATA_KEY)) ); // restart master node and fill in a wrong password secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), wrongPassword ); Set<String> nodesWithWrongPassword = new HashSet<>(); do { String masterNodeName = internalCluster().getMasterName(); logger.info("--> restart master node {}", masterNodeName); internalCluster().restartNode(masterNodeName, new InternalTestCluster.RestartCallback()); nodesWithWrongPassword.add(masterNodeName); ensureStableCluster(2); } while (false == nodesWithWrongPassword.contains(internalCluster().getMasterName())); // maybe recreate the repository if (randomBoolean()) { deleteRepository(repositoryName); createRepository(repositoryName, repositorySettings, false); } // all repository operations return "repository password is incorrect", but the repository does not move to the corrupted state final BlobStoreRepository blobStoreRepository = (BlobStoreRepository) internalCluster().getCurrentMasterNodeInstance( RepositoriesService.class ).repository(repositoryName); RepositoryException e = expectThrows( RepositoryException.class, () -> PlainActionFuture.<RepositoryData, Exception>get( f -> blobStoreRepository.threadPool().generic().execute(ActionRunnable.wrap(f, blobStoreRepository::getRepositoryData)) ) ); assertThat(e.getCause().getMessage(), containsString("repository password is incorrect")); e = expectThrows( RepositoryException.class, () -> client().admin().cluster().prepareCreateSnapshot(repositoryName, snapshotName + "2").setWaitForCompletion(true).get() ); assertThat(e.getCause().getMessage(), containsString("repository password is incorrect")); GetSnapshotsResponse getSnapshotResponse = client().admin().cluster().prepareGetSnapshots(repositoryName).get(); assertThat(getSnapshotResponse.getSuccessfulResponses().keySet(), empty()); assertThat(getSnapshotResponse.getFailedResponses().keySet(), contains(repositoryName)); assertThat( getSnapshotResponse.getFailedResponses().get(repositoryName).getCause().getMessage(), containsString("repository password is incorrect") ); e = expectThrows( RepositoryException.class, () -> client().admin().cluster().prepareRestoreSnapshot(repositoryName, snapshotName).setWaitForCompletion(true).get() ); assertThat(e.getCause().getMessage(), containsString("repository password is incorrect")); e = expectThrows( RepositoryException.class, () -> client().admin().cluster().prepareDeleteSnapshot(repositoryName, snapshotName).get() ); assertThat(e.getCause().getMessage(), containsString("repository password is incorrect")); // restart master node and fill in the good password secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repositoryName).getKey(), goodPassword ); do { String masterNodeName = internalCluster().getMasterName(); logger.info("--> restart master node {}", masterNodeName); internalCluster().restartNode(masterNodeName, new InternalTestCluster.RestartCallback()); nodesWithWrongPassword.remove(masterNodeName); ensureStableCluster(2); } while (nodesWithWrongPassword.contains(internalCluster().getMasterName())); // ensure get snapshot works getSnapshotResponse = client().admin().cluster().prepareGetSnapshots(repositoryName).get(); assertThat(getSnapshotResponse.getFailedResponses().keySet(), empty()); assertThat(getSnapshotResponse.getSuccessfulResponses().keySet(), contains(repositoryName)); } public void testSnapshotFailsForMasterFailoverWithWrongPassword() throws Exception { final String repoName = randomName(); final Settings repoSettings = repositorySettings(repoName); final String goodPass = randomAlphaOfLength(20); final String wrongPass = randomAlphaOfLength(19); MockSecureSettings secureSettingsWithPassword = new MockSecureSettings(); secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repoName).getKey(), goodPass ); logger.info("--> start 4 nodes"); internalCluster().setBootstrapMasterNodeIndex(0); final String masterNode = internalCluster().startMasterOnlyNodes( 1, Settings.builder().setSecureSettings(secureSettingsWithPassword).build() ).get(0); final String otherNode = internalCluster().startDataOnlyNodes( 1, Settings.builder().setSecureSettings(secureSettingsWithPassword).build() ).get(0); ensureStableCluster(2); secureSettingsWithPassword.setString( EncryptedRepositoryPlugin.ENCRYPTION_PASSWORD_SETTING.getConcreteSettingForNamespace(repoName).getKey(), wrongPass ); internalCluster().startMasterOnlyNodes(2, Settings.builder().setSecureSettings(secureSettingsWithPassword).build()); ensureStableCluster(4); assertThat(internalCluster().getMasterName(), equalTo(masterNode)); logger.debug("--> creating repository [name: {}, verify: {}, settings: {}]", repoName, false, repoSettings); assertAcked( client().admin().cluster().preparePutRepository(repoName).setType(repositoryType()).setVerify(false).setSettings(repoSettings) ); // create index with just one shard on the "other" data node final String indexName = randomName(); final Settings indexSettings = Settings.builder() .put(indexSettings()) .put("index.routing.allocation.include._name", otherNode) .put(SETTING_NUMBER_OF_SHARDS, 1) .build(); logger.info("--> create random index {}", indexName); createIndex(indexName, indexSettings); indexRandom( true, client().prepareIndex(indexName).setId("1").setSource("field1", "the quick brown fox jumps"), client().prepareIndex(indexName).setId("2").setSource("field1", "quick brown"), client().prepareIndex(indexName).setId("3").setSource("field1", "quick"), client().prepareIndex(indexName).setId("4").setSource("field1", "lazy"), client().prepareIndex(indexName).setId("5").setSource("field1", "dog") ); assertHitCount(client().prepareSearch(indexName).setSize(0).get(), 5); // block shard snapshot on the data node final LocalStateEncryptedRepositoryPlugin.TestEncryptedRepository otherNodeEncryptedRepo = (LocalStateEncryptedRepositoryPlugin.TestEncryptedRepository) internalCluster().getInstance( RepositoriesService.class, otherNode ).repository(repoName); otherNodeEncryptedRepo.blockSnapshotShard(); final String snapshotName = randomName(); logger.info("--> create snapshot {}:{}", repoName, snapshotName); client().admin().cluster().prepareCreateSnapshot(repoName, snapshotName).setIndices(indexName).setWaitForCompletion(false).get(); // stop master internalCluster().stopRandomNode(InternalTestCluster.nameFilter(masterNode)); ensureStableCluster(3); otherNodeEncryptedRepo.unblockSnapshotShard(); // the failover master has the wrong password, snapshot fails logger.info("--> waiting for completion"); expectThrows(SnapshotMissingException.class, () -> { waitForCompletion(repoName, snapshotName, TimeValue.timeValueSeconds(60)); }); } protected String randomName() { return randomAlphaOfLength(randomIntBetween(1, 10)).toLowerCase(Locale.ROOT); } protected String repositoryType() { return EncryptedRepositoryPlugin.REPOSITORY_TYPE_NAME; } protected Settings repositorySettings(String repositoryName) { return Settings.builder() .put("compress", randomBoolean()) .put(EncryptedRepositoryPlugin.DELEGATE_TYPE_SETTING.getKey(), FsRepository.TYPE) .put(EncryptedRepositoryPlugin.PASSWORD_NAME_SETTING.getKey(), repositoryName) .put("location", randomRepoPath()) .build(); } protected String createRepository(final String name) { return createRepository(name, true); } protected String createRepository(final String name, final boolean verify) { return createRepository(name, repositorySettings(name), verify); } protected String createRepository(final String name, final Settings settings, final boolean verify) { logger.debug("--> creating repository [name: {}, verify: {}, settings: {}]", name, verify, settings); assertAcked( client().admin().cluster().preparePutRepository(name).setType(repositoryType()).setVerify(verify).setSettings(settings) ); internalCluster().getDataOrMasterNodeInstances(RepositoriesService.class).forEach(repositories -> { assertThat(repositories.repository(name), notNullValue()); assertThat(repositories.repository(name), instanceOf(BlobStoreRepository.class)); assertThat(repositories.repository(name).isReadOnly(), is(settings.getAsBoolean(READONLY_SETTING_KEY, false))); }); return name; } protected void deleteRepository(final String name) { logger.debug("--> deleting repository [name: {}]", name); assertAcked(client().admin().cluster().prepareDeleteRepository(name)); internalCluster().getDataOrMasterNodeInstances(RepositoriesService.class).forEach(repositories -> { RepositoryMissingException e = expectThrows(RepositoryMissingException.class, () -> repositories.repository(name)); assertThat(e.repository(), equalTo(name)); }); } private void assertSuccessfulRestore(RestoreSnapshotResponse response) { assertThat(response.getRestoreInfo().successfulShards(), greaterThan(0)); assertThat(response.getRestoreInfo().successfulShards(), equalTo(response.getRestoreInfo().totalShards())); } private void assertSuccessfulSnapshot(CreateSnapshotResponse response) { assertThat(response.getSnapshotInfo().successfulShards(), greaterThan(0)); assertThat(response.getSnapshotInfo().successfulShards(), equalTo(response.getSnapshotInfo().totalShards())); assertThat(response.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_HASH_USER_METADATA_KEY))); assertThat(response.getSnapshotInfo().userMetadata(), not(hasKey(EncryptedRepository.PASSWORD_SALT_USER_METADATA_KEY))); } public SnapshotInfo waitForCompletion(String repository, String snapshotName, TimeValue timeout) throws InterruptedException { long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start < timeout.millis()) { List<SnapshotInfo> snapshotInfos = client().admin() .cluster() .prepareGetSnapshots(repository) .setSnapshots(snapshotName) .get() .getSnapshots(repository); assertThat(snapshotInfos.size(), equalTo(1)); if (snapshotInfos.get(0).state().completed()) { // Make sure that snapshot clean up operations are finished ClusterStateResponse stateResponse = client().admin().cluster().prepareState().get(); SnapshotsInProgress snapshotsInProgress = stateResponse.getState().custom(SnapshotsInProgress.TYPE); if (snapshotsInProgress == null) { return snapshotInfos.get(0); } else { boolean found = false; for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { final Snapshot curr = entry.snapshot(); if (curr.getRepository().equals(repository) && curr.getSnapshotId().getName().equals(snapshotName)) { found = true; break; } } if (found == false) { return snapshotInfos.get(0); } } } Thread.sleep(100); } fail("Timeout!!!"); return null; } }
3e141affd9dc26956afcefa094a2ddcfa7d01f6b
1,271
java
Java
sandbox/src/main/java/ru/stqa/ol/sandbox/Primes.java
ohelge/java_barancev
ee06586db4bc39d2d1976afa68046e9a874f3139
[ "Apache-2.0" ]
null
null
null
sandbox/src/main/java/ru/stqa/ol/sandbox/Primes.java
ohelge/java_barancev
ee06586db4bc39d2d1976afa68046e9a874f3139
[ "Apache-2.0" ]
null
null
null
sandbox/src/main/java/ru/stqa/ol/sandbox/Primes.java
ohelge/java_barancev
ee06586db4bc39d2d1976afa68046e9a874f3139
[ "Apache-2.0" ]
null
null
null
19.859375
129
0.505114
8,500
package ru.stqa.ol.sandbox; /** * Created by OL A546902 on 2016-11-17. */ public class Primes { public static boolean isPrimeFor(int n) { for (int i = 2; i < n; i++) { if (n % i == 0) { return false; } } return true; } // same with while: public static boolean isPrimeWhile(int n) { int i = 2; while (i < n && n % i != 0) { i++; } return i == n; } public static boolean isPrimeForFast(int n) { int m = (int) Math.sqrt(n); for (int i = 2; i < m; i++) { // delim na deliteli do kornq iz n if (n % i == 0) { return false; } } return true; } public static boolean isPrimeForFast(long n) { long m = (long) Math.sqrt(n); for (long i = 2; i < m ; i++) { //delim na deliteli do kornq iz n if (n % i == 0) { return false; } } return true; } public static boolean isPrimeFor(long n) { //OBS! imq funkcii odinakovoe, vibor avtomati4 v zavisimosti ot tipa peremennoi "n" for (long i = 2; i < n; i++) { if (n % i == 0) { return false; } } return true; } public static boolean isPrimeWhile(long n) { long i = 2; while (i < n && n % i != 0) { i++; } return i == n; } }
3e141b1e53e75c0d6adbf8cc6ae3f88d5edf69af
192
java
Java
src/main/java/com/zzf/service/DiscussService.java
zzfn/blog-back-end
53b08474cbbbf251f67b2db3180477246e4a650f
[ "MIT" ]
null
null
null
src/main/java/com/zzf/service/DiscussService.java
zzfn/blog-back-end
53b08474cbbbf251f67b2db3180477246e4a650f
[ "MIT" ]
1
2022-01-19T06:09:49.000Z
2022-01-19T06:09:49.000Z
src/main/java/com/zzf/service/DiscussService.java
zzfn/blog-server
53b08474cbbbf251f67b2db3180477246e4a650f
[ "MIT" ]
null
null
null
16
59
0.770833
8,501
package com.zzf.service; import com.zzf.entity.Discuss; import com.baomidou.mybatisplus.extension.service.IService; /** * */ public interface DiscussService extends IService<Discuss> { }
3e141bb9f4509ec3bab1f63e321746111898e055
128
java
Java
00springboot-shop/src/main/java/com/ax/shop/entity/valid/PasswordGroup.java
axinger/SpringBootDemo
a5972c61e96120789ec39920b581e533fec5bbd2
[ "Apache-2.0" ]
null
null
null
00springboot-shop/src/main/java/com/ax/shop/entity/valid/PasswordGroup.java
axinger/SpringBootDemo
a5972c61e96120789ec39920b581e533fec5bbd2
[ "Apache-2.0" ]
1
2021-01-18T08:43:20.000Z
2021-01-18T08:43:20.000Z
00springboot-shop/src/main/java/com/ax/shop/entity/valid/PasswordGroup.java
axinger/SpringBootDemo
a5972c61e96120789ec39920b581e533fec5bbd2
[ "Apache-2.0" ]
null
null
null
18.285714
49
0.804688
8,502
package com.ax.shop.entity.valid; import javax.validation.groups.Default; public interface PasswordGroup extends Default { }
3e141bd88ecc3962536b0f4727728253e904d30f
2,461
java
Java
AccountingAndBudgeting/src/main/java/jdo/budget/model/BudgetItem.java
JimBarrows/JavaDomainObjects
06264a3839eb4ce9472893893ef4c53b3697c51b
[ "Apache-2.0" ]
null
null
null
AccountingAndBudgeting/src/main/java/jdo/budget/model/BudgetItem.java
JimBarrows/JavaDomainObjects
06264a3839eb4ce9472893893ef4c53b3697c51b
[ "Apache-2.0" ]
5
2015-08-09T19:36:55.000Z
2021-12-18T18:11:34.000Z
AccountingAndBudgeting/src/main/java/jdo/budget/model/BudgetItem.java
JimBarrows/JavaDomainObjects
06264a3839eb4ce9472893893ef4c53b3697c51b
[ "Apache-2.0" ]
1
2016-03-09T20:19:23.000Z
2016-03-09T20:19:23.000Z
19.377953
90
0.766761
8,503
package jdo.budget.model; import java.util.List; import java.util.UUID; import javax.persistence.ElementCollection; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import jdo.budget.model.revision.BudgetRevisionImpact; import jdo.fields.Money; import jdo.model.BasePersistentModel; @Entity public class BudgetItem extends BasePersistentModel { /** * */ private static final long serialVersionUID = 1L; @OneToMany private List<BudgetRevisionImpact> affectedBy; @Embedded private Money amount; @ManyToMany private List<BudgetItem> composedOf; private String justification; private String purpose; @ManyToOne private BudgetItemType type; @OneToMany private List<PaymentBudgetAllocation> usedToPay; /** * UUID for OrderItem. * */ @ElementCollection private List<UUID> usedToBuy; @OneToMany private List<RequirementBudgetAllocation> providesFundingVia; public List<RequirementBudgetAllocation> getProvidesFundingVia() { return providesFundingVia; } public void setProvidesFundingVia(List<RequirementBudgetAllocation> providesFundingVia) { this.providesFundingVia = providesFundingVia; } public List<UUID> getUsedToBuy() { return usedToBuy; } public void setUsedToBuy(List<UUID> usedToBuy) { this.usedToBuy = usedToBuy; } public List<PaymentBudgetAllocation> getUsedToPay() { return usedToPay; } public void setUsedToPay(List<PaymentBudgetAllocation> usedToPay) { this.usedToPay = usedToPay; } public List<BudgetRevisionImpact> getAffectedBy() { return affectedBy; } public Money getAmount() { return amount; } public List<BudgetItem> getComposedOf() { return composedOf; } public String getJustification() { return justification; } public String getPurpose() { return purpose; } public BudgetItemType getType() { return type; } public void setAffectedBy(List<BudgetRevisionImpact> affectedBy) { this.affectedBy = affectedBy; } public void setAmount(Money amount) { this.amount = amount; } public void setComposedOf(List<BudgetItem> composedOf) { this.composedOf = composedOf; } public void setJustification(String justification) { this.justification = justification; } public void setPurpose(String purpose) { this.purpose = purpose; } public void setType(BudgetItemType type) { this.type = type; } }
3e141bdf90a0a80e9fcbdb1b2a448e57530551f2
806
java
Java
esco-job-cv-matching/src/main/java/eu/esco/demo/jobcvmatching/root/model/BaseConcept.java
tenforce/semic-pilot-jobmatching
542737cf6e1c1f04688887b7ad922ed7fc356794
[ "Apache-2.0" ]
3
2018-05-13T12:32:45.000Z
2020-05-18T08:32:24.000Z
esco-job-cv-matching/src/main/java/eu/esco/demo/jobcvmatching/root/model/BaseConcept.java
tenforce/semic-pilot-jobmatching
542737cf6e1c1f04688887b7ad922ed7fc356794
[ "Apache-2.0" ]
null
null
null
esco-job-cv-matching/src/main/java/eu/esco/demo/jobcvmatching/root/model/BaseConcept.java
tenforce/semic-pilot-jobmatching
542737cf6e1c1f04688887b7ad922ed7fc356794
[ "Apache-2.0" ]
1
2018-06-06T08:10:32.000Z
2018-06-06T08:10:32.000Z
18.318182
50
0.595533
8,504
package eu.esco.demo.jobcvmatching.root.model; public abstract class BaseConcept { private final String uri; private final String label; public BaseConcept(String uri, String label) { this.uri = uri; this.label = label; } public String getUri() { return uri; } public String getLabel() { return label; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof BaseConcept)) return false; BaseConcept that = (BaseConcept) o; return uri.equals(that.uri); } @Override public String toString() { return getClass().getSimpleName() + "{" + "uri='" + uri + '\'' + ", label='" + label + '\'' + '}'; } @Override public int hashCode() { return uri.hashCode(); } }
3e141c195c420f75a8b0fefebb16e7ab6bf708a0
991
java
Java
spring-boot-rest-client/src/main/java/com/bswen/sbrc/domain/Value.java
bswen/bswen-project
57a88d41a18b1e3d3950a7e6389f57baab58cb14
[ "Apache-2.0" ]
16
2018-02-06T14:08:00.000Z
2022-02-17T00:26:52.000Z
spring-boot-rest-client/src/main/java/com/bswen/sbrc/domain/Value.java
bswen/bswen-project
57a88d41a18b1e3d3950a7e6389f57baab58cb14
[ "Apache-2.0" ]
22
2020-10-14T02:11:00.000Z
2022-03-13T04:39:28.000Z
spring-boot-rest-client/src/main/java/com/bswen/sbrc/domain/Value.java
bswen/bswen-project
57a88d41a18b1e3d3950a7e6389f57baab58cb14
[ "Apache-2.0" ]
33
2017-03-01T01:21:42.000Z
2021-07-12T15:21:16.000Z
18.351852
63
0.523713
8,505
package com.bswen.sbrc.domain; import java.util.Map; /** * Created on 2019/6/27. */ public class Value { private long id; private String quote; private Map<String, String> properties; public Value() { } public Value(long id, String quote) { this.id = id; this.quote = quote; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getQuote() { return quote; } public void setQuote(String quote) { this.quote = quote; } public Map<String, String> getProperties() { return properties; } public void setProperties(Map<String, String> properties) { this.properties = properties; } @Override public String toString() { return "Value{" + "id=" + id + ", quote='" + quote + '\'' + ", properties=" + properties + '}'; } }
3e141c757623aa260e5e939998e3b47f97745f86
80
java
Java
src/JackCompiler/JackCompilerException.java
goldsail/JackCompiler
1d156ff8252d2c4dfcd7d3050259d297213d6945
[ "MIT" ]
null
null
null
src/JackCompiler/JackCompilerException.java
goldsail/JackCompiler
1d156ff8252d2c4dfcd7d3050259d297213d6945
[ "MIT" ]
1
2017-10-28T12:20:01.000Z
2017-12-10T09:48:18.000Z
src/JackCompiler/JackCompilerException.java
kingium/JackCompiler
1d156ff8252d2c4dfcd7d3050259d297213d6945
[ "MIT" ]
null
null
null
16
54
0.8375
8,506
package JackCompiler; public class JackCompilerException extends Exception { }
3e141cd24ba3e9a095df799d0216649b2965e808
8,932
java
Java
yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/menu/PopupMenu.java
Yanndroid/SamsungDesign
01aa4cb2b725f5eb424b5e58066b55d61ce2aac0
[ "MIT" ]
null
null
null
yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/menu/PopupMenu.java
Yanndroid/SamsungDesign
01aa4cb2b725f5eb424b5e58066b55d61ce2aac0
[ "MIT" ]
null
null
null
yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/menu/PopupMenu.java
Yanndroid/SamsungDesign
01aa4cb2b725f5eb424b5e58066b55d61ce2aac0
[ "MIT" ]
null
null
null
36.757202
151
0.646328
8,507
package de.dlyt.yanndroid.oneui.menu; import android.content.Context; import android.graphics.Typeface; import android.text.TextUtils; import android.util.TypedValue; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.LinearLayout; import android.widget.PopupWindow; import android.widget.TextView; import androidx.annotation.MenuRes; import java.util.ArrayList; import de.dlyt.yanndroid.oneui.R; import de.dlyt.yanndroid.oneui.sesl.utils.ReflectUtils; public class PopupMenu { private Context context; private View anchor; private PopupMenuListener popupMenuListener; private Menu menu; private ArrayList<PopupMenuItemView> itemViews; private PopupWindow popupWindow; private PopupListView listView; private PopupMenuAdapter popupMenuAdapter; private LinearLayout layoutWithTitle; private CharSequence title; private int xoff = 0; private int yoff = 0; public PopupMenu(View anchor) { this.context = anchor.getContext(); this.anchor = anchor; } public interface PopupMenuListener { boolean onMenuItemClick(MenuItem item); void onMenuItemUpdate(MenuItem menuItem); } public void setPopupMenuListener(PopupMenuListener listener) { popupMenuListener = listener; } public Menu getMenu() { return menu != null ? menu : (menu = new Menu()); } public void inflate(@MenuRes int menuRes) { inflate(new Menu(menuRes, context)); } public void inflate(@MenuRes int menuRes, CharSequence title) { inflate(new Menu(menuRes, context), title); } public void inflate(Menu menu) { inflate(menu, null); } public void inflate(Menu menu, CharSequence title) { this.menu = menu; this.title = title; if (popupWindow != null) { if (popupWindow.isShowing()) { popupWindow.dismiss(); } popupWindow = null; } itemViews = new ArrayList<>(); for (MenuItem menuItem : menu.menuItems) itemViews.add(new PopupMenuItemView(context, menuItem)); popupMenuAdapter = new PopupMenuAdapter(); listView = new PopupListView(context); listView.setAdapter(popupMenuAdapter); listView.setMaxHeight(context.getResources().getDimensionPixelSize(R.dimen.sesl_menu_popup_max_height)); listView.setDivider(null); listView.setSelector(context.getResources().getDrawable(R.drawable.sesl_list_selector, context.getTheme())); listView.setOnItemClickListener((parent, view, position, id) -> { MenuItem clickedMenuItem = menu.getItem(position); if (clickedMenuItem.isCheckable()) clickedMenuItem.toggleChecked(); if (clickedMenuItem.hasSubMenu()) { PopupMenu subPopupMenu = new PopupMenu(anchor); subPopupMenu.inflate(clickedMenuItem.getSubMenu(), menu.getItem(position).getTitle()); subPopupMenu.setPopupMenuListener(new PopupMenuListener() { @Override public boolean onMenuItemClick(MenuItem item) { return popupMenuListener.onMenuItemClick(item); } @Override public void onMenuItemUpdate(MenuItem menuItem) { popupMenuListener.onMenuItemUpdate(menuItem); } }); subPopupMenu.show(xoff, yoff); popupWindow.dismiss(); } else if (popupMenuListener != null && popupMenuListener.onMenuItemClick(clickedMenuItem)) { popupWindow.dismiss(); } }); if (title != null) { layoutWithTitle = new LinearLayout(context); layoutWithTitle.setOrientation(LinearLayout.VERTICAL); layoutWithTitle.addView(createTitleView()); layoutWithTitle.addView(listView); popupWindow = new PopupWindow(layoutWithTitle); } else { popupWindow = new PopupWindow(listView); } popupWindow.setWidth(getPopupMenuWidth()); popupWindow.setHeight(getPopupMenuHeight()); popupWindow.setAnimationStyle(R.style.MenuPopupAnimStyle); popupWindow.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.sesl_menu_popup_background, context.getTheme())); popupWindow.setOutsideTouchable(true); popupWindow.setElevation(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, (float) 12, context.getResources().getDisplayMetrics())); popupWindow.setFocusable(true); if (popupWindow.isClippingEnabled()) popupWindow.setClippingEnabled(false); popupWindow.getContentView().setOnKeyListener((view, i, keyEvent) -> { if (keyEvent.getKeyCode() != KeyEvent.KEYCODE_MENU || keyEvent.getAction() != KeyEvent.ACTION_UP || !popupWindow.isShowing()) { return false; } popupWindow.dismiss(); return true; }); popupWindow.setTouchInterceptor(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (motionEvent.getAction() != MotionEvent.ACTION_OUTSIDE) { return false; } popupWindow.dismiss(); return true; } }); } private TextView createTitleView() { TextView titleView = new TextView(context); titleView.setPadding(context.getResources().getDimensionPixelSize(R.dimen.sesl_popup_menu_item_start_padding), context.getResources().getDimensionPixelSize(R.dimen.sesl_popup_menu_item_top_padding), context.getResources().getDimensionPixelSize(R.dimen.sesl_popup_menu_item_end_padding), context.getResources().getDimensionPixelSize(R.dimen.sesl_menu_popup_bottom_padding)); titleView.setTextDirection(View.TEXT_DIRECTION_LOCALE); titleView.setTextColor(context.getResources().getColor(R.color.item_color)); titleView.setTypeface(Typeface.DEFAULT_BOLD); titleView.setEllipsize(TextUtils.TruncateAt.END); titleView.setMaxLines(1); titleView.setTextSize(16); titleView.setText(title); return titleView; } public int getPopupMenuWidth() { int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); int popupWidth = 0; for (int i = 0; i < popupMenuAdapter.getCount(); i++) { View view = itemViews.get(i); view.measure(makeMeasureSpec, makeMeasureSpec); int measuredWidth = view.getMeasuredWidth(); if (measuredWidth > popupWidth) { popupWidth = measuredWidth; } } return popupWidth; } public int getPopupMenuHeight() { if (title == null) { listView.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); return listView.getMeasuredHeight() + context.getResources().getDimensionPixelSize(R.dimen.sesl_popup_menu_item_bottom_padding) - 5; } else { layoutWithTitle.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); return layoutWithTitle.getMeasuredHeight() + context.getResources().getDimensionPixelSize(R.dimen.sesl_popup_menu_item_bottom_padding) - 5; } } private void updatePopupSize() { if (popupWindow.isShowing()) popupWindow.update(getPopupMenuWidth(), getPopupMenuHeight()); } public void show() { show(0, 0); } public void show(int xoff, int yoff) { this.xoff = xoff; this.yoff = yoff; popupWindow.showAsDropDown(anchor, xoff, yoff); updatePopupSize(); ((View) ReflectUtils.genericGetField(popupWindow, "mBackgroundView")).setClipToOutline(true); } public void dismiss() { popupWindow.dismiss(); } public boolean isShowing() { return popupWindow.isShowing(); } private class PopupMenuAdapter extends ArrayAdapter { public PopupMenuAdapter() { super(context, 0); } @Override public int getCount() { return menu.size(); } @Override public View getView(int index, View view, ViewGroup parent) { MenuItem menuItem = menu.getItem(index); menuItem.setMenuItemListener(menuItem1 -> { itemViews.get(index).updateView(); popupMenuListener.onMenuItemUpdate(menuItem); updatePopupSize(); }); return itemViews.get(index); } } }
3e141cd6bd957a2f914d37e0cf777cc9f4c55f04
2,651
java
Java
src/main/java/com/wechat/friends/service/impl/CommentsServiceImpl.java
liaoke0123/Wechat
844ce3ef3ce532b83c9d0e234f2ac99ebaa58176
[ "Apache-2.0" ]
null
null
null
src/main/java/com/wechat/friends/service/impl/CommentsServiceImpl.java
liaoke0123/Wechat
844ce3ef3ce532b83c9d0e234f2ac99ebaa58176
[ "Apache-2.0" ]
null
null
null
src/main/java/com/wechat/friends/service/impl/CommentsServiceImpl.java
liaoke0123/Wechat
844ce3ef3ce532b83c9d0e234f2ac99ebaa58176
[ "Apache-2.0" ]
null
null
null
31.939759
137
0.79404
8,508
package com.wechat.friends.service.impl; import com.wechat.friends.dao.CommentRepository; import com.wechat.friends.dao.FriendRepository; import com.wechat.friends.dao.UserRepository; import com.wechat.friends.entity.Comment; import com.wechat.friends.entity.Friend; import com.wechat.friends.entity.User; import com.wechat.friends.exception.BusinessException; import com.wechat.friends.fenum.CommentState; import com.wechat.friends.service.CommentsService; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.Optional; @Service("CommentsService") public class CommentsServiceImpl implements CommentsService { @Resource UserRepository userRepository; @Resource FriendRepository friendRepository; @Resource CommentRepository commentRepository; @Override @Transactional(rollbackFor = Exception.class) public Comment createOneCommentByUser (String content, String user_id, String friend_id) throws BusinessException { Comment comment = new Comment(); comment.setCommentState(CommentState.EXIST); comment.setCommentContent(content); commentRepository.saveAndFlush(comment); Optional<User> user=userRepository.findById(user_id); if(!user.isPresent()){ throw new BusinessException("user is not existed",0,404); } comment.setUser(user.get()); Optional<Friend> friend=friendRepository.findById(friend_id); if(!friend.isPresent()){ throw new BusinessException("moment is not existed",0,404); } comment.setFriend(friend.get()); return comment; } @Override public Comment getOneComment (String id, CommentState commentState) throws BusinessException { Optional<Comment> comment=commentRepository.findByIdAndCommentState(id,commentState); if(!comment.isPresent()){ throw new BusinessException("comment is not existed",0,404); } return comment.get(); } @Override public Page<Comment> getAllComments (CommentState commentState, String friend_id, int pageSize, int pageNum) throws BusinessException { Page<Comment> result = commentRepository.findAllByCommentStateAndFriend_Id(commentState, friend_id, PageRequest.of(pageNum,pageSize) ); return result; } @Override @Transactional public void deleteOneComment (String id) throws BusinessException { Optional<Comment> comment=commentRepository.findById(id); if(!comment.isPresent()){ throw new BusinessException("moment is not existed",0,404); } comment.get().setCommentState(CommentState.DELETED); } }
3e141d40852ff1601e303d23d1a8085e47c9cbad
3,262
java
Java
Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IActivityClientProxy.java
l0neman/BlackBox
20e23c1efeebbb03aca611751c103ce5d162591d
[ "Apache-2.0" ]
4
2022-03-10T05:23:56.000Z
2022-03-15T02:53:12.000Z
Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IActivityClientProxy.java
l0neman/BlackBox
20e23c1efeebbb03aca611751c103ce5d162591d
[ "Apache-2.0" ]
null
null
null
Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IActivityClientProxy.java
l0neman/BlackBox
20e23c1efeebbb03aca611751c103ce5d162591d
[ "Apache-2.0" ]
null
null
null
32.62
91
0.677805
8,509
package top.niunaijun.blackbox.fake.service; import android.app.ActivityManager; import android.os.IBinder; import java.lang.reflect.Method; import black.android.app.BRActivityClient; import black.android.util.BRSingleton; import top.niunaijun.blackbox.fake.frameworks.BActivityManager; import top.niunaijun.blackbox.fake.hook.ClassInvocationStub; import top.niunaijun.blackbox.fake.hook.MethodHook; import top.niunaijun.blackbox.fake.hook.ProxyMethod; import top.niunaijun.blackbox.utils.compat.TaskDescriptionCompat; /** * Created by BlackBox on 2022/2/22. */ public class IActivityClientProxy extends ClassInvocationStub { public static final String TAG = "IActivityClientProxy"; private final Object who; public IActivityClientProxy(Object who) { this.who = who; } @Override protected Object getWho() { if (who != null) { return who; } Object instance = BRActivityClient.get().getInstance(); Object singleton = BRActivityClient.get(instance).INTERFACE_SINGLETON(); return BRSingleton.get(singleton).get(); } @Override protected void inject(Object baseInvocation, Object proxyInvocation) { Object instance = BRActivityClient.get().getInstance(); Object singleton = BRActivityClient.get(instance).INTERFACE_SINGLETON(); BRSingleton.get(singleton)._set_mInstance(proxyInvocation); } @Override public boolean isBadEnv() { return false; } @Override public Object getProxyInvocation() { return super.getProxyInvocation(); } @Override public void onlyProxy(boolean o) { super.onlyProxy(o); } @ProxyMethod("finishActivity") public static class FinishActivity extends MethodHook { @Override protected Object hook(Object who, Method method, Object[] args) throws Throwable { IBinder token = (IBinder) args[0]; BActivityManager.get().onFinishActivity(token); return method.invoke(who, args); } } @ProxyMethod("activityResumed") public static class ActivityResumed extends MethodHook { @Override protected Object hook(Object who, Method method, Object[] args) throws Throwable { IBinder token = (IBinder) args[0]; BActivityManager.get().onActivityResumed(token); return method.invoke(who, args); } } @ProxyMethod("activityDestroyed") public static class ActivityDestroyed extends MethodHook { @Override protected Object hook(Object who, Method method, Object[] args) throws Throwable { IBinder token = (IBinder) args[0]; BActivityManager.get().onActivityDestroyed(token); return method.invoke(who, args); } } // for >= Android 12 @ProxyMethod("setTaskDescription") public static class SetTaskDescription extends MethodHook { @Override protected Object hook(Object who, Method method, Object[] args) throws Throwable { ActivityManager.TaskDescription td = (ActivityManager.TaskDescription) args[1]; args[1] = TaskDescriptionCompat.fix(td); return method.invoke(who, args); } } }
3e141d8ef8b9aea1a145e98a6ff02734e6b94525
1,267
java
Java
subprojects/reporting/src/main/java/org/gradle/api/plugins/ReportingBasePlugin.java
stefanleh/gradle
c48e1c7bc796f7f3f6d207b7f635f0783965ab3d
[ "Apache-2.0" ]
158
2015-04-18T23:39:02.000Z
2021-07-01T18:28:29.000Z
subprojects/reporting/src/main/java/org/gradle/api/plugins/ReportingBasePlugin.java
stefanleh/gradle
c48e1c7bc796f7f3f6d207b7f635f0783965ab3d
[ "Apache-2.0" ]
31
2015-04-29T18:52:40.000Z
2020-06-29T19:25:24.000Z
subprojects/reporting/src/main/java/org/gradle/api/plugins/ReportingBasePlugin.java
stefanleh/gradle
c48e1c7bc796f7f3f6d207b7f635f0783965ab3d
[ "Apache-2.0" ]
32
2016-01-05T21:58:24.000Z
2021-06-21T21:56:34.000Z
33.342105
99
0.737964
8,510
/* * Copyright 2009 the original author or authors. * * 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.gradle.api.plugins; import org.gradle.api.Plugin; import org.gradle.api.internal.project.ProjectInternal; import org.gradle.api.reporting.ReportingExtension; /** * <p>A {@link Plugin} which provides the basic skeleton for reporting.</p> * * <p>This plugin adds the following extension objects to the project:</p> * * <ul> * * <li>{@link org.gradle.api.reporting.ReportingExtension}</li> * * </ul> */ public class ReportingBasePlugin implements Plugin<ProjectInternal> { public void apply(ProjectInternal project) { project.getExtensions().create(ReportingExtension.NAME, ReportingExtension.class, project); } }
3e141de5b0c500cc25fa7375d28314e6218dcc87
5,835
java
Java
app/src/main/java/com/team9797/ToMAS/ui/home/market/MarketCategoryFragment.java
rlarla915/app_ToMAS_9797
7c5ef95f485a22c401c6428cd39b19950f4ccc1e
[ "Apache-2.0" ]
1
2021-08-17T13:03:43.000Z
2021-08-17T13:03:43.000Z
app/src/main/java/com/team9797/ToMAS/ui/home/market/MarketCategoryFragment.java
rlarla915/osam_ToMAS
7c5ef95f485a22c401c6428cd39b19950f4ccc1e
[ "Apache-2.0" ]
31
2020-10-18T13:50:07.000Z
2020-10-31T09:19:48.000Z
app/src/main/java/com/team9797/ToMAS/ui/home/market/MarketCategoryFragment.java
rlarla915/osam_ToMAS
7c5ef95f485a22c401c6428cd39b19950f4ccc1e
[ "Apache-2.0" ]
2
2020-10-18T14:59:54.000Z
2020-10-31T07:42:05.000Z
47.827869
279
0.606341
8,511
package com.team9797.ToMAS.ui.home.market; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ListView; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.firebase.firestore.Query; import com.google.firebase.firestore.QueryDocumentSnapshot; import com.google.firebase.firestore.QuerySnapshot; import com.team9797.ToMAS.MainActivity; import com.team9797.ToMAS.R; import com.team9797.ToMAS.ui.home.market.belong_tree.BelongTreeDialog; public class MarketCategoryFragment extends Fragment { MainActivity mainActivity; BelongTreeDialog dialog; FragmentManager fragmentManager; FloatingActionButton fab; String path; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(R.layout.market_category_fragment, container, false); mainActivity = (MainActivity)getActivity(); fragmentManager = getFragmentManager(); path = getArguments().getString("path"); fab = root.findViewById(R.id.fab_market_category); final ListView market_listView = root.findViewById(R.id.market_category_list); // custom listview를 생성해서 만들어야됨. final MarketListAdapter list_adapter = new MarketListAdapter(); market_listView.setAdapter(list_adapter); // firestore에서 market list 불러오기. mainActivity.db.collection(path).orderBy("timestamp", Query.Direction.DESCENDING) .get() .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() { @Override public void onComplete(@NonNull Task<QuerySnapshot> task) { if (task.isSuccessful()) { for (QueryDocumentSnapshot document : task.getResult()) { mainActivity.db.collection(path).document(document.getId()).collection("participants").orderBy("price", Query.Direction.DESCENDING).limit(1).get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() { @Override public void onComplete(@NonNull Task<QuerySnapshot> task) { if (task.isSuccessful()) { if (task.getResult().size() == 0) list_adapter.addItem(document.get("title").toString(), document.get("numpeople", Integer.class), document.get("due_date").toString(), document.get("writer").toString(), 0, document.getId()); for (QueryDocumentSnapshot price_document : task.getResult()) { list_adapter.addItem(document.get("title").toString(), document.get("numpeople", Integer.class), document.get("due_date").toString(), document.get("writer").toString(), price_document.get("price", Integer.class), document.getId()); } list_adapter.notifyDataSetChanged(); } } }); } } else { //Log.d(TAG, "Error getting documents: ", task.getException()); } } }); // click함수에서 key값을 넘겨서 게시판 db에서 가져온 데이터를 넣어야 함. market_listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View v, int position, long id) { FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.addToBackStack(null); Fragment change_fragment = new MarketContent(); // 게시판 id와 path를 받아와서 board_content fragment로 넘긴다. // maybe 이거 구조를 검색해서 바꿔야 할 듯 Bundle args = new Bundle(); args.putString("post_id", list_adapter.listViewItemList.get(position).getId()); args.putString("path", path); change_fragment.setArguments(args); fragmentTransaction.replace(R.id.nav_host_fragment, change_fragment).commit(); } }); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(mainActivity, RegisterMarketContent.class); String[] tmp = path.split("/"); String parent_path = path.substring(0, path.length() - tmp[tmp.length - 1].length()*2 -2); intent.putExtra("path", parent_path); startActivityForResult(intent, 11115); } }); return root; } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if ((requestCode == 11115) && (resultCode == mainActivity.RESULT_OK)) { fragmentManager.beginTransaction().detach(this).attach(this).commit(); } } @Override public void onResume() { super.onResume(); mainActivity.set_title(); } }
3e141de933e0f24c81c1325829f7530532f03d76
1,243
java
Java
src/main/java/model/hospital/resources/Equipment.java
Abishor/Hospitalia
77f855777242488fc93bc4e2426856135f2b4d4c
[ "Apache-2.0" ]
null
null
null
src/main/java/model/hospital/resources/Equipment.java
Abishor/Hospitalia
77f855777242488fc93bc4e2426856135f2b4d4c
[ "Apache-2.0" ]
null
null
null
src/main/java/model/hospital/resources/Equipment.java
Abishor/Hospitalia
77f855777242488fc93bc4e2426856135f2b4d4c
[ "Apache-2.0" ]
null
null
null
22.6
106
0.627514
8,512
package model.hospital.resources; import model.Schedule; import model.transactions.Request; import model.transactions.Response; import org.joda.time.DateTime; import java.util.UUID; public class Equipment<T> implements Resource { private final UUID id; private T data; private final Schedule schedule; public Equipment(final T data) { id = UUID.randomUUID(); this.data = data; schedule = new Schedule(); } public UUID getId() { return id; } public T getData() { return data; } public void setData(final T data) { this.data = data; } boolean getAvailability(final DateTime startTime, final DateTime endTime) { if (endTime.isBefore(startTime.toInstant())) { return false; } else { final Double diffInMin = (double) (endTime.getMillis() - startTime.getMillis()) / (1000 * 60); return schedule.isAvailable(startTime, diffInMin); } } public Response request(final Request request) { return null; } public Response cancel(final Integer identifier) { return null; } public Double getCost(final Request request) { return null; } }
3e141e8a61898cc7c863277974b5c361339a0328
1,369
java
Java
multi-tenancy/schema-isolation/src/main/java/org/camunda/bpm/tutorial/multitenancy/ProcessDefinitionResource.java
amitvineti/camunda-bpm-examples
ea29ac6bb08cd3bdae2c3d97fc680d54aca33b43
[ "Apache-2.0" ]
1
2021-03-30T06:52:56.000Z
2021-03-30T06:52:56.000Z
multi-tenancy/schema-isolation/src/main/java/org/camunda/bpm/tutorial/multitenancy/ProcessDefinitionResource.java
amitvineti/camunda-bpm-examples
ea29ac6bb08cd3bdae2c3d97fc680d54aca33b43
[ "Apache-2.0" ]
null
null
null
multi-tenancy/schema-isolation/src/main/java/org/camunda/bpm/tutorial/multitenancy/ProcessDefinitionResource.java
amitvineti/camunda-bpm-examples
ea29ac6bb08cd3bdae2c3d97fc680d54aca33b43
[ "Apache-2.0" ]
1
2017-09-11T14:30:09.000Z
2017-09-11T14:30:09.000Z
29.76087
83
0.768444
8,513
/* 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.camunda.bpm.tutorial.multitenancy; import java.util.List; import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.repository.ProcessDefinition; /** * @author Thorben Lindhauer * */ @Path("/process-definition") public class ProcessDefinitionResource { @Inject protected ProcessEngine processEngine; @GET @Produces(MediaType.APPLICATION_JSON) public List<ProcessDefinitionDto> getProcessDefinitions() { List<ProcessDefinition> processDefinitions = processEngine.getRepositoryService().createProcessDefinitionQuery().list(); return ProcessDefinitionDto.fromProcessDefinitions(processDefinitions); } }
3e141e8de08b1d6fd2f39227d14cc27bc582bd1d
524,962
java
Java
com/strongdm/api/v1/plumbing/AccountsPlumbing.java
strongdm/strongdm-sdk-java
4515cca7b17b1778f47c4b068862e57a0b605789
[ "Apache-2.0" ]
3
2021-04-29T19:45:36.000Z
2022-03-24T20:25:09.000Z
com/strongdm/api/v1/plumbing/AccountsPlumbing.java
strongdm/strongdm-sdk-java
4515cca7b17b1778f47c4b068862e57a0b605789
[ "Apache-2.0" ]
null
null
null
com/strongdm/api/v1/plumbing/AccountsPlumbing.java
strongdm/strongdm-sdk-java
4515cca7b17b1778f47c4b068862e57a0b605789
[ "Apache-2.0" ]
1
2021-07-27T12:47:26.000Z
2021-07-27T12:47:26.000Z
34.82566
214
0.61517
8,514
// Copyright 2020 StrongDM Inc // // 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. // // Generated by the protocol buffer compiler. DO NOT EDIT! // source: accounts.proto package com.strongdm.api.v1.plumbing; public final class AccountsPlumbing { private AccountsPlumbing() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } public interface AccountCreateRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountCreateRequest) com.google.protobuf.MessageOrBuilder { /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata getMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ boolean hasAccount(); /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount(); /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder(); } /** * <pre> * AccountCreateRequest specifies what kind of Account should be registered in the * organizations fleet. Note that a Account must be either a User or a Service. * </pre> * * Protobuf type {@code v1.AccountCreateRequest} */ public static final class AccountCreateRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountCreateRequest) AccountCreateRequestOrBuilder { private static final long serialVersionUID = 0L; // Use AccountCreateRequest.newBuilder() to construct. private AccountCreateRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountCreateRequest() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountCreateRequest(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountCreateRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder subBuilder = null; if (account_ != null) { subBuilder = account_.toBuilder(); } account_ = input.readMessage(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(account_); account_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata meta_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.getDefaultInstance() : meta_; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int ACCOUNT_FIELD_NUMBER = 2; private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ @java.lang.Override public boolean hasAccount() { return account_ != null; } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { return getAccount(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (account_ != null) { output.writeMessage(2, getAccount()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (account_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getAccount()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (hasAccount() != other.hasAccount()) return false; if (hasAccount()) { if (!getAccount() .equals(other.getAccount())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } if (hasAccount()) { hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; hash = (53 * hash) + getAccount().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountCreateRequest specifies what kind of Account should be registered in the * organizations fleet. Note that a Account must be either a User or a Service. * </pre> * * Protobuf type {@code v1.AccountCreateRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountCreateRequest) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } if (accountBuilder_ == null) { account_ = null; } else { account_ = null; accountBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateRequest_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } if (accountBuilder_ == null) { result.account_ = account_; } else { result.account_ = accountBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (other.hasAccount()) { mergeAccount(other.getAccount()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata, com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadataOrBuilder> metaBuilder_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateRequestMetadata meta = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata, com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata, com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.CreateRequestMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> accountBuilder_; /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ public boolean hasAccount() { return accountBuilder_ != null || account_ != null; } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { if (accountBuilder_ == null) { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } else { return accountBuilder_.getMessage(); } } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (value == null) { throw new NullPointerException(); } account_ = value; onChanged(); } else { accountBuilder_.setMessage(value); } return this; } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccount( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder builderForValue) { if (accountBuilder_ == null) { account_ = builderForValue.build(); onChanged(); } else { accountBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder mergeAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (account_ != null) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.newBuilder(account_).mergeFrom(value).buildPartial(); } else { account_ = value; } onChanged(); } else { accountBuilder_.mergeFrom(value); } return this; } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder clearAccount() { if (accountBuilder_ == null) { account_ = null; onChanged(); } else { account_ = null; accountBuilder_ = null; } return this; } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder getAccountBuilder() { onChanged(); return getAccountFieldBuilder().getBuilder(); } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { if (accountBuilder_ != null) { return accountBuilder_.getMessageOrBuilder(); } else { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } } /** * <pre> * Parameters to define the new Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountFieldBuilder() { if (accountBuilder_ == null) { accountBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder>( getAccount(), getParentForChildren(), isClean()); account_ = null; } return accountBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountCreateRequest) } // @@protoc_insertion_point(class_scope:v1.AccountCreateRequest) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountCreateRequest> PARSER = new com.google.protobuf.AbstractParser<AccountCreateRequest>() { @java.lang.Override public AccountCreateRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountCreateRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountCreateRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountCreateRequest> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountCreateResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountCreateResponse) com.google.protobuf.MessageOrBuilder { /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata getMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ boolean hasAccount(); /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount(); /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder(); /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @return The token. */ java.lang.String getToken(); /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @return The bytes for token. */ com.google.protobuf.ByteString getTokenBytes(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ boolean hasRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder(); } /** * <pre> * AccountCreateResponse reports how the Accounts were created in the system. * </pre> * * Protobuf type {@code v1.AccountCreateResponse} */ public static final class AccountCreateResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountCreateResponse) AccountCreateResponseOrBuilder { private static final long serialVersionUID = 0L; // Use AccountCreateResponse.newBuilder() to construct. private AccountCreateResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountCreateResponse() { token_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountCreateResponse(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountCreateResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder subBuilder = null; if (account_ != null) { subBuilder = account_.toBuilder(); } account_ = input.readMessage(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(account_); account_ = subBuilder.buildPartial(); } break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); token_ = s; break; } case 34: { com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder subBuilder = null; if (rateLimit_ != null) { subBuilder = rateLimit_.toBuilder(); } rateLimit_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(rateLimit_); rateLimit_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata meta_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.getDefaultInstance() : meta_; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int ACCOUNT_FIELD_NUMBER = 2; private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ @java.lang.Override public boolean hasAccount() { return account_ != null; } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { return getAccount(); } public static final int TOKEN_FIELD_NUMBER = 3; private volatile java.lang.Object token_; /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @return The token. */ @java.lang.Override public java.lang.String getToken() { java.lang.Object ref = token_; 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(); token_ = s; return s; } } /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @return The bytes for token. */ @java.lang.Override public com.google.protobuf.ByteString getTokenBytes() { java.lang.Object ref = token_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); token_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int RATE_LIMIT_FIELD_NUMBER = 4; private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ @java.lang.Override public boolean hasRateLimit() { return rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { return getRateLimit(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (account_ != null) { output.writeMessage(2, getAccount()); } if (!getTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, token_); } if (rateLimit_ != null) { output.writeMessage(4, getRateLimit()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (account_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getAccount()); } if (!getTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, token_); } if (rateLimit_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, getRateLimit()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (hasAccount() != other.hasAccount()) return false; if (hasAccount()) { if (!getAccount() .equals(other.getAccount())) return false; } if (!getToken() .equals(other.getToken())) return false; if (hasRateLimit() != other.hasRateLimit()) return false; if (hasRateLimit()) { if (!getRateLimit() .equals(other.getRateLimit())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } if (hasAccount()) { hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; hash = (53 * hash) + getAccount().hashCode(); } hash = (37 * hash) + TOKEN_FIELD_NUMBER; hash = (53 * hash) + getToken().hashCode(); if (hasRateLimit()) { hash = (37 * hash) + RATE_LIMIT_FIELD_NUMBER; hash = (53 * hash) + getRateLimit().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountCreateResponse reports how the Accounts were created in the system. * </pre> * * Protobuf type {@code v1.AccountCreateResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountCreateResponse) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } if (accountBuilder_ == null) { account_ = null; } else { account_ = null; accountBuilder_ = null; } token_ = ""; if (rateLimitBuilder_ == null) { rateLimit_ = null; } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountCreateResponse_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } if (accountBuilder_ == null) { result.account_ = account_; } else { result.account_ = accountBuilder_.build(); } result.token_ = token_; if (rateLimitBuilder_ == null) { result.rateLimit_ = rateLimit_; } else { result.rateLimit_ = rateLimitBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (other.hasAccount()) { mergeAccount(other.getAccount()); } if (!other.getToken().isEmpty()) { token_ = other.token_; onChanged(); } if (other.hasRateLimit()) { mergeRateLimit(other.getRateLimit()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata, com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadataOrBuilder> metaBuilder_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.CreateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata, com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata, com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.CreateResponseMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> accountBuilder_; /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ public boolean hasAccount() { return accountBuilder_ != null || account_ != null; } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { if (accountBuilder_ == null) { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } else { return accountBuilder_.getMessage(); } } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (value == null) { throw new NullPointerException(); } account_ = value; onChanged(); } else { accountBuilder_.setMessage(value); } return this; } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccount( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder builderForValue) { if (accountBuilder_ == null) { account_ = builderForValue.build(); onChanged(); } else { accountBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder mergeAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (account_ != null) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.newBuilder(account_).mergeFrom(value).buildPartial(); } else { account_ = value; } onChanged(); } else { accountBuilder_.mergeFrom(value); } return this; } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder clearAccount() { if (accountBuilder_ == null) { account_ = null; onChanged(); } else { account_ = null; accountBuilder_ = null; } return this; } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder getAccountBuilder() { onChanged(); return getAccountFieldBuilder().getBuilder(); } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { if (accountBuilder_ != null) { return accountBuilder_.getMessageOrBuilder(); } else { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } } /** * <pre> * The created Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountFieldBuilder() { if (accountBuilder_ == null) { accountBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder>( getAccount(), getParentForChildren(), isClean()); account_ = null; } return accountBuilder_; } private java.lang.Object token_ = ""; /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @return The token. */ public java.lang.String getToken() { java.lang.Object ref = token_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); token_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @return The bytes for token. */ public com.google.protobuf.ByteString getTokenBytes() { java.lang.Object ref = token_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); token_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @param value The token to set. * @return This builder for chaining. */ public Builder setToken( java.lang.String value) { if (value == null) { throw new NullPointerException(); } token_ = value; onChanged(); return this; } /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearToken() { token_ = getDefaultInstance().getToken(); onChanged(); return this; } /** * <pre> * The auth token generated for the Account. The Account will use this token to * authenticate with the strongDM API. * </pre> * * <code>string token = 3 [(.v1.field_options) = { ... }</code> * @param value The bytes for token to set. * @return This builder for chaining. */ public Builder setTokenBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); token_ = value; onChanged(); return this; } private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> rateLimitBuilder_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ public boolean hasRateLimit() { return rateLimitBuilder_ != null || rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { if (rateLimitBuilder_ == null) { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } else { return rateLimitBuilder_.getMessage(); } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (value == null) { throw new NullPointerException(); } rateLimit_ = value; onChanged(); } else { rateLimitBuilder_.setMessage(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit( com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder builderForValue) { if (rateLimitBuilder_ == null) { rateLimit_ = builderForValue.build(); onChanged(); } else { rateLimitBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ public Builder mergeRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (rateLimit_ != null) { rateLimit_ = com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.newBuilder(rateLimit_).mergeFrom(value).buildPartial(); } else { rateLimit_ = value; } onChanged(); } else { rateLimitBuilder_.mergeFrom(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ public Builder clearRateLimit() { if (rateLimitBuilder_ == null) { rateLimit_ = null; onChanged(); } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder getRateLimitBuilder() { onChanged(); return getRateLimitFieldBuilder().getBuilder(); } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { if (rateLimitBuilder_ != null) { return rateLimitBuilder_.getMessageOrBuilder(); } else { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 4 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> getRateLimitFieldBuilder() { if (rateLimitBuilder_ == null) { rateLimitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder>( getRateLimit(), getParentForChildren(), isClean()); rateLimit_ = null; } return rateLimitBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountCreateResponse) } // @@protoc_insertion_point(class_scope:v1.AccountCreateResponse) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountCreateResponse> PARSER = new com.google.protobuf.AbstractParser<AccountCreateResponse>() { @java.lang.Override public AccountCreateResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountCreateResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountCreateResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountCreateResponse> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountCreateResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountGetRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountGetRequest) com.google.protobuf.MessageOrBuilder { /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata getMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ com.strongdm.api.v1.plumbing.Spec.GetRequestMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The id. */ java.lang.String getId(); /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ com.google.protobuf.ByteString getIdBytes(); } /** * <pre> * AccountGetRequest specifies which Account to retrieve. * </pre> * * Protobuf type {@code v1.AccountGetRequest} */ public static final class AccountGetRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountGetRequest) AccountGetRequestOrBuilder { private static final long serialVersionUID = 0L; // Use AccountGetRequest.newBuilder() to construct. private AccountGetRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountGetRequest() { id_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountGetRequest(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountGetRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); id_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata meta_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.getDefaultInstance() : meta_; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.GetRequestMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int ID_FIELD_NUMBER = 2; private volatile java.lang.Object id_; /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The id. */ @java.lang.Override 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(); id_ = s; return s; } } /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ @java.lang.Override 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; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (!getIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (!getIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (!getId() .equals(other.getId())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountGetRequest specifies which Account to retrieve. * </pre> * * Protobuf type {@code v1.AccountGetRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountGetRequest) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } id_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetRequest_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } result.id_ = id_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (!other.getId().isEmpty()) { id_ = other.id_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata, com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.GetRequestMetadataOrBuilder> metaBuilder_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.GetRequestMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetRequestMetadata meta = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata, com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.GetRequestMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata, com.strongdm.api.v1.plumbing.Spec.GetRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.GetRequestMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private java.lang.Object id_ = ""; /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The id. */ public java.lang.String getId() { java.lang.Object ref = id_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); id_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ 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; } } /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @param value The id to set. * @return This builder for chaining. */ public Builder setId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } id_ = value; onChanged(); return this; } /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearId() { id_ = getDefaultInstance().getId(); onChanged(); return this; } /** * <pre> * The unique identifier of the Account to retrieve. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @param value The bytes for id to set. * @return This builder for chaining. */ public Builder setIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); id_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountGetRequest) } // @@protoc_insertion_point(class_scope:v1.AccountGetRequest) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountGetRequest> PARSER = new com.google.protobuf.AbstractParser<AccountGetRequest>() { @java.lang.Override public AccountGetRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountGetRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountGetRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountGetRequest> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountGetResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountGetResponse) com.google.protobuf.MessageOrBuilder { /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata getMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.GetResponseMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ boolean hasAccount(); /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount(); /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ boolean hasRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder(); } /** * <pre> * AccountGetResponse returns a requested Account. * </pre> * * Protobuf type {@code v1.AccountGetResponse} */ public static final class AccountGetResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountGetResponse) AccountGetResponseOrBuilder { private static final long serialVersionUID = 0L; // Use AccountGetResponse.newBuilder() to construct. private AccountGetResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountGetResponse() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountGetResponse(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountGetResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder subBuilder = null; if (account_ != null) { subBuilder = account_.toBuilder(); } account_ = input.readMessage(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(account_); account_ = subBuilder.buildPartial(); } break; } case 26: { com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder subBuilder = null; if (rateLimit_ != null) { subBuilder = rateLimit_.toBuilder(); } rateLimit_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(rateLimit_); rateLimit_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata meta_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.getDefaultInstance() : meta_; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.GetResponseMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int ACCOUNT_FIELD_NUMBER = 2; private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ @java.lang.Override public boolean hasAccount() { return account_ != null; } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { return getAccount(); } public static final int RATE_LIMIT_FIELD_NUMBER = 3; private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ @java.lang.Override public boolean hasRateLimit() { return rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { return getRateLimit(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (account_ != null) { output.writeMessage(2, getAccount()); } if (rateLimit_ != null) { output.writeMessage(3, getRateLimit()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (account_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getAccount()); } if (rateLimit_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getRateLimit()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (hasAccount() != other.hasAccount()) return false; if (hasAccount()) { if (!getAccount() .equals(other.getAccount())) return false; } if (hasRateLimit() != other.hasRateLimit()) return false; if (hasRateLimit()) { if (!getRateLimit() .equals(other.getRateLimit())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } if (hasAccount()) { hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; hash = (53 * hash) + getAccount().hashCode(); } if (hasRateLimit()) { hash = (37 * hash) + RATE_LIMIT_FIELD_NUMBER; hash = (53 * hash) + getRateLimit().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountGetResponse returns a requested Account. * </pre> * * Protobuf type {@code v1.AccountGetResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountGetResponse) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } if (accountBuilder_ == null) { account_ = null; } else { account_ = null; accountBuilder_ = null; } if (rateLimitBuilder_ == null) { rateLimit_ = null; } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountGetResponse_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } if (accountBuilder_ == null) { result.account_ = account_; } else { result.account_ = accountBuilder_.build(); } if (rateLimitBuilder_ == null) { result.rateLimit_ = rateLimit_; } else { result.rateLimit_ = rateLimitBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (other.hasAccount()) { mergeAccount(other.getAccount()); } if (other.hasRateLimit()) { mergeRateLimit(other.getRateLimit()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata, com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.GetResponseMetadataOrBuilder> metaBuilder_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.GetResponseMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.GetResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata, com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.GetResponseMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata, com.strongdm.api.v1.plumbing.Spec.GetResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.GetResponseMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> accountBuilder_; /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ public boolean hasAccount() { return accountBuilder_ != null || account_ != null; } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { if (accountBuilder_ == null) { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } else { return accountBuilder_.getMessage(); } } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (value == null) { throw new NullPointerException(); } account_ = value; onChanged(); } else { accountBuilder_.setMessage(value); } return this; } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccount( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder builderForValue) { if (accountBuilder_ == null) { account_ = builderForValue.build(); onChanged(); } else { accountBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder mergeAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (account_ != null) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.newBuilder(account_).mergeFrom(value).buildPartial(); } else { account_ = value; } onChanged(); } else { accountBuilder_.mergeFrom(value); } return this; } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder clearAccount() { if (accountBuilder_ == null) { account_ = null; onChanged(); } else { account_ = null; accountBuilder_ = null; } return this; } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder getAccountBuilder() { onChanged(); return getAccountFieldBuilder().getBuilder(); } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { if (accountBuilder_ != null) { return accountBuilder_.getMessageOrBuilder(); } else { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } } /** * <pre> * The requested Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountFieldBuilder() { if (accountBuilder_ == null) { accountBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder>( getAccount(), getParentForChildren(), isClean()); account_ = null; } return accountBuilder_; } private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> rateLimitBuilder_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ public boolean hasRateLimit() { return rateLimitBuilder_ != null || rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { if (rateLimitBuilder_ == null) { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } else { return rateLimitBuilder_.getMessage(); } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (value == null) { throw new NullPointerException(); } rateLimit_ = value; onChanged(); } else { rateLimitBuilder_.setMessage(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit( com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder builderForValue) { if (rateLimitBuilder_ == null) { rateLimit_ = builderForValue.build(); onChanged(); } else { rateLimitBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder mergeRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (rateLimit_ != null) { rateLimit_ = com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.newBuilder(rateLimit_).mergeFrom(value).buildPartial(); } else { rateLimit_ = value; } onChanged(); } else { rateLimitBuilder_.mergeFrom(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder clearRateLimit() { if (rateLimitBuilder_ == null) { rateLimit_ = null; onChanged(); } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder getRateLimitBuilder() { onChanged(); return getRateLimitFieldBuilder().getBuilder(); } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { if (rateLimitBuilder_ != null) { return rateLimitBuilder_.getMessageOrBuilder(); } else { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> getRateLimitFieldBuilder() { if (rateLimitBuilder_ == null) { rateLimitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder>( getRateLimit(), getParentForChildren(), isClean()); rateLimit_ = null; } return rateLimitBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountGetResponse) } // @@protoc_insertion_point(class_scope:v1.AccountGetResponse) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountGetResponse> PARSER = new com.google.protobuf.AbstractParser<AccountGetResponse>() { @java.lang.Override public AccountGetResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountGetResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountGetResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountGetResponse> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountGetResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountUpdateRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountUpdateRequest) com.google.protobuf.MessageOrBuilder { /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata getMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @return The id. */ java.lang.String getId(); /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @return The bytes for id. */ com.google.protobuf.ByteString getIdBytes(); /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ boolean hasAccount(); /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> * @return The account. */ com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount(); /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder(); } /** * <pre> * AccountUpdateRequest identifies a Account by ID and provides fields to update on * that Account record. * </pre> * * Protobuf type {@code v1.AccountUpdateRequest} */ public static final class AccountUpdateRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountUpdateRequest) AccountUpdateRequestOrBuilder { private static final long serialVersionUID = 0L; // Use AccountUpdateRequest.newBuilder() to construct. private AccountUpdateRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountUpdateRequest() { id_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountUpdateRequest(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountUpdateRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); id_ = s; break; } case 26: { com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder subBuilder = null; if (account_ != null) { subBuilder = account_.toBuilder(); } account_ = input.readMessage(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(account_); account_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata meta_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.getDefaultInstance() : meta_; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int ID_FIELD_NUMBER = 2; private volatile java.lang.Object id_; /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @return The id. */ @java.lang.Override 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(); id_ = s; return s; } } /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @return The bytes for id. */ @java.lang.Override 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; } } public static final int ACCOUNT_FIELD_NUMBER = 3; private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ @java.lang.Override public boolean hasAccount() { return account_ != null; } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> * @return The account. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { return getAccount(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (!getIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); } if (account_ != null) { output.writeMessage(3, getAccount()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (!getIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); } if (account_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getAccount()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (!getId() .equals(other.getId())) return false; if (hasAccount() != other.hasAccount()) return false; if (hasAccount()) { if (!getAccount() .equals(other.getAccount())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId().hashCode(); if (hasAccount()) { hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; hash = (53 * hash) + getAccount().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountUpdateRequest identifies a Account by ID and provides fields to update on * that Account record. * </pre> * * Protobuf type {@code v1.AccountUpdateRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountUpdateRequest) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } id_ = ""; if (accountBuilder_ == null) { account_ = null; } else { account_ = null; accountBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateRequest_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } result.id_ = id_; if (accountBuilder_ == null) { result.account_ = account_; } else { result.account_ = accountBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (!other.getId().isEmpty()) { id_ = other.id_; onChanged(); } if (other.hasAccount()) { mergeAccount(other.getAccount()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata, com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadataOrBuilder> metaBuilder_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateRequestMetadata meta = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata, com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata, com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.UpdateRequestMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private java.lang.Object id_ = ""; /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @return The id. */ public java.lang.String getId() { java.lang.Object ref = id_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); id_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @return The bytes for id. */ 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; } } /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @param value The id to set. * @return This builder for chaining. */ public Builder setId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } id_ = value; onChanged(); return this; } /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @return This builder for chaining. */ public Builder clearId() { id_ = getDefaultInstance().getId(); onChanged(); return this; } /** * <pre> * The unique identifier of the Account to update. If an ID is already * specified in the `account` field, this field is not required. If an ID is * specified in both places, they must match. * </pre> * * <code>string id = 2;</code> * @param value The bytes for id to set. * @return This builder for chaining. */ public Builder setIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); id_ = value; onChanged(); return this; } private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> accountBuilder_; /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ public boolean hasAccount() { return accountBuilder_ != null || account_ != null; } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> * @return The account. */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { if (accountBuilder_ == null) { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } else { return accountBuilder_.getMessage(); } } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ public Builder setAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (value == null) { throw new NullPointerException(); } account_ = value; onChanged(); } else { accountBuilder_.setMessage(value); } return this; } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ public Builder setAccount( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder builderForValue) { if (accountBuilder_ == null) { account_ = builderForValue.build(); onChanged(); } else { accountBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ public Builder mergeAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (account_ != null) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.newBuilder(account_).mergeFrom(value).buildPartial(); } else { account_ = value; } onChanged(); } else { accountBuilder_.mergeFrom(value); } return this; } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ public Builder clearAccount() { if (accountBuilder_ == null) { account_ = null; onChanged(); } else { account_ = null; accountBuilder_ = null; } return this; } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder getAccountBuilder() { onChanged(); return getAccountFieldBuilder().getBuilder(); } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { if (accountBuilder_ != null) { return accountBuilder_.getMessageOrBuilder(); } else { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } } /** * <pre> * Parameters to overwrite the specified Account. * </pre> * * <code>.v1.Account account = 3 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountFieldBuilder() { if (accountBuilder_ == null) { accountBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder>( getAccount(), getParentForChildren(), isClean()); account_ = null; } return accountBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountUpdateRequest) } // @@protoc_insertion_point(class_scope:v1.AccountUpdateRequest) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountUpdateRequest> PARSER = new com.google.protobuf.AbstractParser<AccountUpdateRequest>() { @java.lang.Override public AccountUpdateRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountUpdateRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountUpdateRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountUpdateRequest> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountUpdateResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountUpdateResponse) com.google.protobuf.MessageOrBuilder { /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata getMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ boolean hasAccount(); /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount(); /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ boolean hasRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder(); } /** * <pre> * AccountUpdateResponse returns the fields of a Account after it has been updated by * a AccountUpdateRequest. * </pre> * * Protobuf type {@code v1.AccountUpdateResponse} */ public static final class AccountUpdateResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountUpdateResponse) AccountUpdateResponseOrBuilder { private static final long serialVersionUID = 0L; // Use AccountUpdateResponse.newBuilder() to construct. private AccountUpdateResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountUpdateResponse() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountUpdateResponse(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountUpdateResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder subBuilder = null; if (account_ != null) { subBuilder = account_.toBuilder(); } account_ = input.readMessage(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(account_); account_ = subBuilder.buildPartial(); } break; } case 26: { com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder subBuilder = null; if (rateLimit_ != null) { subBuilder = rateLimit_.toBuilder(); } rateLimit_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(rateLimit_); rateLimit_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata meta_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.getDefaultInstance() : meta_; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int ACCOUNT_FIELD_NUMBER = 2; private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ @java.lang.Override public boolean hasAccount() { return account_ != null; } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { return getAccount(); } public static final int RATE_LIMIT_FIELD_NUMBER = 3; private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ @java.lang.Override public boolean hasRateLimit() { return rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { return getRateLimit(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (account_ != null) { output.writeMessage(2, getAccount()); } if (rateLimit_ != null) { output.writeMessage(3, getRateLimit()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (account_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getAccount()); } if (rateLimit_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getRateLimit()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (hasAccount() != other.hasAccount()) return false; if (hasAccount()) { if (!getAccount() .equals(other.getAccount())) return false; } if (hasRateLimit() != other.hasRateLimit()) return false; if (hasRateLimit()) { if (!getRateLimit() .equals(other.getRateLimit())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } if (hasAccount()) { hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; hash = (53 * hash) + getAccount().hashCode(); } if (hasRateLimit()) { hash = (37 * hash) + RATE_LIMIT_FIELD_NUMBER; hash = (53 * hash) + getRateLimit().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountUpdateResponse returns the fields of a Account after it has been updated by * a AccountUpdateRequest. * </pre> * * Protobuf type {@code v1.AccountUpdateResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountUpdateResponse) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } if (accountBuilder_ == null) { account_ = null; } else { account_ = null; accountBuilder_ = null; } if (rateLimitBuilder_ == null) { rateLimit_ = null; } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountUpdateResponse_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } if (accountBuilder_ == null) { result.account_ = account_; } else { result.account_ = accountBuilder_.build(); } if (rateLimitBuilder_ == null) { result.rateLimit_ = rateLimit_; } else { result.rateLimit_ = rateLimitBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (other.hasAccount()) { mergeAccount(other.getAccount()); } if (other.hasRateLimit()) { mergeRateLimit(other.getRateLimit()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata, com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadataOrBuilder> metaBuilder_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.UpdateResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata, com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata, com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.UpdateResponseMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private com.strongdm.api.v1.plumbing.AccountsPlumbing.Account account_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> accountBuilder_; /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return Whether the account field is set. */ public boolean hasAccount() { return accountBuilder_ != null || account_ != null; } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> * @return The account. */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccount() { if (accountBuilder_ == null) { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } else { return accountBuilder_.getMessage(); } } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (value == null) { throw new NullPointerException(); } account_ = value; onChanged(); } else { accountBuilder_.setMessage(value); } return this; } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccount( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder builderForValue) { if (accountBuilder_ == null) { account_ = builderForValue.build(); onChanged(); } else { accountBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder mergeAccount(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountBuilder_ == null) { if (account_ != null) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.newBuilder(account_).mergeFrom(value).buildPartial(); } else { account_ = value; } onChanged(); } else { accountBuilder_.mergeFrom(value); } return this; } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public Builder clearAccount() { if (accountBuilder_ == null) { account_ = null; onChanged(); } else { account_ = null; accountBuilder_ = null; } return this; } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder getAccountBuilder() { onChanged(); return getAccountFieldBuilder().getBuilder(); } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountOrBuilder() { if (accountBuilder_ != null) { return accountBuilder_.getMessageOrBuilder(); } else { return account_ == null ? com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance() : account_; } } /** * <pre> * The updated Account. * </pre> * * <code>.v1.Account account = 2 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountFieldBuilder() { if (accountBuilder_ == null) { accountBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder>( getAccount(), getParentForChildren(), isClean()); account_ = null; } return accountBuilder_; } private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> rateLimitBuilder_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ public boolean hasRateLimit() { return rateLimitBuilder_ != null || rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { if (rateLimitBuilder_ == null) { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } else { return rateLimitBuilder_.getMessage(); } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (value == null) { throw new NullPointerException(); } rateLimit_ = value; onChanged(); } else { rateLimitBuilder_.setMessage(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit( com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder builderForValue) { if (rateLimitBuilder_ == null) { rateLimit_ = builderForValue.build(); onChanged(); } else { rateLimitBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder mergeRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (rateLimit_ != null) { rateLimit_ = com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.newBuilder(rateLimit_).mergeFrom(value).buildPartial(); } else { rateLimit_ = value; } onChanged(); } else { rateLimitBuilder_.mergeFrom(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder clearRateLimit() { if (rateLimitBuilder_ == null) { rateLimit_ = null; onChanged(); } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder getRateLimitBuilder() { onChanged(); return getRateLimitFieldBuilder().getBuilder(); } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { if (rateLimitBuilder_ != null) { return rateLimitBuilder_.getMessageOrBuilder(); } else { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> getRateLimitFieldBuilder() { if (rateLimitBuilder_ == null) { rateLimitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder>( getRateLimit(), getParentForChildren(), isClean()); rateLimit_ = null; } return rateLimitBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountUpdateResponse) } // @@protoc_insertion_point(class_scope:v1.AccountUpdateResponse) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountUpdateResponse> PARSER = new com.google.protobuf.AbstractParser<AccountUpdateResponse>() { @java.lang.Override public AccountUpdateResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountUpdateResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountUpdateResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountUpdateResponse> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountUpdateResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountDeleteRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountDeleteRequest) com.google.protobuf.MessageOrBuilder { /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata getMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The id. */ java.lang.String getId(); /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ com.google.protobuf.ByteString getIdBytes(); } /** * <pre> * AccountDeleteRequest identifies a Account by ID to delete. * </pre> * * Protobuf type {@code v1.AccountDeleteRequest} */ public static final class AccountDeleteRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountDeleteRequest) AccountDeleteRequestOrBuilder { private static final long serialVersionUID = 0L; // Use AccountDeleteRequest.newBuilder() to construct. private AccountDeleteRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountDeleteRequest() { id_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountDeleteRequest(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountDeleteRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); id_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata meta_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.getDefaultInstance() : meta_; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int ID_FIELD_NUMBER = 2; private volatile java.lang.Object id_; /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The id. */ @java.lang.Override 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(); id_ = s; return s; } } /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ @java.lang.Override 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; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (!getIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (!getIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (!getId() .equals(other.getId())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountDeleteRequest identifies a Account by ID to delete. * </pre> * * Protobuf type {@code v1.AccountDeleteRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountDeleteRequest) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } id_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteRequest_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } result.id_ = id_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (!other.getId().isEmpty()) { id_ = other.id_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata, com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadataOrBuilder> metaBuilder_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteRequestMetadata meta = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata, com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata, com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.DeleteRequestMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private java.lang.Object id_ = ""; /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The id. */ public java.lang.String getId() { java.lang.Object ref = id_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); id_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ 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; } } /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @param value The id to set. * @return This builder for chaining. */ public Builder setId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } id_ = value; onChanged(); return this; } /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearId() { id_ = getDefaultInstance().getId(); onChanged(); return this; } /** * <pre> * The unique identifier of the Account to delete. * </pre> * * <code>string id = 2 [(.v1.field_options) = { ... }</code> * @param value The bytes for id to set. * @return This builder for chaining. */ public Builder setIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); id_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountDeleteRequest) } // @@protoc_insertion_point(class_scope:v1.AccountDeleteRequest) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountDeleteRequest> PARSER = new com.google.protobuf.AbstractParser<AccountDeleteRequest>() { @java.lang.Override public AccountDeleteRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountDeleteRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountDeleteRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountDeleteRequest> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountDeleteResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountDeleteResponse) com.google.protobuf.MessageOrBuilder { /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata getMeta(); /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ boolean hasRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder(); } /** * <pre> * AccountDeleteResponse returns information about a Account that was deleted. * </pre> * * Protobuf type {@code v1.AccountDeleteResponse} */ public static final class AccountDeleteResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountDeleteResponse) AccountDeleteResponseOrBuilder { private static final long serialVersionUID = 0L; // Use AccountDeleteResponse.newBuilder() to construct. private AccountDeleteResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountDeleteResponse() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountDeleteResponse(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountDeleteResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder subBuilder = null; if (rateLimit_ != null) { subBuilder = rateLimit_.toBuilder(); } rateLimit_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(rateLimit_); rateLimit_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata meta_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.getDefaultInstance() : meta_; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int RATE_LIMIT_FIELD_NUMBER = 2; private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ @java.lang.Override public boolean hasRateLimit() { return rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { return getRateLimit(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (rateLimit_ != null) { output.writeMessage(2, getRateLimit()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (rateLimit_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getRateLimit()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (hasRateLimit() != other.hasRateLimit()) return false; if (hasRateLimit()) { if (!getRateLimit() .equals(other.getRateLimit())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } if (hasRateLimit()) { hash = (37 * hash) + RATE_LIMIT_FIELD_NUMBER; hash = (53 * hash) + getRateLimit().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountDeleteResponse returns information about a Account that was deleted. * </pre> * * Protobuf type {@code v1.AccountDeleteResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountDeleteResponse) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } if (rateLimitBuilder_ == null) { rateLimit_ = null; } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountDeleteResponse_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } if (rateLimitBuilder_ == null) { result.rateLimit_ = rateLimit_; } else { result.rateLimit_ = rateLimitBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (other.hasRateLimit()) { mergeRateLimit(other.getRateLimit()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata, com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadataOrBuilder> metaBuilder_; /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Reserved for future use. * </pre> * * <code>.v1.DeleteResponseMetadata meta = 1 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata, com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata, com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.DeleteResponseMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> rateLimitBuilder_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ public boolean hasRateLimit() { return rateLimitBuilder_ != null || rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { if (rateLimitBuilder_ == null) { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } else { return rateLimitBuilder_.getMessage(); } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (value == null) { throw new NullPointerException(); } rateLimit_ = value; onChanged(); } else { rateLimitBuilder_.setMessage(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit( com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder builderForValue) { if (rateLimitBuilder_ == null) { rateLimit_ = builderForValue.build(); onChanged(); } else { rateLimitBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ public Builder mergeRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (rateLimit_ != null) { rateLimit_ = com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.newBuilder(rateLimit_).mergeFrom(value).buildPartial(); } else { rateLimit_ = value; } onChanged(); } else { rateLimitBuilder_.mergeFrom(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ public Builder clearRateLimit() { if (rateLimitBuilder_ == null) { rateLimit_ = null; onChanged(); } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder getRateLimitBuilder() { onChanged(); return getRateLimitFieldBuilder().getBuilder(); } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { if (rateLimitBuilder_ != null) { return rateLimitBuilder_.getMessageOrBuilder(); } else { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 2 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> getRateLimitFieldBuilder() { if (rateLimitBuilder_ == null) { rateLimitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder>( getRateLimit(), getParentForChildren(), isClean()); rateLimit_ = null; } return rateLimitBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountDeleteResponse) } // @@protoc_insertion_point(class_scope:v1.AccountDeleteResponse) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountDeleteResponse> PARSER = new com.google.protobuf.AbstractParser<AccountDeleteResponse>() { @java.lang.Override public AccountDeleteResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountDeleteResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountDeleteResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountDeleteResponse> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountDeleteResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountListRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountListRequest) com.google.protobuf.MessageOrBuilder { /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata getMeta(); /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ com.strongdm.api.v1.plumbing.Spec.ListRequestMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @return The filter. */ java.lang.String getFilter(); /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for filter. */ com.google.protobuf.ByteString getFilterBytes(); } /** * <pre> * AccountListRequest specifies criteria for retrieving a list of Accounts. * </pre> * * Protobuf type {@code v1.AccountListRequest} */ public static final class AccountListRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountListRequest) AccountListRequestOrBuilder { private static final long serialVersionUID = 0L; // Use AccountListRequest.newBuilder() to construct. private AccountListRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountListRequest() { filter_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountListRequest(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountListRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); filter_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata meta_; /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.getDefaultInstance() : meta_; } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.ListRequestMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int FILTER_FIELD_NUMBER = 2; private volatile java.lang.Object filter_; /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @return The filter. */ @java.lang.Override public java.lang.String getFilter() { java.lang.Object ref = filter_; 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(); filter_ = s; return s; } } /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for filter. */ @java.lang.Override public com.google.protobuf.ByteString getFilterBytes() { java.lang.Object ref = filter_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); filter_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } if (!getFilterBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } if (!getFilterBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (!getFilter() .equals(other.getFilter())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } hash = (37 * hash) + FILTER_FIELD_NUMBER; hash = (53 * hash) + getFilter().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountListRequest specifies criteria for retrieving a list of Accounts. * </pre> * * Protobuf type {@code v1.AccountListRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountListRequest) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } filter_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListRequest_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest(this); if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } result.filter_ = filter_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (!other.getFilter().isEmpty()) { filter_ = other.filter_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata, com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.ListRequestMetadataOrBuilder> metaBuilder_; /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.ListRequestMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Paging parameters for the query. * </pre> * * <code>.v1.ListRequestMetadata meta = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata, com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.ListRequestMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata, com.strongdm.api.v1.plumbing.Spec.ListRequestMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.ListRequestMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private java.lang.Object filter_ = ""; /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @return The filter. */ public java.lang.String getFilter() { java.lang.Object ref = filter_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); filter_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for filter. */ public com.google.protobuf.ByteString getFilterBytes() { java.lang.Object ref = filter_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); filter_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @param value The filter to set. * @return This builder for chaining. */ public Builder setFilter( java.lang.String value) { if (value == null) { throw new NullPointerException(); } filter_ = value; onChanged(); return this; } /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearFilter() { filter_ = getDefaultInstance().getFilter(); onChanged(); return this; } /** * <pre> * A human-readable filter query string. * </pre> * * <code>string filter = 2 [(.v1.field_options) = { ... }</code> * @param value The bytes for filter to set. * @return This builder for chaining. */ public Builder setFilterBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); filter_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountListRequest) } // @@protoc_insertion_point(class_scope:v1.AccountListRequest) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountListRequest> PARSER = new com.google.protobuf.AbstractParser<AccountListRequest>() { @java.lang.Override public AccountListRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountListRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountListRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountListRequest> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountListResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.AccountListResponse) com.google.protobuf.MessageOrBuilder { /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> * @return Whether the meta field is set. */ boolean hasMeta(); /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> * @return The meta. */ com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata getMeta(); /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ com.strongdm.api.v1.plumbing.Spec.ListResponseMetadataOrBuilder getMetaOrBuilder(); /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ java.util.List<com.strongdm.api.v1.plumbing.AccountsPlumbing.Account> getAccountsList(); /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccounts(int index); /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ int getAccountsCount(); /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ java.util.List<? extends com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountsOrBuilderList(); /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountsOrBuilder( int index); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ boolean hasRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit(); /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder(); } /** * <pre> * AccountListResponse returns a list of Accounts that meet the criteria of a * AccountListRequest. * </pre> * * Protobuf type {@code v1.AccountListResponse} */ public static final class AccountListResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.AccountListResponse) AccountListResponseOrBuilder { private static final long serialVersionUID = 0L; // Use AccountListResponse.newBuilder() to construct. private AccountListResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AccountListResponse() { accounts_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AccountListResponse(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AccountListResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.Builder subBuilder = null; if (meta_ != null) { subBuilder = meta_.toBuilder(); } meta_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(meta_); meta_ = subBuilder.buildPartial(); } break; } case 18: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { accounts_ = new java.util.ArrayList<com.strongdm.api.v1.plumbing.AccountsPlumbing.Account>(); mutable_bitField0_ |= 0x00000001; } accounts_.add( input.readMessage(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.parser(), extensionRegistry)); break; } case 26: { com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder subBuilder = null; if (rateLimit_ != null) { subBuilder = rateLimit_.toBuilder(); } rateLimit_ = input.readMessage(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(rateLimit_); rateLimit_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { accounts_ = java.util.Collections.unmodifiableList(accounts_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse.Builder.class); } public static final int META_FIELD_NUMBER = 1; private com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata meta_; /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> * @return Whether the meta field is set. */ @java.lang.Override public boolean hasMeta() { return meta_ != null; } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> * @return The meta. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata getMeta() { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.getDefaultInstance() : meta_; } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.ListResponseMetadataOrBuilder getMetaOrBuilder() { return getMeta(); } public static final int ACCOUNTS_FIELD_NUMBER = 2; private java.util.List<com.strongdm.api.v1.plumbing.AccountsPlumbing.Account> accounts_; /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public java.util.List<com.strongdm.api.v1.plumbing.AccountsPlumbing.Account> getAccountsList() { return accounts_; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public java.util.List<? extends com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountsOrBuilderList() { return accounts_; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public int getAccountsCount() { return accounts_.size(); } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccounts(int index) { return accounts_.get(index); } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountsOrBuilder( int index) { return accounts_.get(index); } public static final int RATE_LIMIT_FIELD_NUMBER = 3; private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ @java.lang.Override public boolean hasRateLimit() { return rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { return getRateLimit(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (meta_ != null) { output.writeMessage(1, getMeta()); } for (int i = 0; i < accounts_.size(); i++) { output.writeMessage(2, accounts_.get(i)); } if (rateLimit_ != null) { output.writeMessage(3, getRateLimit()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (meta_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMeta()); } for (int i = 0; i < accounts_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, accounts_.get(i)); } if (rateLimit_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getRateLimit()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse) obj; if (hasMeta() != other.hasMeta()) return false; if (hasMeta()) { if (!getMeta() .equals(other.getMeta())) return false; } if (!getAccountsList() .equals(other.getAccountsList())) return false; if (hasRateLimit() != other.hasRateLimit()) return false; if (hasRateLimit()) { if (!getRateLimit() .equals(other.getRateLimit())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasMeta()) { hash = (37 * hash) + META_FIELD_NUMBER; hash = (53 * hash) + getMeta().hashCode(); } if (getAccountsCount() > 0) { hash = (37 * hash) + ACCOUNTS_FIELD_NUMBER; hash = (53 * hash) + getAccountsList().hashCode(); } if (hasRateLimit()) { hash = (37 * hash) + RATE_LIMIT_FIELD_NUMBER; hash = (53 * hash) + getRateLimit().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * AccountListResponse returns a list of Accounts that meet the criteria of a * AccountListRequest. * </pre> * * Protobuf type {@code v1.AccountListResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.AccountListResponse) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getAccountsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); if (metaBuilder_ == null) { meta_ = null; } else { meta_ = null; metaBuilder_ = null; } if (accountsBuilder_ == null) { accounts_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { accountsBuilder_.clear(); } if (rateLimitBuilder_ == null) { rateLimit_ = null; } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_AccountListResponse_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse(this); int from_bitField0_ = bitField0_; if (metaBuilder_ == null) { result.meta_ = meta_; } else { result.meta_ = metaBuilder_.build(); } if (accountsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { accounts_ = java.util.Collections.unmodifiableList(accounts_); bitField0_ = (bitField0_ & ~0x00000001); } result.accounts_ = accounts_; } else { result.accounts_ = accountsBuilder_.build(); } if (rateLimitBuilder_ == null) { result.rateLimit_ = rateLimit_; } else { result.rateLimit_ = rateLimitBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse.getDefaultInstance()) return this; if (other.hasMeta()) { mergeMeta(other.getMeta()); } if (accountsBuilder_ == null) { if (!other.accounts_.isEmpty()) { if (accounts_.isEmpty()) { accounts_ = other.accounts_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureAccountsIsMutable(); accounts_.addAll(other.accounts_); } onChanged(); } } else { if (!other.accounts_.isEmpty()) { if (accountsBuilder_.isEmpty()) { accountsBuilder_.dispose(); accountsBuilder_ = null; accounts_ = other.accounts_; bitField0_ = (bitField0_ & ~0x00000001); accountsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getAccountsFieldBuilder() : null; } else { accountsBuilder_.addAllMessages(other.accounts_); } } } if (other.hasRateLimit()) { mergeRateLimit(other.getRateLimit()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata meta_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata, com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.ListResponseMetadataOrBuilder> metaBuilder_; /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> * @return Whether the meta field is set. */ public boolean hasMeta() { return metaBuilder_ != null || meta_ != null; } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> * @return The meta. */ public com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata getMeta() { if (metaBuilder_ == null) { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.getDefaultInstance() : meta_; } else { return metaBuilder_.getMessage(); } } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ public Builder setMeta(com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata value) { if (metaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } meta_ = value; onChanged(); } else { metaBuilder_.setMessage(value); } return this; } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ public Builder setMeta( com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.Builder builderForValue) { if (metaBuilder_ == null) { meta_ = builderForValue.build(); onChanged(); } else { metaBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ public Builder mergeMeta(com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata value) { if (metaBuilder_ == null) { if (meta_ != null) { meta_ = com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.newBuilder(meta_).mergeFrom(value).buildPartial(); } else { meta_ = value; } onChanged(); } else { metaBuilder_.mergeFrom(value); } return this; } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ public Builder clearMeta() { if (metaBuilder_ == null) { meta_ = null; onChanged(); } else { meta_ = null; metaBuilder_ = null; } return this; } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.Builder getMetaBuilder() { onChanged(); return getMetaFieldBuilder().getBuilder(); } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ public com.strongdm.api.v1.plumbing.Spec.ListResponseMetadataOrBuilder getMetaOrBuilder() { if (metaBuilder_ != null) { return metaBuilder_.getMessageOrBuilder(); } else { return meta_ == null ? com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.getDefaultInstance() : meta_; } } /** * <pre> * Paging information for the query. * </pre> * * <code>.v1.ListResponseMetadata meta = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata, com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.ListResponseMetadataOrBuilder> getMetaFieldBuilder() { if (metaBuilder_ == null) { metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata, com.strongdm.api.v1.plumbing.Spec.ListResponseMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.ListResponseMetadataOrBuilder>( getMeta(), getParentForChildren(), isClean()); meta_ = null; } return metaBuilder_; } private java.util.List<com.strongdm.api.v1.plumbing.AccountsPlumbing.Account> accounts_ = java.util.Collections.emptyList(); private void ensureAccountsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { accounts_ = new java.util.ArrayList<com.strongdm.api.v1.plumbing.AccountsPlumbing.Account>(accounts_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> accountsBuilder_; /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public java.util.List<com.strongdm.api.v1.plumbing.AccountsPlumbing.Account> getAccountsList() { if (accountsBuilder_ == null) { return java.util.Collections.unmodifiableList(accounts_); } else { return accountsBuilder_.getMessageList(); } } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public int getAccountsCount() { if (accountsBuilder_ == null) { return accounts_.size(); } else { return accountsBuilder_.getCount(); } } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getAccounts(int index) { if (accountsBuilder_ == null) { return accounts_.get(index); } else { return accountsBuilder_.getMessage(index); } } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccounts( int index, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAccountsIsMutable(); accounts_.set(index, value); onChanged(); } else { accountsBuilder_.setMessage(index, value); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder setAccounts( int index, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder builderForValue) { if (accountsBuilder_ == null) { ensureAccountsIsMutable(); accounts_.set(index, builderForValue.build()); onChanged(); } else { accountsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder addAccounts(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAccountsIsMutable(); accounts_.add(value); onChanged(); } else { accountsBuilder_.addMessage(value); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder addAccounts( int index, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account value) { if (accountsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAccountsIsMutable(); accounts_.add(index, value); onChanged(); } else { accountsBuilder_.addMessage(index, value); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder addAccounts( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder builderForValue) { if (accountsBuilder_ == null) { ensureAccountsIsMutable(); accounts_.add(builderForValue.build()); onChanged(); } else { accountsBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder addAccounts( int index, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder builderForValue) { if (accountsBuilder_ == null) { ensureAccountsIsMutable(); accounts_.add(index, builderForValue.build()); onChanged(); } else { accountsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder addAllAccounts( java.lang.Iterable<? extends com.strongdm.api.v1.plumbing.AccountsPlumbing.Account> values) { if (accountsBuilder_ == null) { ensureAccountsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, accounts_); onChanged(); } else { accountsBuilder_.addAllMessages(values); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder clearAccounts() { if (accountsBuilder_ == null) { accounts_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { accountsBuilder_.clear(); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public Builder removeAccounts(int index) { if (accountsBuilder_ == null) { ensureAccountsIsMutable(); accounts_.remove(index); onChanged(); } else { accountsBuilder_.remove(index); } return this; } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder getAccountsBuilder( int index) { return getAccountsFieldBuilder().getBuilder(index); } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder getAccountsOrBuilder( int index) { if (accountsBuilder_ == null) { return accounts_.get(index); } else { return accountsBuilder_.getMessageOrBuilder(index); } } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public java.util.List<? extends com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountsOrBuilderList() { if (accountsBuilder_ != null) { return accountsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(accounts_); } } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder addAccountsBuilder() { return getAccountsFieldBuilder().addBuilder( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance()); } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder addAccountsBuilder( int index) { return getAccountsFieldBuilder().addBuilder( index, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance()); } /** * <pre> * A single page of results matching the list request criteria. * </pre> * * <code>repeated .v1.Account accounts = 2 [(.v1.field_options) = { ... }</code> */ public java.util.List<com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder> getAccountsBuilderList() { return getAccountsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder> getAccountsFieldBuilder() { if (accountsBuilder_ == null) { accountsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Account, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder>( accounts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); accounts_ = null; } return accountsBuilder_; } private com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata rateLimit_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> rateLimitBuilder_; /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return Whether the rateLimit field is set. */ public boolean hasRateLimit() { return rateLimitBuilder_ != null || rateLimit_ != null; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> * @return The rateLimit. */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata getRateLimit() { if (rateLimitBuilder_ == null) { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } else { return rateLimitBuilder_.getMessage(); } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (value == null) { throw new NullPointerException(); } rateLimit_ = value; onChanged(); } else { rateLimitBuilder_.setMessage(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder setRateLimit( com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder builderForValue) { if (rateLimitBuilder_ == null) { rateLimit_ = builderForValue.build(); onChanged(); } else { rateLimitBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder mergeRateLimit(com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata value) { if (rateLimitBuilder_ == null) { if (rateLimit_ != null) { rateLimit_ = com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.newBuilder(rateLimit_).mergeFrom(value).buildPartial(); } else { rateLimit_ = value; } onChanged(); } else { rateLimitBuilder_.mergeFrom(value); } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public Builder clearRateLimit() { if (rateLimitBuilder_ == null) { rateLimit_ = null; onChanged(); } else { rateLimit_ = null; rateLimitBuilder_ = null; } return this; } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder getRateLimitBuilder() { onChanged(); return getRateLimitFieldBuilder().getBuilder(); } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder getRateLimitOrBuilder() { if (rateLimitBuilder_ != null) { return rateLimitBuilder_.getMessageOrBuilder(); } else { return rateLimit_ == null ? com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.getDefaultInstance() : rateLimit_; } } /** * <pre> * Rate limit information. * </pre> * * <code>.v1.RateLimitMetadata rate_limit = 3 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder> getRateLimitFieldBuilder() { if (rateLimitBuilder_ == null) { rateLimitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadata.Builder, com.strongdm.api.v1.plumbing.Spec.RateLimitMetadataOrBuilder>( getRateLimit(), getParentForChildren(), isClean()); rateLimit_ = null; } return rateLimitBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.AccountListResponse) } // @@protoc_insertion_point(class_scope:v1.AccountListResponse) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AccountListResponse> PARSER = new com.google.protobuf.AbstractParser<AccountListResponse>() { @java.lang.Override public AccountListResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AccountListResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AccountListResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AccountListResponse> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountListResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AccountOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.Account) com.google.protobuf.MessageOrBuilder { /** * <code>.v1.User user = 1;</code> * @return Whether the user field is set. */ boolean hasUser(); /** * <code>.v1.User user = 1;</code> * @return The user. */ com.strongdm.api.v1.plumbing.AccountsPlumbing.User getUser(); /** * <code>.v1.User user = 1;</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.UserOrBuilder getUserOrBuilder(); /** * <code>.v1.Service service = 2;</code> * @return Whether the service field is set. */ boolean hasService(); /** * <code>.v1.Service service = 2;</code> * @return The service. */ com.strongdm.api.v1.plumbing.AccountsPlumbing.Service getService(); /** * <code>.v1.Service service = 2;</code> */ com.strongdm.api.v1.plumbing.AccountsPlumbing.ServiceOrBuilder getServiceOrBuilder(); public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.AccountCase getAccountCase(); } /** * <pre> * Accounts are users that have access to strongDM. There are two types of accounts: * 1. **Users:** humans who are authenticated through username and password or SSO. * 2. **Service Accounts:** machines that are authenticated using a service token. * </pre> * * Protobuf type {@code v1.Account} */ public static final class Account extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.Account) AccountOrBuilder { private static final long serialVersionUID = 0L; // Use Account.newBuilder() to construct. private Account(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Account() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Account(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Account( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { com.strongdm.api.v1.plumbing.AccountsPlumbing.User.Builder subBuilder = null; if (accountCase_ == 1) { subBuilder = ((com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_).toBuilder(); } account_ = input.readMessage(com.strongdm.api.v1.plumbing.AccountsPlumbing.User.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_); account_ = subBuilder.buildPartial(); } accountCase_ = 1; break; } case 18: { com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.Builder subBuilder = null; if (accountCase_ == 2) { subBuilder = ((com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_).toBuilder(); } account_ = input.readMessage(com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_); account_ = subBuilder.buildPartial(); } accountCase_ = 2; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Account_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Account_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder.class); } private int accountCase_ = 0; private java.lang.Object account_; public enum AccountCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { USER(1), SERVICE(2), ACCOUNT_NOT_SET(0); private final int value; private AccountCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static AccountCase valueOf(int value) { return forNumber(value); } public static AccountCase forNumber(int value) { switch (value) { case 1: return USER; case 2: return SERVICE; case 0: return ACCOUNT_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public AccountCase getAccountCase() { return AccountCase.forNumber( accountCase_); } public static final int USER_FIELD_NUMBER = 1; /** * <code>.v1.User user = 1;</code> * @return Whether the user field is set. */ @java.lang.Override public boolean hasUser() { return accountCase_ == 1; } /** * <code>.v1.User user = 1;</code> * @return The user. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.User getUser() { if (accountCase_ == 1) { return (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_; } return com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance(); } /** * <code>.v1.User user = 1;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.UserOrBuilder getUserOrBuilder() { if (accountCase_ == 1) { return (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_; } return com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance(); } public static final int SERVICE_FIELD_NUMBER = 2; /** * <code>.v1.Service service = 2;</code> * @return Whether the service field is set. */ @java.lang.Override public boolean hasService() { return accountCase_ == 2; } /** * <code>.v1.Service service = 2;</code> * @return The service. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Service getService() { if (accountCase_ == 2) { return (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_; } return com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance(); } /** * <code>.v1.Service service = 2;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.ServiceOrBuilder getServiceOrBuilder() { if (accountCase_ == 2) { return (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_; } return com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (accountCase_ == 1) { output.writeMessage(1, (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_); } if (accountCase_ == 2) { output.writeMessage(2, (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (accountCase_ == 1) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_); } if (accountCase_ == 2) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.Account)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.Account other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.Account) obj; if (!getAccountCase().equals(other.getAccountCase())) return false; switch (accountCase_) { case 1: if (!getUser() .equals(other.getUser())) return false; break; case 2: if (!getService() .equals(other.getService())) return false; break; case 0: default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); switch (accountCase_) { case 1: hash = (37 * hash) + USER_FIELD_NUMBER; hash = (53 * hash) + getUser().hashCode(); break; case 2: hash = (37 * hash) + SERVICE_FIELD_NUMBER; hash = (53 * hash) + getService().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * Accounts are users that have access to strongDM. There are two types of accounts: * 1. **Users:** humans who are authenticated through username and password or SSO. * 2. **Service Accounts:** machines that are authenticated using a service token. * </pre> * * Protobuf type {@code v1.Account} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.Account) com.strongdm.api.v1.plumbing.AccountsPlumbing.AccountOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Account_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Account_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); accountCase_ = 0; account_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Account_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.Account result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.Account result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.Account(this); if (accountCase_ == 1) { if (userBuilder_ == null) { result.account_ = account_; } else { result.account_ = userBuilder_.build(); } } if (accountCase_ == 2) { if (serviceBuilder_ == null) { result.account_ = account_; } else { result.account_ = serviceBuilder_.build(); } } result.accountCase_ = accountCase_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.Account) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.Account)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.Account other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.Account.getDefaultInstance()) return this; switch (other.getAccountCase()) { case USER: { mergeUser(other.getUser()); break; } case SERVICE: { mergeService(other.getService()); break; } case ACCOUNT_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.Account parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.Account) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int accountCase_ = 0; private java.lang.Object account_; public AccountCase getAccountCase() { return AccountCase.forNumber( accountCase_); } public Builder clearAccount() { accountCase_ = 0; account_ = null; onChanged(); return this; } private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.User, com.strongdm.api.v1.plumbing.AccountsPlumbing.User.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.UserOrBuilder> userBuilder_; /** * <code>.v1.User user = 1;</code> * @return Whether the user field is set. */ @java.lang.Override public boolean hasUser() { return accountCase_ == 1; } /** * <code>.v1.User user = 1;</code> * @return The user. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.User getUser() { if (userBuilder_ == null) { if (accountCase_ == 1) { return (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_; } return com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance(); } else { if (accountCase_ == 1) { return userBuilder_.getMessage(); } return com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance(); } } /** * <code>.v1.User user = 1;</code> */ public Builder setUser(com.strongdm.api.v1.plumbing.AccountsPlumbing.User value) { if (userBuilder_ == null) { if (value == null) { throw new NullPointerException(); } account_ = value; onChanged(); } else { userBuilder_.setMessage(value); } accountCase_ = 1; return this; } /** * <code>.v1.User user = 1;</code> */ public Builder setUser( com.strongdm.api.v1.plumbing.AccountsPlumbing.User.Builder builderForValue) { if (userBuilder_ == null) { account_ = builderForValue.build(); onChanged(); } else { userBuilder_.setMessage(builderForValue.build()); } accountCase_ = 1; return this; } /** * <code>.v1.User user = 1;</code> */ public Builder mergeUser(com.strongdm.api.v1.plumbing.AccountsPlumbing.User value) { if (userBuilder_ == null) { if (accountCase_ == 1 && account_ != com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance()) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.User.newBuilder((com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_) .mergeFrom(value).buildPartial(); } else { account_ = value; } onChanged(); } else { if (accountCase_ == 1) { userBuilder_.mergeFrom(value); } userBuilder_.setMessage(value); } accountCase_ = 1; return this; } /** * <code>.v1.User user = 1;</code> */ public Builder clearUser() { if (userBuilder_ == null) { if (accountCase_ == 1) { accountCase_ = 0; account_ = null; onChanged(); } } else { if (accountCase_ == 1) { accountCase_ = 0; account_ = null; } userBuilder_.clear(); } return this; } /** * <code>.v1.User user = 1;</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.User.Builder getUserBuilder() { return getUserFieldBuilder().getBuilder(); } /** * <code>.v1.User user = 1;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.UserOrBuilder getUserOrBuilder() { if ((accountCase_ == 1) && (userBuilder_ != null)) { return userBuilder_.getMessageOrBuilder(); } else { if (accountCase_ == 1) { return (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_; } return com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance(); } } /** * <code>.v1.User user = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.User, com.strongdm.api.v1.plumbing.AccountsPlumbing.User.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.UserOrBuilder> getUserFieldBuilder() { if (userBuilder_ == null) { if (!(accountCase_ == 1)) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance(); } userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.User, com.strongdm.api.v1.plumbing.AccountsPlumbing.User.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.UserOrBuilder>( (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) account_, getParentForChildren(), isClean()); account_ = null; } accountCase_ = 1; onChanged();; return userBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Service, com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.ServiceOrBuilder> serviceBuilder_; /** * <code>.v1.Service service = 2;</code> * @return Whether the service field is set. */ @java.lang.Override public boolean hasService() { return accountCase_ == 2; } /** * <code>.v1.Service service = 2;</code> * @return The service. */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Service getService() { if (serviceBuilder_ == null) { if (accountCase_ == 2) { return (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_; } return com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance(); } else { if (accountCase_ == 2) { return serviceBuilder_.getMessage(); } return com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance(); } } /** * <code>.v1.Service service = 2;</code> */ public Builder setService(com.strongdm.api.v1.plumbing.AccountsPlumbing.Service value) { if (serviceBuilder_ == null) { if (value == null) { throw new NullPointerException(); } account_ = value; onChanged(); } else { serviceBuilder_.setMessage(value); } accountCase_ = 2; return this; } /** * <code>.v1.Service service = 2;</code> */ public Builder setService( com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.Builder builderForValue) { if (serviceBuilder_ == null) { account_ = builderForValue.build(); onChanged(); } else { serviceBuilder_.setMessage(builderForValue.build()); } accountCase_ = 2; return this; } /** * <code>.v1.Service service = 2;</code> */ public Builder mergeService(com.strongdm.api.v1.plumbing.AccountsPlumbing.Service value) { if (serviceBuilder_ == null) { if (accountCase_ == 2 && account_ != com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance()) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.newBuilder((com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_) .mergeFrom(value).buildPartial(); } else { account_ = value; } onChanged(); } else { if (accountCase_ == 2) { serviceBuilder_.mergeFrom(value); } serviceBuilder_.setMessage(value); } accountCase_ = 2; return this; } /** * <code>.v1.Service service = 2;</code> */ public Builder clearService() { if (serviceBuilder_ == null) { if (accountCase_ == 2) { accountCase_ = 0; account_ = null; onChanged(); } } else { if (accountCase_ == 2) { accountCase_ = 0; account_ = null; } serviceBuilder_.clear(); } return this; } /** * <code>.v1.Service service = 2;</code> */ public com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.Builder getServiceBuilder() { return getServiceFieldBuilder().getBuilder(); } /** * <code>.v1.Service service = 2;</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.ServiceOrBuilder getServiceOrBuilder() { if ((accountCase_ == 2) && (serviceBuilder_ != null)) { return serviceBuilder_.getMessageOrBuilder(); } else { if (accountCase_ == 2) { return (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_; } return com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance(); } } /** * <code>.v1.Service service = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Service, com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.ServiceOrBuilder> getServiceFieldBuilder() { if (serviceBuilder_ == null) { if (!(accountCase_ == 2)) { account_ = com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance(); } serviceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.AccountsPlumbing.Service, com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.Builder, com.strongdm.api.v1.plumbing.AccountsPlumbing.ServiceOrBuilder>( (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) account_, getParentForChildren(), isClean()); account_ = null; } accountCase_ = 2; onChanged();; return serviceBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.Account) } // @@protoc_insertion_point(class_scope:v1.Account) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.Account DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.Account(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Account> PARSER = new com.google.protobuf.AbstractParser<Account>() { @java.lang.Override public Account parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Account(input, extensionRegistry); } }; public static com.google.protobuf.Parser<Account> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Account> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Account getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface UserOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.User) com.google.protobuf.MessageOrBuilder { /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The id. */ java.lang.String getId(); /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ com.google.protobuf.ByteString getIdBytes(); /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @return The email. */ java.lang.String getEmail(); /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for email. */ com.google.protobuf.ByteString getEmailBytes(); /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @return The firstName. */ java.lang.String getFirstName(); /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @return The bytes for firstName. */ com.google.protobuf.ByteString getFirstNameBytes(); /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @return The lastName. */ java.lang.String getLastName(); /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @return The bytes for lastName. */ com.google.protobuf.ByteString getLastNameBytes(); /** * <pre> * The User's suspended state. * </pre> * * <code>bool suspended = 5 [(.v1.field_options) = { ... }</code> * @return The suspended. */ boolean getSuspended(); /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> * @return Whether the tags field is set. */ boolean hasTags(); /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> * @return The tags. */ com.strongdm.api.v1.plumbing.TagsPlumbing.Tags getTags(); /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder getTagsOrBuilder(); /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @return The permissionLevel. */ java.lang.String getPermissionLevel(); /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @return The bytes for permissionLevel. */ com.google.protobuf.ByteString getPermissionLevelBytes(); } /** * <pre> * A User can connect to resources they are granted directly, or granted * via roles. * </pre> * * Protobuf type {@code v1.User} */ public static final class User extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.User) UserOrBuilder { private static final long serialVersionUID = 0L; // Use User.newBuilder() to construct. private User(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private User() { id_ = ""; email_ = ""; firstName_ = ""; lastName_ = ""; permissionLevel_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new User(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private User( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { java.lang.String s = input.readStringRequireUtf8(); id_ = s; break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); email_ = s; break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); firstName_ = s; break; } case 34: { java.lang.String s = input.readStringRequireUtf8(); lastName_ = s; break; } case 40: { suspended_ = input.readBool(); break; } case 50: { com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder subBuilder = null; if (tags_ != null) { subBuilder = tags_.toBuilder(); } tags_ = input.readMessage(com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(tags_); tags_ = subBuilder.buildPartial(); } break; } case 58: { java.lang.String s = input.readStringRequireUtf8(); permissionLevel_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_User_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_User_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.User.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.User.Builder.class); } public static final int ID_FIELD_NUMBER = 1; private volatile java.lang.Object id_; /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The id. */ @java.lang.Override 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(); id_ = s; return s; } } /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ @java.lang.Override 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; } } public static final int EMAIL_FIELD_NUMBER = 2; private volatile java.lang.Object email_; /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @return The email. */ @java.lang.Override public java.lang.String getEmail() { java.lang.Object ref = email_; 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(); email_ = s; return s; } } /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for email. */ @java.lang.Override public com.google.protobuf.ByteString getEmailBytes() { java.lang.Object ref = email_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); email_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int FIRST_NAME_FIELD_NUMBER = 3; private volatile java.lang.Object firstName_; /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @return The firstName. */ @java.lang.Override public java.lang.String getFirstName() { java.lang.Object ref = firstName_; 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(); firstName_ = s; return s; } } /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @return The bytes for firstName. */ @java.lang.Override public com.google.protobuf.ByteString getFirstNameBytes() { java.lang.Object ref = firstName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); firstName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int LAST_NAME_FIELD_NUMBER = 4; private volatile java.lang.Object lastName_; /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @return The lastName. */ @java.lang.Override public java.lang.String getLastName() { java.lang.Object ref = lastName_; 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(); lastName_ = s; return s; } } /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @return The bytes for lastName. */ @java.lang.Override public com.google.protobuf.ByteString getLastNameBytes() { java.lang.Object ref = lastName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); lastName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SUSPENDED_FIELD_NUMBER = 5; private boolean suspended_; /** * <pre> * The User's suspended state. * </pre> * * <code>bool suspended = 5 [(.v1.field_options) = { ... }</code> * @return The suspended. */ @java.lang.Override public boolean getSuspended() { return suspended_; } public static final int TAGS_FIELD_NUMBER = 6; private com.strongdm.api.v1.plumbing.TagsPlumbing.Tags tags_; /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> * @return Whether the tags field is set. */ @java.lang.Override public boolean hasTags() { return tags_ != null; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> * @return The tags. */ @java.lang.Override public com.strongdm.api.v1.plumbing.TagsPlumbing.Tags getTags() { return tags_ == null ? com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.getDefaultInstance() : tags_; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder getTagsOrBuilder() { return getTags(); } public static final int PERMISSION_LEVEL_FIELD_NUMBER = 7; private volatile java.lang.Object permissionLevel_; /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @return The permissionLevel. */ @java.lang.Override public java.lang.String getPermissionLevel() { java.lang.Object ref = permissionLevel_; 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(); permissionLevel_ = s; return s; } } /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @return The bytes for permissionLevel. */ @java.lang.Override public com.google.protobuf.ByteString getPermissionLevelBytes() { java.lang.Object ref = permissionLevel_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); permissionLevel_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); } if (!getEmailBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, email_); } if (!getFirstNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, firstName_); } if (!getLastNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, lastName_); } if (suspended_ != false) { output.writeBool(5, suspended_); } if (tags_ != null) { output.writeMessage(6, getTags()); } if (!getPermissionLevelBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, permissionLevel_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); } if (!getEmailBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, email_); } if (!getFirstNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, firstName_); } if (!getLastNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, lastName_); } if (suspended_ != false) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(5, suspended_); } if (tags_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, getTags()); } if (!getPermissionLevelBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, permissionLevel_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.User)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.User other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) obj; if (!getId() .equals(other.getId())) return false; if (!getEmail() .equals(other.getEmail())) return false; if (!getFirstName() .equals(other.getFirstName())) return false; if (!getLastName() .equals(other.getLastName())) return false; if (getSuspended() != other.getSuspended()) return false; if (hasTags() != other.hasTags()) return false; if (hasTags()) { if (!getTags() .equals(other.getTags())) return false; } if (!getPermissionLevel() .equals(other.getPermissionLevel())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId().hashCode(); hash = (37 * hash) + EMAIL_FIELD_NUMBER; hash = (53 * hash) + getEmail().hashCode(); hash = (37 * hash) + FIRST_NAME_FIELD_NUMBER; hash = (53 * hash) + getFirstName().hashCode(); hash = (37 * hash) + LAST_NAME_FIELD_NUMBER; hash = (53 * hash) + getLastName().hashCode(); hash = (37 * hash) + SUSPENDED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getSuspended()); if (hasTags()) { hash = (37 * hash) + TAGS_FIELD_NUMBER; hash = (53 * hash) + getTags().hashCode(); } hash = (37 * hash) + PERMISSION_LEVEL_FIELD_NUMBER; hash = (53 * hash) + getPermissionLevel().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.User prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * A User can connect to resources they are granted directly, or granted * via roles. * </pre> * * Protobuf type {@code v1.User} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.User) com.strongdm.api.v1.plumbing.AccountsPlumbing.UserOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_User_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_User_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.User.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.User.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.User.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); id_ = ""; email_ = ""; firstName_ = ""; lastName_ = ""; suspended_ = false; if (tagsBuilder_ == null) { tags_ = null; } else { tags_ = null; tagsBuilder_ = null; } permissionLevel_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_User_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.User getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.User build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.User result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.User buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.User result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.User(this); result.id_ = id_; result.email_ = email_; result.firstName_ = firstName_; result.lastName_ = lastName_; result.suspended_ = suspended_; if (tagsBuilder_ == null) { result.tags_ = tags_; } else { result.tags_ = tagsBuilder_.build(); } result.permissionLevel_ = permissionLevel_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.User) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.User)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.User other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.User.getDefaultInstance()) return this; if (!other.getId().isEmpty()) { id_ = other.id_; onChanged(); } if (!other.getEmail().isEmpty()) { email_ = other.email_; onChanged(); } if (!other.getFirstName().isEmpty()) { firstName_ = other.firstName_; onChanged(); } if (!other.getLastName().isEmpty()) { lastName_ = other.lastName_; onChanged(); } if (other.getSuspended() != false) { setSuspended(other.getSuspended()); } if (other.hasTags()) { mergeTags(other.getTags()); } if (!other.getPermissionLevel().isEmpty()) { permissionLevel_ = other.permissionLevel_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.User parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.User) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object id_ = ""; /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The id. */ public java.lang.String getId() { java.lang.Object ref = id_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); id_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ 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; } } /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @param value The id to set. * @return This builder for chaining. */ public Builder setId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } id_ = value; onChanged(); return this; } /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearId() { id_ = getDefaultInstance().getId(); onChanged(); return this; } /** * <pre> * Unique identifier of the User. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @param value The bytes for id to set. * @return This builder for chaining. */ public Builder setIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); id_ = value; onChanged(); return this; } private java.lang.Object email_ = ""; /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @return The email. */ public java.lang.String getEmail() { java.lang.Object ref = email_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); email_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for email. */ public com.google.protobuf.ByteString getEmailBytes() { java.lang.Object ref = email_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); email_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @param value The email to set. * @return This builder for chaining. */ public Builder setEmail( java.lang.String value) { if (value == null) { throw new NullPointerException(); } email_ = value; onChanged(); return this; } /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearEmail() { email_ = getDefaultInstance().getEmail(); onChanged(); return this; } /** * <pre> * The User's email address. Must be unique. * </pre> * * <code>string email = 2 [(.v1.field_options) = { ... }</code> * @param value The bytes for email to set. * @return This builder for chaining. */ public Builder setEmailBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); email_ = value; onChanged(); return this; } private java.lang.Object firstName_ = ""; /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @return The firstName. */ public java.lang.String getFirstName() { java.lang.Object ref = firstName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); firstName_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @return The bytes for firstName. */ public com.google.protobuf.ByteString getFirstNameBytes() { java.lang.Object ref = firstName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); firstName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @param value The firstName to set. * @return This builder for chaining. */ public Builder setFirstName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } firstName_ = value; onChanged(); return this; } /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearFirstName() { firstName_ = getDefaultInstance().getFirstName(); onChanged(); return this; } /** * <pre> * The User's first name. * </pre> * * <code>string first_name = 3 [(.v1.field_options) = { ... }</code> * @param value The bytes for firstName to set. * @return This builder for chaining. */ public Builder setFirstNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); firstName_ = value; onChanged(); return this; } private java.lang.Object lastName_ = ""; /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @return The lastName. */ public java.lang.String getLastName() { java.lang.Object ref = lastName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); lastName_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @return The bytes for lastName. */ public com.google.protobuf.ByteString getLastNameBytes() { java.lang.Object ref = lastName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); lastName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @param value The lastName to set. * @return This builder for chaining. */ public Builder setLastName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } lastName_ = value; onChanged(); return this; } /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearLastName() { lastName_ = getDefaultInstance().getLastName(); onChanged(); return this; } /** * <pre> * The User's last name. * </pre> * * <code>string last_name = 4 [(.v1.field_options) = { ... }</code> * @param value The bytes for lastName to set. * @return This builder for chaining. */ public Builder setLastNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); lastName_ = value; onChanged(); return this; } private boolean suspended_ ; /** * <pre> * The User's suspended state. * </pre> * * <code>bool suspended = 5 [(.v1.field_options) = { ... }</code> * @return The suspended. */ @java.lang.Override public boolean getSuspended() { return suspended_; } /** * <pre> * The User's suspended state. * </pre> * * <code>bool suspended = 5 [(.v1.field_options) = { ... }</code> * @param value The suspended to set. * @return This builder for chaining. */ public Builder setSuspended(boolean value) { suspended_ = value; onChanged(); return this; } /** * <pre> * The User's suspended state. * </pre> * * <code>bool suspended = 5 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearSuspended() { suspended_ = false; onChanged(); return this; } private com.strongdm.api.v1.plumbing.TagsPlumbing.Tags tags_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.TagsPlumbing.Tags, com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder, com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder> tagsBuilder_; /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> * @return Whether the tags field is set. */ public boolean hasTags() { return tagsBuilder_ != null || tags_ != null; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> * @return The tags. */ public com.strongdm.api.v1.plumbing.TagsPlumbing.Tags getTags() { if (tagsBuilder_ == null) { return tags_ == null ? com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.getDefaultInstance() : tags_; } else { return tagsBuilder_.getMessage(); } } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ public Builder setTags(com.strongdm.api.v1.plumbing.TagsPlumbing.Tags value) { if (tagsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } tags_ = value; onChanged(); } else { tagsBuilder_.setMessage(value); } return this; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ public Builder setTags( com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder builderForValue) { if (tagsBuilder_ == null) { tags_ = builderForValue.build(); onChanged(); } else { tagsBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ public Builder mergeTags(com.strongdm.api.v1.plumbing.TagsPlumbing.Tags value) { if (tagsBuilder_ == null) { if (tags_ != null) { tags_ = com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.newBuilder(tags_).mergeFrom(value).buildPartial(); } else { tags_ = value; } onChanged(); } else { tagsBuilder_.mergeFrom(value); } return this; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ public Builder clearTags() { if (tagsBuilder_ == null) { tags_ = null; onChanged(); } else { tags_ = null; tagsBuilder_ = null; } return this; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder getTagsBuilder() { onChanged(); return getTagsFieldBuilder().getBuilder(); } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder getTagsOrBuilder() { if (tagsBuilder_ != null) { return tagsBuilder_.getMessageOrBuilder(); } else { return tags_ == null ? com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.getDefaultInstance() : tags_; } } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 6 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.TagsPlumbing.Tags, com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder, com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder> getTagsFieldBuilder() { if (tagsBuilder_ == null) { tagsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.TagsPlumbing.Tags, com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder, com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder>( getTags(), getParentForChildren(), isClean()); tags_ = null; } return tagsBuilder_; } private java.lang.Object permissionLevel_ = ""; /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @return The permissionLevel. */ public java.lang.String getPermissionLevel() { java.lang.Object ref = permissionLevel_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); permissionLevel_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @return The bytes for permissionLevel. */ public com.google.protobuf.ByteString getPermissionLevelBytes() { java.lang.Object ref = permissionLevel_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); permissionLevel_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @param value The permissionLevel to set. * @return This builder for chaining. */ public Builder setPermissionLevel( java.lang.String value) { if (value == null) { throw new NullPointerException(); } permissionLevel_ = value; onChanged(); return this; } /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearPermissionLevel() { permissionLevel_ = getDefaultInstance().getPermissionLevel(); onChanged(); return this; } /** * <pre> * PRIVATE: PermissionLevel exposes the user's strongRole for AdminUI purposes. * </pre> * * <code>string permission_level = 7 [(.v1.field_options) = { ... }</code> * @param value The bytes for permissionLevel to set. * @return This builder for chaining. */ public Builder setPermissionLevelBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); permissionLevel_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.User) } // @@protoc_insertion_point(class_scope:v1.User) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.User DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.User(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.User getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<User> PARSER = new com.google.protobuf.AbstractParser<User>() { @java.lang.Override public User parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new User(input, extensionRegistry); } }; public static com.google.protobuf.Parser<User> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<User> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.User getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface ServiceOrBuilder extends // @@protoc_insertion_point(interface_extends:v1.Service) com.google.protobuf.MessageOrBuilder { /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The id. */ java.lang.String getId(); /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ com.google.protobuf.ByteString getIdBytes(); /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @return The name. */ java.lang.String getName(); /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); /** * <pre> * The Service's suspended state. * </pre> * * <code>bool suspended = 3 [(.v1.field_options) = { ... }</code> * @return The suspended. */ boolean getSuspended(); /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> * @return Whether the tags field is set. */ boolean hasTags(); /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> * @return The tags. */ com.strongdm.api.v1.plumbing.TagsPlumbing.Tags getTags(); /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder getTagsOrBuilder(); } /** * <pre> * A Service is a service account that can connect to resources they are granted * directly, or granted via roles. Services are typically automated jobs. * </pre> * * Protobuf type {@code v1.Service} */ public static final class Service extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:v1.Service) ServiceOrBuilder { private static final long serialVersionUID = 0L; // Use Service.newBuilder() to construct. private Service(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Service() { id_ = ""; name_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Service(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Service( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } 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; case 10: { java.lang.String s = input.readStringRequireUtf8(); id_ = s; break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 24: { suspended_ = input.readBool(); break; } case 34: { com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder subBuilder = null; if (tags_ != null) { subBuilder = tags_.toBuilder(); } tags_ = input.readMessage(com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(tags_); tags_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Service_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Service_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.Builder.class); } public static final int ID_FIELD_NUMBER = 1; private volatile java.lang.Object id_; /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The id. */ @java.lang.Override 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(); id_ = s; return s; } } /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ @java.lang.Override 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; } } public static final int NAME_FIELD_NUMBER = 2; private volatile java.lang.Object name_; /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @return The name. */ @java.lang.Override 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(); name_ = s; return s; } } /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for name. */ @java.lang.Override 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; } } public static final int SUSPENDED_FIELD_NUMBER = 3; private boolean suspended_; /** * <pre> * The Service's suspended state. * </pre> * * <code>bool suspended = 3 [(.v1.field_options) = { ... }</code> * @return The suspended. */ @java.lang.Override public boolean getSuspended() { return suspended_; } public static final int TAGS_FIELD_NUMBER = 4; private com.strongdm.api.v1.plumbing.TagsPlumbing.Tags tags_; /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> * @return Whether the tags field is set. */ @java.lang.Override public boolean hasTags() { return tags_ != null; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> * @return The tags. */ @java.lang.Override public com.strongdm.api.v1.plumbing.TagsPlumbing.Tags getTags() { return tags_ == null ? com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.getDefaultInstance() : tags_; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ @java.lang.Override public com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder getTagsOrBuilder() { return getTags(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); } if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); } if (suspended_ != false) { output.writeBool(3, suspended_); } if (tags_ != null) { output.writeMessage(4, getTags()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); } if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); } if (suspended_ != false) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(3, suspended_); } if (tags_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, getTags()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.Service)) { return super.equals(obj); } com.strongdm.api.v1.plumbing.AccountsPlumbing.Service other = (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) obj; if (!getId() .equals(other.getId())) return false; if (!getName() .equals(other.getName())) return false; if (getSuspended() != other.getSuspended()) return false; if (hasTags() != other.hasTags()) return false; if (hasTags()) { if (!getTags() .equals(other.getTags())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + SUSPENDED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getSuspended()); if (hasTags()) { hash = (37 * hash) + TAGS_FIELD_NUMBER; hash = (53 * hash) + getTags().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.strongdm.api.v1.plumbing.AccountsPlumbing.Service prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * A Service is a service account that can connect to resources they are granted * directly, or granted via roles. Services are typically automated jobs. * </pre> * * Protobuf type {@code v1.Service} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:v1.Service) com.strongdm.api.v1.plumbing.AccountsPlumbing.ServiceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Service_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Service_fieldAccessorTable .ensureFieldAccessorsInitialized( com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.class, com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.Builder.class); } // Construct using com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); id_ = ""; name_ = ""; suspended_ = false; if (tagsBuilder_ == null) { tags_ = null; } else { tags_ = null; tagsBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.internal_static_v1_Service_descriptor; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Service getDefaultInstanceForType() { return com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance(); } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Service build() { com.strongdm.api.v1.plumbing.AccountsPlumbing.Service result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Service buildPartial() { com.strongdm.api.v1.plumbing.AccountsPlumbing.Service result = new com.strongdm.api.v1.plumbing.AccountsPlumbing.Service(this); result.id_ = id_; result.name_ = name_; result.suspended_ = suspended_; if (tagsBuilder_ == null) { result.tags_ = tags_; } else { result.tags_ = tagsBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) { return mergeFrom((com.strongdm.api.v1.plumbing.AccountsPlumbing.Service)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.strongdm.api.v1.plumbing.AccountsPlumbing.Service other) { if (other == com.strongdm.api.v1.plumbing.AccountsPlumbing.Service.getDefaultInstance()) return this; if (!other.getId().isEmpty()) { id_ = other.id_; onChanged(); } if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getSuspended() != false) { setSuspended(other.getSuspended()); } if (other.hasTags()) { mergeTags(other.getTags()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.strongdm.api.v1.plumbing.AccountsPlumbing.Service parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.strongdm.api.v1.plumbing.AccountsPlumbing.Service) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object id_ = ""; /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The id. */ public java.lang.String getId() { java.lang.Object ref = id_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); id_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return The bytes for id. */ 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; } } /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @param value The id to set. * @return This builder for chaining. */ public Builder setId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } id_ = value; onChanged(); return this; } /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearId() { id_ = getDefaultInstance().getId(); onChanged(); return this; } /** * <pre> * Unique identifier of the Service. * </pre> * * <code>string id = 1 [(.v1.field_options) = { ... }</code> * @param value The bytes for id to set. * @return This builder for chaining. */ public Builder setIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); id_ = value; onChanged(); return this; } private java.lang.Object name_ = ""; /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @return The bytes for name. */ 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; } } /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @param value The name to set. * @return This builder for chaining. */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * <pre> * Unique human-readable name of the Service. * </pre> * * <code>string name = 2 [(.v1.field_options) = { ... }</code> * @param value The bytes for name to set. * @return This builder for chaining. */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private boolean suspended_ ; /** * <pre> * The Service's suspended state. * </pre> * * <code>bool suspended = 3 [(.v1.field_options) = { ... }</code> * @return The suspended. */ @java.lang.Override public boolean getSuspended() { return suspended_; } /** * <pre> * The Service's suspended state. * </pre> * * <code>bool suspended = 3 [(.v1.field_options) = { ... }</code> * @param value The suspended to set. * @return This builder for chaining. */ public Builder setSuspended(boolean value) { suspended_ = value; onChanged(); return this; } /** * <pre> * The Service's suspended state. * </pre> * * <code>bool suspended = 3 [(.v1.field_options) = { ... }</code> * @return This builder for chaining. */ public Builder clearSuspended() { suspended_ = false; onChanged(); return this; } private com.strongdm.api.v1.plumbing.TagsPlumbing.Tags tags_; private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.TagsPlumbing.Tags, com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder, com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder> tagsBuilder_; /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> * @return Whether the tags field is set. */ public boolean hasTags() { return tagsBuilder_ != null || tags_ != null; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> * @return The tags. */ public com.strongdm.api.v1.plumbing.TagsPlumbing.Tags getTags() { if (tagsBuilder_ == null) { return tags_ == null ? com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.getDefaultInstance() : tags_; } else { return tagsBuilder_.getMessage(); } } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ public Builder setTags(com.strongdm.api.v1.plumbing.TagsPlumbing.Tags value) { if (tagsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } tags_ = value; onChanged(); } else { tagsBuilder_.setMessage(value); } return this; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ public Builder setTags( com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder builderForValue) { if (tagsBuilder_ == null) { tags_ = builderForValue.build(); onChanged(); } else { tagsBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ public Builder mergeTags(com.strongdm.api.v1.plumbing.TagsPlumbing.Tags value) { if (tagsBuilder_ == null) { if (tags_ != null) { tags_ = com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.newBuilder(tags_).mergeFrom(value).buildPartial(); } else { tags_ = value; } onChanged(); } else { tagsBuilder_.mergeFrom(value); } return this; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ public Builder clearTags() { if (tagsBuilder_ == null) { tags_ = null; onChanged(); } else { tags_ = null; tagsBuilder_ = null; } return this; } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder getTagsBuilder() { onChanged(); return getTagsFieldBuilder().getBuilder(); } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ public com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder getTagsOrBuilder() { if (tagsBuilder_ != null) { return tagsBuilder_.getMessageOrBuilder(); } else { return tags_ == null ? com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.getDefaultInstance() : tags_; } } /** * <pre> * Tags is a map of key, value pairs. * </pre> * * <code>.v1.Tags tags = 4 [(.v1.field_options) = { ... }</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.TagsPlumbing.Tags, com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder, com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder> getTagsFieldBuilder() { if (tagsBuilder_ == null) { tagsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.strongdm.api.v1.plumbing.TagsPlumbing.Tags, com.strongdm.api.v1.plumbing.TagsPlumbing.Tags.Builder, com.strongdm.api.v1.plumbing.TagsPlumbing.TagsOrBuilder>( getTags(), getParentForChildren(), isClean()); tags_ = null; } return tagsBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:v1.Service) } // @@protoc_insertion_point(class_scope:v1.Service) private static final com.strongdm.api.v1.plumbing.AccountsPlumbing.Service DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.strongdm.api.v1.plumbing.AccountsPlumbing.Service(); } public static com.strongdm.api.v1.plumbing.AccountsPlumbing.Service getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Service> PARSER = new com.google.protobuf.AbstractParser<Service>() { @java.lang.Override public Service parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Service(input, extensionRegistry); } }; public static com.google.protobuf.Parser<Service> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Service> getParserForType() { return PARSER; } @java.lang.Override public com.strongdm.api.v1.plumbing.AccountsPlumbing.Service getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountCreateRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountCreateRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountCreateResponse_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountCreateResponse_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountGetRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountGetRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountGetResponse_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountGetResponse_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountUpdateRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountUpdateRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountUpdateResponse_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountUpdateResponse_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountDeleteRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountDeleteRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountDeleteResponse_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountDeleteResponse_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountListRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountListRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_AccountListResponse_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_AccountListResponse_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_Account_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_Account_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_User_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_User_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_v1_Service_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_v1_Service_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\016accounts.proto\022\002v1\032\roptions.proto\032\nspe" + "c.proto\032\ntags.proto\"i\n\024AccountCreateRequ" + "est\022\'\n\004meta\030\001 \001(\0132\031.v1.CreateRequestMeta" + "data\022(\n\007account\030\002 \001(\0132\013.v1.AccountB\n\362\370\263\007" + "\005\260\363\263\007\001\"\344\001\n\025AccountCreateResponse\0224\n\004meta" + "\030\001 \001(\0132\032.v1.CreateResponseMetadataB\n\362\370\263\007" + "\005\260\363\263\007\001\022(\n\007account\030\002 \001(\0132\013.v1.AccountB\n\362\370" + "\263\007\005\260\363\263\007\001\022\036\n\005token\030\003 \001(\tB\017\362\370\263\007\n\260\363\263\007\001\360\363\263\007\001" + "\022?\n\nrate_limit\030\004 \001(\0132\025.v1.RateLimitMetad" + "ataB\024\362\370\263\007\005\260\363\263\007\001\362\370\263\007\005\220\364\263\007\001:\n\372\370\263\007\005\250\363\263\007\001\"Q\n" + "\021AccountGetRequest\022$\n\004meta\030\001 \001(\0132\026.v1.Ge" + "tRequestMetadata\022\026\n\002id\030\002 \001(\tB\n\362\370\263\007\005\260\363\263\007\001" + "\"\276\001\n\022AccountGetResponse\0221\n\004meta\030\001 \001(\0132\027." + "v1.GetResponseMetadataB\n\362\370\263\007\005\260\363\263\007\001\022(\n\007ac" + "count\030\002 \001(\0132\013.v1.AccountB\n\362\370\263\007\005\260\363\263\007\001\022?\n\n" + "rate_limit\030\003 \001(\0132\025.v1.RateLimitMetadataB" + "\024\362\370\263\007\005\260\363\263\007\001\362\370\263\007\005\220\364\263\007\001:\n\372\370\263\007\005\250\363\263\007\001\"u\n\024Acc" + "ountUpdateRequest\022\'\n\004meta\030\001 \001(\0132\031.v1.Upd" + "ateRequestMetadata\022\n\n\002id\030\002 \001(\t\022(\n\007accoun" + "t\030\003 \001(\0132\013.v1.AccountB\n\362\370\263\007\005\260\363\263\007\001\"\304\001\n\025Acc" + "ountUpdateResponse\0224\n\004meta\030\001 \001(\0132\032.v1.Up" + "dateResponseMetadataB\n\362\370\263\007\005\260\363\263\007\001\022(\n\007acco" + "unt\030\002 \001(\0132\013.v1.AccountB\n\362\370\263\007\005\260\363\263\007\001\022?\n\nra" + "te_limit\030\003 \001(\0132\025.v1.RateLimitMetadataB\024\362" + "\370\263\007\005\260\363\263\007\001\362\370\263\007\005\220\364\263\007\001:\n\372\370\263\007\005\250\363\263\007\001\"W\n\024Accou" + "ntDeleteRequest\022\'\n\004meta\030\001 \001(\0132\031.v1.Delet" + "eRequestMetadata\022\026\n\002id\030\002 \001(\tB\n\362\370\263\007\005\260\363\263\007\001" + "\"\232\001\n\025AccountDeleteResponse\0224\n\004meta\030\001 \001(\013" + "2\032.v1.DeleteResponseMetadataB\n\362\370\263\007\005\260\363\263\007\001" + "\022?\n\nrate_limit\030\002 \001(\0132\025.v1.RateLimitMetad" + "ataB\024\362\370\263\007\005\260\363\263\007\001\362\370\263\007\005\220\364\263\007\001:\n\372\370\263\007\005\250\363\263\007\001\"W\n" + "\022AccountListRequest\022%\n\004meta\030\001 \001(\0132\027.v1.L" + "istRequestMetadata\022\032\n\006filter\030\002 \001(\tB\n\362\370\263\007" + "\005\260\363\263\007\001\"\251\001\n\023AccountListResponse\022&\n\004meta\030\001" + " \001(\0132\030.v1.ListResponseMetadata\022)\n\010accoun" + "ts\030\002 \003(\0132\013.v1.AccountB\n\362\370\263\007\005\270\363\263\007\001\022?\n\nrat" + "e_limit\030\003 \001(\0132\025.v1.RateLimitMetadataB\024\362\370" + "\263\007\005\260\363\263\007\001\362\370\263\007\005\220\364\263\007\001\"\324\001\n\007Account\022\030\n\004user\030\001" + " \001(\0132\010.v1.UserH\000\022\036\n\007service\030\002 \001(\0132\013.v1.S" + "erviceH\000:a\372\370\263\007\005\250\363\263\007\001\372\370\263\007R\302\363\263\007M\242\363\263\007 tf_ex" + "amples/account_resource.txt\252\363\263\007#tf_examp" + "les/account_data_source.txtB,\n\007account\022!" + "\252\370\263\007\016\252\370\263\007\tsuspended\252\370\263\007\t\252\370\263\007\004tags\"\223\002\n\004Us" + "er\022\026\n\002id\030\001 \001(\tB\n\362\370\263\007\005\260\363\263\007\001\022\036\n\005email\030\002 \001(" + "\tB\017\362\370\263\007\n\260\363\263\007\001\300\363\263\007\001\022#\n\nfirst_name\030\003 \001(\tB\017" + "\362\370\263\007\n\260\363\263\007\001\300\363\263\007\001\022\"\n\tlast_name\030\004 \001(\tB\017\362\370\263\007" + "\n\260\363\263\007\001\300\363\263\007\001\022\035\n\tsuspended\030\005 \001(\010B\n\362\370\263\007\005\260\363\263" + "\007\001\022\"\n\004tags\030\006 \001(\0132\010.v1.TagsB\n\362\370\263\007\005\260\363\263\007\001\022;" + "\n\020permission_level\030\007 \001(\tB!\362\370\263\007\034\260\363\263\007\001\332\363\263\007" + "\010readonly\230\364\263\007\001\260\364\263\007\001:\n\372\370\263\007\005\250\363\263\007\001\"\217\001\n\007Serv" + "ice\022\026\n\002id\030\001 \001(\tB\n\362\370\263\007\005\260\363\263\007\001\022\035\n\004name\030\002 \001(" + "\tB\017\362\370\263\007\n\260\363\263\007\001\300\363\263\007\001\022\035\n\tsuspended\030\003 \001(\010B\n\362" + "\370\263\007\005\260\363\263\007\001\022\"\n\004tags\030\004 \001(\0132\010.v1.TagsB\n\362\370\263\007\005" + "\260\363\263\007\001:\n\372\370\263\007\005\250\363\263\007\0012\225\004\n\010Accounts\022c\n\006Create" + "\022\030.v1.AccountCreateRequest\032\031.v1.AccountC" + "reateResponse\"$\202\371\263\007\t\242\363\263\007\004post\202\371\263\007\021\252\363\263\007\014/" + "v1/accounts\022^\n\003Get\022\025.v1.AccountGetReques" + "t\032\026.v1.AccountGetResponse\"(\202\371\263\007\010\242\363\263\007\003get" + "\202\371\263\007\026\252\363\263\007\021/v1/accounts/{id}\022g\n\006Update\022\030." + "v1.AccountUpdateRequest\032\031.v1.AccountUpda" + "teResponse\"(\202\371\263\007\010\242\363\263\007\003put\202\371\263\007\026\252\363\263\007\021/v1/a" + "ccounts/{id}\022j\n\006Delete\022\030.v1.AccountDelet" + "eRequest\032\031.v1.AccountDeleteResponse\"+\202\371\263" + "\007\013\242\363\263\007\006delete\202\371\263\007\026\252\363\263\007\021/v1/accounts/{id}" + "\022\\\n\004List\022\026.v1.AccountListRequest\032\027.v1.Ac" + "countListResponse\"#\202\371\263\007\010\242\363\263\007\003get\202\371\263\007\021\252\363\263" + "\007\014/v1/accounts\032\021\312\371\263\007\014\302\371\263\007\007AccountBd\n\034com" + ".strongdm.api.v1.plumbingB\020AccountsPlumb" + "ingZ2github.com/strongdm/strongdm-sdk-go" + "/internal/v1;v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.strongdm.api.v1.plumbing.Options.getDescriptor(), com.strongdm.api.v1.plumbing.Spec.getDescriptor(), com.strongdm.api.v1.plumbing.TagsPlumbing.getDescriptor(), }); internal_static_v1_AccountCreateRequest_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_v1_AccountCreateRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountCreateRequest_descriptor, new java.lang.String[] { "Meta", "Account", }); internal_static_v1_AccountCreateResponse_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_v1_AccountCreateResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountCreateResponse_descriptor, new java.lang.String[] { "Meta", "Account", "Token", "RateLimit", }); internal_static_v1_AccountGetRequest_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_v1_AccountGetRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountGetRequest_descriptor, new java.lang.String[] { "Meta", "Id", }); internal_static_v1_AccountGetResponse_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_v1_AccountGetResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountGetResponse_descriptor, new java.lang.String[] { "Meta", "Account", "RateLimit", }); internal_static_v1_AccountUpdateRequest_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_v1_AccountUpdateRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountUpdateRequest_descriptor, new java.lang.String[] { "Meta", "Id", "Account", }); internal_static_v1_AccountUpdateResponse_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_v1_AccountUpdateResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountUpdateResponse_descriptor, new java.lang.String[] { "Meta", "Account", "RateLimit", }); internal_static_v1_AccountDeleteRequest_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_v1_AccountDeleteRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountDeleteRequest_descriptor, new java.lang.String[] { "Meta", "Id", }); internal_static_v1_AccountDeleteResponse_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_v1_AccountDeleteResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountDeleteResponse_descriptor, new java.lang.String[] { "Meta", "RateLimit", }); internal_static_v1_AccountListRequest_descriptor = getDescriptor().getMessageTypes().get(8); internal_static_v1_AccountListRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountListRequest_descriptor, new java.lang.String[] { "Meta", "Filter", }); internal_static_v1_AccountListResponse_descriptor = getDescriptor().getMessageTypes().get(9); internal_static_v1_AccountListResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_AccountListResponse_descriptor, new java.lang.String[] { "Meta", "Accounts", "RateLimit", }); internal_static_v1_Account_descriptor = getDescriptor().getMessageTypes().get(10); internal_static_v1_Account_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_Account_descriptor, new java.lang.String[] { "User", "Service", "Account", }); internal_static_v1_User_descriptor = getDescriptor().getMessageTypes().get(11); internal_static_v1_User_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_User_descriptor, new java.lang.String[] { "Id", "Email", "FirstName", "LastName", "Suspended", "Tags", "PermissionLevel", }); internal_static_v1_Service_descriptor = getDescriptor().getMessageTypes().get(12); internal_static_v1_Service_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_v1_Service_descriptor, new java.lang.String[] { "Id", "Name", "Suspended", "Tags", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.strongdm.api.v1.plumbing.Options.fieldOptions); registry.add(com.strongdm.api.v1.plumbing.Options.messageOptions); registry.add(com.strongdm.api.v1.plumbing.Options.methodOptions); registry.add(com.strongdm.api.v1.plumbing.Options.oneofOptions); registry.add(com.strongdm.api.v1.plumbing.Options.serviceOptions); com.google.protobuf.Descriptors.FileDescriptor .internalUpdateFileDescriptor(descriptor, registry); com.strongdm.api.v1.plumbing.Options.getDescriptor(); com.strongdm.api.v1.plumbing.Spec.getDescriptor(); com.strongdm.api.v1.plumbing.TagsPlumbing.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) }
3e141eaccefa1963d74e832cb014faa234fcc531
5,055
java
Java
src/main/java/com/flutter/example/sgs/node/actor/retry/RetryActor.java
bytemania/sgs
fedecbcd51e407712821572a9e703fccaea52343
[ "Unlicense" ]
null
null
null
src/main/java/com/flutter/example/sgs/node/actor/retry/RetryActor.java
bytemania/sgs
fedecbcd51e407712821572a9e703fccaea52343
[ "Unlicense" ]
3
2019-11-13T11:55:01.000Z
2021-01-21T00:18:43.000Z
src/main/java/com/flutter/example/sgs/node/actor/retry/RetryActor.java
bytemania/sgs
fedecbcd51e407712821572a9e703fccaea52343
[ "Unlicense" ]
null
null
null
38.587786
119
0.582196
8,515
package com.flutter.example.sgs.node.actor.retry; import akka.actor.AbstractActor; import akka.actor.Actor; import akka.actor.ActorRef; import akka.actor.Props; import akka.dispatch.OnComplete; import akka.event.Logging; import akka.event.LoggingAdapter; import akka.pattern.Patterns; import akka.util.Timeout; import com.flutter.example.sgs.cluster.Nack; import io.vavr.control.Either; import lombok.Getter; import lombok.RequiredArgsConstructor; import scala.concurrent.Future; import java.time.Duration; public class RetryActor extends AbstractActor { public static Props props(int tries, int timeoutSeconds, int intervalSeconds, ActorRef forwardTo) { return Props.create(RetryActor.class, () -> new RetryActor(tries, timeoutSeconds, intervalSeconds, forwardTo)); } @RequiredArgsConstructor(staticName = "of") @Getter private static class InternalRetry { private final ActorRef originalSender; private final Object message; private final int times; private final String id; } @RequiredArgsConstructor(staticName = "of") @Getter private static class InternalResponse { private final ActorRef originalSender; private final Either<Throwable, Object> result; private final String id; } private LoggingAdapter log = Logging.getLogger(getContext().system(), this); private final int tries; private Timeout timeout; private final Duration interval; private final ActorRef forwardTo; private AbstractActor.Receive loop; private RetryActor(int tries, int timeoutSeconds, int intervalSeconds, ActorRef forwardTo) { this.tries = tries; this.timeout = Timeout.create(Duration.ofSeconds(timeoutSeconds)); this.interval = Duration.ofSeconds(intervalSeconds); this.forwardTo = forwardTo; loop = receiveBuilder() .match(InternalRetry.class, this::retryMessage) .match(InternalResponse.class, this::responseMessage) .matchAny(m ->log.warning("No handling defined for message {}", m)) .build(); } @Override public Receive createReceive() { return receiveBuilder() .match(SendRetryCommand.class, this::receiveMessage) .build(); } private void receiveMessage(SendRetryCommand command) { getContext().become(loop); self().tell(InternalRetry.of(sender(), command.getMessage(), tries, command.getId()), Actor.noSender()); } private void retryMessage(InternalRetry internalRetry) { Future<Object> scalaFuture = Patterns.ask(forwardTo, internalRetry.message, timeout); scalaFuture.onComplete(new OnComplete<>() { @Override public void onComplete(Throwable failure, Object response) { if (failure == null) { log.info("@@@@@@@@@@@@@@@@@@@@@@@@ SUCCESS RESPONSE:{}", response); self().tell(InternalResponse.of( internalRetry.originalSender, Either.right(response), internalRetry.getId()), Actor.noSender()); } else if (internalRetry.getTimes() > 1) { log.info("@@@@@@@@@@@@@@@@@@@@@@@@ ERROR TIMES:{}", internalRetry.getTimes()); getContext().getSystem().scheduler().scheduleOnce( interval, self(), InternalRetry.of( internalRetry.originalSender, internalRetry.getMessage(), internalRetry.getTimes() - 1, internalRetry.getId()), getContext().getDispatcher(), Actor.noSender()); } else if(internalRetry.getTimes() == 1) { log.info("@@@@@@@@@@@@@@@@@@@@@@@@ ERROR NO MORE TIMES FAILURE :{}", failure); self().tell(InternalResponse.of( internalRetry.originalSender, Either.left(failure), internalRetry.getId()), Actor.noSender()); } else { log.error("Error occurred", failure); } } }, getContext().getDispatcher()); } private void responseMessage(InternalResponse response) { if (response.result.isLeft()) { log.error("Message not delivered id:{} from:{} to:{}", response.getId(), response.originalSender.path(), forwardTo.path()); response.originalSender.tell(Nack.of(response.getId()), Actor.noSender()); } else { response.originalSender.tell(response.result.get(), Actor.noSender()); } log.info("@@@@@@@@@@@@@@@@@@@@@@@@ STOPPING ACTOR for id: {}", response.getId()); getContext().stop(self()); } }
3e141f648ce09edd13c3a5b1874d759eb7f580a2
4,787
java
Java
testeditor/src/main/java/org/museautomation/ui/steptask/execution/InteractiveTestControllerImpl.java
ChrisLMerrill/museide
0e12fd3005f36a72f0075b227387673cda293874
[ "Apache-2.0" ]
null
null
null
testeditor/src/main/java/org/museautomation/ui/steptask/execution/InteractiveTestControllerImpl.java
ChrisLMerrill/museide
0e12fd3005f36a72f0075b227387673cda293874
[ "Apache-2.0" ]
null
null
null
testeditor/src/main/java/org/museautomation/ui/steptask/execution/InteractiveTestControllerImpl.java
ChrisLMerrill/museide
0e12fd3005f36a72f0075b227387673cda293874
[ "Apache-2.0" ]
null
null
null
24.299492
119
0.722164
8,516
package org.museautomation.ui.steptask.execution; import org.museautomation.core.*; import org.museautomation.core.context.*; import org.museautomation.core.events.*; import org.museautomation.core.execution.*; import org.museautomation.core.plugins.*; import org.museautomation.core.task.*; import org.museautomation.core.task.input.*; import org.museautomation.ui.extend.edit.step.*; import org.museautomation.ui.steptree.*; import java.util.*; /** * Manages the state of an interactive execution of a stepped test and summarizes test events * into InteractiveTestState change events. * * @author Christopher L Merrill (see LICENSE.txt for license details) */ public class InteractiveTestControllerImpl extends BaseInteractiveTestController { public InteractiveTestControllerImpl() { } public InteractiveTaskState getState() { return _state; } public Breakpoints getBreakpoints() { return _breakpoints; } public boolean run(SteppedTaskProvider task_provider) { if (_state.equals(InteractiveTaskState.IDLE)) { _task_provider = task_provider; InteractiveTaskRunner runner = getRunner(); runner.start(); setState(InteractiveTaskState.STARTING); setState(InteractiveTaskState.RUNNING); runner.runTask(); return true; } return false; } private InteractiveTaskRunner getRunner() { if (_runner == null && _task_provider != null) { BasicTaskConfiguration config = new BasicTaskConfiguration(_task_provider.getTask()); config.addPlugin(new EventListener()); final PauseOnFailureOrError pauser = new PauseOnFailureOrError(); config.addPlugin(pauser); _runner = new InteractiveTaskRunner(new ProjectExecutionContext(_task_provider.getProject()), config, _breakpoints); for (TaskInputProvider provider : _input_providers) _runner.addInputProvider(provider); pauser.setRunner(_runner); } return _runner; } class EventListener implements MusePlugin, MuseEventListener { @Override public void eventRaised(MuseEvent event) { switch (event.getTypeId()) { case EndTaskEventType.TYPE_ID: setState(InteractiveTaskState.STOPPING); break; case PauseTaskEventType.TYPE_ID: setState(InteractiveTaskState.PAUSED); break; default: setState(InteractiveTaskState.RUNNING); } } @Override public boolean conditionallyAddToContext(MuseExecutionContext context, boolean automatic) { context.addPlugin(this); return true; } @Override public void initialize(MuseExecutionContext context) { _context = context; _context.addEventListener(this); } @Override public void shutdown() { _result = TaskResult.find(getRunner().getExecutionContext()); _runner = null; setState(InteractiveTaskState.IDLE); _context.removeEventListener(this); } @Override public String getId() { return "no/id"; } MuseExecutionContext _context; } private void setState(InteractiveTaskState state) { if (state.equals(_state)) return; _state = state; // iterate a separate list, so that listeners may unsubscribe during an event. List<InteractiveTaskStateListener> listeners = new ArrayList<>(_listeners); for (InteractiveTaskStateListener listener : listeners) listener.stateChanged(state); } /** * Get the current TestRunner, or null if there is no TestRunner active. */ public TaskRunner getTestRunner() { return getRunner(); } @SuppressWarnings("unused") // used in GUI public void stop() { getRunner().requestStop(); } @SuppressWarnings("unused") // used in GUI public void pause() { getRunner().requestPause(); } public void resume() { getRunner().requestResume(); } public void step() { getRunner().requestStep(); } /* public void runPastStep(SteppedTestProvider provider, StepConfiguration step) { _provider = provider; getRunner().getExecutionContext().addEventListener(new PauseAfterStep(getRunner(), step)); run(provider); } */ @SuppressWarnings("unused") // used in GUI public void runOneStep(SteppedTaskProvider provider) { _task_provider = provider; getRunner().requestPause(); run(provider); } public void addInputProvider(TaskInputProvider provider) { _input_providers.add(provider); } public TaskResult getResult() { return _result; } private InteractiveTaskState _state = InteractiveTaskState.IDLE; private SteppedTaskProvider _task_provider; private InteractiveTaskRunner _runner; private TaskResult _result = null; private final Breakpoints _breakpoints = new TaskBreakpoints(); private final List<TaskInputProvider> _input_providers = new ArrayList<>(); }
3e141fbb350515810f576adea1fcfed03737102d
2,541
java
Java
spring-creed-example/spring-creed-cache/src/main/java/com/ethan/cache/config/CaffeineConfig.java
PhotonAlpha/spring-creed
fb5cabd060c33ac06d31e24b6d0f11501ece8ab8
[ "Apache-2.0" ]
null
null
null
spring-creed-example/spring-creed-cache/src/main/java/com/ethan/cache/config/CaffeineConfig.java
PhotonAlpha/spring-creed
fb5cabd060c33ac06d31e24b6d0f11501ece8ab8
[ "Apache-2.0" ]
null
null
null
spring-creed-example/spring-creed-cache/src/main/java/com/ethan/cache/config/CaffeineConfig.java
PhotonAlpha/spring-creed
fb5cabd060c33ac06d31e24b6d0f11501ece8ab8
[ "Apache-2.0" ]
null
null
null
37.925373
104
0.763479
8,517
package com.ethan.cache.config; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.RemovalCause; import com.github.benmanes.caffeine.cache.RemovalListener; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; import org.springframework.cache.CacheManager; import org.springframework.cache.caffeine.CaffeineCache; import org.springframework.cache.support.SimpleCacheManager; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; //@Configuration @Deprecated public class CaffeineConfig { private final ApplicationContext applicationContext; private final CacheProperties cacheProperties; public CaffeineConfig(ApplicationContext applicationContext, CacheProperties cacheProperties) { this.applicationContext = applicationContext; this.cacheProperties = cacheProperties; } @Bean public CacheRemovalListener cacheRemovalListener() { return new CacheRemovalListener(); } /** * system local cache configuration * //TODO * create schedule pool executor to refresh the cache */ @Bean public CacheManager cacheManager(CacheRemovalListener cacheRemovalListener) { List<CaffeineCache> caches = cacheProperties.getConfig().stream().map(bean -> { Cache<Object, Object> cache = Caffeine.newBuilder() .initialCapacity(bean.getCaffeine().getInitialCapacity()) .maximumSize(bean.getCaffeine().getMaximumSize()) .expireAfterWrite(bean.getCaffeine().getExpireAfterWriteMins(), TimeUnit.SECONDS) //.weakKeys() .weakValues() .removalListener(cacheRemovalListener) .recordStats() .build(); return new CaffeineCache(bean.getCacheName(), cache); }).collect(Collectors.toList()); SimpleCacheManager manager = new SimpleCacheManager(); manager.setCaches(caches); return manager; } static class CacheRemovalListener implements RemovalListener<Object, Object> { private static final Logger log = org.slf4j.LoggerFactory.getLogger(CacheRemovalListener.class); @Override public void onRemoval(@Nullable Object o, @Nullable Object o2, @NonNull RemovalCause removalCause) { log.info("CacheRemovalListener:{} :{}", new Object[]{o, removalCause}); } } }
3e141ffc42f72db5c03cc7a3460491b3c3f0bbbb
213
java
Java
libs/joriki/src/info/joriki/font/GlyphProvider.java
murkhog/emistoolbox
c973fc5ebe2607402a0c48b8c548dfe3188b27b9
[ "Apache-2.0" ]
1
2015-03-26T18:50:16.000Z
2015-03-26T18:50:16.000Z
libs/joriki/src/info/joriki/font/GlyphProvider.java
murkhog/emistoolbox
c973fc5ebe2607402a0c48b8c548dfe3188b27b9
[ "Apache-2.0" ]
12
2015-03-24T12:29:42.000Z
2015-03-24T13:20:20.000Z
libs/joriki/src/info/joriki/font/GlyphProvider.java
emistoolbox/emistoolbox
c973fc5ebe2607402a0c48b8c548dfe3188b27b9
[ "Apache-2.0" ]
null
null
null
17.75
55
0.751174
8,518
/* * Copyright 2002 Felix Pahl. All rights reserved. * Use is subject to license terms. */ package info.joriki.font; public interface GlyphProvider { public void interpret (GlyphInterpreter interpreter); }
3e1422e6cf7dc812800b0d9d2de65314391b0e2a
17,890
java
Java
exporter/src/main/java/com/datapath/ocds/kyrgyzstan/exporter/dao/services/CNPublicationDAOService.java
DataPathAnalytics/KR_Developing-a-New-Audit-Methodology-for-Electronic-Public-Tenders-OCDS
c5e37f092bd6f0980ec47d4904cbd6b852819727
[ "Apache-2.0" ]
null
null
null
exporter/src/main/java/com/datapath/ocds/kyrgyzstan/exporter/dao/services/CNPublicationDAOService.java
DataPathAnalytics/KR_Developing-a-New-Audit-Methodology-for-Electronic-Public-Tenders-OCDS
c5e37f092bd6f0980ec47d4904cbd6b852819727
[ "Apache-2.0" ]
null
null
null
exporter/src/main/java/com/datapath/ocds/kyrgyzstan/exporter/dao/services/CNPublicationDAOService.java
DataPathAnalytics/KR_Developing-a-New-Audit-Methodology-for-Electronic-Public-Tenders-OCDS
c5e37f092bd6f0980ec47d4904cbd6b852819727
[ "Apache-2.0" ]
null
null
null
52.772861
140
0.515372
8,519
package com.datapath.ocds.kyrgyzstan.exporter.dao.services; import com.datapath.ocds.kyrgyzstan.exporter.dao.entity.*; import com.datapath.ocds.kyrgyzstan.exporter.dao.repository.CompanyRepository; import com.datapath.ocds.kyrgyzstan.exporter.dao.repository.OrderRepository; import com.datapath.ocds.kyrgyzstan.exporter.exceptions.EntityNotFoundException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import java.util.List; @Service public class CNPublicationDAOService { private static final String PARTIES_QUERY = "with ate_parsed as (\n" + " with recursive ate_rec(id, code, tree) as (\n" + " select\n" + " id,\n" + " code,\n" + " name_ru :: text as tree\n" + " from ate\n" + " where parent is null\n" + " union\n" + " select\n" + " a.id,\n" + " a.code,\n" + " concat(ate_rec.tree, '|', a.name_ru) as tree\n" + " from ate a\n" + " join ate_rec on a.parent = ate_rec.id\n" + " )\n" + " select\n" + " id,\n" + " code,\n" + " nullif(split_part(tree, '|', 1), '') as country,\n" + " nullif(split_part(tree, '|', 2), '') as region,\n" + " nullif(split_part(tree, '|', 3), '') as subregion,\n" + " nullif(split_part(tree, '|', 4), '') as district,\n" + " nullif(split_part(tree, '|', 5), '') as subdistrict,\n" + " nullif(split_part(tree, '|', 6), '') as subsubdistrict,\n" + " nullif(split_part(tree, '|', 7), '') as locality\n" + " from ate_rec)\n" + "select\n" + "\n" + " c.inn id,\n" + " c.title_en name_en,\n" + " c.title_ru name_ru,\n" + " c.title_ky name_kg,\n" + " a.code as ate_code,\n" + " a.country as country_name,\n" + " a.region as region,\n" + " a.subregion as subregion,\n" + " a.district as district,\n" + " a.subdistrict as subdistrict,\n" + " a.subsubdistrict as subsubdistrict,\n" + " a.locality as locality,\n" + " c.fact_address as street_address\n" + "from json_event je\n" + " join orders o on o.id = je.order_id\n" + " join company c on c.id = o.company_id\n" + " left join ate_parsed a on a.id = c.ate_id\n" + "where je.id = ?"; private static final String ALLOWED_TENDERER_QUERY = "with ate_parsed as (\n" + " with recursive ate_rec(id, code, tree) as (\n" + " select\n" + " id,\n" + " code,\n" + " name_ru :: text as tree\n" + " from ate\n" + " where parent is null\n" + " union\n" + " select\n" + " a.id,\n" + " a.code,\n" + " concat(ate_rec.tree, '|', a.name_ru) as tree\n" + " from ate a\n" + " join ate_rec on a.parent = ate_rec.id\n" + " )\n" + " select\n" + " id,\n" + " code,\n" + " nullif(split_part(tree, '|', 1), '') as country,\n" + " nullif(split_part(tree, '|', 2), '') as region,\n" + " nullif(split_part(tree, '|', 3), '') as subregion,\n" + " nullif(split_part(tree, '|', 4), '') as district,\n" + " nullif(split_part(tree, '|', 5), '') as subdistrict,\n" + " nullif(split_part(tree, '|', 6), '') as subsubdistrict,\n" + " nullif(split_part(tree, '|', 7), '') as locality\n" + " from ate_rec)\n" + "select\n" + " c.inn,\n" + " c.title_en,\n" + " c.title_ru,\n" + " c.title_ky,\n" + " a.code as ate_code,\n" + " a.country as country_name,\n" + " a.region as region,\n" + " a.subregion as subregion,\n" + " a.district as district,\n" + " a.subdistrict as subdistrict,\n" + " a.subsubdistrict as subsubdistrict,\n" + " a.locality as locality,\n" + " c.fact_address as street_address\n" + "from json_event je\n" + " inner join orders_single_source_allowed_companies ssa on ssa.order_id = je.order_id\n" + " inner join company c on c.id = ssa.company_id\n" + " inner join ate_parsed a on c.ate_id = a.id\n" + "where je.id = ?"; private static final String RELATED_PROCESSES = "select case when previous_signed_order_number is not null\n" + " then (select id from orders where number=o.previous_signed_order_number limit 1 ) else null end as identifier,\n" + " 'prior' as relationship\n" + "from orders o WHERE length(o.previous_signed_order_number)>5\n" + " AND o.id = ?\n" + "union\n" + "select ns.previous_not_signed_order_id identifier,\n" + " 'unsuccessfulProcess' as relationship\n" + "from orders o\n" + " join orders_previous_not_signed_orders ns on ns.order_id=o.id\n" + "WHERE o.id = ?"; private static final String QUALIFICATION_REQUIREMENTS = "select qr.id,q.title\n" + "from qualifier_requirement qr\n" + "join qualifier q on q.id=qr.qualifier_id\n" + "where qr.order_id = ?"; private static final String ITEMS = "select\n" + " p.id,\n" + " l.id related_lot,\n" + " oz.original_code classification_id,\n" + " p.amount quantity,\n" + " m.id unit_id,\n" + " m.full_name unit_name,\n" + " p.prce_for_unit unit_value_amount\n" + "from lot l\n" + " join products p on p.lot_id = l.id\n" + " join okgz oz on oz.code = p.okgz_id\n" + " join measurement_unit m on p.measurement_unit_id = m.id\n" + "where l.order_id = ?"; private static final String DOCUMENTS = "select att.id,null::integer related_lot,null::integer related_item\n" + " from orders o\n" + " join attachment att on (att.id = o.main_order_attachment or att.id = o.reason_attachment_id)\n" + "where o.id = ?\n" + "union\n" + "select att.id,l.id related_lot,null related_item\n" + "from lot l\n" + " join attachment att on (att.id = l.pre_qualification_attachment or att.id = l.time_table_id)\n" + "where l.order_id = ?\n" + "union\n" + "select att.id id,null related_lot,p.id related_item\n" + "from lot l\n" + " join products p on p.lot_id=l.id\n" + " join product_attachment pa on pa.product_id=p.id\n" + " join attachment att on pa.attachment_id = att.id\n" + "where l.order_id = ?"; private static final String LOTS = "SELECT id,sum_contest AS amount, number FROM lot WHERE order_id=?"; private static final String CONTRACT_POINTS_QUERY = "select\n" + " p.full_name as name,\n" + " p.mobile_phone as phone,\n" + " p.email as email,\n" + " p.position as role\n" + "from company c\n" + " join person p on p.company_id = c.id\n" + "where c.id = ?"; private static final String TENDER_QUERY = "select\n" + " o.id id,\n" + " o.status current_stage,\n" + " o.date_published date_published,\n" + " o.number,\n" + " 'electronicSubmission' as submission_method,\n" + " case\n" + " when o.procurement_method in (0, 7, 8, 9)\n" + " then 'open'\n" + " when o.procurement_method = 6 and o.only_previously_signed_companies = true\n" + " then 'selective'\n" + " when o.procurement_method = 6 and o.only_previously_signed_companies = false\n" + " then 'open'\n" + " when o.procurement_method = 6 and o.only_previously_signed_companies is null\n" + " then 'open'\n" + " end as procurement_method,\n" + " case\n" + " when o.pre_qualification = true then 'preQualification'::text\n" + " when o.procurement_method = 0 then 'egov'::text\n" + " when o.procurement_method = 6 then 'singleSource'::text\n" + " when o.procurement_method = 7 then 'oneStage'::text\n" + " when o.procurement_method = 8 then 'simplicated'::text\n" + " when o.procurement_method = 9 then 'downgrade'::text\n" + " end as procurement_method_details,\n" + " case\n" + " when o.single_source_reason = 0\n" + " then 'additionalProcurement10'\n" + " when o.single_source_reason = 1\n" + " then 'additionalProcurement25'\n" + " when o.single_source_reason = 2\n" + " then 'annualProcurement'\n" + " when o.single_source_reason = 3\n" + " then 'forPenalSystem'\n" + " when o.single_source_reason = 4\n" + " then 'intellectualRights'\n" + " when o.single_source_reason = 5\n" + " then 'twiceUnsuccessful'\n" + " when o.single_source_reason = 6\n" + " then 'urgentNeed'\n" + " when o.single_source_reason = 7\n" + " then 'earlyElections'\n" + " when o.single_source_reason = 8\n" + " then 'foreignInstitutionsKR'\n" + " when o.single_source_reason = 9\n" + " then 'art'\n" + " when o.single_source_reason = 10\n" + " then 'selfReliance'\n" + " end as procurement_method_rationale,\n" + " o.total_sum as value_amount,\n" + " 'KGS' as value_currency,\n" + " o.date_published as start_date,\n" + " o.date_contest as end_date,\n" + " cc.id condition_of_contract_id,\n" + " cc.day_rate_delivery late_delivery_rate,\n" + " cc.day_rate_payment late_payment_rate,\n" + " cc.forfeit_day_rate late_guarantee_rate,\n" + " cc.guarantee_provision guarantee_percent,\n" + " cc.max_deductible_amount_delivery max_deductible_amount_delivery,\n" + " cc.max_deductible_amount_payment max_deductible_amount_payment,\n" + " cc.max_deductible_amount max_deductible_amount_guarantee,\n" + " cc.allow_guarantee has_guarantee,\n" + " cc.allow_insurance has_insurance,\n" + " cc.allow_related_service has_related_services,\n" + " cc.allow_spares has_spares,\n" + " cc.allow_technical_control has_technical_control,\n" + " cc.allow_advance has_prepayment,\n" + " cc.allow_after_acceptance has_acceptance_payment,\n" + " cc.allow_after_shipment has_shipment_payment,\n" + " cc.advance prepayment_percent,\n" + " cc.after_acceptance acceptance_payment_percent,\n" + " cc.after_shipment shipment_payment_percent,\n" + " cc.insurance insurance_type,\n" + " cc.court_type has_arbitral_tribunal\n" + "from json_event je\n" + " inner join orders o on o.id = je.order_id\n" + " inner join company c on c.id = o.company_id\n" + " left join conditions_of_contract cc on cc.id = o.contract_id\n" + "where je.id = ?"; private static final String CONDITION_OF_CONTRACT_QUERY = "select\n" + " cc.id,\n" + " cc.day_rate_delivery late_delivery_rate,\n" + " cc.day_rate_payment late_payment_rate,\n" + " cc.forfeit_day_rate late_guarantee_rate,\n" + " cc.guarantee_provision guarantee_percent,\n" + " cc.max_deductible_amount_delivery max_deductible_amount_delivery,\n" + " cc.max_deductible_amount_payment max_deductible_amount_payment,\n" + " cc.max_deductible_amount max_deductible_amount_guarantee,\n" + " cc.allow_guarantee has_guarantee,\n" + " cc.allow_insurance has_insurance,\n" + " cc.allow_related_service has_related_services,\n" + " cc.allow_spares has_spares,\n" + " cc.allow_technical_control has_technical_control,\n" + " cc.allow_advance has_prepayment,\n" + " cc.allow_after_acceptance has_acceptance_payment,\n" + " cc.allow_after_shipment has_shipment_payment,\n" + " cc.advance prepayment_percent,\n" + " cc.after_acceptance acceptance_payment_percent,\n" + " cc.after_shipment shipment_payment_percent,\n" + " cc.insurance insurance_type,\n" + " cc.court_type has_arbitral_tribunal\n" + "from conditions_of_contract cc\n" + "where cc.order_id = ?"; @Autowired private OrderRepository orderRepository; @Autowired private CompanyRepository companyRepository; private JdbcTemplate jdbcTemplate; public CNPublicationDAOService(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } public Order getOrder(Integer orderId) { return orderRepository.findById(orderId).orElseThrow(() -> new EntityNotFoundException("Order not found")); } public Company getCompany(Integer companyId) { return companyRepository.findById(companyId).orElseThrow(() -> new EntityNotFoundException("Company not found")); } public List<PartyDAO> getAllowedTenderers(Integer jsonEventId) { return jdbcTemplate.query(ALLOWED_TENDERER_QUERY, new BeanPropertyRowMapper<>(PartyDAO.class), jsonEventId); } public List<RelatedProcessDAO> getRelatedProcesses(Integer orderId) { return jdbcTemplate.query(RELATED_PROCESSES, new BeanPropertyRowMapper<>(RelatedProcessDAO.class), orderId, orderId); } public List<QualificationRequirementDAO> getQualificationRequirements(Integer orderId) { return jdbcTemplate.query(QUALIFICATION_REQUIREMENTS, new BeanPropertyRowMapper<>(QualificationRequirementDAO.class), orderId); } public List<LotDAO> getLots(Integer orderId) { return jdbcTemplate.query(LOTS, new BeanPropertyRowMapper<>(LotDAO.class), orderId); } public List<TenderItemDAO> getItems(Integer orderId) { return jdbcTemplate.query(ITEMS, new BeanPropertyRowMapper<>(TenderItemDAO.class), orderId); } public ConditionOfContractDAO getConditionsOfContract(Integer orderId) { return jdbcTemplate.queryForObject(CONDITION_OF_CONTRACT_QUERY, new BeanPropertyRowMapper<>(ConditionOfContractDAO.class), orderId); } public List<TenderDocumentDAO> getDocuments(Integer orderId) { return jdbcTemplate.query(DOCUMENTS, new BeanPropertyRowMapper<>(TenderDocumentDAO.class), orderId, orderId, orderId); } public PartyDAO getBuyer(Integer jsonEventId) { return jdbcTemplate.queryForObject(PARTIES_QUERY, new BeanPropertyRowMapper<>(PartyDAO.class), jsonEventId); } public List<ContactPointDAO> getContactPoints(Integer companyId) { return jdbcTemplate.query(CONTRACT_POINTS_QUERY, new BeanPropertyRowMapper<>(ContactPointDAO.class), companyId); } public TenderDAO getTender(Integer jsonEventId) { return jdbcTemplate.queryForObject(TENDER_QUERY, new BeanPropertyRowMapper<>(TenderDAO.class), jsonEventId); } }
3e1423794bc72333cbb63a8ececc7d1e2b1a0a4e
466
java
Java
matterwiki-4j-boot/src/main/java/com/brainboom/matterwiki4jboot/repository/TopicsRepository.java
volunL/Matterwiki4j
a499974f36a3db8b594b1dbfb563a56670fca567
[ "MIT" ]
4
2020-06-18T14:26:00.000Z
2020-12-31T01:16:57.000Z
matterwiki-4j-boot/src/main/java/com/brainboom/matterwiki4jboot/repository/TopicsRepository.java
volunL/Matterwiki4j
a499974f36a3db8b594b1dbfb563a56670fca567
[ "MIT" ]
1
2022-01-21T23:45:16.000Z
2022-01-21T23:45:16.000Z
matterwiki-4j-boot/src/main/java/com/brainboom/matterwiki4jboot/repository/TopicsRepository.java
volunL/Matterwiki4j
a499974f36a3db8b594b1dbfb563a56670fca567
[ "MIT" ]
null
null
null
20.26087
74
0.815451
8,520
package com.brainboom.matterwiki4jboot.repository; import com.brainboom.matterwiki4jboot.entity.Topics; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface TopicsRepository extends JpaRepository<Topics, Integer> { Topics findTopicsById(int Id); Topics findTopicsByNameAndDescription(String name,String description); boolean existsByName(String name); }
3e14237a31ed17cdc03cb7d34629def759da8137
666
java
Java
src/main/java/fi/riista/feature/gamediary/mobile/MobileGameSpeciesCodesetDTO.java
suomenriistakeskus/oma-riista-web
4b641df6b80384ed36bc3e284f104b98f8a84afd
[ "MIT" ]
14
2017-01-11T23:22:36.000Z
2022-02-09T06:49:46.000Z
src/main/java/fi/riista/feature/gamediary/mobile/MobileGameSpeciesCodesetDTO.java
suomenriistakeskus/oma-riista-web
4b641df6b80384ed36bc3e284f104b98f8a84afd
[ "MIT" ]
4
2018-04-16T13:00:49.000Z
2021-02-15T11:56:06.000Z
src/main/java/fi/riista/feature/gamediary/mobile/MobileGameSpeciesCodesetDTO.java
suomenriistakeskus/oma-riista-web
4b641df6b80384ed36bc3e284f104b98f8a84afd
[ "MIT" ]
4
2017-01-20T10:34:24.000Z
2021-02-09T14:41:46.000Z
23.785714
104
0.735736
8,521
package fi.riista.feature.gamediary.mobile; import fi.riista.feature.gamediary.GameCategoryDTO; import fi.riista.feature.gamediary.GameSpeciesDTO; import java.util.List; public class MobileGameSpeciesCodesetDTO { private final List<GameCategoryDTO> categories; private final List<GameSpeciesDTO> species; public MobileGameSpeciesCodesetDTO(List<GameCategoryDTO> categories, List<GameSpeciesDTO> species) { this.categories = categories; this.species = species; } public List<GameCategoryDTO> getCategories() { return categories; } public List<GameSpeciesDTO> getSpecies() { return species; } }
3e1423ea39e138dc36856d073b0fddb70ff2794d
7,140
java
Java
spring-brick/src/main/java/com/gitee/starblues/utils/PluginFileUtils.java
starblues-zhuo/spring-brick
a484b17eee75ac4bc8861e738db86e5a716fc91f
[ "Apache-2.0" ]
2
2022-03-22T08:50:20.000Z
2022-03-31T08:25:16.000Z
spring-brick/src/main/java/com/gitee/starblues/utils/PluginFileUtils.java
starblues-zhuo/spring-brick
a484b17eee75ac4bc8861e738db86e5a716fc91f
[ "Apache-2.0" ]
6
2022-03-20T06:39:15.000Z
2022-03-20T06:39:18.000Z
spring-brick/src/main/java/com/gitee/starblues/utils/PluginFileUtils.java
starblues-zhuo/spring-brick
a484b17eee75ac4bc8861e738db86e5a716fc91f
[ "Apache-2.0" ]
3
2022-03-23T10:34:46.000Z
2022-03-31T10:16:55.000Z
31.875
111
0.547759
8,522
/** * Copyright [2019-2022] [starBlues] * * 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.gitee.starblues.utils; import com.gitee.starblues.common.PackageStructure; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import java.io.*; import java.math.BigInteger; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.MessageDigest; import java.util.Enumeration; import java.util.List; import java.util.jar.Attributes; import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; /** * 插件文件工具类 * * @author starBlues * @version 3.0.0 */ public final class PluginFileUtils { private static final String FILE_POINT = "."; private PluginFileUtils(){} public static String getMd5ByFile(File file) throws FileNotFoundException { String value = null; FileInputStream in = new FileInputStream(file); try { MappedByteBuffer byteBuffer = in.getChannel().map(FileChannel.MapMode.READ_ONLY, 0, file.length()); MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(byteBuffer); BigInteger bi = new BigInteger(1, md5.digest()); value = bi.toString(16); } catch (Exception e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(in); } return value; } public static void cleanEmptyFile(List<String> paths){ if(ObjectUtils.isEmpty(paths)){ return; } for (String pathStr : paths) { Path path = Paths.get(pathStr); if(!Files.exists(path)){ continue; } try { Files.list(path) .forEach(subPath -> { File file = subPath.toFile(); if(!file.isFile()){ return; } long length = file.length(); if(length == 0){ try { Files.deleteIfExists(subPath); } catch (IOException e) { e.printStackTrace(); } } }); } catch (IOException e) { e.printStackTrace(); } } } /** * 如果文件不存在, 则会创建 * @param path 插件路径 * @return 插件路径 * @throws IOException 没有发现文件异常 */ public static File createExistFile(Path path) throws IOException { Path parent = path.getParent(); if(!Files.exists(parent)){ Files.createDirectories(parent); } if(!Files.exists(path)){ Files.createFile(path); } return path.toFile(); } /** * 得到文件名称 * @param file 原始文件 * @return String */ public static String getFileName(File file){ String fileName = file.getName(); if(!file.exists() | file.isDirectory()){ return fileName; } return getFileName(fileName); } /** * 得到文件名称 * @param fileName 原始文件名称. 比如: file.txt * @return String */ public static String getFileName(String fileName){ if(ObjectUtils.isEmpty(fileName)){ return fileName; } if(fileName.lastIndexOf(FILE_POINT) > 0){ return fileName.substring(0, fileName.lastIndexOf(FILE_POINT)); } else { return fileName; } } public static Manifest getManifest(InputStream inputStream) throws IOException { Manifest manifest = new Manifest(); Attributes attributes = manifest.getMainAttributes(); List<String> lines = IOUtils.readLines(inputStream, PackageStructure.CHARSET_NAME); for (String line : lines) { String[] split = line.split(":"); if(split.length == 2){ String key = split[0]; String value = split[1]; attributes.putValue(trim(key), trim(value)); } } return manifest; } private static String trim(String value){ if(ObjectUtils.isEmpty(value)){ return value; } return value.trim(); } public static void deleteFile(File file) throws IOException { if(file == null || !file.exists()){ return; } if(file.isDirectory()){ FileUtils.deleteDirectory(file); } else { FileUtils.delete(file); } } public static void decompressZip(String zipPath, String targetDir) throws IOException { File zipFile = new File(zipPath); if(!ResourceUtils.isZip(zipPath) && !ResourceUtils.isJar(zipPath)){ throw new IOException("文件[" + zipFile.getName() + "]非压缩包, 不能解压"); } File targetDirFile = new File(targetDir); if(!targetDirFile.exists()){ targetDirFile.mkdirs(); } try (ZipFile zip = new ZipFile(zipFile, Charset.forName(PackageStructure.CHARSET_NAME))) { Enumeration<? extends ZipEntry> zipEnumeration = zip.entries(); ZipEntry zipEntry = null; while (zipEnumeration.hasMoreElements()) { zipEntry = zipEnumeration.nextElement(); String zipEntryName = zipEntry.getName(); String currentZipPath = PackageStructure.resolvePath(zipEntryName); String currentTargetPath = FilesUtils.joiningFilePath(targetDir, currentZipPath); //判断路径是否存在,不存在则创建文件路径 if (zipEntry.isDirectory()) { FileUtils.forceMkdir(new File(currentTargetPath)); continue; } InputStream in = null; FileOutputStream out = null; try { in = zip.getInputStream(zipEntry); out = new FileOutputStream(currentTargetPath); IOUtils.copy(in, out); } finally { if (in != null) { IOUtils.closeQuietly(in); } if (out != null) { IOUtils.closeQuietly(out); } } } } } }
3e14248851a6d237de2a5973fcfd1cea29fbcf87
1,198
java
Java
EJB2toEJB3/src/ch/itenengineering/migration/ejb/EJB2Bean.java
iten-engineering/jee6
2638398bf0f7c3f7b8640fc504293ca5471e4d00
[ "MIT" ]
null
null
null
EJB2toEJB3/src/ch/itenengineering/migration/ejb/EJB2Bean.java
iten-engineering/jee6
2638398bf0f7c3f7b8640fc504293ca5471e4d00
[ "MIT" ]
null
null
null
EJB2toEJB3/src/ch/itenengineering/migration/ejb/EJB2Bean.java
iten-engineering/jee6
2638398bf0f7c3f7b8640fc504293ca5471e4d00
[ "MIT" ]
null
null
null
22.603774
76
0.552588
8,523
package ch.itenengineering.migration.ejb; import java.rmi.RemoteException; import javax.ejb.EJB; import javax.ejb.EJBException; import javax.ejb.SessionContext; public class EJB2Bean implements javax.ejb.SessionBean { private static final long serialVersionUID = 1L; @SuppressWarnings("unused") private SessionContext sessionContext; @EJB EJB3Local ejb3; // ------------------------------------------------------------------------ // bean methods // ------------------------------------------------------------------------ public void ejbCreate() { } public void ejbActivate() { } public void ejbPassivate() { } public void ejbRemove() { } public void setSessionContext(SessionContext sessionContext) throws EJBException, RemoteException { this.sessionContext = sessionContext; } // ------------------------------------------------------------------------ // business methods // ------------------------------------------------------------------------ public String echo(String message) { return "echo from EJB2Bean - message <" + message + "> received!"; } public String echoFromEJB3(String message) { return ejb3.echo(message); } } // end class
3e1424947f57b71ea9a7f12e501cba566548c0b0
208
java
Java
src/main/java/io/alapierre/pki/gui/task/FaultCallback.java
alapierre/pki-csr-generator
b8083d18f80cef9073504b704b9cf66f3af232d6
[ "Apache-2.0" ]
null
null
null
src/main/java/io/alapierre/pki/gui/task/FaultCallback.java
alapierre/pki-csr-generator
b8083d18f80cef9073504b704b9cf66f3af232d6
[ "Apache-2.0" ]
null
null
null
src/main/java/io/alapierre/pki/gui/task/FaultCallback.java
alapierre/pki-csr-generator
b8083d18f80cef9073504b704b9cf66f3af232d6
[ "Apache-2.0" ]
null
null
null
18.727273
55
0.718447
8,524
package io.alapierre.pki.gui.task; /** * @author Adrian Lapierre {@literal <dycjh@example.com>} * created 20.09.18 */ @FunctionalInterface public interface FaultCallback { void fault(Throwable ex); }
3e1424dc87d43ae7727f2ac020b6272fde152294
2,343
java
Java
src/main/java/org/elaastic/qtapi/entities/User.java
elaastic/elaastic-qt-api
22ca0a296ec12243d9616d7ab8890c5fd2d1f353
[ "Apache-2.0" ]
null
null
null
src/main/java/org/elaastic/qtapi/entities/User.java
elaastic/elaastic-qt-api
22ca0a296ec12243d9616d7ab8890c5fd2d1f353
[ "Apache-2.0" ]
12
2019-02-13T12:20:44.000Z
2019-02-20T10:27:09.000Z
src/main/java/org/elaastic/qtapi/entities/User.java
elaastic/elaastic-qt-api
22ca0a296ec12243d9616d7ab8890c5fd2d1f353
[ "Apache-2.0" ]
null
null
null
20.198276
66
0.632949
8,525
package org.elaastic.qtapi.entities; import org.hibernate.validator.constraints.UniqueElements; import org.springframework.lang.Nullable; import javax.persistence.*; import javax.validation.constraints.*; @Entity public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @NotBlank private String firstName; @NotBlank private String lastName; @NotNull private String username; @NotBlank @UniqueElements @Pattern(regexp = "^[a-zA-Z0-9_-]{1,15}$") private String normalizedUsername; @Email @UniqueElements private String email; @NotBlank @Size(min = 4) private String password; @NotNull private boolean canBeUserOwner = false; @NotNull private User owner; public String getFullname() { return firstName + " " + lastName; } public String toString() { return getFullname(); } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getNormalizedUsername() { return normalizedUsername; } public void setNormalizedUsername(String normalizedUsername) { this.normalizedUsername = normalizedUsername; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public boolean isCanBeUserOwner() { return canBeUserOwner; } public void setCanBeUserOwner(boolean canBeUserOwner) { this.canBeUserOwner = canBeUserOwner; } public User getOwner() { return owner; } public void setOwner(User owner) { this.owner = owner; } }
3e14264fa8fc78f60853f3fa07c75f11e15c10ba
6,880
java
Java
src/main/java/com/arm/pelion/bridge/servlet/CommandsProcessor.java
PelionIoT/pelion-bridge
294b2b8ee27689dd049a19022dcd9cb7f1b649e0
[ "Apache-2.0" ]
1
2020-04-28T17:49:50.000Z
2020-04-28T17:49:50.000Z
src/main/java/com/arm/pelion/bridge/servlet/CommandsProcessor.java
PelionIoT/pelion-bridge
294b2b8ee27689dd049a19022dcd9cb7f1b649e0
[ "Apache-2.0" ]
2
2020-06-18T15:34:41.000Z
2020-08-31T23:14:40.000Z
src/main/java/com/arm/pelion/bridge/servlet/CommandsProcessor.java
ARMmbed/pelion-bridge
294b2b8ee27689dd049a19022dcd9cb7f1b649e0
[ "Apache-2.0" ]
1
2021-12-03T17:14:59.000Z
2021-12-03T17:14:59.000Z
34.923858
139
0.651308
8,526
/** * @file CommandsProcessor.java * @brief Peer Commands Servlet Handler * @author Doug Anson * @version 1.0 * @see * * Copyright 2015. ARM Ltd. All rights reserved. * * 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.arm.pelion.bridge.servlet; import com.arm.pelion.bridge.core.ErrorLogger; import com.arm.pelion.bridge.preferences.PreferenceManager; import com.arm.pelion.bridge.servlet.interfaces.ServletProcessor; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Peer Commands Servlet Handler * * @author Doug Anson */ @WebServlet(name = "commands", urlPatterns = {"/commands/*"}) public class CommandsProcessor extends HttpServlet implements ServletProcessor { private Manager m_manager = null; private ErrorLogger m_error_logger = null; private PreferenceManager m_preferences = null; // constructor public CommandsProcessor(ErrorLogger error_logger,PreferenceManager preferences) { super(); this.m_error_logger = error_logger; this.m_preferences = preferences; if (this.m_manager == null) { this.m_manager = Manager.getInstance(this,error_logger,preferences); } } // get our manager public Manager manager() { return this.m_manager; } /** * Process an inbound command request to the Pelion bridge * * @param request inbound request * @param response outbound response */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) { //ProcessorInvocationThread pit = new ProcessorInvocationThread(request,response,this); //Thread t = new Thread(pit); //t.start(); this.invokeRequest(request,response); } // invoke the command processing request @Override public void invokeRequest(HttpServletRequest request, HttpServletResponse response) { try { if (this.m_manager != null) { // process our command request this.m_manager.processPeerCommand(request, response); } else { // error - no Manager instance this.m_error_logger.warning("CommandsProcessor: ERROR: Manager instance is NULL. Ignoring the inbound command request..."); // send a response response.setContentType("application/json;charset=utf-8"); response.setHeader("Pragma", "no-cache"); PrintWriter out = response.getWriter(); out.println("{}"); } } catch (IOException | ServletException ex) { this.m_error_logger.critical("CommandsProcessor: Unable to send command response back to Pelion...", ex); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP * <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // GET not used - just send a response try { response.setContentType("application/json;charset=utf-8"); response.setHeader("Pragma", "no-cache"); PrintWriter out = response.getWriter(); out.println("{}"); } catch (IOException ex) { this.m_error_logger.critical("CommandsProcessor(GET): returning empty result", ex); } } /** * Handles the HTTP * <code>PUT</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // PUT not used - just send a response try { response.setContentType("application/json;charset=utf-8"); response.setHeader("Pragma", "no-cache"); PrintWriter out = response.getWriter(); out.println("{}"); } catch (IOException ex) { this.m_error_logger.critical("CommandsProcessor(PUT): returning empty result", ex); } } /** * Handles the HTTP * <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP * <code>DELETE</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // DELETE not used - just send a response try { response.setContentType("application/json;charset=utf-8"); response.setHeader("Pragma", "no-cache"); PrintWriter out = response.getWriter(); out.println("{}"); } catch (IOException ex) { this.m_error_logger.critical("CommandsProcessor(DELETE): returning empty result", ex); } } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Pelion Bridge 1.0"; }// </editor-fold> }
3e14268b2c5be17761be1ab84aacb552ac9a2699
9,362
java
Java
android/titanium/src/java/org/appcelerator/titanium/TiLaunchActivity.java
kasatani/titanium_mobile
714ab28ba58ba12f2339e9bfe54d3479676b6503
[ "Apache-2.0" ]
null
null
null
android/titanium/src/java/org/appcelerator/titanium/TiLaunchActivity.java
kasatani/titanium_mobile
714ab28ba58ba12f2339e9bfe54d3479676b6503
[ "Apache-2.0" ]
1
2018-10-02T13:36:41.000Z
2018-10-02T13:36:41.000Z
android/titanium/src/java/org/appcelerator/titanium/TiLaunchActivity.java
Jasig/titanium_mobile
30eb2ef7547a0aa12b36bef0d57ce1855db0c232
[ "Apache-2.0" ]
null
null
null
27.863095
126
0.736167
8,527
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ package org.appcelerator.titanium; import java.util.Set; import org.appcelerator.kroll.KrollRuntime; import org.appcelerator.kroll.common.Log; import org.appcelerator.kroll.common.TiConfig; import org.appcelerator.kroll.util.KrollAssetHelper; import org.appcelerator.titanium.analytics.TiAnalyticsEventFactory; import org.appcelerator.titanium.util.TiColorHelper; import org.appcelerator.titanium.util.TiUrl; import org.appcelerator.titanium.view.TiCompositeLayout; import android.app.Activity; import android.app.AlarmManager; import android.app.AlertDialog; import android.app.PendingIntent; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.widget.Toast; /** * Titanium launch activites have a single TiContext and launch an associated * Javascript URL during onCreate() */ public abstract class TiLaunchActivity extends TiBaseActivity { private static final String TAG = "TiLaunchActivity"; private static final boolean DBG = TiConfig.LOGD; private static final int MSG_FINISH = 100; private static final int RESTART_DELAY = 500; private static final int FINISH_DELAY = 500; protected TiUrl url; // For restarting due to android bug 2373 detection. private boolean noLaunchCategoryDetected = false; private AlertDialog noLaunchCategoryAlert; private PendingIntent restartPendingIntent = null; private AlarmManager restartAlarmManager = null; private int restartDelay = 0; /** * @return The Javascript URL that this Activity should run */ public abstract String getUrl(); /** * Subclasses should override to perform custom behavior * when the Launch Activity's script is finished loading */ protected void scriptLoaded() { } /** * Subclasses should override to perform custom behavior * when the TiContext has been created. * This happens before the script is loaded. */ protected void contextCreated() { } protected void loadActivityScript() { try { String fullUrl = url.resolve(); if (DBG) { Log.d(TAG, "Eval JS Activity:" + fullUrl); } if (fullUrl.startsWith(TiC.URL_APP_PREFIX)) { fullUrl = fullUrl.replaceAll("app:/", "Resources"); } else if (fullUrl.startsWith(TiC.URL_ANDROID_ASSET_RESOURCES)) { fullUrl = fullUrl.replaceAll("file:///android_asset/", ""); } KrollRuntime.getInstance().runModule(KrollAssetHelper.readAsset(fullUrl), fullUrl, activityProxy); } finally { if (DBG) { Log.d(TAG, "Signal JS loaded"); } } } @Override protected void onCreate(Bundle savedInstanceState) { if (noLaunchCategoryDetected || checkMissingLauncher(savedInstanceState)) { return; } url = TiUrl.normalizeWindowUrl(getUrl()); // we only want to set the current activity for good in the resume state but we need it right now. // save off the existing current activity, set ourselves to be the new current activity temporarily // so we don't run into problems when we bind the current activity TiApplication tiApp = getTiApp(); Activity tempCurrentActivity = tiApp.getCurrentActivity(); tiApp.setCurrentActivity(this, this); // set the current activity back to what it was originally tiApp.setCurrentActivity(this, tempCurrentActivity); contextCreated(); super.onCreate(savedInstanceState); } @Override protected void windowCreated() { super.windowCreated(); loadActivityScript(); scriptLoaded(); } protected boolean checkMissingLauncher(Bundle savedInstanceState) { Intent intent = getIntent(); if (intent != null) { TiProperties systemProperties = getTiApp().getSystemProperties(); boolean detectionDisabled = systemProperties.getBool("ti.android.bug2373.disableDetection", false); if (!detectionDisabled) { return checkMissingLauncher(intent, savedInstanceState); } } return false; } protected boolean checkMissingLauncher(Intent intent, Bundle savedInstanceState) { noLaunchCategoryDetected = false; String action = intent.getAction(); if (action != null && action.equals(Intent.ACTION_MAIN)) { Set<String> categories = intent.getCategories(); noLaunchCategoryDetected = true; // Absence of LAUNCHER is the problem. if (categories != null) { for(String category : categories) { if (category.equals(Intent.CATEGORY_LAUNCHER)) { noLaunchCategoryDetected = false; break; } } } if (noLaunchCategoryDetected) { Log.e(TAG, "Android issue 2373 detected (missing intent CATEGORY_LAUNCHER), restarting app. " + this); layout = new TiCompositeLayout(this); setContentView(layout); TiProperties systemProperties = getTiApp().getSystemProperties(); int backgroundColor = TiColorHelper.parseColor(systemProperties.getString("ti.android.bug2373.backgroundColor", "black")); getWindow().getDecorView().setBackgroundColor(backgroundColor); layout.setBackgroundColor(backgroundColor); activityOnCreate(savedInstanceState); return true; } } return false; } protected void alertMissingLauncher() { // No context, we have a launch problem. TiProperties systemProperties = getTiApp().getSystemProperties(); String message = systemProperties.getString("ti.android.bug2373.message", "An application restart is required"); final int restartDelay = systemProperties.getInt("ti.android.bug2373.restartDelay", RESTART_DELAY); final int finishDelay = systemProperties.getInt("ti.android.bug2373.finishDelay", FINISH_DELAY); if (systemProperties.getBool("ti.android.bug2373.skipAlert", false)) { if (message != null && message.length() > 0) { Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); } restartActivity(restartDelay, finishDelay); } else { OnClickListener restartListener = new OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { restartActivity(restartDelay, finishDelay); } }; String title = systemProperties.getString("ti.android.bug2373.title", "Restart Required"); String buttonText = systemProperties.getString("ti.android.bug2373.buttonText", "Continue"); noLaunchCategoryAlert = new AlertDialog.Builder(this) .setTitle(title) .setMessage(message) .setPositiveButton(buttonText, restartListener) .setCancelable(false).create(); noLaunchCategoryAlert.show(); } } protected void restartActivity(int delay) { restartActivity(delay, 0); } protected void restartActivity(int delay, int finishDelay) { Intent relaunch = new Intent(getApplicationContext(), getClass()); relaunch.setAction(Intent.ACTION_MAIN); relaunch.addCategory(Intent.CATEGORY_LAUNCHER); restartAlarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); if (restartAlarmManager != null) { restartPendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, relaunch, PendingIntent.FLAG_ONE_SHOT); restartDelay = delay; } if (finishDelay > 0) { Handler handler = new Handler() { @Override public void handleMessage(Message msg) { if (msg.what == MSG_FINISH) { doFinishForRestart(); } else { super.handleMessage(msg); } } }; handler.sendEmptyMessageDelayed(MSG_FINISH, finishDelay); } else { doFinishForRestart(); } } private void doFinishForRestart() { if (noLaunchCategoryAlert != null && noLaunchCategoryAlert.isShowing()) { noLaunchCategoryAlert.cancel(); noLaunchCategoryAlert = null; } if (!isFinishing()) { finish(); } } @Override protected void onRestart() { super.onRestart(); TiProperties systemProperties = getTiApp().getSystemProperties(); boolean restart = systemProperties.getBool("ti.android.root.reappears.restart", false); if (restart) { Log.w(TAG, "Tasks may have been destroyed by Android OS for inactivity. Restarting."); restartActivity(250); } } @Override protected void onPause() { if (noLaunchCategoryDetected) { doFinishForRestart(); activityOnPause(); return; } super.onPause(); } @Override protected void onStop() { if (noLaunchCategoryDetected) { activityOnStop(); return; } super.onStop(); } @Override protected void onStart() { if (noLaunchCategoryDetected) { activityOnStart(); return; } super.onStart(); } @Override protected void onResume() { if (noLaunchCategoryDetected) { alertMissingLauncher(); // This also kicks off the finish() and restart. activityOnResume(); return; } super.onResume(); } @Override protected void onDestroy() { if (noLaunchCategoryDetected) { activityOnDestroy(); restartAlarmManager.set(AlarmManager.RTC, System.currentTimeMillis() + restartDelay, restartPendingIntent); restartPendingIntent = null; restartAlarmManager = null; noLaunchCategoryAlert = null; noLaunchCategoryDetected = false; return; } TiApplication tiApp = TiApplication.getInstance(); if (tiApp != null) { tiApp.postAnalyticsEvent(TiAnalyticsEventFactory.createAppEndEvent()); } super.onDestroy(); } }
3e1427a7faba9bcc58d436e50cc361004a32fd98
7,700
java
Java
app/src/main/java/com/application/baatna/views/AboutUs.java
baatna/Baatna-android
582490db2bbf9cbf0c6e02eeda385d7b162f7a05
[ "MIT" ]
1
2018-07-20T04:25:16.000Z
2018-07-20T04:25:16.000Z
app/src/main/java/com/application/baatna/views/AboutUs.java
app-ad/Baatna-android
582490db2bbf9cbf0c6e02eeda385d7b162f7a05
[ "MIT" ]
null
null
null
app/src/main/java/com/application/baatna/views/AboutUs.java
app-ad/Baatna-android
582490db2bbf9cbf0c6e02eeda385d7b162f7a05
[ "MIT" ]
null
null
null
31.818182
108
0.744286
8,528
package com.application.baatna.views; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.text.Spannable; import android.text.SpannableString; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import com.application.baatna.R; import com.application.baatna.utils.CommonLib; import com.application.baatna.utils.TypefaceSpan; import com.google.android.gms.plus.PlusOneButton; public class AboutUs extends AppCompatActivity { private int width; PlusOneButton mPlusOneButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.about_us); width = getWindowManager().getDefaultDisplay().getWidth(); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_actionbar); setSupportActionBar(toolbar); setUpActionBar(); fixsizes(); setListeners(); mPlusOneButton = (PlusOneButton) findViewById(R.id.plus_one_button); ImageView img = (ImageView) findViewById(R.id.zomato_logo); img.getLayoutParams().width = width / 3; img.getLayoutParams().height = width / 3; // setting image try { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher, options); options.inSampleSize = CommonLib.calculateInSampleSize(options, width, width); options.inJustDecodeBounds = false; options.inPreferredConfig = Config.RGB_565; Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher, options); img.setImageBitmap(bitmap); } catch (OutOfMemoryError e) { e.printStackTrace(); img.setBackgroundColor(getResources().getColor(R.color.black)); } catch (Exception e) { e.printStackTrace(); img.setBackgroundColor(getResources().getColor(R.color.black)); } } @Override public void onResume() { super.onResume(); try { if (mPlusOneButton != null) mPlusOneButton.initialize( "https://market.android.com/details?id=" + getPackageName(), 0); } catch (Exception d) { } } private void setUpActionBar() { android.support.v7.app.ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayShowCustomEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setHomeButtonEnabled(false); actionBar.setDisplayHomeAsUpEnabled(false); if(Build.VERSION.SDK_INT > 20) actionBar.setElevation(0); LayoutInflater inflator = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View actionBarCustomView = inflator.inflate(R.layout.white_action_bar, null); actionBarCustomView.findViewById(R.id.home_icon_container).setVisibility(View.VISIBLE); actionBar.setCustomView(actionBarCustomView); SpannableString s = new SpannableString(getString(R.string.about_us)); s.setSpan( new TypefaceSpan(getApplicationContext(), CommonLib.BOLD_FONT_FILENAME, getResources().getColor(R.color.white), getResources().getDimension(R.dimen.size16)), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); TextView title = (TextView) actionBarCustomView.findViewById(R.id.title); ((RelativeLayout.LayoutParams) actionBarCustomView.findViewById(R.id.back_icon).getLayoutParams()) .setMargins(width / 40, 0, 0, 0); actionBarCustomView.findViewById(R.id.title).setPadding(width / 20, 0, width / 40, 0); title.setText(s); title.setAllCaps(true); } void fixsizes() { width = getWindowManager().getDefaultDisplay().getWidth(); // About us main page layouts // findViewById(R.id.home_logo).getLayoutParams().height = 3 * width / // 10; // findViewById(R.id.home_logo).getLayoutParams().width = 3 * width / // 10; findViewById(R.id.home_version).setPadding(width / 20, 0, 0, 0); findViewById(R.id.home_logo_container).setPadding(width / 20, width / 20, width / 20, width / 20); findViewById(R.id.about_us_body).setPadding(width / 20, 0, width / 20, width / 20); ((LinearLayout.LayoutParams) findViewById(R.id.plus_one_button) .getLayoutParams()).setMargins(width / 20, width / 20, width / 20, width / 20); RelativeLayout.LayoutParams relativeParams2 = new RelativeLayout.LayoutParams( width, 9 * width / 80); relativeParams2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); findViewById(R.id.about_us_privacy_policy_container).setLayoutParams( relativeParams2); ((TextView) ((LinearLayout) findViewById(R.id.about_us_privacy_policy_container)) .getChildAt(0)).setPadding(width / 20, 0, 0, 0); findViewById(R.id.about_us_privacy_policy).setPadding(width / 40, 0, width / 20, 0); RelativeLayout.LayoutParams relativeParams3 = new RelativeLayout.LayoutParams( width, 9 * width / 80); relativeParams3.addRule(RelativeLayout.ABOVE, R.id.separator3); findViewById(R.id.about_us_terms_conditions_container).setLayoutParams( relativeParams3); ((TextView) ((LinearLayout) findViewById(R.id.about_us_terms_conditions_container)) .getChildAt(0)).setPadding(width / 20, 0, 0, 0); findViewById(R.id.about_us_terms_conditions).setPadding(width / 40, 0, width / 20, 0); } public void setListeners() { LinearLayout btnTermsAndConditons = (LinearLayout) findViewById(R.id.about_us_terms_conditions_container); btnTermsAndConditons.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(AboutUs.this, BWebView.class); intent.putExtra("title", getResources() .getString(R.string.about_us_terms_of_use)); intent.putExtra("url", "https://www.baatna.com/terms.html"); startActivity(intent); overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); } }); LinearLayout btnPrivacyPolicy = (LinearLayout) findViewById(R.id.about_us_privacy_policy_container); btnPrivacyPolicy.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(AboutUs.this, BWebView.class); intent.putExtra( "title", getResources().getString( R.string.about_us_privacypolicy)); intent.putExtra("url", "https://www.zomato.com/privacy.html"); startActivity(intent); overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); } }); } public void goBack(View view) { onBackPressed(); } @Override public void onBackPressed() { super.onBackPressed(); overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; } return super.onOptionsItemSelected(item); } public void actionBarSelected(View v) { switch (v.getId()) { case R.id.home_icon_container: onBackPressed(); default: break; } } public void aboutUs(View view) { Uri uri = Uri.parse("http://www.baatna.com"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } public void privacyPolicy(View view) { Uri uri = Uri.parse("http://www.baatna.com"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } }
3e1428586ea68559e2a8223e153b98ce1e934411
407
java
Java
src/main/java/com/eu/habbo/messages/outgoing/unknown/ModToolComposerOne.java
IagoNatan/ArcturusMHN
a039967aa27e5340ac2997822142f4eaa9caafe4
[ "Apache-2.0" ]
5
2017-12-10T13:55:58.000Z
2018-12-21T00:02:33.000Z
src/main/java/com/eu/habbo/messages/outgoing/unknown/ModToolComposerOne.java
IagoNatan/ArcturusMHN
a039967aa27e5340ac2997822142f4eaa9caafe4
[ "Apache-2.0" ]
5
2017-12-14T00:51:19.000Z
2017-12-21T18:54:50.000Z
src/main/java/com/eu/habbo/messages/outgoing/unknown/ModToolComposerOne.java
IagoNatan/ArcturusMHN
a039967aa27e5340ac2997822142f4eaa9caafe4
[ "Apache-2.0" ]
8
2019-04-23T18:03:43.000Z
2021-07-06T12:41:24.000Z
22.611111
56
0.759214
8,529
package com.eu.habbo.messages.outgoing.unknown; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; public class ModToolComposerOne extends MessageComposer { @Override public ServerMessage compose() { this.response.init(Outgoing.ModToolComposerOne); return this.response; } }
3e14293f12a555a6eafdf61e0ef09aa53605d292
1,017
java
Java
base/lang/src/main/java/leap/lang/serialize/Serialize.java
leapframework/framework
e6c77c11ae95bf24db793f965dece4925a7aabae
[ "Apache-2.0" ]
46
2015-12-25T08:49:28.000Z
2021-10-21T08:08:55.000Z
base/lang/src/main/java/leap/lang/serialize/Serialize.java
leapframework/framework
8ef3772c83c6eef1ec07f63310888b5c3df45d2a
[ "Apache-2.0" ]
19
2017-06-06T02:52:03.000Z
2022-01-21T23:11:18.000Z
base/lang/src/main/java/leap/lang/serialize/Serialize.java
leapframework/framework
8ef3772c83c6eef1ec07f63310888b5c3df45d2a
[ "Apache-2.0" ]
23
2016-05-05T09:44:55.000Z
2019-07-26T14:17:35.000Z
30.818182
75
0.749263
8,530
/* * Copyright 2002-2011 the original author or authors. * * 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 leap.lang.serialize; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.Target; @Target({ElementType.FIELD,ElementType.METHOD,ElementType.PARAMETER}) @Retention(RUNTIME) public @interface Serialize { /** * The name of serializer. */ String value(); }
3e1429502a1f066d877a732365a2adba74dead53
1,927
java
Java
andhow-core/src/main/java/org/yarnandtail/andhow/property/BolProp.java
emafazillah/andhow
641db9ff58494b979eafe5e70e8295a89b6e7f9e
[ "Apache-2.0" ]
28
2017-12-13T04:29:42.000Z
2022-03-09T01:31:58.000Z
andhow-core/src/main/java/org/yarnandtail/andhow/property/BolProp.java
emafazillah/andhow
641db9ff58494b979eafe5e70e8295a89b6e7f9e
[ "Apache-2.0" ]
524
2016-12-08T19:41:04.000Z
2022-03-08T16:05:05.000Z
andhow-core/src/main/java/org/yarnandtail/andhow/property/BolProp.java
emafazillah/andhow
641db9ff58494b979eafe5e70e8295a89b6e7f9e
[ "Apache-2.0" ]
41
2018-01-24T23:46:57.000Z
2021-08-20T13:55:29.000Z
28.338235
98
0.699014
8,531
package org.yarnandtail.andhow.property; import org.yarnandtail.andhow.api.*; import org.yarnandtail.andhow.valuetype.BolType; import java.util.List; /** * A {@link Boolean} configuration Property * <p> * <em>Note: The parsing behavior of this class may change in the 0.5.0 release</em> * to have an explicit list of False values. * See <a href="https://github.com/eeverman/andhow/issues/658"></a>Issue 658</a>. * <p> * Parsing values from strings is done by the {@link BolType}. * When parsing, the value is considered {@code True} if it case-insensitive matches one of: * <ul> * <li>true</li> * <li>t</li> * <li>yes</li> * <li>y</li> * <li>on</li> * </ul> * <p> * If it does not match a value in that list and does not trim to null, it is {@code False}. * If the value is null after trimming, the value is considered unset. */ public class BolProp extends PropertyBase<Boolean> { public BolProp( Boolean defaultValue, boolean nonNull, String shortDesc, List<Name> aliases, PropertyType paramType, ValueType<Boolean> valueType, Trimmer trimmer, String helpText) { super(defaultValue, nonNull, shortDesc, null, aliases, paramType, valueType, trimmer, helpText); } /** * A chainable builder for this property that should terminate with {@code build()} * <p> * Use as: {@code BolProp.builder()...series of builder methods...build();} * <p> * @return The builder instance that can be chained */ public static BolBuilder builder() { return new BolBuilder(); } public static class BolBuilder extends PropertyBuilderBase<BolBuilder, BolProp, Boolean> { public BolBuilder() { instance = this; valueType(BolType.instance()); trimmer(TrimToNullTrimmer.instance()); } @Override public BolProp build() { return new BolProp(_defaultValue, _nonNull, _desc, _aliases, PropertyType.SINGLE_NAME_VALUE, _valueType, _trimmer, _helpText); } } }
3e14299dd8fde926776a5edaf35c2001889427c6
3,637
java
Java
src/test/java/com/github/alexfalappa/nbspringboot/cfgprops/parser/BasicTest.java
blackleg/nb-springboot
2b0426a98178ab8c273fb3bf70355b5ad7a7d070
[ "Apache-2.0" ]
141
2016-05-25T21:00:00.000Z
2022-03-27T12:22:12.000Z
src/test/java/com/github/alexfalappa/nbspringboot/cfgprops/parser/BasicTest.java
blackleg/nb-springboot
2b0426a98178ab8c273fb3bf70355b5ad7a7d070
[ "Apache-2.0" ]
170
2016-04-22T16:09:50.000Z
2021-08-14T03:01:08.000Z
src/test/java/com/github/alexfalappa/nbspringboot/cfgprops/parser/BasicTest.java
blackleg/nb-springboot
2b0426a98178ab8c273fb3bf70355b5ad7a7d070
[ "Apache-2.0" ]
37
2016-05-23T18:22:32.000Z
2022-03-06T15:42:30.000Z
29.330645
84
0.652736
8,532
package com.github.alexfalappa.nbspringboot.cfgprops.parser; import java.io.IOException; import java.net.URISyntaxException; import org.junit.Test; /** * Syntax test suite for BootCfgParser: basic scenario. * * @author Alessandro Falappa */ //@Ignore public class BasicTest extends TestBase { @Test public void testEmpty() throws URISyntaxException, IOException { System.out.println("\n-- empty"); parseMatch(""); } @Test public void testComment1() throws URISyntaxException, IOException { System.out.println("\n-- comment1"); parseMatch("# pound sign comment"); } @Test public void testComment2() throws URISyntaxException, IOException { System.out.println("\n-- comment2"); parseMatch("! exclamation mark comment"); } @Test public void testKeyOnly() throws URISyntaxException, IOException { System.out.println("\n-- key only"); parseMatch("key"); } @Test public void testSingleEqualEmpty() throws URISyntaxException, IOException { System.out.println("\n-- single empty equal"); parseMatch("key="); } @Test public void testSingleEqualValued() throws URISyntaxException, IOException { System.out.println("\n-- single equal"); parseMatch("key=val"); } @Test public void testSingleEqualDotted() throws URISyntaxException, IOException { System.out.println("\n-- single dotted equal"); parseMatch("prefix.key=val"); } @Test public void testSingleEqualHyphen() throws URISyntaxException, IOException { System.out.println("\n-- single equal hyphen"); parseMatch("my-key=val"); } @Test public void testSingleEqualUnderscore() throws URISyntaxException, IOException { System.out.println("\n-- single equal underscore"); parseMatch("my_key=val"); } @Test public void testSingleColonEmpty() throws URISyntaxException, IOException { System.out.println("\n-- single empty colon"); parseMatch("key:"); } @Test public void testSingleColonValued() throws URISyntaxException, IOException { System.out.println("\n-- single colon"); parseMatch("key:val"); } @Test public void testSingleDottedColon() throws URISyntaxException, IOException { System.out.println("\n-- single dotted colon"); parseMatch("prefix.middle.key:val"); } @Test public void testSingleColonHyphen() throws URISyntaxException, IOException { System.out.println("\n-- single colon hyphen"); parseMatch("my-key:val"); } @Test public void testSingleColonUnderscore() throws URISyntaxException, IOException { System.out.println("\n-- single colon underscore"); parseMatch("my_key:val"); } @Test public void testSingleWhitespace1() throws URISyntaxException, IOException { System.out.println("\n-- single with withespace 1"); parseMatch(" \t key =\tval "); } @Test public void testSingleWhitespace2() throws URISyntaxException, IOException { System.out.println("\n-- single with withespace 2"); parseMatch(" \t key =\t val"); } @Test public void testSingleWhitespace3() throws URISyntaxException, IOException { System.out.println("\n-- single with withespace 3"); parseMatch(" \t key =val"); } @Test public void testSingleWhitespace4() throws URISyntaxException, IOException { System.out.println("\n-- single with withespace 4"); parseMatch(" \t key=val"); } }
3e142ad3544c723eff82f904e8fc1299fc554d80
1,379
java
Java
persistence-modules/core-java-persistence-2/src/main/java/com/baeldung/resultsetrowcount/RowCounterApp.java
andresluzu/tutorials
150804b28eaf3bf168bec6e5f1ed1506a7221905
[ "MIT" ]
1
2021-09-14T06:50:20.000Z
2021-09-14T06:50:20.000Z
persistence-modules/core-java-persistence-2/src/main/java/com/baeldung/resultsetrowcount/RowCounterApp.java
andresluzu/tutorials
150804b28eaf3bf168bec6e5f1ed1506a7221905
[ "MIT" ]
10
2021-12-15T08:39:48.000Z
2022-03-22T18:04:26.000Z
persistence-modules/core-java-persistence-2/src/main/java/com/baeldung/resultsetrowcount/RowCounterApp.java
andresluzu/tutorials
150804b28eaf3bf168bec6e5f1ed1506a7221905
[ "MIT" ]
null
null
null
35.358974
105
0.664975
8,533
package com.baeldung.resultsetrowcount; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; class RowCounterApp { public static void main(String[] args) throws SQLException { Connection conn = createDummyDB(); String selectQuery = "SELECT * FROM STORAGE"; StandardRowCounter standardCounter = new StandardRowCounter(conn); assert standardCounter.getQueryRowCount(selectQuery) == 3; ScrollableRowCounter scrollableCounter = new ScrollableRowCounter(conn); assert scrollableCounter.getQueryRowCount(selectQuery) == 3; } static Connection createDummyDB() throws SQLException { String dbUrl = "jdbc:h2:mem:storagedb"; Connection conn = DriverManager.getConnection(dbUrl); try (Statement statement = conn.createStatement()) { String sql = "CREATE TABLE STORAGE (id INTEGER not null, val VARCHAR(50), PRIMARY KEY (id))"; statement.executeUpdate(sql); sql = "INSERT INTO STORAGE VALUES (1, 'Entry A')"; statement.executeUpdate(sql); sql = "INSERT INTO STORAGE VALUES (2, 'Entry A')"; statement.executeUpdate(sql); sql = "INSERT INTO STORAGE VALUES (3, 'Entry A')"; statement.executeUpdate(sql); } return conn; } }
3e142b9975913488f17cf2d93524cb96414a9c26
2,952
java
Java
aries/common/common-model/src/main/java/org/aries/common/util/LanguageUtil.java
tfisher1226/ARIES
814e3a4b4b48396bcd6d082e78f6519679ccaa01
[ "Apache-2.0" ]
2
2019-09-16T10:06:07.000Z
2021-02-25T11:46:23.000Z
aries/common/common-model/src/main/java/org/aries/common/util/LanguageUtil.java
tfisher1226/ARIES
814e3a4b4b48396bcd6d082e78f6519679ccaa01
[ "Apache-2.0" ]
null
null
null
aries/common/common-model/src/main/java/org/aries/common/util/LanguageUtil.java
tfisher1226/ARIES
814e3a4b4b48396bcd6d082e78f6519679ccaa01
[ "Apache-2.0" ]
null
null
null
28.384615
103
0.734079
8,534
package org.aries.common.util; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import org.apache.commons.lang.StringEscapeUtils; import org.aries.common.Language; import org.aries.util.BaseUtil; public class LanguageUtil extends BaseUtil { public static final Language[] VALUES_ARRAY = new Language[] { Language.ENGLISH, Language.SPANISH, Language.FRENCH, Language.ITALIAN, Language.GERMAN, Language.PORTUGUESE, Language.JAPANESE, Language.CHINESE, Language.KOREAN, Language.VIETNAMESE, Language.THAI, Language.OTHER }; public static final List<Language> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); public static Language getLanguage(int ordinal) { if (ordinal == Language.ENGLISH.ordinal()) return Language.ENGLISH; if (ordinal == Language.SPANISH.ordinal()) return Language.SPANISH; if (ordinal == Language.FRENCH.ordinal()) return Language.FRENCH; if (ordinal == Language.ITALIAN.ordinal()) return Language.ITALIAN; if (ordinal == Language.GERMAN.ordinal()) return Language.GERMAN; if (ordinal == Language.PORTUGUESE.ordinal()) return Language.PORTUGUESE; if (ordinal == Language.JAPANESE.ordinal()) return Language.JAPANESE; if (ordinal == Language.CHINESE.ordinal()) return Language.CHINESE; if (ordinal == Language.KOREAN.ordinal()) return Language.KOREAN; if (ordinal == Language.VIETNAMESE.ordinal()) return Language.VIETNAMESE; if (ordinal == Language.THAI.ordinal()) return Language.THAI; if (ordinal == Language.OTHER.ordinal()) return Language.OTHER; return null; } public static String toString(Language language) { return language.name(); } public static String toString(Collection<Language> languageList) { StringBuffer buf = new StringBuffer(); Iterator<Language> iterator = languageList.iterator(); for (int i=0; iterator.hasNext(); i++) { Language language = iterator.next(); if (i > 0) buf.append(", "); String text = toString(language); buf.append(text); } String text = StringEscapeUtils.escapeJavaScript(buf.toString()); return text; } public static void sortRecords(List<Language> languageList) { Collections.sort(languageList, createLanguageComparator()); } public static Collection<Language> sortRecords(Collection<Language> languageCollection) { List<Language> list = new ArrayList<Language>(languageCollection); Collections.sort(list, createLanguageComparator()); return list; } public static Comparator<Language> createLanguageComparator() { return new Comparator<Language>() { public int compare(Language language1, Language language2) { String text1 = language1.value(); String text2 = language2.value(); int status = text1.compareTo(text2); return status; } }; } }
3e142cb3a203f260ca7db0299e368b8e41ac1319
9,996
java
Java
indexers/src/main/java/org/mousephenotype/cda/indexers/Allele2Indexer.java
jwgwarren/PhenotypeData
a1a36fd0efacc6515ad843ff7ce4bebc3ae98393
[ "Apache-2.0" ]
null
null
null
indexers/src/main/java/org/mousephenotype/cda/indexers/Allele2Indexer.java
jwgwarren/PhenotypeData
a1a36fd0efacc6515ad843ff7ce4bebc3ae98393
[ "Apache-2.0" ]
null
null
null
indexers/src/main/java/org/mousephenotype/cda/indexers/Allele2Indexer.java
jwgwarren/PhenotypeData
a1a36fd0efacc6515ad843ff7ce4bebc3ae98393
[ "Apache-2.0" ]
null
null
null
54.923077
132
0.732793
8,535
package org.mousephenotype.cda.indexers; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrServerException; import org.mousephenotype.cda.db.repositories.OntologyTermRepository; import org.mousephenotype.cda.indexers.exceptions.IndexerException; import org.mousephenotype.cda.solr.service.dto.Allele2DTO; import org.mousephenotype.cda.utilities.RunStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.Banner; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.ConfigurableApplicationContext; import javax.inject.Inject; import javax.sql.DataSource; import javax.validation.constraints.NotNull; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Map; /** * Created by ilinca on 23/09/2016. */ @EnableAutoConfiguration public class Allele2Indexer extends AbstractIndexer implements CommandLineRunner { @Value("${allele2File}") private String pathToAlleleFile; private Integer alleleDocCount; private Map<String, Integer> columns = new HashMap<>(); private final Logger logger = LoggerFactory.getLogger(this.getClass()); private SolrClient allele2Core; protected Allele2Indexer() { } @Inject public Allele2Indexer( @NotNull DataSource komp2DataSource, @NotNull OntologyTermRepository ontologyTermRepository, @NotNull SolrClient allele2Core) { super(komp2DataSource, ontologyTermRepository); this.allele2Core = allele2Core; } @Override public RunStatus run() throws IOException, SolrServerException { RunStatus runStatus = new RunStatus(); allele2Core.deleteByQuery("*:*"); allele2Core.commit(); long start = System.currentTimeMillis(); BufferedReader in = new BufferedReader(new FileReader(new File(pathToAlleleFile))); String[] header = in.readLine().split("\t"); for (int i = 0; i < header.length; i++){ columns.put(header[i], i); } int index = 0 ; String line = in.readLine(); while (line != null){ String[] array = line.split("\t", -1); index ++; Allele2DTO doc = new Allele2DTO(); doc.setAllele2Id(String.valueOf(index)); doc.setAlleleCategory(getValueFor(Allele2DTO.ALLELE_CATEGORY, array, columns, runStatus)); doc.setAlleleDescription(getValueFor(Allele2DTO.ALLELE_DESCRIPTION,array, columns, runStatus)); doc.setAlleleImage(getValueFor(Allele2DTO.ALLELE_IMAGE,array, columns, runStatus)); doc.setAlleleMgiAccessionId(getValueFor(Allele2DTO.ALLELE_MGI_ACCESSION_ID,array, columns, runStatus)); doc.setAlleleName(getValueFor(Allele2DTO.ALLELE_NAME,array, columns, runStatus)); doc.setAlleleSimpleImage(getValueFor(Allele2DTO.ALLELE_SIMPLE_IMAGE,array, columns, runStatus)); doc.setAlleleType(getValueFor(Allele2DTO.ALLELE_TYPE,array, columns, runStatus)); doc.setAlleleFeatures(getListValueFor(Allele2DTO.ALLELE_FEATURES, array, columns, runStatus)); doc.setAlleleSymbol(getValueFor(Allele2DTO.ALLELE_SYMBOL, array, columns, runStatus)); doc.setAlleleSymbolSearchVariants(getListValueFor(Allele2DTO.ALLELE_SYMBOL_SEARCH_VARIANTS, array, columns, runStatus)); doc.setCassette(getValueFor(Allele2DTO.CASSETTE,array, columns, runStatus)); doc.setDesignId(getValueFor(Allele2DTO.DESIGN_ID,array, columns, runStatus)); doc.setEsCellStatus(getValueFor(Allele2DTO.ES_CELL_STATUS,array, columns, runStatus)); doc.setEsCellAvailable(getBooleanValueFor(Allele2DTO.ES_CELL_AVAILABLE,array, columns, runStatus)); doc.setFeatureChromosome(getValueFor(Allele2DTO.FEATURE_CHROMOSOME,array, columns, runStatus)); doc.setFeatureStrand(getValueFor(Allele2DTO.FEATURE_STRAND,array, columns, runStatus)); doc.setFeatureCoordEnd(getIntValueFor(Allele2DTO.FEATURE_COORD_END,array, columns, runStatus)); doc.setFeatureCoordStart(getIntValueFor(Allele2DTO.FEAURE_COORD_START,array, columns, runStatus)); doc.setFeatureType(getValueFor(Allele2DTO.FEATURE_TYPE,array, columns, runStatus)); doc.setGenbankFile(getValueFor(Allele2DTO.GENBANK_FILE,array, columns, runStatus)); doc.setGeneModelIds(getListValueFor(Allele2DTO.GENE_MODEL_IDS,array, columns, runStatus)); doc.setGeneticMapLinks(getListValueFor(Allele2DTO.GENETIC_MAP_LINKS,array, columns, runStatus)); doc.setIkmcProject(getListValueFor(Allele2DTO.IKMC_PROJECT,array, columns, runStatus)); doc.setLatestEsCellStatus(getValueFor(Allele2DTO.LATEST_ES_CELL_STATUS,array, columns, runStatus)); doc.setLatestMouseStatus(getValueFor(Allele2DTO.LATEST_MOUSE_STATUS,array, columns, runStatus)); doc.setLatestPhenotypeComplete(getValueFor(Allele2DTO.LATEST_PHENOTYPE_COMPLETE,array, columns, runStatus)); doc.setLatestPhenotypeStarted(getValueFor(Allele2DTO.LATEST_PHENOTYPE_STARTED,array, columns, runStatus)); doc.setLatestProductionCentre(getListValueFor(Allele2DTO.LATEST_PRODUCTION_CENTRE,array, columns, runStatus)); doc.setLatestPhenotypingCentre(getListValueFor(Allele2DTO.LATEST_PHENOTYPING_CENTRE,array, columns, runStatus)); doc.setLatestPhenotypeStatus(getValueFor(Allele2DTO.LATEST_PHENOTYPE_STATUS,array, columns, runStatus)); doc.setLatestProjectStatus(getValueFor(Allele2DTO.LATEST_PROJECT_STATUS,array, columns, runStatus)); doc.setLatestProjectStatusLegacy(getValueFor(Allele2DTO.LATEST_PROJECT_STATUS_LEGACY,array, columns, runStatus)); doc.setLinks(getListValueFor(Allele2DTO.LINKS,array, columns, runStatus)); doc.setMarkerType(getValueFor(Allele2DTO.MARKER_TYPE,array, columns, runStatus)); doc.setMarkerSymbol(getValueFor(Allele2DTO.MARKER_SYMBOL, array, columns, runStatus)); doc.setMgiAccessionId(getValueFor(Allele2DTO.MGI_ACCESSION_ID, array, columns, runStatus)); doc.setMarkerName(getValueFor(Allele2DTO.MARKER_NAME,array, columns, runStatus)); doc.setMarkerSynonym(getListValueFor(Allele2DTO.MARKER_SYNONYM, array, columns, runStatus)); doc.setHumanGeneSymbol(getListValueFor(Allele2DTO.HUMAN_GENE_SYMBOL, array, columns, runStatus)); doc.setMouseAvailable(getBooleanValueFor(Allele2DTO.MOUSE_AVAILABLE, array, columns, runStatus)); doc.setMutationType(getValueFor(Allele2DTO.MUTATION_TYPE,array,columns, runStatus)); doc.setMouseStatus(getValueFor(Allele2DTO.MOUSE_STATUS, array,columns, runStatus)); doc.setPhenotypeStatus(getValueFor(Allele2DTO.PHENOTYPE_STATUS,array, columns, runStatus)); doc.setPhenotypingCentres(getListValueFor(Allele2DTO.PHENOTYPING_CENTRES,array, columns, runStatus)); doc.setProductionCentres(getListValueFor(Allele2DTO.PRODUCTION_CENTRES,array, columns, runStatus)); doc.setPipeline(getListValueFor(Allele2DTO.PIPELINE,array, columns, runStatus)); doc.setSequenceMapLinks(getListValueFor(Allele2DTO.SEQUENCE_MAP_LINKS, array, columns, runStatus)); doc.setSynonym(getListValueFor(Allele2DTO.SYNONYM, array, columns, runStatus)); doc.setTargetingVectorAvailable(getBooleanValueFor(Allele2DTO.TARGETING_VECTOR_AVAILABLE, array, columns, runStatus)); doc.setType(getValueFor(Allele2DTO.TYPE, array, columns, runStatus)); doc.setVectorAlleleImage(getValueFor(Allele2DTO.VECTOR_ALLELE_IMAGE, array, columns, runStatus)); doc.setVectorGenbankLink(getValueFor(Allele2DTO.VECTOR_GENBANK_LINK, array, columns, runStatus)); doc.setWithoutAlleleFeatures(getListValueFor(Allele2DTO.WITHOUT_ALLELE_FEATURES, array, columns, runStatus)); doc.setAlleleDesignProject(getValueFor(Allele2DTO.ALLELE_DESIGN_PROJECT, array, columns, runStatus)); doc.setTissuesAvailable(getBooleanValueFor(Allele2DTO.TISSUES_AVAILABLE, array, columns, runStatus)); doc.setTissueTypes(getListValueFor(Allele2DTO.TISSUE_TYPES, array, columns, runStatus)); doc.setTissueEnquiryLinks(getListValueFor(Allele2DTO.TISSUE_ENQUIRY_LINKS, array, columns, runStatus)); doc.setTissueDistributionCentres(getListValueFor(Allele2DTO.TISSUE_DISTRIBUTION_CENTRES, array, columns, runStatus)); line = in.readLine(); allele2Core.addBean(doc, 30000); } allele2Core.commit(); alleleDocCount = index; logger.info(" Added {} total beans in {}", alleleDocCount, commonUtils.msToHms(System.currentTimeMillis() - start)); return runStatus; } @Override public RunStatus validateBuild() throws IndexerException { RunStatus runStatus = new RunStatus(); Long actualSolrDocumentCount = getImitsDocumentCount(allele2Core); if (actualSolrDocumentCount < alleleDocCount) { runStatus.addError("Expected " + alleleDocCount + " documents. Actual count: " + actualSolrDocumentCount + "."); } return runStatus; } public static void main(String[] args) { ConfigurableApplicationContext context = new SpringApplicationBuilder(Allele2Indexer.class) .web(WebApplicationType.NONE) .bannerMode(Banner.Mode.OFF) .logStartupInfo(false) .run(args); context.close(); } }
3e142cb905beb1e160c5317d2fb4d0c257392216
1,305
java
Java
java340/src/main/java/soupply/java340/protocol/clientbound/ChatMessage.java
soupply/java
40fecf30625bdbdc71cce4c6e3222022c0387c6e
[ "MIT" ]
2
2018-03-04T15:57:37.000Z
2019-01-18T02:59:18.000Z
java340/src/main/java/soupply/java340/protocol/clientbound/ChatMessage.java
soupply/java
40fecf30625bdbdc71cce4c6e3222022c0387c6e
[ "MIT" ]
null
null
null
java340/src/main/java/soupply/java340/protocol/clientbound/ChatMessage.java
soupply/java
40fecf30625bdbdc71cce4c6e3222022c0387c6e
[ "MIT" ]
2
2018-06-21T10:40:33.000Z
2020-07-03T21:56:59.000Z
21.75
65
0.641379
8,536
package soupply.java340.protocol.clientbound; import java.util.*; import soupply.util.*; public class ChatMessage extends soupply.java340.Packet { public static final int ID = 15; // position public static final byte CHAT = (byte)0; public static final byte SYSTEM_MESSAGE = (byte)1; public static final byte ABOVE_HOTBAR = (byte)2; public String message; public byte position; public ChatMessage() { } public ChatMessage(String message, byte position) { this.message = message; this.position = position; } @Override public int getId() { return ID; } @Override public void encodeBody(Buffer _buffer) { byte[] bvcfz = _buffer.convertString(message); _buffer.writeVaruint((int)bvcfz.length); _buffer.writeBytes(bvcfz); _buffer.writeByte(position); } @Override public void decodeBody(Buffer _buffer) throws DecodeException { final int bvbvcfz = _buffer.readVaruint(); message = _buffer.readString(bvbvcfz); position = _buffer.readByte(); } public static ChatMessage fromBuffer(byte[] buffer) { ChatMessage packet = new ChatMessage(); packet.safeDecode(buffer); return packet; } }