blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 132 | path stringlengths 2 382 | src_encoding stringclasses 34
values | length_bytes int64 9 3.8M | score float64 1.5 4.94 | int_score int64 2 5 | detected_licenses listlengths 0 142 | license_type stringclasses 2
values | text stringlengths 9 3.8M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
c9d35d02f6d4e8681129ec43db7a042997b2c6d3 | Java | kriyeta/Spring-WebServices-Hibernate-Boilerplate | /src/main/java/com/techlify/rbac/controller/UserController.java | UTF-8 | 7,152 | 2.359375 | 2 | [] | no_license | package com.techlify.rbac.controller;
import java.util.List;
import org.jsondoc.core.annotation.Api;
import org.jsondoc.core.annotation.ApiBodyObject;
import org.jsondoc.core.annotation.ApiMethod;
import org.jsondoc.core.annotation.ApiPathParam;
import org.jsondoc.core.annotation.ApiQueryParam;
import org.jsondoc.core.annotation.ApiResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.techlify.commons.Constants;
import com.techlify.rbac.commons.Result;
import com.techlify.rbac.model.User;
import com.techlify.rbac.repository.UserRepository;
@RestController
@RequestMapping(value = "/user", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@Api(description = "The user controller", name = Constants.USER_GROUP)
public class UserController {
@Autowired
private UserRepository userRepository;
/*
* GET requests
*/
@ApiMethod(id = Constants.USER_GROUP + "_FIND_ALL", description="VIEW ALL USERS")
@RequestMapping(value = { "/all" }, method = RequestMethod.GET)
public @ApiResponseObject @ResponseBody Result getAllUsers() {
try{
List<User> users = userRepository.findAll();
return new Result("Success", users);
} catch(Exception e){
return new Result("Failed", null);
}
}
@ApiMethod(id = Constants.USER_GROUP + "_FIND_BY_NAME", description="VIEW USERS BY NAME")
@RequestMapping(value = { "/" }, method = RequestMethod.GET)
public @ApiResponseObject @ResponseBody Result getUserByName(
@ApiQueryParam(name = "name", description = "The name of the user") @RequestParam("name") String name) {
try{
List<User> users = userRepository.findByName(name);
return new Result("Success", users);
} catch(Exception e){
return new Result("Failed", null);
}
}
@ApiMethod(id = Constants.USER_GROUP + "_FIND_BY_NAME", description="VIEW USERS BY NAME")
@RequestMapping(value = { "/info/{userName}" }, method = RequestMethod.GET)
public @ApiResponseObject @ResponseBody Result getUserByUserName(@ApiPathParam(name = "userName", description = "The userName of the user") @PathVariable("userName") String userName) {
try{
User existingUser = userRepository.findByUserName(userName);
return new Result("Success", existingUser);
} catch(Exception e){
return new Result("Failed", null);
}
}
@ApiMethod(id = Constants.USER_GROUP + "_FIND_BY_ID", description="VIEW USER BY ID")
@RequestMapping(value = { "/{id}" }, method = RequestMethod.GET)
public @ApiResponseObject @ResponseBody User getUserById(
@ApiPathParam(name = "id", description = "The id of the user") @PathVariable("id") Long id) {
User user = userRepository.findOne(id);
return user;
}
/*
* POST requests
*/
@ApiMethod(id = Constants.USER_GROUP + "_ADD", description="ADD NEW USER")
@RequestMapping(value = { "/add" }, method = RequestMethod.POST)
public @ApiResponseObject @ResponseBody Result saveUser(
@ApiBodyObject @RequestBody User user) {
Result result = new Result("Failure", null);
try{
result = new Result("Success", userRepository.saveAndFlush(user));
return result;
} catch(Exception e){
return result;
}
}
@ApiMethod(id = Constants.USER_GROUP + "_AUTHENTICATE", description="AUTHENTICATE USER")
@RequestMapping(value = { "/authenticate" }, method = RequestMethod.POST)
public @ApiResponseObject @ResponseBody Result authenticateUser(
@ApiBodyObject @RequestBody User user) {
User existingUser = userRepository.findByUserName(user.getUserName());
try {
if(existingUser != null && user !=null&& existingUser.getPassword().equals(user.getPassword()))
return new Result("Success",existingUser);
else
return new Result("Failed",null);
} catch (Exception e) {
e.printStackTrace();
}
return new Result("Failed",null);
}
/*
* PUT requests
*/
@ApiMethod(id = Constants.USER_GROUP + "_UPDATE_BY_USER_NAME", description="UPDATE YOUR PROFILE")
@RequestMapping(value = { "/{userName}/update-your-profile" }, method = RequestMethod.PUT)
public @ApiResponseObject @ResponseBody Result updateYourProfile(@ApiPathParam(name = "userName", description = "The userName of the user") @PathVariable("username") String userName,
@ApiBodyObject @RequestBody User user) {
User existingUser = userRepository.findByUserName(userName);
if(existingUser != null && existingUser.getUserName().equals(user.getUserName())){
user.setPassword(existingUser.getPassword());
user.setUserId(existingUser.getUserId());
user.setUserName(existingUser.getUserName());
return new Result("Sucess",userRepository.save(user));
}
else
return new Result("Failed",user);
}
@ApiMethod(id = Constants.USER_GROUP + "_UPDATE_BY_ID", description="UPDATE USER'S PROFILE")
@RequestMapping(value = { "/{id}/update-profile" }, method = RequestMethod.PUT)
public @ApiResponseObject @ResponseBody Result updateUser(@ApiPathParam(name = "id", description = "The id of the user") @PathVariable("id") Long id,
@ApiBodyObject @RequestBody User user) {
User existingUser = userRepository.findOne(id);
if(existingUser != null){
user.setPassword(existingUser.getPassword());
user.setUserId(existingUser.getUserId());
user.setUserName(existingUser.getUserName());
return new Result("Success",userRepository.saveAndFlush(user));
}
else
return new Result("Failed",user);
}
@ApiMethod(id = Constants.USER_GROUP + "_RESET_PASSWOD", description="UPDATE USER'S PASSWORD")
@RequestMapping(value = { "/{id}/reset-password" }, method = RequestMethod.PUT)
public @ApiResponseObject @ResponseBody Result resetPassword(
@ApiBodyObject @RequestBody User user) {
User existingUser = userRepository.findByUserName(user.getUserName());
if(existingUser != null){
existingUser.setPassword(user.getPassword());
return new Result("Sucess",userRepository.saveAndFlush(existingUser));
}
else
return new Result("Failed",user);
}
/*
* DELETE requests
*/
@ApiMethod(id = Constants.USER_GROUP + "_DELETE_ALL", description="DELETE ALL USERS")
@RequestMapping(value = { "/all" }, method = RequestMethod.DELETE)
public @ApiResponseObject @ResponseBody String removeAllUsers() {
userRepository.deleteAll();
return "All users deleted";
}
@ApiMethod(id = Constants.USER_GROUP + "_DELETE_BY_ID", description="DELETE USER")
@RequestMapping(value = { "/{id}" }, method = RequestMethod.DELETE)
public @ApiResponseObject @ResponseBody String removeUser(
@ApiPathParam(name = "id", description = "The id of the user") @PathVariable("id") Long id) {
userRepository.delete(id);
return "User deleted with ID: " + id;
}
} | true |
af573a6eb8f10b845b260b70115b05d8c041c01a | Java | pavelkv96/AndroidSchedule | /app/src/main/java/com/github/pavelkv96/schedule/models/Teacher.java | UTF-8 | 2,512 | 2.3125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2018 The Android Open Source Project
*
* 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.github.pavelkv96.schedule.models;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.SerializedName;
public class Teacher extends BaseEntity implements Parcelable {
@SerializedName("name")
private String name;
@SerializedName("surname")
private String surname;
@SerializedName("patronym")
private String patronym;
@SerializedName("fullname")
private String fullname;
@SerializedName("post")
private String post;
public String getName() {
return name;
}
public String getSurname() {
return surname;
}
public String getPatronym() {
return patronym;
}
public String getFullname() {
return fullname;
}
public String getPost() {
return post;
}
@Override
public String toString() {
return surname + " " + name + " " + patronym;
}
private Teacher(Parcel in) {
super(in);
id = in.readInt();
name = in.readString();
surname = in.readString();
patronym = in.readString();
fullname = in.readString();
post = in.readString();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(id);
dest.writeString(name);
dest.writeString(surname);
dest.writeString(patronym);
dest.writeString(fullname);
dest.writeString(post);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<Teacher> CREATOR = new Creator<Teacher>() {
@Override
public Teacher createFromParcel(Parcel in) {
return new Teacher(in);
}
@Override
public Teacher[] newArray(int size) {
return new Teacher[size];
}
};
}
| true |
9eff1a8afe7e845bf712a54ffcbe76bef5bbb6ea | Java | ArtemSolomatin/supervised-java-tasks | /AcademicProgress/src/main/java/JpaApplication/service/AssessmentServiceImpl.java | UTF-8 | 1,588 | 2.34375 | 2 | [] | no_license | package JpaApplication.service;
import JpaApplication.entity.Assessment;
import JpaApplication.repository.AssessmentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.util.List;
/**
* Created by Artem Solomatin on 09.09.17.
* AcademicProgress
*/
@Service
@Transactional //need to update\delete queries.
public class AssessmentServiceImpl implements AssessmentService {
@Autowired
private AssessmentRepository assessmentRepository;
@PersistenceContext
private EntityManager entityManager;
@Override
public void addAssessment(Integer assessmentId, Integer studentId, Integer subjectId, Integer semesterNum, Integer mark, String examinerSurname) {
Query query = entityManager.createNativeQuery("INSERT INTO assessment values (?, ?, ?, ?, ?, ?)");
query.setParameter(1, assessmentId);
query.setParameter(2, studentId);
query.setParameter(3, subjectId);
query.setParameter(4, semesterNum);
query.setParameter(5, mark);
query.setParameter(6, examinerSurname);
query.executeUpdate();
}
@Override
public void delete(int id) {
assessmentRepository.deleteByAssessmentId(id);
}
@Override
public Assessment getById(Integer assessmentId) {
return assessmentRepository.findByAssessmentId(assessmentId);
}
@Override
public List<Assessment> getAll() {
return assessmentRepository.findAll();
}
}
| true |
2070de851be0aa6783ad1959b773ce1660dcd750 | Java | OkanKY/spring-boot-example | /demo/src/main/java/com/example/demo/controller/DemoController.java | UTF-8 | 749 | 2.140625 | 2 | [] | no_license | package com.example.demo.controller;
import lombok.Data;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api")
public class DemoController {
@GetMapping(value = "/test")
public String test(@RequestParam String param1) {
return "test " + param1;
}
@PostMapping(value = "/test")
public Body testPost(@RequestParam String x, @RequestParam String y, @RequestBody Body body) {
body.setX(x);
body.setY(y);
return body;
}
@DeleteMapping(value = "/test")
public String delete(@RequestParam String param1) {
return "test " + param1;
}
@Data
public static class Body {
private String x;
private String y;
}
}
| true |
621164d7dd8101373e1d95c70e9daae322b04c86 | Java | yw228/FamilyMapServerStudent | /src/main/java/DAO/AuthTokenDAO.java | UTF-8 | 1,992 | 3.046875 | 3 | [] | no_license | package DAO;
import Model.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* A class used for accessing the AuthToken table in the database.
*/
public class AuthTokenDAO {
private Connection conn;
public AuthTokenDAO(Connection conn) {this.conn = conn; }
/**
* Inserts the authToken into the AuthToken table in the database.
*
* @param authToken the token to be inserted into the database.
* @return true or false depending on if the token is correctly inserted into the table.
*/
public void Insert(AuthToken authToken) throws DataAccessException {
String sql = "INSERT INTO AuthToken (Username, Auth_Token) VALUES (?,?)";
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setString(1, authToken.getUserName());
stmt.setString(2, authToken.getAuthToken());
stmt.executeUpdate();
} catch (SQLException e) {
throw new DataAccessException("Error encountered while inserting into the database");
}
}
public AuthToken find(String searchToken) throws DataAccessException {
AuthToken token;
ResultSet rs = null;
String sql = "SELECT * FROM AuthToken WHERE Auth_Token = ?;";
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setString(1, searchToken);
rs = stmt.executeQuery();
if (rs.next()) {
token = new AuthToken(rs.getString("Username"), rs.getString("Auth_Token"));
return token;
}
} catch (SQLException e) {
e.printStackTrace();
throw new DataAccessException("Error encountered while finding token");
} finally {
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
return null;
}
public String getUserName(User user) { return user.getUserName(); }
public String getPassword(User user) { return user.getPassWord(); }
}
| true |
5c4efeedb33621a2a86c43f3e2b89f92287d0f31 | Java | yxhuangCH/JavaAsm | /src/main/java/com/yxhuang/asm/method/AddTimerMethodAdapter.java | UTF-8 | 1,329 | 2.921875 | 3 | [
"MIT"
] | permissive | package com.yxhuang.asm.method;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
public class AddTimerMethodAdapter extends MethodVisitor {
private String owner;
public AddTimerMethodAdapter(MethodVisitor methodVisitor, String owner) {
super(Opcodes.ASM7, methodVisitor);
this.owner = owner;
}
@Override
public void visitCode() {
// 这是方法调用前增加的内容
mv.visitCode();
mv.visitFieldInsn(Opcodes.GETSTATIC, owner, "timer", "J");
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/System", "currentTimeMillis", "()J", false);
mv.visitInsn(Opcodes.LSUB);
mv.visitFieldInsn(Opcodes.PUTSTATIC, owner, "timer", "J");
}
@Override
public void visitInsn(int opcode) {
System.out.println("AddTimerMethodAdapter visitInsn opcode= " + opcode);
// Opcodes.IRETURN 或者 Opcodes.ATHROW 代表着方法调用结束
if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN) || opcode == Opcodes.ATHROW){
mv.visitFieldInsn(Opcodes.GETSTATIC, owner, "timer", "J");
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/System", "currentTimeMillis", "()J", false);
mv.visitInsn(Opcodes.LADD);
}
mv.visitInsn(opcode);
}
}
| true |
49fb9a3746eff62e68e46957ab9b8edcdc62913c | Java | lujianyun06/VATask | /app/src/main/java/com/example/lll/va/task1/Task1.java | UTF-8 | 1,989 | 2.265625 | 2 | [] | no_license | package com.example.lll.va.task1;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.ImageView;
import com.example.lll.va.R;
public class Task1 {
// 任务一
void displayImg(Activity activity){
final ImageView iv = activity.findViewById(R.id.iv_lu);
//1
// iv.setImageResource(R.mipmap.wechatimg1);
//2
// Drawable drawable = getResources().getDrawable(R.mipmap.wechatimg1, null);
// iv.setImageDrawable(drawable);
//3
Bitmap bitmap = BitmapFactory.decodeResource(activity.getResources(), R.mipmap.wechatimg1);
iv.setImageBitmap(bitmap);
}
void displaySurfaceView(final Activity activity){
final SurfaceView sv = activity.findViewById(R.id.sv_lu);
final SurfaceHolder holder = sv.getHolder();
final Thread t = new Thread(new Runnable() {
@Override
public void run() {
Canvas canvas = holder.lockCanvas();
Bitmap bitmap = BitmapFactory.decodeResource(activity.getResources(), R.mipmap.wechatimg1);
canvas.drawBitmap(bitmap, 0, 0, null);
holder.unlockCanvasAndPost(canvas);
holder.lockCanvas(new Rect(0,0,0,0));
holder.unlockCanvasAndPost(canvas);
}
});
holder.addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder holder) {
t.start();
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
}
});
}
}
| true |
a01b67727e3ad5632a0e40eee03687670d270669 | Java | YASHGEEL/FinaAssignment | /ExcelData/src/ReadExcelFile.java | UTF-8 | 898 | 2.65625 | 3 | [] | no_license | import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
public class ReadExcelFile
{
public static void main(String args[]) throws BiffException, IOException {
String FilePath = "D:\\sample.xlsx";
FileInputStream fs = new FileInputStream(new File(FilePath));
XSSFWorkbook wb = new XSSFWorkbook(fs);
XSSFSheet sh = wb.getSheetAt(0);
int r = sh.getLastRowNum();
System.out.println(r);
for(int i=0;i<=r;i++)
{
Row row = sh.getRow(i);
System.out.print(sh.getRow(i).getCell(0));
Cell cell = row.getCell(1);
System.out.println(" " + cell);
}
}
}
| true |
5bd963737140f2dea440fbf31c93f85d8f90b0c0 | Java | chaimaaElHaddad/CSI_Projects | /Gestion_Des_Formations/src/main/java/csi/master/gestion_des_formations/entities/Formation.java | UTF-8 | 1,123 | 2.09375 | 2 | [] | no_license | package csi.master.gestion_des_formations.entities;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import lombok.Data;
@Entity
@Data
public class Formation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String nom;
private Calendar date;
private String accueil; // accueil=nom,address
private int nombres_places;
private float prix;
private String objectifs;
private String prerequis;
private String description;
@ManyToOne
private User formateur;
@OneToMany(mappedBy = "formation" ,cascade = CascadeType.PERSIST, orphanRemoval = true, fetch = FetchType.EAGER)
@JsonManagedReference
private List<ElementDeFormation> elementDeFormations = new ArrayList<ElementDeFormation>();
}
| true |
279dcd5759cc3cf2db0383d042e1492fe3ad0ece | Java | jasonYang6/designPattern | /src/com/designPattern/builder/Director.java | UTF-8 | 572 | 3.515625 | 4 | [] | no_license | package com.designPattern.builder;
/**
* 建造者模式中的导演,发布建造的命令,确定建造顺序
*
* @author Jason
*
*/
public class Director {
Builder builder;
public Director(Builder builder) {
this.builder = builder;
}
// 确定建造过程
public void build() throws Exception {
if (builder == null) {
throw new Exception("建造者不能为空!");
}
builder.buildPartA();
builder.buildPartB();
}
// 返回产品
public Product getProduct() {
if (builder != null) {
return builder.getProduct();
}
return null;
}
}
| true |
75dc0e6f0eafb68eb17b93cc1401f460e05fdb13 | Java | nurbekinho/HackerRank | /src/main/java/net/nurbek/HackerRank/Algorithms/Implementation/P45_ModifiedKaprekarNumbers.java | UTF-8 | 2,990 | 4 | 4 | [] | no_license | package net.nurbek.HackerRank.Algorithms.Implementation;
public class P45_ModifiedKaprekarNumbers
{
public static void main(String[] args)
{
kaprekarNumbers(2, 5);
kaprekarNumbers(1, 100000);
}
private static void kaprekarNumbers(int p, int q)
{
boolean found = false;
for(int i = p; i <= q; i++)
{
if(isKaprekar(i))
{
System.out.print(i + " ");
found = true;
}
}
if(!found) System.out.println("INVALID RANGE");
}
private static boolean isKaprekar(int number)
{
long nSquare = (long) Math.pow(number, 2);
String nStr = Long.toString(nSquare);
String firstHalf = nStr.substring(0, nStr.length() / 2);
String secondHalf = nStr.substring(nStr.length() / 2, nStr.length());
return (number == Integer.parseInt(firstHalf.length() > 0 ? firstHalf : "0") +
Integer.parseInt(secondHalf.length() > 0 ? secondHalf : "0"));
}
}
// SOLVED //
/*
A modified Kaprekar number is a positive whole number with a special property. If you square it, then split the number
into two integers and sum those integers, you have the same value you started with.
Consider a positive whole number "n" with "d" digits. We square "n" to arrive at a number that is either 2 * d digits
long or (2 * d) - 1 digits long. Split the string representation of the square into two parts, "l" and "r". The right
hand part, "r" must be "d" digits long. The left is the remaining substring. Convert those two substrings back to
integers, add them and see if you get "n".
For example, if n = 5, d = 1 then n² = 25. We split that into two strings and convert them back to integers 2 and 5.
We test 2 + 5 = 7 != 5, so this is not a modified Kaprekar number. If n = 9, still d = 1, and n² = 81. This gives
us 1 + 8 = 9, the original "n".
Note: r may have leading zeros.
Here's an explanation from Wikipedia about the ORIGINAL Kaprekar Number (spot the difference!):
In mathematics, a Kaprekar number for a given base is a non-negative integer, the representation of whose square in that
base can be split into two parts that add up to the original number again. For instance, 45 is a Kaprekar number, because
45² = 2025 and 20+25 = 45.
The Task
You are given the two positive integers "p" and "q" where "p" is lower than "q". Write a program to print the modified
Kaprekar numbers in the range between p and q, inclusive.
Input Format
The first line contains the lower integer limit p. The second line contains the upper integer limit q.
Note: Your range should be inclusive of the limits.
Output Format
Output each modified Kaprekar number in the given range, space-separated on a single line. If no modified Kaprekar
numbers exist in the given range, print INVALID RANGE.
Sample Input
1
100
Sample Output
1 9 45 55 99
Explanation
1, 9, 45, 55, and 99 are the Kaprekar Numbers in the given range.
*/ | true |
cff2124c71a96f2a7830f1652ec7cda09d6a87ac | Java | nedasma/hack4vilnius | /app/src/main/java/com/example/myapplication/ui/main/PagerFragment.java | UTF-8 | 4,925 | 2.125 | 2 | [] | no_license | package com.example.myapplication.ui.main;
import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import androidx.fragment.app.Fragment;
import com.example.myapplication.R;
import com.example.myapplication.Services.OrganizationsService;
import com.example.myapplication.Services.UserService;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Collections;
public class PagerFragment extends Fragment {
public static final String ARG_PAGE = "ARG_PAGE";
ArrayList<String> user_string_array = new ArrayList<String>();
ArrayList<String> organizations_string_array = new ArrayList<String>();
private int mPage;
public static PagerFragment newInstance(int page) {
Bundle args = new Bundle();
args.putInt(ARG_PAGE, page);
PagerFragment fragment = new PagerFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPage = getArguments().getInt(ARG_PAGE);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scoreboard, container, false);
ListView ListView = view.findViewById(R.id.ListView);
if (mPage == 1) {
UserService userService = new UserService(getActivity());
userService.getJSONArryOfUsers(new UserService.VolleyResponseListener() {
@Override
public void onError(String message) {
ArrayAdapter<String> arrayAdapter =
new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, Collections.singletonList("Something wrong"));
ListView.setAdapter(arrayAdapter);
}
@Override
public void onResponse(JSONObject user_object) {
}
@Override
public void onResponse(JSONArray user_list) {
if (user_list != null) {
for (int i = 0; i < user_list.length(); i++) {
try {
user_string_array.add(" " + user_list.getJSONObject(i).getString("user_email").split("@")[0] +
" score: " + user_list.getJSONObject(i).getString("user_points"));
} catch (JSONException e) {
e.printStackTrace();
}
}
}
ArrayAdapter<String> arrayAdapter =
new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, user_string_array);
ListView.setAdapter(arrayAdapter);
}
@Override
public void onResponse(int points) {
}
});
} else {
OrganizationsService organizationsService = new OrganizationsService(getActivity());
organizationsService.getJSONArryOfOrganizations(new OrganizationsService.VolleyResponseListener() {
@Override
public void onError(String message) {
ArrayAdapter<String> arrayAdapter =
new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, Collections.singletonList("Something wrong"));
ListView.setAdapter(arrayAdapter);
}
@Override
public void onResponse(JSONArray organizations_list) {
if (organizations_list != null) {
for (int i = 0; i < organizations_list.length(); i++) {
try {
organizations_string_array.add(" " + organizations_list.getJSONObject(i).getString("organisation_email").split("@")[0] +
" score: " + organizations_list.getJSONObject(i).getString("organisation_points"));
} catch (JSONException e) {
e.printStackTrace();
}
}
}
ArrayAdapter<String> arrayAdapter =
new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, user_string_array);
ListView.setAdapter(arrayAdapter);
}
});
}
return view;
}
}
| true |
f236689af6a22b23e3d77759db2582aaeec7b431 | Java | st-hol/kpi-java-classes | /java-core-exercises/file-reader/src/main/java/ua/procamp/FileReaders.java | UTF-8 | 1,299 | 2.96875 | 3 | [] | no_license | package ua.procamp;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.stream.Stream;
/**
* {@link FileReaders} privides an API that allow to read whole file into a {@link String} by file name.
*/
public class FileReaders {
/**
* Returns a {@link String} that contains whole text from the file specified by name.
*
* @param fileName a name of a text file
* @return string that holds whole file content
*/
public static String readWholeFile(String fileName) throws URISyntaxException {
URI path = Objects.requireNonNull(FileReaders.class
.getClassLoader().getResource(fileName)).toURI();
StringBuilder contentBuilder = new StringBuilder();
try (Stream<String> stream = Files.lines(Paths.get(path), StandardCharsets.UTF_8)) {
stream.forEach(s -> contentBuilder.append(s).append("\n"));
} catch (IOException e) {
e.printStackTrace();
}
if (contentBuilder.length() > 0) {
contentBuilder.deleteCharAt(contentBuilder.length() - 1);
}
return contentBuilder.toString();
}
}
| true |
adebed923786b04e0f3874111e176fb350cd2899 | Java | vrudenskyi/LogHub | /src/main/java/loghub/processors/Log.java | UTF-8 | 2,819 | 2.296875 | 2 | [
"Apache-2.0"
] | permissive | package loghub.processors;
import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.codehaus.groovy.control.CompilationFailedException;
import loghub.Event;
import loghub.Expression;
import loghub.Processor;
import loghub.ProcessorException;
import loghub.Expression.ExpressionException;
import loghub.configuration.Properties;
public class Log extends Processor {
private String message;
private Expression expression;
private Logger customLogger;
private String pipeName;
private Level level;
@Override
public boolean configure(Properties properties) {
customLogger = LogManager.getLogger("loghub.eventlogger." + pipeName);
try {
expression = new Expression(message, properties.groovyClassLoader, properties.formatters);
} catch (ExpressionException e) {
Throwable cause = e.getCause();
if (cause instanceof CompilationFailedException) {
logger.error("invalid groovy expression: {}", e.getMessage());
return false;
} else {
logger.error("Critical groovy error: {}", e.getCause().getMessage());
logger.throwing(Level.DEBUG, e.getCause());
return false;
}
}
return super.configure(properties);
}
@Override
public boolean process(Event event) throws ProcessorException {
if (customLogger == null) {
throw event.buildException("Undefined logger");
} else if (customLogger.isEnabled(level)) {
Map<String, Object> esjson = new HashMap<>(event.size());
esjson.putAll(event);
esjson.put("@timestamp", event.getTimestamp());
customLogger.log(level, expression.eval(event));
return true;
} else {
return false;
}
}
@Override
public String getName() {
return "log";
}
/**
* @return the level
*/
public String getLevel() {
return level.toString();
}
/**
* @param level the level to set
*/
public void setLevel(String level) {
this.level = Level.toLevel(level);
}
/**
* @return the pipeName
*/
public String getPipeName() {
return pipeName;
}
/**
* @param pipeName the pipeName to set
*/
public void setPipeName(String pipeName) {
this.pipeName = pipeName;
}
/**
* @return the message
*/
public String getMessage() {
return message;
}
/**
* @param message the expression to set
*/
public void setMessage(String message) {
this.message = message;
}
}
| true |
9f13c431326ed797914ed462fcf7c53a38f0eb64 | Java | ChenHazut/AES-G2 | /src/logic/TeacherController.java | UTF-8 | 3,985 | 2.6875 | 3 | [] | no_license | package logic;
import java.util.ArrayList;
import common.Message;
public class TeacherController
{
User teacher;
LoginController lc;
ClientConsole client;
ArrayList<Course> courses;
ArrayList<Subject> subjects;
public TeacherController()
{
lc=new LoginController();
teacher=lc.getUser();
client=new ClientConsole();
}
public ArrayList<Question> getAllQuestions()//send request to db to get all question which belong to subject this teacher teach
{
Message msg=new Message();
msg.setSentObj(teacher);
msg.setqueryToDo("getAllQuestionRelevantToTeacher");
msg.setClassType("Teacher");
client.accept(msg);
try {
Thread.sleep(1500L);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
msg=client.getMessage();
ArrayList<Question> arrOfQuestions=new ArrayList<Question>();
arrOfQuestions=(ArrayList<Question>)msg.getReturnObj();
System.out.println("***************");
return arrOfQuestions;
}
public void deleteQuestion(Question qToDel)
{
Message msg=new Message();
msg.setClassType("teacher");
msg.setqueryToDo("deleteQuestion");
msg.setSentObj(qToDel);
client.accept(msg);
try {
Thread.sleep(1500L);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public Question createNewQuestion(Question qToAdd)
{
Message questionToSend=new Message();
questionToSend.setClassType("Teacher");
questionToSend.setqueryToDo("createQuestion");
questionToSend.setSentObj(qToAdd);
client.accept(questionToSend);
try
{
Thread.sleep(2500L);
} catch (InterruptedException e)
{
e.printStackTrace();
}
return (Question) client.getMessage().getReturnObj();
}
public void getTeacherCourse()
{
Message msg=new Message();
msg.setSentObj(teacher);
msg.setqueryToDo("getAllCourseRelevantToTeacher");
msg.setClassType("Teacher");
client.accept(msg);
try {
Thread.sleep(2500L);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
msg=client.getMessage();
ArrayList<Course> arrOfCourses=new ArrayList<Course>();
arrOfCourses=(ArrayList<Course>)msg.getReturnObj();
courses=arrOfCourses;
subjects=new ArrayList<Subject>();
ArrayList<String> subjectFlag=new ArrayList<String>();
for(int i=0;i<courses.size();i++)
if(!subjectFlag.contains(courses.get(i).getSubject().getSubjectID()))
{
subjectFlag.add(courses.get(i).getSubject().getSubjectID());
subjects.add(courses.get(i).getSubject());
}
}
public User getTeacher() {
return teacher;
}
public ArrayList<Subject> getSubjects()
{
return subjects;
}
public ArrayList<Course> getCourses()
{
return courses;
}
public User teacherDet(String uID)
{
Message msg=new Message();
msg.setSentObj(uID);
msg.setqueryToDo("getTeacherDetails");
msg.setClassType("Teacher");
client.accept(msg);
try {
Thread.sleep(1500L);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
msg=client.getMessage();
User teacher = (User)msg.getReturnObj();
return teacher;
}
public void deleteExam(Exam eToDel) {
Message msg=new Message();
msg.setClassType("teacher");
msg.setqueryToDo("deleteExam");
msg.setSentObj(eToDel);
client.accept(msg);
try {
Thread.sleep(1500L);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public ArrayList<Exam> getAllExams() {
Message msg=new Message();
msg.setSentObj(teacher);
msg.setqueryToDo("getAllExamsRelevantToTeacher");
msg.setClassType("Teacher");
client.accept(msg);
try {
Thread.sleep(2000L);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
msg=client.getMessage();
ArrayList<Exam> arrOfExams=new ArrayList<Exam>();
arrOfExams=(ArrayList<Exam>)msg.getReturnObj();
return arrOfExams;
}
}
| true |
09e8ffea77cda398e048be9ac028cc49fd6b77e6 | Java | EngineerZhong/Android_example_learn | /My Application12321321/app/src/main/java/com/example/a/myapplication12321321/base/recyclerviewadapter/MainAdapter.java | UTF-8 | 4,964 | 2.015625 | 2 | [] | no_license | package com.example.a.myapplication12321321.base.recyclerviewadapter;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
import android.support.annotation.NonNull;
import android.support.constraint.ConstraintLayout;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.animation.BaseAnimation;
import com.example.a.myapplication12321321.R;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* recyclerview适配器。
*/
public abstract class MainAdapter<T> extends BaseQuickAdapter<T,BaseViewHolder> {
// 上下文
protected Context mContext;
// 数据源
protected List<T> mData;
// ItemView Layout
protected int mItemViewId;
// HeadView
protected View mHeaderView;
// FooterView
protected View mFooterView;
public MainAdapter(List<T> data,int itemViewId,Context context){
super(itemViewId,data);
this.mData = data;
this.mItemViewId = itemViewId;
this.mContext = context;
}
@Override
protected void convert(BaseViewHolder viewHolder, T item) {
initView(viewHolder,item);
initData(viewHolder,item);
setListener(viewHolder,item);
}
protected abstract void initView(BaseViewHolder viewHolder, T t);
protected abstract void initData(BaseViewHolder viewHolder, T t);
protected abstract void setListener(BaseViewHolder viewHolder, T t);
/**获取position,当添加有header或footer要注意改变**/
public int getPosition(BaseViewHolder viewHolder){
return viewHolder.getLayoutPosition();
}
/**获取headerView**/
protected View getHeaderView(int headerViewId) {
if(mContext!=null){
mHeaderView=LayoutInflater.from(mContext).inflate(headerViewId, null);
}
return mHeaderView;
}
/**获取footerView**/
protected View getFooterView(int footerViewId) {
if (mContext != null&&mFooterView==null) {
mFooterView = LayoutInflater.from(mContext).inflate(footerViewId, null);
}
return mFooterView;
}
/**添加headerView**/
public void addHeaderView(int headerViewId){
addHeaderView(getHeaderView(headerViewId));
};
/**添加footerView**/
public void addFooterView(int footerViewId){
addFooterView(getFooterView(footerViewId));
}
/**设置RecyclerView**/
public void setRecyclerManager(RecyclerView recyclerView){
LinearLayoutManager layoutManager=new LinearLayoutManager(mContext);
layoutManager.setSmoothScrollbarEnabled(true);
layoutManager.setAutoMeasureEnabled(true);
recyclerView.setNestedScrollingEnabled(false);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(this);
openLoadAnimation();//默认adapter渐现效果
}
public void setGridLayoutManager(RecyclerView recyclerView){
final GridLayoutManager manager = new GridLayoutManager(mContext,5);
recyclerView.setLayoutManager(manager);
recyclerView.setAdapter(this);
// recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
// @Override
// public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
// super.getItemOffsets(outRect, view, parent, state);
// outRect.top = 5;
// outRect.right = 5;
// outRect.left = 5;
// }
// });
}
public void setEmptyView(int mViewEmptyId){
View viewNoData = View.inflate(mContext,mViewEmptyId,null);
this.setEmptyView(viewNoData);
}
/**adapter渐现动画**/
public void openAlphaAnimation(){
openLoadAnimation(BaseQuickAdapter.ALPHAIN);
}
/**adapter缩放动画**/
public void openScaleAnimation(){
openLoadAnimation(BaseQuickAdapter.SCALEIN );
}
/**adapter从下到上动画**/
public void openBottomAnimation(){
openLoadAnimation(BaseQuickAdapter.SLIDEIN_BOTTOM );
}
/**adapter从左到右动画**/
public void openLeftAnimation(){
openLoadAnimation(BaseQuickAdapter.SLIDEIN_LEFT );
}
/**adapter从右到左动画**/
public void openRightAnimation(){
openLoadAnimation(BaseQuickAdapter.SLIDEIN_RIGHT );
}
/**自定义动画**/
public void openLoadAnimation(BaseAnimation animation){
}
} | true |
8057b8c951f1b65f0da89d7d04e3eb43969d0840 | Java | pluto0007/DS | /Test/src/org/com/exam/module1/InheritanceQuestion.java | UTF-8 | 608 | 3.265625 | 3 | [] | no_license | package org.com.exam.module1;
import java.io.IOException;
class SuperClass{
public static final void method1() throws IOException {
try {
System.out.println("in upper class");
throw new IOException();
} catch (IOException e) {
throw e;
}
}
}
public class InheritanceQuestion extends SuperClass{
static Integer i;
// you can't override final method
/* public void method1() {
System.out.println("in upper class");
}
*/
public static void main(String[] args) throws IOException {
System.out.println(i*2);
for(int i=0;i<10;i++)
System.out.println("i");
method1();
}
}
| true |
d6c75bb6022318d8195891a268cfe03cf1c6f9e6 | Java | mohit4703/DTMF_MANUAL_WIRELESS_ROBOT_CONTROL | /DtmfManual/src/com/mohit/dtmfmanual/Server_Main.java | UTF-8 | 6,190 | 1.984375 | 2 | [
"MIT"
] | permissive | package com.mohit.dtmfmanual;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.Socket;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Bitmap.Config;
import android.hardware.Camera;
import android.hardware.Camera.PreviewCallback;
import android.media.ToneGenerator;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.view.SurfaceHolder;
import android.view.Window;
import android.view.WindowManager;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;
import android.widget.TextView;
import android.widget.Toast;
@SuppressLint("HandlerLeak")
public class Server_Main extends Activity {
Camera mCam;
Camera.Parameters camParam;
SurfaceHolder sHolder;
OutputStream out;
DataOutputStream dos;
TextView ipAd;
SurfaceView sView;
Asynchservice as;
String pass;
protected boolean state=false;
boolean started=false;
int w;
int h;
int[] rgb;
Bitmap bitmap;
ByteArrayOutputStream baos;
protected int i;
protected boolean val;
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN|WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.activity_server__main);
pass=getIntent().getExtras().getString("passs");
ipAd=(TextView)findViewById(R.id.server_ipaddress);
ipAd.setText(getIp());
as=new Asynchservice(getApplicationContext(),handle,pass);
as.execute();
}
Handler handle=new Handler(){
@Override
public void handleMessage(Message msg) {
int receieve=msg.what;
if(receieve==Asynchservice.MESSAGERIGHT)
{
try {
out=((Socket)msg.obj).getOutputStream();
dos=new DataOutputStream(out);
state=true;
sendString("ACCEPT");
Toast.makeText(getApplicationContext(), "Accepted", Toast.LENGTH_LONG).show();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else if(receieve==Asynchservice.MESSAGEWRONG)
{
try {
out=((Socket)msg.obj).getOutputStream();
dos=new DataOutputStream(out);
sendString("WRONG");
Toast.makeText(getApplicationContext(), "wrrong", Toast.LENGTH_LONG).show();
as.finish();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else if(receieve==Asynchservice.MESSAGEONE)
{
ipAd.setText("UP"+i);
startTone("UU");
val=true;
}
else if(receieve==Asynchservice.MESSAGETWO)
{
ipAd.setText("DD"+i);
val=true;
startTone("DD");
}
else if(receieve==Asynchservice.MESSAGETHREE)
{
ipAd.setText("RR"+i);
val=true;
startTone("RR");
}
else if(receieve==Asynchservice.MESSAGEFOUR)
{
ipAd.setText("LL"+i);
val=true;
startTone("LL");
}
else if(receieve==Asynchservice.MESSAGEFIVE)
{
ipAd.setText("SS"+i);
startTone("SS");
val=false;
}
i++;
}
};
private void sendString(String string) {
// TODO Auto-generated method stub
try {
dos.writeInt(string.length());
dos.write(string.getBytes());
out.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
state=false;
finish();
}
}
static Thread r;
protected void startTone(final String string) {
// TODO Auto-generated method stub
r=new Thread(new Runnable() {
ToneGenerator dtmf=new ToneGenerator(0, ToneGenerator.MAX_VOLUME);
@Override
public void run() {
// TODO Auto-generated method stub
if(val==true)
{
if(string.contains("UU"))
{dtmf.startTone(ToneGenerator.TONE_DTMF_2, 1000);
}
else if(string.contains("DD"))
{
dtmf.startTone(ToneGenerator.TONE_DTMF_8, 1000);
}
else if(string.contains("RR"))
{
dtmf.startTone(ToneGenerator.TONE_DTMF_6, 1000);
}
else if(string.contains("LL"))
{
dtmf.startTone(ToneGenerator.TONE_DTMF_4, 1000);
}
else if(string.contains("SS"))
{
dtmf.startTone(ToneGenerator.TONE_DTMF_5, 1000);
}
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
dtmf.stopTone();
dtmf.release();
}
else
{
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
dtmf.startTone(ToneGenerator.TONE_DTMF_5, 1000);
dtmf.stopTone();
dtmf.release();
}
}
});
r.start();
}
public String getIp()
{
WifiManager wifi=(WifiManager)getSystemService(Context.WIFI_SERVICE);
Method[] wifim=wifi.getClass().getDeclaredMethods();
for(Method m:wifim)
{
if(m.getName().equals("isWifiApEnabled"))
{
try {
if(m.invoke(wifi).toString().equals("false"))
{
WifiInfo info=wifi.getConnectionInfo();
int ip=info.getIpAddress();
String ipad=(ip& 0xFF) + "." +
((ip>> 8 ) & 0xFF) + "." +
((ip>> 16 ) & 0xFF) + "." +
((ip>> 24 ) & 0xFF ) ;
return ipad;
}
else if(m.invoke(wifi).toString().equals("true"))
{
return "192.168.48.1";
}
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return null;
}
}
| true |
7fcb93709ab5c7e458b13b8396e45926bcaf52b2 | Java | lipky88/mentoring-project | /src/main/java/ru/lmru/mentoring/education/equalshashcode/HashCodeProbeCheckClass.java | UTF-8 | 5,974 | 2.890625 | 3 | [] | no_license | package ru.lmru.mentoring.education.equalshashcode;
import lombok.SneakyThrows;
import ru.lmru.mentoring.education.equalshashcode.data.TestEntry;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class HashCodeProbeCheckClass {
private final Integer probe = 1;
private Integer capacity = 10000;
private List<TestEntry<Object, String>> data = new ArrayList<>(capacity);
private Integer usedSlots = 0;
private static final Integer USED_SLOTS_THRESHOLD_PERCENT = 60;
public HashCodeProbeCheckClass() {
init(data, capacity);
}
private void init(List<TestEntry<Object, String>> data, Integer capacity) {
for (int i = 0; i < capacity; i++) {
data.add(i, null);
}
}
private void tryToExtend() {
if (usedSlots * 100 / capacity >= USED_SLOTS_THRESHOLD_PERCENT) {
System.out.println("===========EXTENSION===========");
int newCapacity = capacity << 1;
List<TestEntry<Object, String>> newData = new ArrayList<>(newCapacity);
init(newData, newCapacity);
data.stream().filter(Objects::nonNull)
.forEach(slot -> {
put(newData, newCapacity, slot.getKey(), slot.getValue());
});
data = newData;
capacity = newCapacity;
}
}
public TestEntry put(Object key, String value) {
usedSlots += 1;
tryToExtend();
TestEntry entry = new TestEntry(key, value);
int index = getIndex(key);
saveToIndex(index, entry);
return entry;
}
public TestEntry put(List<TestEntry<Object, String>> data, Integer capacity, Object key, String value) {
TestEntry<Object, String> entry = new TestEntry(key, value);
int index = getIndex(capacity, key);
saveToIndex(data, capacity, index, entry);
return entry;
}
@SneakyThrows
private int getIndex(Object key) {
return key.hashCode() % capacity;
}
@SneakyThrows
private int getIndex(Integer capacity, Object key) {
return key.hashCode() % capacity;
}
private void saveToIndex(int index, TestEntry entry) {
if (data.get(index) == null) {
data.set(index, entry);
return;
}
while (index + probe < capacity) {
if (data.get(index) == null) {
data.set(index, entry);
return;
}
if (data.get(index).getKey().equals(entry.getKey())) {
data.set(index, entry);
return;
}
index += probe;
}
}
private void saveToIndex(List<TestEntry<Object, String>> data, Integer capacity, int index, TestEntry entry) {
if (data.get(index) == null) {
data.set(index, entry);
return;
}
while (index + probe < capacity) {
if (data.get(index) == null) {
data.set(index, entry);
return;
}
if (data.get(index).getKey().equals(entry.getKey())) {
data.set(index, entry);
return;
}
index += probe;
}
}
// public String getValue(String key) {
// long startTime = System.nanoTime();
//
// int index = getIndex(key);
// String result = getByIndex(index, key);
//
// long endTime = System.nanoTime();
// long duration = endTime - startTime;
// System.out.printf("duration: %s%n", duration);
// return result;
// }
//
// private String getByIndex(int index, String key) {
// for (int i = index; i < capacity; i += probe) {
// if (key.equals(data.get(i).getKey())) {
// if (i != index) {
//// System.out.printf("collision get key: %s\n", key);
// }
// return data.get(i).getValue();
// }
// }
//// System.out.printf("sorry, can't find your element with key:%s\n", key);
// return "";
// }
//
// private static int getCapacity(List<?> list) throws Exception {
// Field dataField = ArrayList.class.getDeclaredField("elementData");
// dataField.setAccessible(true);
// return ((Object[]) dataField.get(list)).length;
// }
static class Key {
private final String a;
Key(int i) {
this.a = "kjdfadashdfpiashudlehrpiuqeriuvaspofnmpewoijf[qowmefoiwqjefqoijf;oiajsd;fkas;dofiuqewojfq;" +
"wijef;oiwqjef;oqij" +
"lkjasdfkjsad;fajs;dijfa;sidfjaskdhfliueqhrgiuqheworhf.kjqhfdapiushdfpaiushd" +
".kjfqghrphqpireuhgqluehf.kjshfdaiushdpf" +
";lksjdfpoijeqheoifqjwpeifhsdjf.akhdsfouahsdviuahrg;" +
"hqeruhglqehrgkjqhdfiuashdifuahsdkjfahdslfhasldfhaslkjdfhalsiudh" + i;
}
}
public static void main(String[] args) {
HashCodeProbeCheckClass test = new HashCodeProbeCheckClass();
for (int i = 1; i <= 999; i++) {
test.put(new Key(i), "value: " + i);
}
for (int i = 1; i <= 999; i++) {
test.put(new Key(i), null);
}
System.out.println("=======PUT=======");
long startTime = System.nanoTime();
int valuesCount = 50000;
for (int i = 1; i <= valuesCount; i++) {
test.put(new EqualsCheckClass.Key(i), "d;alksjdf;aksjdnkjcankj.nweifjqnwekjfnaldskjfnas," +
"mdfnaskjdnflaskjdnfkjsadnfas,mdnclajd" +
"as;kdjfoqjewqkfu;ewifjpqoiwjef;ijoidsajf;aoijdskcah.kjhreviuqh;icas.,d;fasdjf;aisjdfoi" +
";lajsdoifjapoiejrclkdjaoijdsfoiajsdlkfha;ewoihfoiqhew;oifhq;oiewhf;oihd;isahv.kkhdviua" +
"askdjfoaijsvoiaelkjas;doijf[aoijewflkjwe;fkhdsa;hfakjdshfliuewhfianhdsfkjasnhdlfiuansd");
if (i * 100 % valuesCount == 0) {
// System.out.println(i*100/capacity");
long endTime = System.nanoTime();
long duration = endTime - startTime;
System.out.printf("%s%n", duration / valuesCount);
}
}
}
}
| true |
4b56af48778121775da49ef6db89b018e093d237 | Java | jiachchengGit/work_demo | /jccdemo-dsf/src/main/java/org/jccdemo/dsf/utils/JDKProxy.java | UTF-8 | 1,114 | 2.578125 | 3 | [] | no_license | /**
* @Title: JDKProxy.java
* @Package org.jccdemo.dsf.utils
* @Description: TODO(用一句话描述该文件做什么)
* @author chenjiacheng
* @date 2016年6月7日 上午10:06:03
* @version V1.0
*/
package org.jccdemo.dsf.utils;
import java.lang.reflect.Proxy;
import org.jccdemo.dsf.base.MethodInvoker;
/**
* @ClassName: JDKProxy
* @Description: TODO(这里用一句话描述这个类的作用)
* @author chenjiacheng
* @date 2016年6月7日 上午10:06:03
*
*/
public class JDKProxy {
@SuppressWarnings("unchecked")
public static <T> T getProxy(Class<T> interfaceClass,MethodInvoker methodInvoker){
JDKInvocationHandler handler = new JDKInvocationHandler(methodInvoker);
Object newProxyInstance = Proxy.newProxyInstance(getCurrentClassLoader(), new Class[]{interfaceClass}, handler);
return (T) newProxyInstance;
}
public static ClassLoader getCurrentClassLoader() {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = JDKProxy.class.getClassLoader();
}
return cl == null ? ClassLoader.getSystemClassLoader() : cl;
}
}
| true |
74d5b686c0967ee4b8673b62c8ce343c4a193398 | Java | smxknife/smxknife | /smxknife-java/src/main/java/com/smxknife/java2/serializable/Employee.java | UTF-8 | 1,256 | 2.65625 | 3 | [] | no_license | package com.smxknife.java2.serializable;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
/**
* @author smxknife
* 2018/11/2
*/
public class Employee extends People implements Serializable {
private static final long serialVersionUID = 1L;
public String name;
public String address;
public transient int SSN;
public int number;
public static String staticAttr;
public void mailCheck()
{
System.out.println("Mailing a check to " + name
+ " " + address);
}
private void writeObject(ObjectOutputStream oos) {
try {
ObjectOutputStream.PutField putField = oos.putFields();
System.out.println("is serializing");
System.out.println("name = " + name);
name = name + "_suffix";
putField.put("name", name);
oos.writeFields();
} catch (IOException e) {
e.printStackTrace();
}
}
private void readObject(ObjectInputStream ois) {
try {
ois.readObject();
// ObjectInputStream.GetField getField = ois.readFields();
// System.out.println("is deserializing");
// System.out.println(getField.get("name", ""));
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
| true |
77014aca384af0d347fd362db24909988ccaf8ad | Java | SeongHwan2/Y201904 | /src/com/y0430/지렁이.java | UTF-8 | 3,571 | 3.09375 | 3 | [] | no_license | package com.y0430;
import java.util.Scanner;
public class 지렁이 {
int[][] map = {
{0,0,0,0,0,0,0,0,0,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,0,0,0,0,0,0,0,1,0},
};
int[] play = {1,1}; //Y, X
int[][] 꼬리 = new int[6][2];
int count = 0;
int[] history = {1,1}; //Y,X
int[][] eat = {
{2,2},{2,7},{4,5},{6,2},{6,8},{8,4}
};
public void start() {
Scanner scan = new Scanner(System.in);
view();
while(true) {
switch(scan.next().toUpperCase()) {//사용자에게 명령어 받음
case "W"://위쪽 (-1)
play[0] = play[0] - 1;
break;
case "S"://아래쪽 (+1)
play[0] = play[0] + 1;
break;
case "A"://왼쪽 (-1)
play[1] = play[1] - 1;
break;
case "D"://오른쪽 (+1)
play[1] = play[1] + 1;
break;
default:
break;
}
//벽 예외 처리
if(play[0] == 0) {
play[0] = 1;
} else if(play[1] == 0) {
play[1] = 1;
} else if(play[1] == 9) {
play[1] = 8;
} else if(play[0] == 9 && play[1] == 8) {//if문은 차례대로 동작하기 때문에 이부분에 추가
view();
System.out.println("끝!");
break; //게임종료
} else if(play[0] == 9) {
play[0] = 8;
}
//eat 예외처리 : 6개이기 때문에 반복문 필요.
for(int 대상 = 0;대상 < eat.length; 대상++) {
if(play[0] == eat[대상][0] && play[1] == eat[대상][1]) {
꼬리[count][0] = 대상 +1;//1,2,3,4,5,6
꼬리[count][1] = 1;
count++;
}
}
if(count > 0) {
// 먹을꺼의 히스토리 적용
for(int 대상 = (count - 1); 대상 >= 0; 대상--) {
int 오리지날대상 = 꼬리[대상][0] - 1;
if(대상 == 0) {
if(꼬리[대상][1] == 0) {
꼬리[대상][1] = 1;
}else {
eat[오리지날대상][0] = history[0];
eat[오리지날대상][1] = history[1];
}
} else {
int 오리지날전대상 = 꼬리[대상-1][0] - 1;
if(꼬리[대상][1] == 0) {
꼬리[대상][1] = 1;
}else {
eat[오리지날대상][0] = eat[오리지날전대상][0];
eat[오리지날대상][1] = eat[오리지날전대상][1];
}
}
}
}
view();
history[0] = play[0];
history[1] = play[1];
}
}
public void view() {
for(int row = 0; row < map.length; row++) {
for(int col = 0; col < map[row].length; col++) {
//System.out.print(map[row][col]);
boolean check = true;
if(play[0] == row && play[1] == col) {
System.out.print(" ㉿ ");
continue;
}
for(int 대상 = 0; 대상 < eat.length; 대상++) {
for(int i = 0; i <= count; i++) {
if(eat[대상][0] == row && eat[대상][1] == col) {
System.out.print(" ♥ ");
check = false;
break;
}
/************************************
* 0 1 2 3 4 5 6
* 1 0 1 1 1 1 1 1 1 1 1 1 1 1
* 2 0 2 0 2 2 2 2 2 2 2 2 2 2
* 3 0 3 0 3 0 3 3 3 3 3 3 3 3
* 4 0 4 0 4 0 4 0 4 4 4 4 4 4
* 5 0 5 0 5 0 5 0 5 0 5 5 5 5
* 6 0 6 0 6 0 6 0 6 0 6 0 6 6
************************************/
}
}
if(check) {
if(map[row][col] == 1) {
System.out.print(" □ ");
}else if(map[row][col] == 0) {
System.out.print(" ■ ");
}
}
}
System.out.println();
}
}
public void move() {
}
public void sum() {
}
}
| true |
7ed4826f6b16aa452878afe10252a5ca87e0ff76 | Java | Y-B-Class-Projects/AOOP_Ex_09 | /src/WS1/System/StationToolKit.java | UTF-8 | 301 | 2.109375 | 2 | [] | no_license | package WS1.System;
import WS1.API.SensorImp;
import WS1.Observables.AlarmClock;
import WS1.Observables.AlarmClockImp;
public abstract class StationToolKit {
public abstract SensorImp makeSensorImp(String type) throws ClassNotFoundException;
public abstract AlarmClockImp getAlarmClock();
} | true |
51fa7a59e9bd4198a0c21145457614498eb8f307 | Java | rononz/algorithm | /Week_04/id_142/LeetCode_455_142.java | UTF-8 | 960 | 3.25 | 3 | [] | no_license | import java.util.Arrays;
class Solution {
public int findContentChildren(int[] g, int[] s) {
if (g == null || s == null) {
return 0;
}
int max = 0;
Arrays.sort(g);
Arrays.sort(s);
int cursor = 0;
// assign cookies from the child who is easiest to be contented
for (int greedFactor : g) {
// find the cookie that can content the current child
while (cursor < s.length) {
// for the next child, check cookies starting from cursor++
// because the cookies that are smaller than the current one can't content the next child
int cookieSize = s[cursor++];
if (cookieSize >= greedFactor) {
max++; // find the smallest cookie that can content this child.
break; // move to the next child
}
}
}
return max;
}
}
| true |
d3acd3b41ae863166c3766bdb2555828bb28f99b | Java | lunat1k-12/barman | /src/main/java/com/barman/barman/commands/AllowListCommand.java | UTF-8 | 1,389 | 2.28125 | 2 | [] | no_license | package com.barman.barman.commands;
import com.barman.barman.dao.IUserPrivilegesDao;
import com.barman.barman.domain.CommandWorkspace;
import com.barman.barman.domain.DbUserPrivilege;
import com.barman.barman.util.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.util.List;
public class AllowListCommand extends AbstractCommandProcessor {
public static final String ALLOW_LIST_COMMAND = "allow list";
@Value("${admin.name}")
private String adminName;
@Autowired
private IUserPrivilegesDao userPrivilegesDao;
@Override
public CommandWorkspace processCommand(CommandWorkspace cspace) {
if(cspace.getRequestMessage() != null && cspace.getRequestMessage().trim().equals(ALLOW_LIST_COMMAND)) {
cspace.setResponseMessage(adminName.equals(cspace.getUserPrivilege().getUserId()) ? this.getAllowList() : Constants.ACCESS_DENIED);
return cspace;
}
return processNextOrExit(cspace);
}
private String getAllowList() {
List<DbUserPrivilege> users = userPrivilegesDao.loadNotGranted();
return users.stream().map(u -> u.getUserId() + ": " + u.getAllowDrink() + u.getAllowPhoto() + u.getAllowAllPhoto())
.reduce((left, right) -> left + "\n" + right + "\n").orElse("empty");
}
}
| true |
73ed050c399723bb4348515f5de857581611e4a7 | Java | giangphan11/MVVM-Example | /app/src/main/java/phanbagiang/com/mvvm/activities/TesstColorActivity.java | UTF-8 | 385 | 1.679688 | 2 | [] | no_license | package phanbagiang.com.mvvm.activities;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import phanbagiang.com.mvvm.R;
public class TesstColorActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tesst_color);
}
} | true |
8db4e5505e2ce2349c1846c6c57621485fba1135 | Java | AndroidWorkGumy/CTP | /app/src/main/java/com/example/radu/firstapp/MainActivity.java | UTF-8 | 4,686 | 2.3125 | 2 | [] | no_license | package com.example.radu.firstapp;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import java.util.Calendar;
import java.util.Random;
public class MainActivity extends Activity {
public static String text;
public static String linie;
public static String getMinutes(Calendar rightNow) {
if (rightNow.get(Calendar.MINUTE) + 45 > 59)
return (String.valueOf(rightNow.get(Calendar.MINUTE) - 15));
return String.valueOf(rightNow.get(Calendar.MINUTE) + 45);
}
public static String getHourAndMinutes(Calendar rightNow) {
if (!String.valueOf(rightNow.get((Calendar.MINUTE)) + 45).equals(getMinutes(rightNow))) {
if (rightNow.get(Calendar.HOUR_OF_DAY) + 1 < 10)
return "0" + String.valueOf(rightNow.get(Calendar.HOUR_OF_DAY) + 1)
+ ":"
+ String.valueOf(getMinutes(rightNow));
return String.valueOf(rightNow.get(Calendar.HOUR_OF_DAY) + 1)
+ ":"
+ String.valueOf(getMinutes(rightNow));
}
return getHour(rightNow) + ":" + getMinutes(rightNow);
}
public static String getHour(Calendar rightNow) {
if (rightNow.get(Calendar.HOUR_OF_DAY) < 10)
return "0" + String.valueOf(rightNow.get(Calendar.HOUR_OF_DAY));
return String.valueOf(rightNow.get(Calendar.HOUR_OF_DAY));
}
public static String getMonth(Calendar rightNow) {
if (rightNow.get(Calendar.MONTH) + 1 < 10)
return "0" + String.valueOf(rightNow.get(Calendar.MONTH) + 1);
return String.valueOf(rightNow.get(Calendar.MONTH) + 1);
}
public static String getDay(Calendar rightNow) {
if (rightNow.get(Calendar.DAY_OF_MONTH) < 10)
return "0" + String.valueOf(rightNow.get(Calendar.DAY_OF_MONTH));
return String.valueOf(rightNow.get(Calendar.DAY_OF_MONTH));
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button button = (Button) findViewById(R.id.button);
final EditText ctpLine = (EditText) findViewById(R.id.ctpLine);
final Intent intent = new Intent(MainActivity.this, ChatLayout.class);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int min = 132795;
int max = 865742;
Random randomNumber = new Random();
linie = ctpLine.getText().toString();
if (!linie.isEmpty()) {
Calendar rightNow = Calendar.getInstance();
text = "Biletul pentru linia " + linie + " a fost activat. Valabil pana la " +
getHourAndMinutes(rightNow)
+ " in " + getDay(rightNow) + "/" + getMonth(rightNow) +
"/" + rightNow.get(Calendar.YEAR) +
". Cost total:0.50EUR + Tva. Cod confirmare: " + (randomNumber.nextInt(max - min + 1) + min) + ".";
// ContentValues values = new ContentValues();
// values.put("address", "7479");
// values.put("body", linie);
// getContentResolver().insert(Uri.parse("content://sms/sent"), values);
// values.put("body", text);
// getContentResolver().insert(Uri.parse("content://sms/inbox"), values);
startActivity(intent);
}
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| true |
f54df19d4c1403184a907f2b7ca77bf43a927ccb | Java | dkranes/GuildProjects | /FlooringCalculatorWeb/FlooringCalculatorWeb/src/main/java/com/swcguild/flooringcalculatorweb/FlooringCalculatorWebServlet.java | UTF-8 | 4,440 | 2.625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.swcguild.flooringcalculatorweb;
import java.io.IOException;
import java.text.DecimalFormat;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author apprentice
*/
@WebServlet(name = "FlooringCalculatorWebServlet", urlPatterns = {"/FlooringCalculatorWebServlet"})
public class FlooringCalculatorWebServlet extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
// protected void processRequest(HttpServletRequest request, HttpServletResponse response)
// throws ServletException, IOException {
// response.setContentType("text/html;charset=UTF-8");
// try (PrintWriter out = response.getWriter()) {
// /* TODO output your page here. You may use following sample code. */
// out.println("<!DOCTYPE html>");
// out.println("<html>");
// out.println("<head>");
// out.println("<title>Servlet FlooringCalculatorWebServlet</title>");
// out.println("</head>");
// out.println("<body>");
// out.println("<h1>Servlet FlooringCalculatorWebServlet at " + request.getContextPath() + "</h1>");
// out.println("</body>");
// out.println("</html>");
// }
// }
// <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 {
RequestDispatcher rd = request.getRequestDispatcher("index.jsp");
rd.forward(request, response);
}
/**
* 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 {
double width = Double.parseDouble(request.getParameter("myWidth"));
double length = Double.parseDouble(request.getParameter("myLength"));
String myCost = request.getParameter("myCost");
double cost = Double.parseDouble(myCost);
double area = width * length;
double totalMatCost = area * cost;
double totalLabor = laborCost(area);
double quote = totalLabor + totalMatCost;
DecimalFormat df=new DecimalFormat("#.##");
request.setAttribute("area", df.format(area));
request.setAttribute("totalMatCost", df.format(totalMatCost));
request.setAttribute("totalLabor", df.format(totalLabor));
request.setAttribute("quote", df.format(quote));
RequestDispatcher rd = request.getRequestDispatcher("response.jsp");
rd.forward(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
public double laborCost(double area) {
final double QUARTER_RATE = 21.5;
int timeBlocks = 0;
if (area % 5 != 0) {
timeBlocks = ((int)area / 5) + 1;
} else {
timeBlocks = (int)area / 5;
}
return timeBlocks * QUARTER_RATE;
}
}
| true |
04f31f16cf7513cc5f1a6afd53cd8f2a762e648b | Java | Heleor/java-game | /core/src/world/ActiveMap.java | UTF-8 | 2,707 | 2.625 | 3 | [] | no_license | package world;
import static personal.game.Constants.TILE_SIZE;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import personal.game.Direction;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Rectangle;
public class ActiveMap {
private int tileCols;
private int tileRows;
private WorldTile[][] tiles;
private List<CollisionArea> collisions;
private Pixmap pixmap;
private Texture texture;
private World world;
private Map<Direction, String> connections;
public ActiveMap(World world, int width, int height,
WorldTile[][] tiles, List<CollisionArea> collisions,
Map<Direction, String> connections) {
this.world = world;
this.tileCols = width;
this.tileRows = height;
this.tiles = tiles;
this.collisions = collisions;
this.connections = connections;
this.pixmap = new Pixmap(tileCols * TILE_SIZE, tileRows * TILE_SIZE, Pixmap.Format.RGBA8888);
draw();
}
public int getWidth() {
return tileCols * TILE_SIZE;
}
public int getHeight() {
return tileRows * TILE_SIZE;
}
public Rectangle getArea() {
return new Rectangle(0,0,getWidth(), getHeight());
}
public void render(SpriteBatch batch, float xOff, float yOff) {
batch.draw(texture, xOff,yOff, getWidth(), getHeight());
}
public void render(SpriteBatch batch) {
render(batch, 0, 0);
}
/**
* Update the internal texture for this map.
*/
private void draw() {
for (int i = 0; i < tileCols; i++) {
for (int j = 0; j < tileRows; j++) {
tiles[i][j].tile.drawTo(pixmap, i * TILE_SIZE, j * TILE_SIZE);
}
}
texture = new Texture(pixmap);
}
public void renderCollision(ShapeRenderer shapes) {
for (CollisionArea area : collisions) {
if (!area.passable) {
shapes.setColor(1.0f, 0.0f, 0.0f, 0.5f);
} else if (area.slow > 0) {
shapes.setColor(1.0f, 1.0f - (area.slow / 4.0f), 0.0f, 0.5f);
} else {
shapes.setColor(0.5f, 0.0f, 0.5f, 0.5f);
}
shapes.rect(area.area.x, area.area.y, area.area.width, area.area.height);
}
}
public List<CollisionArea> collisions(Rectangle collision) {
List<CollisionArea> matches = new LinkedList<>();
for (CollisionArea area : collisions) {
if (area.area.overlaps(collision)) {
matches.add(area);
}
}
return matches;
}
public void transition(Direction direction) {
if (connections.containsKey(direction)) {
world.transitionTo(connections.get(direction), direction);
}
}
}
| true |
0702ee81751ec7b04bace958cfd472520342a295 | Java | Young-Zen/springboot-sample-demo | /src/main/java/com/sz/springbootsample/demo/controller/FileController.java | UTF-8 | 1,844 | 2.140625 | 2 | [] | no_license | package com.sz.springbootsample.demo.controller;
import com.sz.springbootsample.demo.annotation.IgnoreTracing;
import com.sz.springbootsample.demo.dto.ResponseResultDTO;
import com.sz.springbootsample.demo.enums.ResponseCodeEnum;
import com.sz.springbootsample.demo.form.UploadFileForm;
import com.sz.springbootsample.demo.service.UploadFileService;
import com.sz.springbootsample.demo.util.RSAUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* this module only use for CD
*
* @author yanghaojia CD-Group
* @date 2022/9/8 16:53
*/
@RestController
@Validated
@RequestMapping("/file")
@Api(tags = "文件控制器")
public class FileController {
@Resource
private UploadFileService uploadFileService;
@GetMapping("/getRsaPublicKey")
@IgnoreTracing
@ApiOperation("获取 RSA 公钥")
public ResponseResultDTO getRsaPublicKey() {
return ResponseResultDTO.ok(ResponseCodeEnum.OK.getCode(), ResponseCodeEnum.OK.getMsg(), RSAUtils.getPublicKey());
}
@PostMapping("/upload")
@IgnoreTracing
@ApiOperation("上传")
public ResponseResultDTO upload(@ApiParam(name = "上传文件表单", value = "json格式", required = true) @Validated @RequestBody UploadFileForm form) {
return ResponseResultDTO.ok(ResponseCodeEnum.OK.getCode(), ResponseCodeEnum.OK.getMsg(), uploadFileService.upload(form));
}
}
| true |
7b24e0c2692a1c2ce320c9c23ba17fd2028f301d | Java | zyc1996/CS453_Homework | /HW1/app/src/main/java/cs453/homework/geoquiz/QuizActivity.java | UTF-8 | 2,989 | 2.5 | 2 | [] | no_license | package cs453.homework.geoquiz;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class QuizActivity extends AppCompatActivity {
private Button mTrueButton;
private Button mFalseButton;
private Button mNextButton;
private TextView mQuestionTextView;
private Question[] mQuestionBank = new Question[]{
new Question(R.string.question_australia,true),
new Question(R.string.question_ocean,true),
new Question(R.string.question_mideast,false),
new Question(R.string.question_africa,false),
new Question(R.string.queustion_americas,true),
new Question(R.string.question_asia,true),
};
private int mCurrentIndex = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mQuestionTextView = findViewById(R.id.question_text_view);
mTrueButton = findViewById(R.id.true_button);
mFalseButton = findViewById(R.id.false_button);
mNextButton = findViewById(R.id.next_button);
//true onclick
mTrueButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkAnswer(true);
}
});
//false onclick
mFalseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkAnswer(false);
}
});
//next onclick
mNextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCurrentIndex = (mCurrentIndex + 1)%mQuestionBank.length;
updateQuestion();
}
});
updateQuestion();
}
//next onclick Textview
public void textViewUpdate(View view){
Log.d("textViewUpdate1: ", "index" + mCurrentIndex);
if(mCurrentIndex < mQuestionBank.length-1){
mCurrentIndex++;
}else{
mCurrentIndex = 0;
}
Log.d("textViewUpdate2: ", "index" + mCurrentIndex);
updateQuestion();
}
private void updateQuestion(){
int question = mQuestionBank[mCurrentIndex].getmTextResId();
mQuestionTextView.setText(question);
}
private void checkAnswer(Boolean userPressedTrue){
boolean answerIsTrue = mQuestionBank[mCurrentIndex].ismAnswerTrue();
int messageResId = 0;
if(userPressedTrue == answerIsTrue){
messageResId = R.string.correct_toast;
}else{
messageResId = R.string.incorrect_toast;
}
Toast.makeText(this,messageResId, Toast.LENGTH_SHORT).show();
}
}
| true |
2565123d241088d92351ad6bc794e2e5b55d680d | Java | LittleWindCoat/Learning-decision-tree-linear-classifers | /CSC242-Project-4-Fall2018/src/nn/ui/NeuronUnitView.java | UTF-8 | 1,599 | 2.828125 | 3 | [] | no_license | package nn.ui;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;
import nn.core.Connection;
import nn.core.NeuronUnit;
public class NeuronUnitView extends JPanel {
private static final long serialVersionUID = 1L;
protected NeuronUnit unit;
protected JPanel weightsPanel;
protected JLabel weightLabels[];
protected JLabel outputLabel;
public NeuronUnitView(NeuronUnit unit) {
super();
this.unit = unit;
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
weightsPanel = new JPanel();
weightsPanel.setLayout(new BoxLayout(weightsPanel, BoxLayout.Y_AXIS));
int nweights = unit.incomingConnections.size();
weightLabels = new JLabel[nweights];
for (int i=0; i < nweights; i++) {
weightLabels[i] = new JLabel();
weightsPanel.add(weightLabels[i]);
}
add(weightsPanel);
add(Box.createRigidArea(new Dimension(5,00)));
outputLabel = new JLabel();
add(outputLabel);
update();
// Border
Border line = BorderFactory.createLineBorder(Color.black);
Border space = BorderFactory.createEmptyBorder(5,5,5,5);
this.setBorder(BorderFactory.createCompoundBorder(line, space));
}
public void update() {
int nweights = unit.incomingConnections.size();
for (int i=0; i < nweights; i++) {
Connection conn = unit.incomingConnections.get(i);
weightLabels[i].setText(String.format("%.3f", conn.weight));
}
outputLabel.setText(String.format("%.3f", unit.getOutput()));
}
}
| true |
8f5ae4ab2db93656c3eaff73b2129e1a3ebb6c8b | Java | ffuel/android-architecture-components | /app/src/main/java/com/a65apps/architecturecomponents/sample/domain/mvi/MviConstants.java | UTF-8 | 267 | 1.71875 | 2 | [] | no_license | package com.a65apps.architecturecomponents.sample.domain.mvi;
public final class MviConstants {
public static final String TITLE_INTENT = "title_intent";
public static final String SUBTITLE_INTENT = "subtitle_intent";
private MviConstants() {
}
}
| true |
57fe4a3271281ef3955ff4af06349a5b2ee65de0 | Java | ErwanHEI/ApplicationGestion | /src/daoImpl/ProduitDaoImpl.java | ISO-8859-1 | 17,337 | 2.375 | 2 | [] | no_license | package daoImpl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import dao.ProduitDao;
import entitie.Fournisseur;
import entitie.ModificationProduit;
import entitie.Produit;
import entitie.Stockage;
import entitie.User;
public class ProduitDaoImpl implements ProduitDao{
DataBase bdd=new DataBase("gestionstock.sqlite");
Connection connection;
@Override
public Produit ajout(Produit produit) {
bdd.connect();
try {
PreparedStatement stmt = bdd.getConnection().prepareStatement("INSERT INTO `produit`(`nomProduit`,`categorie`,`quantite`,`prixU`,`idFournisseur`,`idStockage`,`idUser`) VALUES(?,?,?,?,?,?,?)",Statement.RETURN_GENERATED_KEYS);
stmt.setString(1, produit.getNomProduit());
stmt.setString(2, produit.getCategorie());
stmt.setInt(3, produit.getQuantite());
stmt.setDouble(4, produit.getPrixU());
stmt.setInt(5, produit.getFournisseur().getIdFournisseur());
stmt.setInt(6, produit.getStockage().getIdStockage());
stmt.setInt(7, produit.getCreateur().getIdUser());
stmt.execute();
ResultSet ids = stmt.getGeneratedKeys();
if (ids.next()) {
int idProduit = ids.getInt(1);
produit.setIdProduit(idProduit);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bdd.close();
return produit;
}
@Override
public List<Produit> listerProduit() {
bdd.connect();
List<Produit> listeProduit = new ArrayList<Produit>();
try {
Statement stm = bdd.getConnection().createStatement();
String rqt="SELECT * FROM produit JOIN stockage ON produit.idStockage=stockage.idStockage";
ResultSet res=stm.executeQuery(rqt);
while (res.next()){
String name=res.getString("nomProduit");
Integer idProduit=res.getInt("idProduit");
String categorie=res.getString("categorie");
Integer quantite=res.getInt("quantite");
Double prixU=res.getDouble("prixU");
Integer idFournisseur=res.getInt("idFournisseur");
Integer idCreateur=res.getInt("idUser");
Integer idStockage=res.getInt("idStockage");
String localisation=res.getString("localisation");
String nomStockage=res.getString("nomStockage");
Integer remplissage=res.getInt("remplissage");
Stockage stockage=new Stockage(idStockage,localisation,nomStockage,remplissage);
PreparedStatement stmt = bdd.getConnection().prepareStatement("SELECT * FROM fournisseur WHERE idFournisseur=?");
stmt.setInt(1, idFournisseur);
ResultSet res1=stmt.executeQuery();
String nomF=res1.getString("nomFournisseur");
String adresse=res1.getString("adresse");
Fournisseur fournisseur=new Fournisseur(idFournisseur,nomF,adresse);
PreparedStatement stmt1 = bdd.getConnection().prepareStatement("SELECT * FROM user WHERE idUser=?");
stmt1.setInt(1, idCreateur);
ResultSet res2=stmt1.executeQuery();
User createur=map(res2);
Produit produit=new Produit(idProduit,name, categorie,prixU, quantite,stockage,fournisseur,null);
listeProduit.add(produit);
}
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bdd.close();
return listeProduit;
}
@Override
public List<Produit> listerProduitFiltre(String filtre) {
bdd.connect();
List<Produit> listeProduit = new ArrayList<Produit>();
String tri="";
if(filtre=="Catgorie : Ordre alphabtique"){tri="categorie asc";}
else if (filtre=="Catgorie : Ordre alphabtique inverse"){tri="categorie desc";}
else if (filtre=="Nom : Ordre alphabtique"){tri="nomProduit asc";}
else if (filtre=="Nom : Ordre alphabtique inverse"){tri="nomProduit desc";}
else if (filtre=="Prix : Ordre croissant"){tri="prixU asc";}
else if (filtre=="Prix : Ordre dcroissant"){tri="prixU desc";}
else if (filtre=="Quantit : Ordre croissant"){tri="quantite asc";}
else if (filtre=="Quantit : Ordre dcroissant"){tri="quantite desc";}
else if (filtre=="Lieu de stockage : Ordre alphabtique"){tri="categorie desc";}
else if (filtre=="Lieu de stockage : Ordre alphabtique inverse"){tri="categorie desc";}
try {
Statement stm = bdd.getConnection().createStatement();
String rqt="SELECT * FROM produit JOIN stockage ON produit.idStockage=stockage.idStockage ORDER BY "+tri;
ResultSet res=stm.executeQuery(rqt);
while (res.next()){
String name=res.getString("nomProduit");
Integer idProduit=res.getInt("idProduit");
String categorie=res.getString("categorie");
Integer quantite=res.getInt("quantite");
Double prixU=res.getDouble("prixU");
Integer idFournisseur=res.getInt("idFournisseur");
Integer idCreateur=res.getInt("idUser");
Integer idStockage=res.getInt("idStockage");
String localisation=res.getString("localisation");
String nomStockage=res.getString("nomStockage");
Integer remplissage=res.getInt("remplissage");
Stockage stockage=new Stockage(idStockage,localisation,nomStockage,remplissage);
PreparedStatement stmt = bdd.getConnection().prepareStatement("SELECT * FROM fournisseur WHERE idFournisseur=?");
stmt.setInt(1, idFournisseur);
ResultSet res1=stmt.executeQuery();
String nomF=res1.getString("nomFournisseur");
String adresse=res1.getString("adresse");
Fournisseur fournisseur=new Fournisseur(idFournisseur,nomF,adresse);
PreparedStatement stmt1 = bdd.getConnection().prepareStatement("SELECT * FROM user WHERE idUser=?");
stmt1.setInt(1, 3);
ResultSet res2=stmt1.executeQuery();
//User createur=map(res2);
Produit produit=new Produit(idProduit,name, categorie,prixU, quantite,stockage,fournisseur,null);
listeProduit.add(produit);
}
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bdd.close();
return listeProduit;
}
@Override
public List<Produit> listerProduitEvenement(List<Integer> listeIdProduit) {
bdd.connect();
List<Produit> listeProduitEvenement = new ArrayList<Produit>();
for(int i=0; i<listeIdProduit.size(); i++){
try {
Statement stm = bdd.getConnection().createStatement();
String rqt="SELECT * FROM produit JOIN stockage ON produit.idStockage=stockage.idStockage WHERE idProduit="+listeIdProduit.get(i);
ResultSet res=stm.executeQuery(rqt);
while (res.next()){
String name=res.getString("nomProduit");
Integer idProduit=res.getInt("idProduit");
String categorie=res.getString("categorie");
Integer quantite=res.getInt("quantite");
Double prixU=res.getDouble("prixU");
Integer idFournisseur=res.getInt("idFournisseur");
//Integer idCreateur=res.getInt("idUser");
Integer idStockage=res.getInt("idStockage");
String localisation=res.getString("localisation");
String nomStockage=res.getString("nomStockage");
Integer remplissage=res.getInt("remplissage");
Stockage stockage=new Stockage(idStockage,localisation,nomStockage,remplissage);
PreparedStatement stmt = bdd.getConnection().prepareStatement("SELECT * FROM fournisseur WHERE idFournisseur=?");
stmt.setInt(1, idFournisseur);
ResultSet res1=stmt.executeQuery();
String nomF=res1.getString("nomFournisseur");
String adresse=res1.getString("adresse");
Fournisseur fournisseur=new Fournisseur(idFournisseur,nomF,adresse);
PreparedStatement stmt1 = bdd.getConnection().prepareStatement("SELECT * FROM user WHERE idUser=?");
stmt1.setInt(1, 3);
ResultSet res2=stmt1.executeQuery();
//User createur=map(res2);
Produit produit=new Produit(idProduit, name, categorie, prixU, 0, stockage, fournisseur, null);
listeProduitEvenement.add(produit);
}
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
bdd.close();
return listeProduitEvenement;
}
private static User map(ResultSet resultSet) throws SQLException {
User utilisateur = new User();
utilisateur.setIdUser(resultSet.getInt("idUser"));
utilisateur.setEmail(resultSet.getString("email"));
utilisateur.setMdp(resultSet.getString("mdp"));
utilisateur.setNom(resultSet.getString("nomUser"));
return utilisateur;
}
@Override
public void majPrix(Integer prix, Produit produit, User user,String comment) {
bdd.connect();
Connection connection;
try {
PreparedStatement stmt = bdd.getConnection()
.prepareStatement("UPDATE produit SET prix=? WHERE idProduit=?");
stmt.setInt(1, prix);
stmt.setInt(2, produit.getIdProduit());
stmt.execute();
PreparedStatement stmt1 = bdd.getConnection()
.prepareStatement("INSERT INTO`modificationProduit`(`modification`,`datModif`,`utilisateur`, `produit`, `comment`) VALUES(?,?,?,?,?)",Statement.RETURN_GENERATED_KEYS);
stmt1.setString(1, "Prix : "+prix.toString());
Date aujourdhui = new Date();
List<String> dateA=new ArrayList<String>();
DateFormat shortDateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT);
String date=shortDateFormat.format(aujourdhui);
System.out.println(date);
for (String retval: date.split(" ")){
dateA.add(retval);
}
stmt1.setString(2, dateA.get(0));
stmt1.setString(3, user.getEmail());
stmt1.setString(4, produit.getNomProduit());
stmt1.setString(5, comment);
stmt1.execute();
} catch (SQLException e) {
e.printStackTrace();
}
bdd.close();
}
@Override
public void majQuantite(Integer quantite,Produit produit, User user, String comment) {
bdd.connect();
Connection connection;
try {
PreparedStatement stmt = bdd.getConnection()
.prepareStatement("UPDATE produit SET quantite=? WHERE idProduit=?");
stmt.setInt(1, quantite);
stmt.setInt(2, produit.getIdProduit());
stmt.execute();
PreparedStatement stmt1 = bdd.getConnection()
.prepareStatement("INSERT INTO`modificationProduit`(`modification`,`dateModif`,`utilisateur`, `produit`,`comment`) VALUES(?,?,?,?,?)",Statement.RETURN_GENERATED_KEYS);
stmt1.setString(1, "Quantit : "+quantite.toString());
Date aujourdhui = new Date();
List<String> dateA=new ArrayList<String>();
DateFormat shortDateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT);
String date=shortDateFormat.format(aujourdhui);
System.out.println(date);
for (String retval: date.split(" ")){
dateA.add(retval);
}
stmt1.setString(2, dateA.get(0));
stmt1.setString(3, user.getEmail());
stmt1.setString(4, produit.getNomProduit());
stmt1.setString(5, comment);
stmt1.execute();
} catch (SQLException e) {
e.printStackTrace();
}
bdd.close();
}
@Override
public void majStockage(Stockage stockage,Produit produit, User user, String comment) {
bdd.connect();
Connection connection;
try {
PreparedStatement stmt = bdd.getConnection()
.prepareStatement("UPDATE produit SET idStockage=? WHERE idProduit=?");
stmt.setInt(1, stockage.getIdStockage());
stmt.setInt(2, produit.getIdProduit());
stmt.execute();
PreparedStatement stmt1 = bdd.getConnection()
.prepareStatement("INSERT INTO`modificationProduit`(`modification`,`dateModif`,`utilisateur`, `produit`,`comment`) VALUES(?,?,?,?,?)",Statement.RETURN_GENERATED_KEYS);
stmt1.setString(1, stockage.getNomStockage());
Date aujourdhui = new Date();
List<String> dateA=new ArrayList<String>();
DateFormat shortDateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT);
String date=shortDateFormat.format(aujourdhui);
System.out.println(date);
for (String retval: date.split(" ")){
dateA.add(retval);
}
stmt1.setString(2, dateA.get(0));
stmt1.setString(3, user.getEmail());
stmt1.setString(4, produit.getNomProduit());
stmt1.setString(5, comment);
stmt1.execute();
} catch (SQLException e) {
e.printStackTrace();
}
bdd.close();
}
@Override
public List<ModificationProduit> listerModification() {
bdd.connect();
List<ModificationProduit> listeModif = new ArrayList<ModificationProduit>();
try {
Statement stm = bdd.getConnection().createStatement();
String rqt="SELECT * FROM modificationProduit";
ResultSet res=stm.executeQuery(rqt);
while (res.next()){
Integer idModif=res.getInt("idModif");
String nomP=res.getString("produit");
String modification=res.getString("modification");
String dateModif=res.getString("dateModif");
String createur=res.getString("utilisateur");
String comment=res.getString("comment");
ModificationProduit modif=new ModificationProduit(idModif, nomP, modification,createur , dateModif, comment);
listeModif.add(modif);
}
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return listeModif;
}
@Override
public List<ModificationProduit> listerModificationFiltre(String filtre) {
bdd.connect();
List<ModificationProduit> listeModif = new ArrayList<ModificationProduit>();
String tri="";
if(filtre=="Quantit : Ordre croissant"){tri="quantite asc";}
else if (filtre=="Quantit : Ordre dcroissant"){tri="quantite desc";}
try {
Statement stm = bdd.getConnection().createStatement();
String rqt="SELECT * FROM modificationProduit ORDER BY "+tri;
ResultSet res=stm.executeQuery(rqt);
while (res.next()){
Integer idModif=res.getInt("idModif");
String nomP=res.getString("produit");
String nouveauStockage=res.getString("stockage");
Integer nouvelleQu=res.getInt("quantite");
Double nouveauprixU=res.getDouble("prix");
String createur=res.getString("utilisateur");
//ModificationProduit modif=new ModificationProduit(idModif,nouveauprixU,nouvelleQu,nomP,nouveauStockage,createur);
//listeModif.add(modif);
}
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bdd.close();
return listeModif;
}
@Override
public void suppressionProduit(Integer id) {
bdd.connect();
try {
PreparedStatement stmt = bdd.getConnection().prepareStatement("DELETE FROM produit WHERE idProduit=?");
stmt.setInt(1, id);
stmt.execute();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bdd.close();
}
@Override
public void suppressionJournalProduit(Integer id) {
bdd.connect();
try {
PreparedStatement stmt = bdd.getConnection().prepareStatement("DELETE FROM modificationProduit WHERE idModif=?");
stmt.setInt(1, id);
stmt.execute();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
;
bdd.close();
}
@Override
public Integer recupNewQuantite(Integer id) {
bdd.connect();
Integer newQuantite=null;
try {
PreparedStatement stmt = bdd.getConnection().prepareStatement("SELECT quantite FROM produit WHERE idProduit=?");
stmt.setInt(1, id);
ResultSet res=stmt.executeQuery();
newQuantite =res.getInt("quantite");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bdd.close();
return newQuantite;
}
@Override
public List<Produit> recherche(String mot) {
bdd.connect();
List<Produit> listeProduit = new ArrayList<Produit>();
try {
Statement stm = bdd.getConnection().createStatement();
String rqt="SELECT * FROM produit JOIN stockage ON produit.idStockage=stockage.idStockage WHERE nomProduit LIKE '%"+mot+"%'";
ResultSet res=stm.executeQuery(rqt);
while (res.next()){
String name=res.getString("nomProduit");
Integer idProduit=res.getInt("idProduit");
String categorie=res.getString("categorie");
Integer quantite=res.getInt("quantite");
Double prixU=res.getDouble("prixU");
Integer idFournisseur=res.getInt("idFournisseur");
Integer idCreateur=res.getInt("idUser");
Integer idStockage=res.getInt("idStockage");
String localisation=res.getString("localisation");
String nomStockage=res.getString("nomStockage");
Integer remplissage=res.getInt("remplissage");
Stockage stockage=new Stockage(idStockage,localisation,nomStockage,remplissage);
PreparedStatement stmt = bdd.getConnection().prepareStatement("SELECT * FROM fournisseur WHERE idFournisseur=?");
stmt.setInt(1, idFournisseur);
ResultSet res1=stmt.executeQuery();
String nomF=res1.getString("nomFournisseur");
String adresse=res1.getString("adresse");
Fournisseur fournisseur=new Fournisseur(idFournisseur,nomF,adresse);
PreparedStatement stmt1 = bdd.getConnection().prepareStatement("SELECT * FROM user WHERE idUser=?");
stmt1.setInt(1, idCreateur);
ResultSet res2=stmt1.executeQuery();
//User createur=map(res2);
Produit produit=new Produit(idProduit,name, categorie,prixU, quantite,stockage,fournisseur,null);
listeProduit.add(produit);
}
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bdd.close();
return listeProduit;
}
}
| true |
def3ea6e9260601b255ed4e350001a34acf1ac02 | Java | zbraden/Sonic-Intelligence | /com/z4/sonicraft/common/items/ItemResAlloy.java | UTF-8 | 395 | 1.828125 | 2 | [] | no_license | package com.z4.sonicraft.common.items;
import net.minecraft.item.Item;
import com.z4.sonicraft.Sonicraft;
import com.z4.sonicraft.common.utils.Reference;
public class ItemResAlloy extends Item
{
public ItemResAlloy()
{
super();
setUnlocalizedName("resAlloy");
setTextureName(Reference.MODID + ":" + getUnlocalizedName().substring(5));
setCreativeTab(Sonicraft.tabSonicraft);
}
}
| true |
dae1a332f4bc65d7645fc072d8e8ecb92e88e002 | Java | agrimony/learn-web | /src/main/java/novel/model/CrawelBook.java | UTF-8 | 1,226 | 2.1875 | 2 | [] | no_license | package novel.model;
import java.util.Date;
public class CrawelBook {
private int id;
private String bookName;
private String bookLink;
private Date insertTime;
private byte status;
private String lastArticleLink;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getBookName() {
return bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public String getBookLink() {
return bookLink;
}
public void setBookLink(String bookLink) {
this.bookLink = bookLink;
}
public Date getInsertTime() {
return insertTime;
}
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
public byte getStatus() {
return status;
}
public void setStatus(byte status) {
this.status = status;
}
public String getLastArticleLink() {
return lastArticleLink;
}
public void setLastArticleLink(String lastArticleLink) {
this.lastArticleLink = lastArticleLink;
}
} | true |
6e96a597d3d3ab4fff90d7e5d4f1129544c17941 | Java | lizhjian/Think-in-java | /Chapter11/src/Demo1127.java | ISO-8859-3 | 1,156 | 3.359375 | 3 | [] | no_license | import java.util.LinkedList;
import java.util.Queue;
/**
* <pre>
* desc TODO
* author lizj
* date 2019-08-11 10:55
* </pre>
*/
public class Demo1127 {
public static void main(String[] args) {
Command c1 = new Command("11");
Command c2 = new Command("22");
Command c3 = new Command("33");
QueueTest test = new QueueTest();
Queue<Command> queue = new LinkedList<Command>();
queue.offer(c1);
queue.offer(c2);
queue.offer(c3);
test.setQueue(queue);
while (queue.peek()!=null){
System.out.println(queue.poll().operation());
}
}
}
class Command{
public Command(String length) {
this.length = length;
}
private String length;
public String getLength() {
return length;
}
public void setLength(String length) {
this.length = length;
}
public String operation(){
return length;
}
}
class QueueTest{
private Queue queue;
public Queue getQueue() {
return queue;
}
public void setQueue(Queue queue) {
this.queue = queue;
}
}
| true |
487da48eaf875e1488cb8d46282e8dd7ca8e2701 | Java | PF-pedro/RPGs | /src/view/AbilitiesView.java | UTF-8 | 297 | 1.8125 | 2 | [] | no_license | package view;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.Box;
public class AbilitiesView extends JPanel{
public AbilitiesView() {
// TODO Auto-generated constructor stub
this.setBackground(Color.GREEN);
}
}
| true |
47da142ff84aef3a09f4a8694587889d975d0a97 | Java | googleapis/google-cloud-java | /java-security-private-ca/proto-google-cloud-security-private-ca-v1beta1/src/main/java/com/google/cloud/security/privateca/v1beta1/CertificateAuthority.java | UTF-8 | 685,930 | 1.851563 | 2 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | /*
* Copyright 2023 Google LLC
*
* 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
*
* https://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: google/cloud/security/privateca/v1beta1/resources.proto
package com.google.cloud.security.privateca.v1beta1;
/**
*
*
* <pre>
* A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] represents an individual Certificate Authority.
* A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] can be used to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* Protobuf type {@code google.cloud.security.privateca.v1beta1.CertificateAuthority}
*/
public final class CertificateAuthority extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority)
CertificateAuthorityOrBuilder {
private static final long serialVersionUID = 0L;
// Use CertificateAuthority.newBuilder() to construct.
private CertificateAuthority(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private CertificateAuthority() {
name_ = "";
type_ = 0;
tier_ = 0;
state_ = 0;
pemCaCertificates_ = com.google.protobuf.LazyStringArrayList.emptyList();
caCertificateDescriptions_ = java.util.Collections.emptyList();
gcsBucket_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new CertificateAuthority();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapField internalGetMapField(int number) {
switch (number) {
case 18:
return internalGetLabels();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Builder.class);
}
/**
*
*
* <pre>
* The type of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating its issuing chain.
* </pre>
*
* Protobuf enum {@code google.cloud.security.privateca.v1beta1.CertificateAuthority.Type}
*/
public enum Type implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
* <pre>
* Not specified.
* </pre>
*
* <code>TYPE_UNSPECIFIED = 0;</code>
*/
TYPE_UNSPECIFIED(0),
/**
*
*
* <pre>
* Self-signed CA.
* </pre>
*
* <code>SELF_SIGNED = 1;</code>
*/
SELF_SIGNED(1),
/**
*
*
* <pre>
* Subordinate CA. Could be issued by a Private CA [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* or an unmanaged CA.
* </pre>
*
* <code>SUBORDINATE = 2;</code>
*/
SUBORDINATE(2),
UNRECOGNIZED(-1),
;
/**
*
*
* <pre>
* Not specified.
* </pre>
*
* <code>TYPE_UNSPECIFIED = 0;</code>
*/
public static final int TYPE_UNSPECIFIED_VALUE = 0;
/**
*
*
* <pre>
* Self-signed CA.
* </pre>
*
* <code>SELF_SIGNED = 1;</code>
*/
public static final int SELF_SIGNED_VALUE = 1;
/**
*
*
* <pre>
* Subordinate CA. Could be issued by a Private CA [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* or an unmanaged CA.
* </pre>
*
* <code>SUBORDINATE = 2;</code>
*/
public static final int SUBORDINATE_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Type valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Type forNumber(int value) {
switch (value) {
case 0:
return TYPE_UNSPECIFIED;
case 1:
return SELF_SIGNED;
case 2:
return SUBORDINATE;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<Type> internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<Type> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Type>() {
public Type findValueByNumber(int number) {
return Type.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.getDescriptor()
.getEnumTypes()
.get(0);
}
private static final Type[] VALUES = values();
public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Type(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.Type)
}
/**
*
*
* <pre>
* The tier of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating its supported
* functionality and/or billing SKU.
* </pre>
*
* Protobuf enum {@code google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier}
*/
public enum Tier implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
* <pre>
* Not specified.
* </pre>
*
* <code>TIER_UNSPECIFIED = 0;</code>
*/
TIER_UNSPECIFIED(0),
/**
*
*
* <pre>
* Enterprise tier.
* </pre>
*
* <code>ENTERPRISE = 1;</code>
*/
ENTERPRISE(1),
/**
*
*
* <pre>
* DevOps tier.
* </pre>
*
* <code>DEVOPS = 2;</code>
*/
DEVOPS(2),
UNRECOGNIZED(-1),
;
/**
*
*
* <pre>
* Not specified.
* </pre>
*
* <code>TIER_UNSPECIFIED = 0;</code>
*/
public static final int TIER_UNSPECIFIED_VALUE = 0;
/**
*
*
* <pre>
* Enterprise tier.
* </pre>
*
* <code>ENTERPRISE = 1;</code>
*/
public static final int ENTERPRISE_VALUE = 1;
/**
*
*
* <pre>
* DevOps tier.
* </pre>
*
* <code>DEVOPS = 2;</code>
*/
public static final int DEVOPS_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Tier valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Tier forNumber(int value) {
switch (value) {
case 0:
return TIER_UNSPECIFIED;
case 1:
return ENTERPRISE;
case 2:
return DEVOPS;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<Tier> internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<Tier> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Tier>() {
public Tier findValueByNumber(int number) {
return Tier.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.getDescriptor()
.getEnumTypes()
.get(1);
}
private static final Tier[] VALUES = values();
public static Tier valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Tier(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier)
}
/**
*
*
* <pre>
* The state of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating if it can be used.
* </pre>
*
* Protobuf enum {@code google.cloud.security.privateca.v1beta1.CertificateAuthority.State}
*/
public enum State implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
* <pre>
* Not specified.
* </pre>
*
* <code>STATE_UNSPECIFIED = 0;</code>
*/
STATE_UNSPECIFIED(0),
/**
*
*
* <pre>
* Certificates can be issued from this CA. CRLs will be generated for this
* CA.
* </pre>
*
* <code>ENABLED = 1;</code>
*/
ENABLED(1),
/**
*
*
* <pre>
* Certificates cannot be issued from this CA. CRLs will still be generated.
* </pre>
*
* <code>DISABLED = 2;</code>
*/
DISABLED(2),
/**
*
*
* <pre>
* Certificates cannot be issued from this CA. CRLs will not be generated.
* </pre>
*
* <code>PENDING_ACTIVATION = 3;</code>
*/
PENDING_ACTIVATION(3),
/**
*
*
* <pre>
* Certificates cannot be issued from this CA. CRLs will not be generated.
* </pre>
*
* <code>PENDING_DELETION = 4;</code>
*/
PENDING_DELETION(4),
UNRECOGNIZED(-1),
;
/**
*
*
* <pre>
* Not specified.
* </pre>
*
* <code>STATE_UNSPECIFIED = 0;</code>
*/
public static final int STATE_UNSPECIFIED_VALUE = 0;
/**
*
*
* <pre>
* Certificates can be issued from this CA. CRLs will be generated for this
* CA.
* </pre>
*
* <code>ENABLED = 1;</code>
*/
public static final int ENABLED_VALUE = 1;
/**
*
*
* <pre>
* Certificates cannot be issued from this CA. CRLs will still be generated.
* </pre>
*
* <code>DISABLED = 2;</code>
*/
public static final int DISABLED_VALUE = 2;
/**
*
*
* <pre>
* Certificates cannot be issued from this CA. CRLs will not be generated.
* </pre>
*
* <code>PENDING_ACTIVATION = 3;</code>
*/
public static final int PENDING_ACTIVATION_VALUE = 3;
/**
*
*
* <pre>
* Certificates cannot be issued from this CA. CRLs will not be generated.
* </pre>
*
* <code>PENDING_DELETION = 4;</code>
*/
public static final int PENDING_DELETION_VALUE = 4;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static State valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static State forNumber(int value) {
switch (value) {
case 0:
return STATE_UNSPECIFIED;
case 1:
return ENABLED;
case 2:
return DISABLED;
case 3:
return PENDING_ACTIVATION;
case 4:
return PENDING_DELETION;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<State> internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<State> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<State>() {
public State findValueByNumber(int number) {
return State.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.getDescriptor()
.getEnumTypes()
.get(2);
}
private static final State[] VALUES = values();
public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private State(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.State)
}
/**
*
*
* <pre>
* The algorithm of a Cloud KMS CryptoKeyVersion of a
* [CryptoKey][google.cloud.kms.v1.CryptoKey] with the
* [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value
* `ASYMMETRIC_SIGN`. These values correspond to the
* [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
* values. For RSA signing algorithms, the PSS algorithms should be preferred,
* use PKCS1 algorithms if required for compatibility. For further
* recommandations, see
* https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations.
* </pre>
*
* Protobuf enum {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm}
*/
public enum SignHashAlgorithm implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
* <pre>
* Not specified.
* </pre>
*
* <code>SIGN_HASH_ALGORITHM_UNSPECIFIED = 0;</code>
*/
SIGN_HASH_ALGORITHM_UNSPECIFIED(0),
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256
* </pre>
*
* <code>RSA_PSS_2048_SHA256 = 1;</code>
*/
RSA_PSS_2048_SHA256(1),
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256
* </pre>
*
* <code>RSA_PSS_3072_SHA256 = 2;</code>
*/
RSA_PSS_3072_SHA256(2),
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256
* </pre>
*
* <code>RSA_PSS_4096_SHA256 = 3;</code>
*/
RSA_PSS_4096_SHA256(3),
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256
* </pre>
*
* <code>RSA_PKCS1_2048_SHA256 = 6;</code>
*/
RSA_PKCS1_2048_SHA256(6),
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256
* </pre>
*
* <code>RSA_PKCS1_3072_SHA256 = 7;</code>
*/
RSA_PKCS1_3072_SHA256(7),
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256
* </pre>
*
* <code>RSA_PKCS1_4096_SHA256 = 8;</code>
*/
RSA_PKCS1_4096_SHA256(8),
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256
* </pre>
*
* <code>EC_P256_SHA256 = 4;</code>
*/
EC_P256_SHA256(4),
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384
* </pre>
*
* <code>EC_P384_SHA384 = 5;</code>
*/
EC_P384_SHA384(5),
UNRECOGNIZED(-1),
;
/**
*
*
* <pre>
* Not specified.
* </pre>
*
* <code>SIGN_HASH_ALGORITHM_UNSPECIFIED = 0;</code>
*/
public static final int SIGN_HASH_ALGORITHM_UNSPECIFIED_VALUE = 0;
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256
* </pre>
*
* <code>RSA_PSS_2048_SHA256 = 1;</code>
*/
public static final int RSA_PSS_2048_SHA256_VALUE = 1;
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256
* </pre>
*
* <code>RSA_PSS_3072_SHA256 = 2;</code>
*/
public static final int RSA_PSS_3072_SHA256_VALUE = 2;
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256
* </pre>
*
* <code>RSA_PSS_4096_SHA256 = 3;</code>
*/
public static final int RSA_PSS_4096_SHA256_VALUE = 3;
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256
* </pre>
*
* <code>RSA_PKCS1_2048_SHA256 = 6;</code>
*/
public static final int RSA_PKCS1_2048_SHA256_VALUE = 6;
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256
* </pre>
*
* <code>RSA_PKCS1_3072_SHA256 = 7;</code>
*/
public static final int RSA_PKCS1_3072_SHA256_VALUE = 7;
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256
* </pre>
*
* <code>RSA_PKCS1_4096_SHA256 = 8;</code>
*/
public static final int RSA_PKCS1_4096_SHA256_VALUE = 8;
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256
* </pre>
*
* <code>EC_P256_SHA256 = 4;</code>
*/
public static final int EC_P256_SHA256_VALUE = 4;
/**
*
*
* <pre>
* maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384
* </pre>
*
* <code>EC_P384_SHA384 = 5;</code>
*/
public static final int EC_P384_SHA384_VALUE = 5;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static SignHashAlgorithm valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static SignHashAlgorithm forNumber(int value) {
switch (value) {
case 0:
return SIGN_HASH_ALGORITHM_UNSPECIFIED;
case 1:
return RSA_PSS_2048_SHA256;
case 2:
return RSA_PSS_3072_SHA256;
case 3:
return RSA_PSS_4096_SHA256;
case 6:
return RSA_PKCS1_2048_SHA256;
case 7:
return RSA_PKCS1_3072_SHA256;
case 8:
return RSA_PKCS1_4096_SHA256;
case 4:
return EC_P256_SHA256;
case 5:
return EC_P384_SHA384;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<SignHashAlgorithm>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<SignHashAlgorithm>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<SignHashAlgorithm>() {
public SignHashAlgorithm findValueByNumber(int number) {
return SignHashAlgorithm.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.getDescriptor()
.getEnumTypes()
.get(3);
}
private static final SignHashAlgorithm[] VALUES = values();
public static SignHashAlgorithm valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private SignHashAlgorithm(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm)
}
public interface IssuingOptionsOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Required. When true, includes a URL to the issuing CA certificate in the
* "authority information access" X.509 extension.
* </pre>
*
* <code>bool include_ca_cert_url = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The includeCaCertUrl.
*/
boolean getIncludeCaCertUrl();
/**
*
*
* <pre>
* Required. When true, includes a URL to the CRL corresponding to certificates
* issued from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* CRLs will expire 7 days from their creation. However, we will rebuild
* daily. CRLs are also rebuilt shortly after a certificate is revoked.
* </pre>
*
* <code>bool include_crl_access_url = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The includeCrlAccessUrl.
*/
boolean getIncludeCrlAccessUrl();
}
/**
*
*
* <pre>
* Options that affect all certificates issued by a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions}
*/
public static final class IssuingOptions extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions)
IssuingOptionsOrBuilder {
private static final long serialVersionUID = 0L;
// Use IssuingOptions.newBuilder() to construct.
private IssuingOptions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private IssuingOptions() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new IssuingOptions();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_IssuingOptions_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_IssuingOptions_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.Builder.class);
}
public static final int INCLUDE_CA_CERT_URL_FIELD_NUMBER = 1;
private boolean includeCaCertUrl_ = false;
/**
*
*
* <pre>
* Required. When true, includes a URL to the issuing CA certificate in the
* "authority information access" X.509 extension.
* </pre>
*
* <code>bool include_ca_cert_url = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The includeCaCertUrl.
*/
@java.lang.Override
public boolean getIncludeCaCertUrl() {
return includeCaCertUrl_;
}
public static final int INCLUDE_CRL_ACCESS_URL_FIELD_NUMBER = 2;
private boolean includeCrlAccessUrl_ = false;
/**
*
*
* <pre>
* Required. When true, includes a URL to the CRL corresponding to certificates
* issued from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* CRLs will expire 7 days from their creation. However, we will rebuild
* daily. CRLs are also rebuilt shortly after a certificate is revoked.
* </pre>
*
* <code>bool include_crl_access_url = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The includeCrlAccessUrl.
*/
@java.lang.Override
public boolean getIncludeCrlAccessUrl() {
return includeCrlAccessUrl_;
}
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 (includeCaCertUrl_ != false) {
output.writeBool(1, includeCaCertUrl_);
}
if (includeCrlAccessUrl_ != false) {
output.writeBool(2, includeCrlAccessUrl_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (includeCaCertUrl_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, includeCaCertUrl_);
}
if (includeCrlAccessUrl_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, includeCrlAccessUrl_);
}
size += getUnknownFields().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.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions)) {
return super.equals(obj);
}
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions other =
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions) obj;
if (getIncludeCaCertUrl() != other.getIncludeCaCertUrl()) return false;
if (getIncludeCrlAccessUrl() != other.getIncludeCrlAccessUrl()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + INCLUDE_CA_CERT_URL_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeCaCertUrl());
hash = (37 * hash) + INCLUDE_CRL_ACCESS_URL_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeCrlAccessUrl());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
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.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
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.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
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.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
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.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions 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>
* Options that affect all certificates issued by a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions)
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptionsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_IssuingOptions_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_IssuingOptions_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.Builder.class);
}
// Construct using
// com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
includeCaCertUrl_ = false;
includeCrlAccessUrl_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_IssuingOptions_descriptor;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
getDefaultInstanceForType() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
build() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions result =
buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
buildPartial() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions result =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions(
this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.includeCaCertUrl_ = includeCaCertUrl_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.includeCrlAccessUrl_ = includeCrlAccessUrl_;
}
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions) {
return mergeFrom(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions)
other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions other) {
if (other
== com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.getDefaultInstance()) return this;
if (other.getIncludeCaCertUrl() != false) {
setIncludeCaCertUrl(other.getIncludeCaCertUrl());
}
if (other.getIncludeCrlAccessUrl() != false) {
setIncludeCrlAccessUrl(other.getIncludeCrlAccessUrl());
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8:
{
includeCaCertUrl_ = input.readBool();
bitField0_ |= 0x00000001;
break;
} // case 8
case 16:
{
includeCrlAccessUrl_ = input.readBool();
bitField0_ |= 0x00000002;
break;
} // case 16
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private boolean includeCaCertUrl_;
/**
*
*
* <pre>
* Required. When true, includes a URL to the issuing CA certificate in the
* "authority information access" X.509 extension.
* </pre>
*
* <code>bool include_ca_cert_url = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The includeCaCertUrl.
*/
@java.lang.Override
public boolean getIncludeCaCertUrl() {
return includeCaCertUrl_;
}
/**
*
*
* <pre>
* Required. When true, includes a URL to the issuing CA certificate in the
* "authority information access" X.509 extension.
* </pre>
*
* <code>bool include_ca_cert_url = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The includeCaCertUrl to set.
* @return This builder for chaining.
*/
public Builder setIncludeCaCertUrl(boolean value) {
includeCaCertUrl_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. When true, includes a URL to the issuing CA certificate in the
* "authority information access" X.509 extension.
* </pre>
*
* <code>bool include_ca_cert_url = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return This builder for chaining.
*/
public Builder clearIncludeCaCertUrl() {
bitField0_ = (bitField0_ & ~0x00000001);
includeCaCertUrl_ = false;
onChanged();
return this;
}
private boolean includeCrlAccessUrl_;
/**
*
*
* <pre>
* Required. When true, includes a URL to the CRL corresponding to certificates
* issued from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* CRLs will expire 7 days from their creation. However, we will rebuild
* daily. CRLs are also rebuilt shortly after a certificate is revoked.
* </pre>
*
* <code>bool include_crl_access_url = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The includeCrlAccessUrl.
*/
@java.lang.Override
public boolean getIncludeCrlAccessUrl() {
return includeCrlAccessUrl_;
}
/**
*
*
* <pre>
* Required. When true, includes a URL to the CRL corresponding to certificates
* issued from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* CRLs will expire 7 days from their creation. However, we will rebuild
* daily. CRLs are also rebuilt shortly after a certificate is revoked.
* </pre>
*
* <code>bool include_crl_access_url = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The includeCrlAccessUrl to set.
* @return This builder for chaining.
*/
public Builder setIncludeCrlAccessUrl(boolean value) {
includeCrlAccessUrl_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. When true, includes a URL to the CRL corresponding to certificates
* issued from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* CRLs will expire 7 days from their creation. However, we will rebuild
* daily. CRLs are also rebuilt shortly after a certificate is revoked.
* </pre>
*
* <code>bool include_crl_access_url = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return This builder for chaining.
*/
public Builder clearIncludeCrlAccessUrl() {
bitField0_ = (bitField0_ & ~0x00000002);
includeCrlAccessUrl_ = false;
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:google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions)
}
// @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions)
private static final com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.IssuingOptions
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions();
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<IssuingOptions> PARSER =
new com.google.protobuf.AbstractParser<IssuingOptions>() {
@java.lang.Override
public IssuingOptions parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<IssuingOptions> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<IssuingOptions> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface CertificateAuthorityPolicyOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedConfigList field is set.
*/
boolean hasAllowedConfigList();
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedConfigList.
*/
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.AllowedConfigList
getAllowedConfigList();
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.AllowedConfigListOrBuilder
getAllowedConfigListOrBuilder();
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the overwriteConfigValues field is set.
*/
boolean hasOverwriteConfigValues();
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The overwriteConfigValues.
*/
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper getOverwriteConfigValues();
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder
getOverwriteConfigValuesOrBuilder();
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
java.util.List<com.google.cloud.security.privateca.v1beta1.Subject>
getAllowedLocationsAndOrganizationsList();
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
com.google.cloud.security.privateca.v1beta1.Subject getAllowedLocationsAndOrganizations(
int index);
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
int getAllowedLocationsAndOrganizationsCount();
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
java.util.List<? extends com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder>
getAllowedLocationsAndOrganizationsOrBuilderList();
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder
getAllowedLocationsAndOrganizationsOrBuilder(int index);
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedCommonNames.
*/
java.util.List<java.lang.String> getAllowedCommonNamesList();
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedCommonNames.
*/
int getAllowedCommonNamesCount();
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedCommonNames at the given index.
*/
java.lang.String getAllowedCommonNames(int index);
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedCommonNames at the given index.
*/
com.google.protobuf.ByteString getAllowedCommonNamesBytes(int index);
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedSans field is set.
*/
boolean hasAllowedSans();
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedSans.
*/
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.AllowedSubjectAltNames
getAllowedSans();
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.AllowedSubjectAltNamesOrBuilder
getAllowedSansOrBuilder();
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the maximumLifetime field is set.
*/
boolean hasMaximumLifetime();
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The maximumLifetime.
*/
com.google.protobuf.Duration getMaximumLifetime();
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
com.google.protobuf.DurationOrBuilder getMaximumLifetimeOrBuilder();
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedIssuanceModes field is set.
*/
boolean hasAllowedIssuanceModes();
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedIssuanceModes.
*/
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.IssuanceModes
getAllowedIssuanceModes();
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.IssuanceModesOrBuilder
getAllowedIssuanceModesOrBuilder();
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.ConfigPolicyCase
getConfigPolicyCase();
}
/**
*
*
* <pre>
* The issuing policy for a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] will not be successfully issued from this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] if they violate the policy.
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy}
*/
public static final class CertificateAuthorityPolicy
extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy)
CertificateAuthorityPolicyOrBuilder {
private static final long serialVersionUID = 0L;
// Use CertificateAuthorityPolicy.newBuilder() to construct.
private CertificateAuthorityPolicy(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private CertificateAuthorityPolicy() {
allowedLocationsAndOrganizations_ = java.util.Collections.emptyList();
allowedCommonNames_ = com.google.protobuf.LazyStringArrayList.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new CertificateAuthorityPolicy();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.Builder.class);
}
public interface AllowedConfigListOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
java.util.List<com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper>
getAllowedConfigValuesList();
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper getAllowedConfigValues(
int index);
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
int getAllowedConfigValuesCount();
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
java.util.List<
? extends com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>
getAllowedConfigValuesOrBuilderList();
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder
getAllowedConfigValuesOrBuilder(int index);
}
/**
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList}
*/
public static final class AllowedConfigList extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList)
AllowedConfigListOrBuilder {
private static final long serialVersionUID = 0L;
// Use AllowedConfigList.newBuilder() to construct.
private AllowedConfigList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AllowedConfigList() {
allowedConfigValues_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AllowedConfigList();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedConfigList_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedConfigList_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.Builder.class);
}
public static final int ALLOWED_CONFIG_VALUES_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private java.util.List<com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper>
allowedConfigValues_;
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
@java.lang.Override
public java.util.List<com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper>
getAllowedConfigValuesList() {
return allowedConfigValues_;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
@java.lang.Override
public java.util.List<
? extends com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>
getAllowedConfigValuesOrBuilderList() {
return allowedConfigValues_;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
@java.lang.Override
public int getAllowedConfigValuesCount() {
return allowedConfigValues_.size();
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
getAllowedConfigValues(int index) {
return allowedConfigValues_.get(index);
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder
getAllowedConfigValuesOrBuilder(int index) {
return allowedConfigValues_.get(index);
}
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 {
for (int i = 0; i < allowedConfigValues_.size(); i++) {
output.writeMessage(1, allowedConfigValues_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < allowedConfigValues_.size(); i++) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
1, allowedConfigValues_.get(i));
}
size += getUnknownFields().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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)) {
return super.equals(obj);
}
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.AllowedConfigList
other =
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
obj;
if (!getAllowedConfigValuesList().equals(other.getAllowedConfigValuesList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getAllowedConfigValuesCount() > 0) {
hash = (37 * hash) + ALLOWED_CONFIG_VALUES_FIELD_NUMBER;
hash = (53 * hash) + getAllowedConfigValuesList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
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;
}
/**
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList)
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigListOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedConfigList_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedConfigList_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.Builder.class);
}
// Construct using
// com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (allowedConfigValuesBuilder_ == null) {
allowedConfigValues_ = java.util.Collections.emptyList();
} else {
allowedConfigValues_ = null;
allowedConfigValuesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedConfigList_descriptor;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
getDefaultInstanceForType() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
build() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
buildPartial() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
result =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
result) {
if (allowedConfigValuesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
allowedConfigValues_ = java.util.Collections.unmodifiableList(allowedConfigValues_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.allowedConfigValues_ = allowedConfigValues_;
} else {
result.allowedConfigValues_ = allowedConfigValuesBuilder_.build();
}
}
private void buildPartial0(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
result) {
int from_bitField0_ = bitField0_;
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList) {
return mergeFrom(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
other) {
if (other
== com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance()) return this;
if (allowedConfigValuesBuilder_ == null) {
if (!other.allowedConfigValues_.isEmpty()) {
if (allowedConfigValues_.isEmpty()) {
allowedConfigValues_ = other.allowedConfigValues_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.addAll(other.allowedConfigValues_);
}
onChanged();
}
} else {
if (!other.allowedConfigValues_.isEmpty()) {
if (allowedConfigValuesBuilder_.isEmpty()) {
allowedConfigValuesBuilder_.dispose();
allowedConfigValuesBuilder_ = null;
allowedConfigValues_ = other.allowedConfigValues_;
bitField0_ = (bitField0_ & ~0x00000001);
allowedConfigValuesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getAllowedConfigValuesFieldBuilder()
: null;
} else {
allowedConfigValuesBuilder_.addAllMessages(other.allowedConfigValues_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper m =
input.readMessage(
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
.parser(),
extensionRegistry);
if (allowedConfigValuesBuilder_ == null) {
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.add(m);
} else {
allowedConfigValuesBuilder_.addMessage(m);
}
break;
} // case 10
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.util.List<com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper>
allowedConfigValues_ = java.util.Collections.emptyList();
private void ensureAllowedConfigValuesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
allowedConfigValues_ =
new java.util.ArrayList<
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper>(
allowedConfigValues_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>
allowedConfigValuesBuilder_;
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public java.util.List<com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper>
getAllowedConfigValuesList() {
if (allowedConfigValuesBuilder_ == null) {
return java.util.Collections.unmodifiableList(allowedConfigValues_);
} else {
return allowedConfigValuesBuilder_.getMessageList();
}
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public int getAllowedConfigValuesCount() {
if (allowedConfigValuesBuilder_ == null) {
return allowedConfigValues_.size();
} else {
return allowedConfigValuesBuilder_.getCount();
}
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
getAllowedConfigValues(int index) {
if (allowedConfigValuesBuilder_ == null) {
return allowedConfigValues_.get(index);
} else {
return allowedConfigValuesBuilder_.getMessage(index);
}
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder setAllowedConfigValues(
int index, com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper value) {
if (allowedConfigValuesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.set(index, value);
onChanged();
} else {
allowedConfigValuesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder setAllowedConfigValues(
int index,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder
builderForValue) {
if (allowedConfigValuesBuilder_ == null) {
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.set(index, builderForValue.build());
onChanged();
} else {
allowedConfigValuesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder addAllowedConfigValues(
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper value) {
if (allowedConfigValuesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.add(value);
onChanged();
} else {
allowedConfigValuesBuilder_.addMessage(value);
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder addAllowedConfigValues(
int index, com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper value) {
if (allowedConfigValuesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.add(index, value);
onChanged();
} else {
allowedConfigValuesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder addAllowedConfigValues(
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder
builderForValue) {
if (allowedConfigValuesBuilder_ == null) {
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.add(builderForValue.build());
onChanged();
} else {
allowedConfigValuesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder addAllowedConfigValues(
int index,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder
builderForValue) {
if (allowedConfigValuesBuilder_ == null) {
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.add(index, builderForValue.build());
onChanged();
} else {
allowedConfigValuesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder addAllAllowedConfigValues(
java.lang.Iterable<
? extends com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper>
values) {
if (allowedConfigValuesBuilder_ == null) {
ensureAllowedConfigValuesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedConfigValues_);
onChanged();
} else {
allowedConfigValuesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder clearAllowedConfigValues() {
if (allowedConfigValuesBuilder_ == null) {
allowedConfigValues_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
allowedConfigValuesBuilder_.clear();
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder removeAllowedConfigValues(int index) {
if (allowedConfigValuesBuilder_ == null) {
ensureAllowedConfigValuesIsMutable();
allowedConfigValues_.remove(index);
onChanged();
} else {
allowedConfigValuesBuilder_.remove(index);
}
return this;
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder
getAllowedConfigValuesBuilder(int index) {
return getAllowedConfigValuesFieldBuilder().getBuilder(index);
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder
getAllowedConfigValuesOrBuilder(int index) {
if (allowedConfigValuesBuilder_ == null) {
return allowedConfigValues_.get(index);
} else {
return allowedConfigValuesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public java.util.List<
? extends
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>
getAllowedConfigValuesOrBuilderList() {
if (allowedConfigValuesBuilder_ != null) {
return allowedConfigValuesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(allowedConfigValues_);
}
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder
addAllowedConfigValuesBuilder() {
return getAllowedConfigValuesFieldBuilder()
.addBuilder(
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
.getDefaultInstance());
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder
addAllowedConfigValuesBuilder(int index) {
return getAllowedConfigValuesFieldBuilder()
.addBuilder(
index,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
.getDefaultInstance());
}
/**
*
*
* <pre>
* Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a
* [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be
* allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper allowed_config_values = 1 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public java.util.List<
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder>
getAllowedConfigValuesBuilderList() {
return getAllowedConfigValuesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>
getAllowedConfigValuesFieldBuilder() {
if (allowedConfigValuesBuilder_ == null) {
allowedConfigValuesBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>(
allowedConfigValues_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
allowedConfigValues_ = null;
}
return allowedConfigValuesBuilder_;
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList)
}
// @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList)
private static final com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList();
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AllowedConfigList> PARSER =
new com.google.protobuf.AbstractParser<AllowedConfigList>() {
@java.lang.Override
public AllowedConfigList parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<AllowedConfigList> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AllowedConfigList> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface AllowedSubjectAltNamesOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedDnsNames.
*/
java.util.List<java.lang.String> getAllowedDnsNamesList();
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedDnsNames.
*/
int getAllowedDnsNamesCount();
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedDnsNames at the given index.
*/
java.lang.String getAllowedDnsNames(int index);
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedDnsNames at the given index.
*/
com.google.protobuf.ByteString getAllowedDnsNamesBytes(int index);
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return A list containing the allowedUris.
*/
java.util.List<java.lang.String> getAllowedUrisList();
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The count of allowedUris.
*/
int getAllowedUrisCount();
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the element to return.
* @return The allowedUris at the given index.
*/
java.lang.String getAllowedUris(int index);
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedUris at the given index.
*/
com.google.protobuf.ByteString getAllowedUrisBytes(int index);
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedEmailAddresses.
*/
java.util.List<java.lang.String> getAllowedEmailAddressesList();
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedEmailAddresses.
*/
int getAllowedEmailAddressesCount();
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedEmailAddresses at the given index.
*/
java.lang.String getAllowedEmailAddresses(int index);
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedEmailAddresses at the given index.
*/
com.google.protobuf.ByteString getAllowedEmailAddressesBytes(int index);
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return A list containing the allowedIps.
*/
java.util.List<java.lang.String> getAllowedIpsList();
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The count of allowedIps.
*/
int getAllowedIpsCount();
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the element to return.
* @return The allowedIps at the given index.
*/
java.lang.String getAllowedIps(int index);
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedIps at the given index.
*/
com.google.protobuf.ByteString getAllowedIpsBytes(int index);
/**
*
*
* <pre>
* Optional. Specifies if glob patterns used for [allowed_dns_names][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowed_dns_names] allows
* wildcard certificates.
* </pre>
*
* <code>bool allow_globbing_dns_wildcards = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowGlobbingDnsWildcards.
*/
boolean getAllowGlobbingDnsWildcards();
/**
*
*
* <pre>
* Optional. Specifies if to allow custom X509Extension values.
* </pre>
*
* <code>bool allow_custom_sans = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The allowCustomSans.
*/
boolean getAllowCustomSans();
}
/**
*
*
* <pre>
* [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] specifies the allowed values for
* [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames}
*/
public static final class AllowedSubjectAltNames extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames)
AllowedSubjectAltNamesOrBuilder {
private static final long serialVersionUID = 0L;
// Use AllowedSubjectAltNames.newBuilder() to construct.
private AllowedSubjectAltNames(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AllowedSubjectAltNames() {
allowedDnsNames_ = com.google.protobuf.LazyStringArrayList.emptyList();
allowedUris_ = com.google.protobuf.LazyStringArrayList.emptyList();
allowedEmailAddresses_ = com.google.protobuf.LazyStringArrayList.emptyList();
allowedIps_ = com.google.protobuf.LazyStringArrayList.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AllowedSubjectAltNames();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedSubjectAltNames_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedSubjectAltNames_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.Builder.class);
}
public static final int ALLOWED_DNS_NAMES_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList allowedDnsNames_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedDnsNames.
*/
public com.google.protobuf.ProtocolStringList getAllowedDnsNamesList() {
return allowedDnsNames_;
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedDnsNames.
*/
public int getAllowedDnsNamesCount() {
return allowedDnsNames_.size();
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedDnsNames at the given index.
*/
public java.lang.String getAllowedDnsNames(int index) {
return allowedDnsNames_.get(index);
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedDnsNames at the given index.
*/
public com.google.protobuf.ByteString getAllowedDnsNamesBytes(int index) {
return allowedDnsNames_.getByteString(index);
}
public static final int ALLOWED_URIS_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList allowedUris_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return A list containing the allowedUris.
*/
public com.google.protobuf.ProtocolStringList getAllowedUrisList() {
return allowedUris_;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The count of allowedUris.
*/
public int getAllowedUrisCount() {
return allowedUris_.size();
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the element to return.
* @return The allowedUris at the given index.
*/
public java.lang.String getAllowedUris(int index) {
return allowedUris_.get(index);
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedUris at the given index.
*/
public com.google.protobuf.ByteString getAllowedUrisBytes(int index) {
return allowedUris_.getByteString(index);
}
public static final int ALLOWED_EMAIL_ADDRESSES_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList allowedEmailAddresses_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedEmailAddresses.
*/
public com.google.protobuf.ProtocolStringList getAllowedEmailAddressesList() {
return allowedEmailAddresses_;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedEmailAddresses.
*/
public int getAllowedEmailAddressesCount() {
return allowedEmailAddresses_.size();
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedEmailAddresses at the given index.
*/
public java.lang.String getAllowedEmailAddresses(int index) {
return allowedEmailAddresses_.get(index);
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedEmailAddresses at the given index.
*/
public com.google.protobuf.ByteString getAllowedEmailAddressesBytes(int index) {
return allowedEmailAddresses_.getByteString(index);
}
public static final int ALLOWED_IPS_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList allowedIps_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return A list containing the allowedIps.
*/
public com.google.protobuf.ProtocolStringList getAllowedIpsList() {
return allowedIps_;
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The count of allowedIps.
*/
public int getAllowedIpsCount() {
return allowedIps_.size();
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the element to return.
* @return The allowedIps at the given index.
*/
public java.lang.String getAllowedIps(int index) {
return allowedIps_.get(index);
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedIps at the given index.
*/
public com.google.protobuf.ByteString getAllowedIpsBytes(int index) {
return allowedIps_.getByteString(index);
}
public static final int ALLOW_GLOBBING_DNS_WILDCARDS_FIELD_NUMBER = 5;
private boolean allowGlobbingDnsWildcards_ = false;
/**
*
*
* <pre>
* Optional. Specifies if glob patterns used for [allowed_dns_names][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowed_dns_names] allows
* wildcard certificates.
* </pre>
*
* <code>bool allow_globbing_dns_wildcards = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowGlobbingDnsWildcards.
*/
@java.lang.Override
public boolean getAllowGlobbingDnsWildcards() {
return allowGlobbingDnsWildcards_;
}
public static final int ALLOW_CUSTOM_SANS_FIELD_NUMBER = 6;
private boolean allowCustomSans_ = false;
/**
*
*
* <pre>
* Optional. Specifies if to allow custom X509Extension values.
* </pre>
*
* <code>bool allow_custom_sans = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The allowCustomSans.
*/
@java.lang.Override
public boolean getAllowCustomSans() {
return allowCustomSans_;
}
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 {
for (int i = 0; i < allowedDnsNames_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedDnsNames_.getRaw(i));
}
for (int i = 0; i < allowedUris_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, allowedUris_.getRaw(i));
}
for (int i = 0; i < allowedEmailAddresses_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(
output, 3, allowedEmailAddresses_.getRaw(i));
}
for (int i = 0; i < allowedIps_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, allowedIps_.getRaw(i));
}
if (allowGlobbingDnsWildcards_ != false) {
output.writeBool(5, allowGlobbingDnsWildcards_);
}
if (allowCustomSans_ != false) {
output.writeBool(6, allowCustomSans_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < allowedDnsNames_.size(); i++) {
dataSize += computeStringSizeNoTag(allowedDnsNames_.getRaw(i));
}
size += dataSize;
size += 1 * getAllowedDnsNamesList().size();
}
{
int dataSize = 0;
for (int i = 0; i < allowedUris_.size(); i++) {
dataSize += computeStringSizeNoTag(allowedUris_.getRaw(i));
}
size += dataSize;
size += 1 * getAllowedUrisList().size();
}
{
int dataSize = 0;
for (int i = 0; i < allowedEmailAddresses_.size(); i++) {
dataSize += computeStringSizeNoTag(allowedEmailAddresses_.getRaw(i));
}
size += dataSize;
size += 1 * getAllowedEmailAddressesList().size();
}
{
int dataSize = 0;
for (int i = 0; i < allowedIps_.size(); i++) {
dataSize += computeStringSizeNoTag(allowedIps_.getRaw(i));
}
size += dataSize;
size += 1 * getAllowedIpsList().size();
}
if (allowGlobbingDnsWildcards_ != false) {
size +=
com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowGlobbingDnsWildcards_);
}
if (allowCustomSans_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, allowCustomSans_);
}
size += getUnknownFields().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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames)) {
return super.equals(obj);
}
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.AllowedSubjectAltNames
other =
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames)
obj;
if (!getAllowedDnsNamesList().equals(other.getAllowedDnsNamesList())) return false;
if (!getAllowedUrisList().equals(other.getAllowedUrisList())) return false;
if (!getAllowedEmailAddressesList().equals(other.getAllowedEmailAddressesList()))
return false;
if (!getAllowedIpsList().equals(other.getAllowedIpsList())) return false;
if (getAllowGlobbingDnsWildcards() != other.getAllowGlobbingDnsWildcards()) return false;
if (getAllowCustomSans() != other.getAllowCustomSans()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getAllowedDnsNamesCount() > 0) {
hash = (37 * hash) + ALLOWED_DNS_NAMES_FIELD_NUMBER;
hash = (53 * hash) + getAllowedDnsNamesList().hashCode();
}
if (getAllowedUrisCount() > 0) {
hash = (37 * hash) + ALLOWED_URIS_FIELD_NUMBER;
hash = (53 * hash) + getAllowedUrisList().hashCode();
}
if (getAllowedEmailAddressesCount() > 0) {
hash = (37 * hash) + ALLOWED_EMAIL_ADDRESSES_FIELD_NUMBER;
hash = (53 * hash) + getAllowedEmailAddressesList().hashCode();
}
if (getAllowedIpsCount() > 0) {
hash = (37 * hash) + ALLOWED_IPS_FIELD_NUMBER;
hash = (53 * hash) + getAllowedIpsList().hashCode();
}
hash = (37 * hash) + ALLOW_GLOBBING_DNS_WILDCARDS_FIELD_NUMBER;
hash =
(53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowGlobbingDnsWildcards());
hash = (37 * hash) + ALLOW_CUSTOM_SANS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowCustomSans());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
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>
* [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] specifies the allowed values for
* [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames)
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNamesOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedSubjectAltNames_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedSubjectAltNames_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.Builder.class);
}
// Construct using
// com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
allowedDnsNames_ = com.google.protobuf.LazyStringArrayList.emptyList();
allowedUris_ = com.google.protobuf.LazyStringArrayList.emptyList();
allowedEmailAddresses_ = com.google.protobuf.LazyStringArrayList.emptyList();
allowedIps_ = com.google.protobuf.LazyStringArrayList.emptyList();
allowGlobbingDnsWildcards_ = false;
allowCustomSans_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_AllowedSubjectAltNames_descriptor;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
getDefaultInstanceForType() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
build() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
buildPartial() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
result =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
allowedDnsNames_.makeImmutable();
result.allowedDnsNames_ = allowedDnsNames_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
allowedUris_.makeImmutable();
result.allowedUris_ = allowedUris_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
allowedEmailAddresses_.makeImmutable();
result.allowedEmailAddresses_ = allowedEmailAddresses_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
allowedIps_.makeImmutable();
result.allowedIps_ = allowedIps_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.allowGlobbingDnsWildcards_ = allowGlobbingDnsWildcards_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.allowCustomSans_ = allowCustomSans_;
}
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames) {
return mergeFrom(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames)
other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
other) {
if (other
== com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.getDefaultInstance())
return this;
if (!other.allowedDnsNames_.isEmpty()) {
if (allowedDnsNames_.isEmpty()) {
allowedDnsNames_ = other.allowedDnsNames_;
bitField0_ |= 0x00000001;
} else {
ensureAllowedDnsNamesIsMutable();
allowedDnsNames_.addAll(other.allowedDnsNames_);
}
onChanged();
}
if (!other.allowedUris_.isEmpty()) {
if (allowedUris_.isEmpty()) {
allowedUris_ = other.allowedUris_;
bitField0_ |= 0x00000002;
} else {
ensureAllowedUrisIsMutable();
allowedUris_.addAll(other.allowedUris_);
}
onChanged();
}
if (!other.allowedEmailAddresses_.isEmpty()) {
if (allowedEmailAddresses_.isEmpty()) {
allowedEmailAddresses_ = other.allowedEmailAddresses_;
bitField0_ |= 0x00000004;
} else {
ensureAllowedEmailAddressesIsMutable();
allowedEmailAddresses_.addAll(other.allowedEmailAddresses_);
}
onChanged();
}
if (!other.allowedIps_.isEmpty()) {
if (allowedIps_.isEmpty()) {
allowedIps_ = other.allowedIps_;
bitField0_ |= 0x00000008;
} else {
ensureAllowedIpsIsMutable();
allowedIps_.addAll(other.allowedIps_);
}
onChanged();
}
if (other.getAllowGlobbingDnsWildcards() != false) {
setAllowGlobbingDnsWildcards(other.getAllowGlobbingDnsWildcards());
}
if (other.getAllowCustomSans() != false) {
setAllowCustomSans(other.getAllowCustomSans());
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
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();
ensureAllowedDnsNamesIsMutable();
allowedDnsNames_.add(s);
break;
} // case 10
case 18:
{
java.lang.String s = input.readStringRequireUtf8();
ensureAllowedUrisIsMutable();
allowedUris_.add(s);
break;
} // case 18
case 26:
{
java.lang.String s = input.readStringRequireUtf8();
ensureAllowedEmailAddressesIsMutable();
allowedEmailAddresses_.add(s);
break;
} // case 26
case 34:
{
java.lang.String s = input.readStringRequireUtf8();
ensureAllowedIpsIsMutable();
allowedIps_.add(s);
break;
} // case 34
case 40:
{
allowGlobbingDnsWildcards_ = input.readBool();
bitField0_ |= 0x00000010;
break;
} // case 40
case 48:
{
allowCustomSans_ = input.readBool();
bitField0_ |= 0x00000020;
break;
} // case 48
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.google.protobuf.LazyStringArrayList allowedDnsNames_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureAllowedDnsNamesIsMutable() {
if (!allowedDnsNames_.isModifiable()) {
allowedDnsNames_ = new com.google.protobuf.LazyStringArrayList(allowedDnsNames_);
}
bitField0_ |= 0x00000001;
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedDnsNames.
*/
public com.google.protobuf.ProtocolStringList getAllowedDnsNamesList() {
allowedDnsNames_.makeImmutable();
return allowedDnsNames_;
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedDnsNames.
*/
public int getAllowedDnsNamesCount() {
return allowedDnsNames_.size();
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedDnsNames at the given index.
*/
public java.lang.String getAllowedDnsNames(int index) {
return allowedDnsNames_.get(index);
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedDnsNames at the given index.
*/
public com.google.protobuf.ByteString getAllowedDnsNamesBytes(int index) {
return allowedDnsNames_.getByteString(index);
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index to set the value at.
* @param value The allowedDnsNames to set.
* @return This builder for chaining.
*/
public Builder setAllowedDnsNames(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedDnsNamesIsMutable();
allowedDnsNames_.set(index, value);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param value The allowedDnsNames to add.
* @return This builder for chaining.
*/
public Builder addAllowedDnsNames(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedDnsNamesIsMutable();
allowedDnsNames_.add(value);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param values The allowedDnsNames to add.
* @return This builder for chaining.
*/
public Builder addAllAllowedDnsNames(java.lang.Iterable<java.lang.String> values) {
ensureAllowedDnsNamesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedDnsNames_);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearAllowedDnsNames() {
allowedDnsNames_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid, fully-qualified host names. Glob patterns are also
* supported. To allow an explicit wildcard certificate, escape with
* backlash (i.e. `\*`).
* E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not
* `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set.
* E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not
* `foo.bar.com`.
* </pre>
*
* <code>repeated string allowed_dns_names = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param value The bytes of the allowedDnsNames to add.
* @return This builder for chaining.
*/
public Builder addAllowedDnsNamesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureAllowedDnsNamesIsMutable();
allowedDnsNames_.add(value);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList allowedUris_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureAllowedUrisIsMutable() {
if (!allowedUris_.isModifiable()) {
allowedUris_ = new com.google.protobuf.LazyStringArrayList(allowedUris_);
}
bitField0_ |= 0x00000002;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return A list containing the allowedUris.
*/
public com.google.protobuf.ProtocolStringList getAllowedUrisList() {
allowedUris_.makeImmutable();
return allowedUris_;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The count of allowedUris.
*/
public int getAllowedUrisCount() {
return allowedUris_.size();
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the element to return.
* @return The allowedUris at the given index.
*/
public java.lang.String getAllowedUris(int index) {
return allowedUris_.get(index);
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedUris at the given index.
*/
public com.google.protobuf.ByteString getAllowedUrisBytes(int index) {
return allowedUris_.getByteString(index);
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index to set the value at.
* @param value The allowedUris to set.
* @return This builder for chaining.
*/
public Builder setAllowedUris(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedUrisIsMutable();
allowedUris_.set(index, value);
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The allowedUris to add.
* @return This builder for chaining.
*/
public Builder addAllowedUris(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedUrisIsMutable();
allowedUris_.add(value);
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param values The allowedUris to add.
* @return This builder for chaining.
*/
public Builder addAllAllowedUris(java.lang.Iterable<java.lang.String> values) {
ensureAllowedUrisIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedUris_);
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearAllowedUris() {
allowedUris_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To
* match across path seperators (i.e. '/') use the double star glob
* pattern (i.e. '**').
* </pre>
*
* <code>repeated string allowed_uris = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The bytes of the allowedUris to add.
* @return This builder for chaining.
*/
public Builder addAllowedUrisBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureAllowedUrisIsMutable();
allowedUris_.add(value);
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList allowedEmailAddresses_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureAllowedEmailAddressesIsMutable() {
if (!allowedEmailAddresses_.isModifiable()) {
allowedEmailAddresses_ =
new com.google.protobuf.LazyStringArrayList(allowedEmailAddresses_);
}
bitField0_ |= 0x00000004;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedEmailAddresses.
*/
public com.google.protobuf.ProtocolStringList getAllowedEmailAddressesList() {
allowedEmailAddresses_.makeImmutable();
return allowedEmailAddresses_;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedEmailAddresses.
*/
public int getAllowedEmailAddressesCount() {
return allowedEmailAddresses_.size();
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedEmailAddresses at the given index.
*/
public java.lang.String getAllowedEmailAddresses(int index) {
return allowedEmailAddresses_.get(index);
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedEmailAddresses at the given index.
*/
public com.google.protobuf.ByteString getAllowedEmailAddressesBytes(int index) {
return allowedEmailAddresses_.getByteString(index);
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index to set the value at.
* @param value The allowedEmailAddresses to set.
* @return This builder for chaining.
*/
public Builder setAllowedEmailAddresses(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedEmailAddressesIsMutable();
allowedEmailAddresses_.set(index, value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param value The allowedEmailAddresses to add.
* @return This builder for chaining.
*/
public Builder addAllowedEmailAddresses(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedEmailAddressesIsMutable();
allowedEmailAddresses_.add(value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param values The allowedEmailAddresses to add.
* @return This builder for chaining.
*/
public Builder addAllAllowedEmailAddresses(java.lang.Iterable<java.lang.String> values) {
ensureAllowedEmailAddressesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedEmailAddresses_);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearAllowedEmailAddresses() {
allowedEmailAddresses_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also
* supported.
* </pre>
*
* <code>
* repeated string allowed_email_addresses = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param value The bytes of the allowedEmailAddresses to add.
* @return This builder for chaining.
*/
public Builder addAllowedEmailAddressesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureAllowedEmailAddressesIsMutable();
allowedEmailAddresses_.add(value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList allowedIps_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureAllowedIpsIsMutable() {
if (!allowedIps_.isModifiable()) {
allowedIps_ = new com.google.protobuf.LazyStringArrayList(allowedIps_);
}
bitField0_ |= 0x00000008;
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return A list containing the allowedIps.
*/
public com.google.protobuf.ProtocolStringList getAllowedIpsList() {
allowedIps_.makeImmutable();
return allowedIps_;
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The count of allowedIps.
*/
public int getAllowedIpsCount() {
return allowedIps_.size();
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the element to return.
* @return The allowedIps at the given index.
*/
public java.lang.String getAllowedIps(int index) {
return allowedIps_.get(index);
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedIps at the given index.
*/
public com.google.protobuf.ByteString getAllowedIpsBytes(int index) {
return allowedIps_.getByteString(index);
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param index The index to set the value at.
* @param value The allowedIps to set.
* @return This builder for chaining.
*/
public Builder setAllowedIps(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedIpsIsMutable();
allowedIps_.set(index, value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The allowedIps to add.
* @return This builder for chaining.
*/
public Builder addAllowedIps(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedIpsIsMutable();
allowedIps_.add(value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param values The allowedIps to add.
* @return This builder for chaining.
*/
public Builder addAllAllowedIps(java.lang.Iterable<java.lang.String> values) {
ensureAllowedIpsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedIps_);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearAllowedIps() {
allowedIps_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6
* addresses and subnet ranges. Subnet ranges are specified using the
* '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns
* are supported only for ip address entries (i.e. not for subnet ranges).
* </pre>
*
* <code>repeated string allowed_ips = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The bytes of the allowedIps to add.
* @return This builder for chaining.
*/
public Builder addAllowedIpsBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureAllowedIpsIsMutable();
allowedIps_.add(value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
private boolean allowGlobbingDnsWildcards_;
/**
*
*
* <pre>
* Optional. Specifies if glob patterns used for [allowed_dns_names][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowed_dns_names] allows
* wildcard certificates.
* </pre>
*
* <code>bool allow_globbing_dns_wildcards = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowGlobbingDnsWildcards.
*/
@java.lang.Override
public boolean getAllowGlobbingDnsWildcards() {
return allowGlobbingDnsWildcards_;
}
/**
*
*
* <pre>
* Optional. Specifies if glob patterns used for [allowed_dns_names][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowed_dns_names] allows
* wildcard certificates.
* </pre>
*
* <code>bool allow_globbing_dns_wildcards = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param value The allowGlobbingDnsWildcards to set.
* @return This builder for chaining.
*/
public Builder setAllowGlobbingDnsWildcards(boolean value) {
allowGlobbingDnsWildcards_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Specifies if glob patterns used for [allowed_dns_names][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowed_dns_names] allows
* wildcard certificates.
* </pre>
*
* <code>bool allow_globbing_dns_wildcards = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearAllowGlobbingDnsWildcards() {
bitField0_ = (bitField0_ & ~0x00000010);
allowGlobbingDnsWildcards_ = false;
onChanged();
return this;
}
private boolean allowCustomSans_;
/**
*
*
* <pre>
* Optional. Specifies if to allow custom X509Extension values.
* </pre>
*
* <code>bool allow_custom_sans = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The allowCustomSans.
*/
@java.lang.Override
public boolean getAllowCustomSans() {
return allowCustomSans_;
}
/**
*
*
* <pre>
* Optional. Specifies if to allow custom X509Extension values.
* </pre>
*
* <code>bool allow_custom_sans = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The allowCustomSans to set.
* @return This builder for chaining.
*/
public Builder setAllowCustomSans(boolean value) {
allowCustomSans_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Specifies if to allow custom X509Extension values.
* </pre>
*
* <code>bool allow_custom_sans = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearAllowCustomSans() {
bitField0_ = (bitField0_ & ~0x00000020);
allowCustomSans_ = false;
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:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames)
}
// @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames)
private static final com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames();
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AllowedSubjectAltNames> PARSER =
new com.google.protobuf.AbstractParser<AllowedSubjectAltNames>() {
@java.lang.Override
public AllowedSubjectAltNames parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<AllowedSubjectAltNames> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AllowedSubjectAltNames> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface IssuanceModesOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a CSR.
* </pre>
*
* <code>bool allow_csr_based_issuance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The allowCsrBasedIssuance.
*/
boolean getAllowCsrBasedIssuance();
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig].
* </pre>
*
* <code>bool allow_config_based_issuance = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The allowConfigBasedIssuance.
*/
boolean getAllowConfigBasedIssuance();
}
/**
*
*
* <pre>
* [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] specifies the allowed ways in which
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] may be requested from this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes}
*/
public static final class IssuanceModes extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes)
IssuanceModesOrBuilder {
private static final long serialVersionUID = 0L;
// Use IssuanceModes.newBuilder() to construct.
private IssuanceModes(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private IssuanceModes() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new IssuanceModes();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_IssuanceModes_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_IssuanceModes_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.Builder.class);
}
public static final int ALLOW_CSR_BASED_ISSUANCE_FIELD_NUMBER = 1;
private boolean allowCsrBasedIssuance_ = false;
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a CSR.
* </pre>
*
* <code>bool allow_csr_based_issuance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The allowCsrBasedIssuance.
*/
@java.lang.Override
public boolean getAllowCsrBasedIssuance() {
return allowCsrBasedIssuance_;
}
public static final int ALLOW_CONFIG_BASED_ISSUANCE_FIELD_NUMBER = 2;
private boolean allowConfigBasedIssuance_ = false;
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig].
* </pre>
*
* <code>bool allow_config_based_issuance = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The allowConfigBasedIssuance.
*/
@java.lang.Override
public boolean getAllowConfigBasedIssuance() {
return allowConfigBasedIssuance_;
}
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 (allowCsrBasedIssuance_ != false) {
output.writeBool(1, allowCsrBasedIssuance_);
}
if (allowConfigBasedIssuance_ != false) {
output.writeBool(2, allowConfigBasedIssuance_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (allowCsrBasedIssuance_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, allowCsrBasedIssuance_);
}
if (allowConfigBasedIssuance_ != false) {
size +=
com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowConfigBasedIssuance_);
}
size += getUnknownFields().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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes)) {
return super.equals(obj);
}
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.IssuanceModes
other =
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes)
obj;
if (getAllowCsrBasedIssuance() != other.getAllowCsrBasedIssuance()) return false;
if (getAllowConfigBasedIssuance() != other.getAllowConfigBasedIssuance()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ALLOW_CSR_BASED_ISSUANCE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowCsrBasedIssuance());
hash = (37 * hash) + ALLOW_CONFIG_BASED_ISSUANCE_FIELD_NUMBER;
hash =
(53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowConfigBasedIssuance());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
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>
* [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] specifies the allowed ways in which
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] may be requested from this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes)
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModesOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_IssuanceModes_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_IssuanceModes_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.Builder.class);
}
// Construct using
// com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
allowCsrBasedIssuance_ = false;
allowConfigBasedIssuance_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_IssuanceModes_descriptor;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
getDefaultInstanceForType() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
build() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
buildPartial() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
result =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.allowCsrBasedIssuance_ = allowCsrBasedIssuance_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.allowConfigBasedIssuance_ = allowConfigBasedIssuance_;
}
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes) {
return mergeFrom(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes)
other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
other) {
if (other
== com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.getDefaultInstance()) return this;
if (other.getAllowCsrBasedIssuance() != false) {
setAllowCsrBasedIssuance(other.getAllowCsrBasedIssuance());
}
if (other.getAllowConfigBasedIssuance() != false) {
setAllowConfigBasedIssuance(other.getAllowConfigBasedIssuance());
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8:
{
allowCsrBasedIssuance_ = input.readBool();
bitField0_ |= 0x00000001;
break;
} // case 8
case 16:
{
allowConfigBasedIssuance_ = input.readBool();
bitField0_ |= 0x00000002;
break;
} // case 16
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private boolean allowCsrBasedIssuance_;
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a CSR.
* </pre>
*
* <code>bool allow_csr_based_issuance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The allowCsrBasedIssuance.
*/
@java.lang.Override
public boolean getAllowCsrBasedIssuance() {
return allowCsrBasedIssuance_;
}
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a CSR.
* </pre>
*
* <code>bool allow_csr_based_issuance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The allowCsrBasedIssuance to set.
* @return This builder for chaining.
*/
public Builder setAllowCsrBasedIssuance(boolean value) {
allowCsrBasedIssuance_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a CSR.
* </pre>
*
* <code>bool allow_csr_based_issuance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return This builder for chaining.
*/
public Builder clearAllowCsrBasedIssuance() {
bitField0_ = (bitField0_ & ~0x00000001);
allowCsrBasedIssuance_ = false;
onChanged();
return this;
}
private boolean allowConfigBasedIssuance_;
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig].
* </pre>
*
* <code>bool allow_config_based_issuance = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The allowConfigBasedIssuance.
*/
@java.lang.Override
public boolean getAllowConfigBasedIssuance() {
return allowConfigBasedIssuance_;
}
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig].
* </pre>
*
* <code>bool allow_config_based_issuance = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @param value The allowConfigBasedIssuance to set.
* @return This builder for chaining.
*/
public Builder setAllowConfigBasedIssuance(boolean value) {
allowConfigBasedIssuance_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by
* specifying a [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig].
* </pre>
*
* <code>bool allow_config_based_issuance = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearAllowConfigBasedIssuance() {
bitField0_ = (bitField0_ & ~0x00000002);
allowConfigBasedIssuance_ = false;
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:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes)
}
// @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes)
private static final com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes();
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<IssuanceModes> PARSER =
new com.google.protobuf.AbstractParser<IssuanceModes>() {
@java.lang.Override
public IssuanceModes parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<IssuanceModes> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<IssuanceModes> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int configPolicyCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object configPolicy_;
public enum ConfigPolicyCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
ALLOWED_CONFIG_LIST(1),
OVERWRITE_CONFIG_VALUES(2),
CONFIGPOLICY_NOT_SET(0);
private final int value;
private ConfigPolicyCase(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 ConfigPolicyCase valueOf(int value) {
return forNumber(value);
}
public static ConfigPolicyCase forNumber(int value) {
switch (value) {
case 1:
return ALLOWED_CONFIG_LIST;
case 2:
return OVERWRITE_CONFIG_VALUES;
case 0:
return CONFIGPOLICY_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public ConfigPolicyCase getConfigPolicyCase() {
return ConfigPolicyCase.forNumber(configPolicyCase_);
}
public static final int ALLOWED_CONFIG_LIST_FIELD_NUMBER = 1;
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedConfigList field is set.
*/
@java.lang.Override
public boolean hasAllowedConfigList() {
return configPolicyCase_ == 1;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedConfigList.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
getAllowedConfigList() {
if (configPolicyCase_ == 1) {
return (com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
configPolicy_;
}
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance();
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigListOrBuilder
getAllowedConfigListOrBuilder() {
if (configPolicyCase_ == 1) {
return (com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
configPolicy_;
}
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance();
}
public static final int OVERWRITE_CONFIG_VALUES_FIELD_NUMBER = 2;
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the overwriteConfigValues field is set.
*/
@java.lang.Override
public boolean hasOverwriteConfigValues() {
return configPolicyCase_ == 2;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The overwriteConfigValues.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
getOverwriteConfigValues() {
if (configPolicyCase_ == 2) {
return (com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper) configPolicy_;
}
return com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.getDefaultInstance();
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder
getOverwriteConfigValuesOrBuilder() {
if (configPolicyCase_ == 2) {
return (com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper) configPolicy_;
}
return com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.getDefaultInstance();
}
public static final int ALLOWED_LOCATIONS_AND_ORGANIZATIONS_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List<com.google.cloud.security.privateca.v1beta1.Subject>
allowedLocationsAndOrganizations_;
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public java.util.List<com.google.cloud.security.privateca.v1beta1.Subject>
getAllowedLocationsAndOrganizationsList() {
return allowedLocationsAndOrganizations_;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public java.util.List<? extends com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder>
getAllowedLocationsAndOrganizationsOrBuilderList() {
return allowedLocationsAndOrganizations_;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public int getAllowedLocationsAndOrganizationsCount() {
return allowedLocationsAndOrganizations_.size();
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.Subject getAllowedLocationsAndOrganizations(
int index) {
return allowedLocationsAndOrganizations_.get(index);
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder
getAllowedLocationsAndOrganizationsOrBuilder(int index) {
return allowedLocationsAndOrganizations_.get(index);
}
public static final int ALLOWED_COMMON_NAMES_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList allowedCommonNames_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedCommonNames.
*/
public com.google.protobuf.ProtocolStringList getAllowedCommonNamesList() {
return allowedCommonNames_;
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedCommonNames.
*/
public int getAllowedCommonNamesCount() {
return allowedCommonNames_.size();
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedCommonNames at the given index.
*/
public java.lang.String getAllowedCommonNames(int index) {
return allowedCommonNames_.get(index);
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedCommonNames at the given index.
*/
public com.google.protobuf.ByteString getAllowedCommonNamesBytes(int index) {
return allowedCommonNames_.getByteString(index);
}
public static final int ALLOWED_SANS_FIELD_NUMBER = 5;
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
allowedSans_;
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedSans field is set.
*/
@java.lang.Override
public boolean hasAllowedSans() {
return allowedSans_ != null;
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedSans.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
getAllowedSans() {
return allowedSans_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.getDefaultInstance()
: allowedSans_;
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNamesOrBuilder
getAllowedSansOrBuilder() {
return allowedSans_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.getDefaultInstance()
: allowedSans_;
}
public static final int MAXIMUM_LIFETIME_FIELD_NUMBER = 6;
private com.google.protobuf.Duration maximumLifetime_;
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the maximumLifetime field is set.
*/
@java.lang.Override
public boolean hasMaximumLifetime() {
return maximumLifetime_ != null;
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The maximumLifetime.
*/
@java.lang.Override
public com.google.protobuf.Duration getMaximumLifetime() {
return maximumLifetime_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: maximumLifetime_;
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.protobuf.DurationOrBuilder getMaximumLifetimeOrBuilder() {
return maximumLifetime_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: maximumLifetime_;
}
public static final int ALLOWED_ISSUANCE_MODES_FIELD_NUMBER = 8;
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
allowedIssuanceModes_;
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedIssuanceModes field is set.
*/
@java.lang.Override
public boolean hasAllowedIssuanceModes() {
return allowedIssuanceModes_ != null;
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedIssuanceModes.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
getAllowedIssuanceModes() {
return allowedIssuanceModes_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.getDefaultInstance()
: allowedIssuanceModes_;
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModesOrBuilder
getAllowedIssuanceModesOrBuilder() {
return allowedIssuanceModes_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.getDefaultInstance()
: allowedIssuanceModes_;
}
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 (configPolicyCase_ == 1) {
output.writeMessage(
1,
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
configPolicy_);
}
if (configPolicyCase_ == 2) {
output.writeMessage(
2, (com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper) configPolicy_);
}
for (int i = 0; i < allowedLocationsAndOrganizations_.size(); i++) {
output.writeMessage(3, allowedLocationsAndOrganizations_.get(i));
}
for (int i = 0; i < allowedCommonNames_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(
output, 4, allowedCommonNames_.getRaw(i));
}
if (allowedSans_ != null) {
output.writeMessage(5, getAllowedSans());
}
if (maximumLifetime_ != null) {
output.writeMessage(6, getMaximumLifetime());
}
if (allowedIssuanceModes_ != null) {
output.writeMessage(8, getAllowedIssuanceModes());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (configPolicyCase_ == 1) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
1,
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
configPolicy_);
}
if (configPolicyCase_ == 2) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
2,
(com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper) configPolicy_);
}
for (int i = 0; i < allowedLocationsAndOrganizations_.size(); i++) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
3, allowedLocationsAndOrganizations_.get(i));
}
{
int dataSize = 0;
for (int i = 0; i < allowedCommonNames_.size(); i++) {
dataSize += computeStringSizeNoTag(allowedCommonNames_.getRaw(i));
}
size += dataSize;
size += 1 * getAllowedCommonNamesList().size();
}
if (allowedSans_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAllowedSans());
}
if (maximumLifetime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getMaximumLifetime());
}
if (allowedIssuanceModes_ != null) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(8, getAllowedIssuanceModes());
}
size += getUnknownFields().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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy)) {
return super.equals(obj);
}
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
other =
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy)
obj;
if (!getAllowedLocationsAndOrganizationsList()
.equals(other.getAllowedLocationsAndOrganizationsList())) return false;
if (!getAllowedCommonNamesList().equals(other.getAllowedCommonNamesList())) return false;
if (hasAllowedSans() != other.hasAllowedSans()) return false;
if (hasAllowedSans()) {
if (!getAllowedSans().equals(other.getAllowedSans())) return false;
}
if (hasMaximumLifetime() != other.hasMaximumLifetime()) return false;
if (hasMaximumLifetime()) {
if (!getMaximumLifetime().equals(other.getMaximumLifetime())) return false;
}
if (hasAllowedIssuanceModes() != other.hasAllowedIssuanceModes()) return false;
if (hasAllowedIssuanceModes()) {
if (!getAllowedIssuanceModes().equals(other.getAllowedIssuanceModes())) return false;
}
if (!getConfigPolicyCase().equals(other.getConfigPolicyCase())) return false;
switch (configPolicyCase_) {
case 1:
if (!getAllowedConfigList().equals(other.getAllowedConfigList())) return false;
break;
case 2:
if (!getOverwriteConfigValues().equals(other.getOverwriteConfigValues())) return false;
break;
case 0:
default:
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getAllowedLocationsAndOrganizationsCount() > 0) {
hash = (37 * hash) + ALLOWED_LOCATIONS_AND_ORGANIZATIONS_FIELD_NUMBER;
hash = (53 * hash) + getAllowedLocationsAndOrganizationsList().hashCode();
}
if (getAllowedCommonNamesCount() > 0) {
hash = (37 * hash) + ALLOWED_COMMON_NAMES_FIELD_NUMBER;
hash = (53 * hash) + getAllowedCommonNamesList().hashCode();
}
if (hasAllowedSans()) {
hash = (37 * hash) + ALLOWED_SANS_FIELD_NUMBER;
hash = (53 * hash) + getAllowedSans().hashCode();
}
if (hasMaximumLifetime()) {
hash = (37 * hash) + MAXIMUM_LIFETIME_FIELD_NUMBER;
hash = (53 * hash) + getMaximumLifetime().hashCode();
}
if (hasAllowedIssuanceModes()) {
hash = (37 * hash) + ALLOWED_ISSUANCE_MODES_FIELD_NUMBER;
hash = (53 * hash) + getAllowedIssuanceModes().hashCode();
}
switch (configPolicyCase_) {
case 1:
hash = (37 * hash) + ALLOWED_CONFIG_LIST_FIELD_NUMBER;
hash = (53 * hash) + getAllowedConfigList().hashCode();
break;
case 2:
hash = (37 * hash) + OVERWRITE_CONFIG_VALUES_FIELD_NUMBER;
hash = (53 * hash) + getOverwriteConfigValues().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
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.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
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>
* The issuing policy for a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] will not be successfully issued from this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] if they violate the policy.
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy)
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.Builder.class);
}
// Construct using
// com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (allowedConfigListBuilder_ != null) {
allowedConfigListBuilder_.clear();
}
if (overwriteConfigValuesBuilder_ != null) {
overwriteConfigValuesBuilder_.clear();
}
if (allowedLocationsAndOrganizationsBuilder_ == null) {
allowedLocationsAndOrganizations_ = java.util.Collections.emptyList();
} else {
allowedLocationsAndOrganizations_ = null;
allowedLocationsAndOrganizationsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
allowedCommonNames_ = com.google.protobuf.LazyStringArrayList.emptyList();
allowedSans_ = null;
if (allowedSansBuilder_ != null) {
allowedSansBuilder_.dispose();
allowedSansBuilder_ = null;
}
maximumLifetime_ = null;
if (maximumLifetimeBuilder_ != null) {
maximumLifetimeBuilder_.dispose();
maximumLifetimeBuilder_ = null;
}
allowedIssuanceModes_ = null;
if (allowedIssuanceModesBuilder_ != null) {
allowedIssuanceModesBuilder_.dispose();
allowedIssuanceModesBuilder_ = null;
}
configPolicyCase_ = 0;
configPolicy_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_CertificateAuthorityPolicy_descriptor;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
getDefaultInstanceForType() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
build() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
buildPartial() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
result =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
result) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
allowedLocationsAndOrganizations_ =
java.util.Collections.unmodifiableList(allowedLocationsAndOrganizations_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.allowedLocationsAndOrganizations_ = allowedLocationsAndOrganizations_;
} else {
result.allowedLocationsAndOrganizations_ =
allowedLocationsAndOrganizationsBuilder_.build();
}
}
private void buildPartial0(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000008) != 0)) {
allowedCommonNames_.makeImmutable();
result.allowedCommonNames_ = allowedCommonNames_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.allowedSans_ =
allowedSansBuilder_ == null ? allowedSans_ : allowedSansBuilder_.build();
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.maximumLifetime_ =
maximumLifetimeBuilder_ == null ? maximumLifetime_ : maximumLifetimeBuilder_.build();
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.allowedIssuanceModes_ =
allowedIssuanceModesBuilder_ == null
? allowedIssuanceModes_
: allowedIssuanceModesBuilder_.build();
}
}
private void buildPartialOneofs(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
result) {
result.configPolicyCase_ = configPolicyCase_;
result.configPolicy_ = this.configPolicy_;
if (configPolicyCase_ == 1 && allowedConfigListBuilder_ != null) {
result.configPolicy_ = allowedConfigListBuilder_.build();
}
if (configPolicyCase_ == 2 && overwriteConfigValuesBuilder_ != null) {
result.configPolicy_ = overwriteConfigValuesBuilder_.build();
}
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy) {
return mergeFrom(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy)
other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
other) {
if (other
== com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.getDefaultInstance()) return this;
if (allowedLocationsAndOrganizationsBuilder_ == null) {
if (!other.allowedLocationsAndOrganizations_.isEmpty()) {
if (allowedLocationsAndOrganizations_.isEmpty()) {
allowedLocationsAndOrganizations_ = other.allowedLocationsAndOrganizations_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.addAll(other.allowedLocationsAndOrganizations_);
}
onChanged();
}
} else {
if (!other.allowedLocationsAndOrganizations_.isEmpty()) {
if (allowedLocationsAndOrganizationsBuilder_.isEmpty()) {
allowedLocationsAndOrganizationsBuilder_.dispose();
allowedLocationsAndOrganizationsBuilder_ = null;
allowedLocationsAndOrganizations_ = other.allowedLocationsAndOrganizations_;
bitField0_ = (bitField0_ & ~0x00000004);
allowedLocationsAndOrganizationsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getAllowedLocationsAndOrganizationsFieldBuilder()
: null;
} else {
allowedLocationsAndOrganizationsBuilder_.addAllMessages(
other.allowedLocationsAndOrganizations_);
}
}
}
if (!other.allowedCommonNames_.isEmpty()) {
if (allowedCommonNames_.isEmpty()) {
allowedCommonNames_ = other.allowedCommonNames_;
bitField0_ |= 0x00000008;
} else {
ensureAllowedCommonNamesIsMutable();
allowedCommonNames_.addAll(other.allowedCommonNames_);
}
onChanged();
}
if (other.hasAllowedSans()) {
mergeAllowedSans(other.getAllowedSans());
}
if (other.hasMaximumLifetime()) {
mergeMaximumLifetime(other.getMaximumLifetime());
}
if (other.hasAllowedIssuanceModes()) {
mergeAllowedIssuanceModes(other.getAllowedIssuanceModes());
}
switch (other.getConfigPolicyCase()) {
case ALLOWED_CONFIG_LIST:
{
mergeAllowedConfigList(other.getAllowedConfigList());
break;
}
case OVERWRITE_CONFIG_VALUES:
{
mergeOverwriteConfigValues(other.getOverwriteConfigValues());
break;
}
case CONFIGPOLICY_NOT_SET:
{
break;
}
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
input.readMessage(
getAllowedConfigListFieldBuilder().getBuilder(), extensionRegistry);
configPolicyCase_ = 1;
break;
} // case 10
case 18:
{
input.readMessage(
getOverwriteConfigValuesFieldBuilder().getBuilder(), extensionRegistry);
configPolicyCase_ = 2;
break;
} // case 18
case 26:
{
com.google.cloud.security.privateca.v1beta1.Subject m =
input.readMessage(
com.google.cloud.security.privateca.v1beta1.Subject.parser(),
extensionRegistry);
if (allowedLocationsAndOrganizationsBuilder_ == null) {
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.add(m);
} else {
allowedLocationsAndOrganizationsBuilder_.addMessage(m);
}
break;
} // case 26
case 34:
{
java.lang.String s = input.readStringRequireUtf8();
ensureAllowedCommonNamesIsMutable();
allowedCommonNames_.add(s);
break;
} // case 34
case 42:
{
input.readMessage(getAllowedSansFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000010;
break;
} // case 42
case 50:
{
input.readMessage(
getMaximumLifetimeFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000020;
break;
} // case 50
case 66:
{
input.readMessage(
getAllowedIssuanceModesFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000040;
break;
} // case 66
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int configPolicyCase_ = 0;
private java.lang.Object configPolicy_;
public ConfigPolicyCase getConfigPolicyCase() {
return ConfigPolicyCase.forNumber(configPolicyCase_);
}
public Builder clearConfigPolicy() {
configPolicyCase_ = 0;
configPolicy_ = null;
onChanged();
return this;
}
private int bitField0_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigListOrBuilder>
allowedConfigListBuilder_;
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedConfigList field is set.
*/
@java.lang.Override
public boolean hasAllowedConfigList() {
return configPolicyCase_ == 1;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedConfigList.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
getAllowedConfigList() {
if (allowedConfigListBuilder_ == null) {
if (configPolicyCase_ == 1) {
return (com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
configPolicy_;
}
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance();
} else {
if (configPolicyCase_ == 1) {
return allowedConfigListBuilder_.getMessage();
}
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance();
}
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setAllowedConfigList(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
value) {
if (allowedConfigListBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
configPolicy_ = value;
onChanged();
} else {
allowedConfigListBuilder_.setMessage(value);
}
configPolicyCase_ = 1;
return this;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setAllowedConfigList(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.Builder
builderForValue) {
if (allowedConfigListBuilder_ == null) {
configPolicy_ = builderForValue.build();
onChanged();
} else {
allowedConfigListBuilder_.setMessage(builderForValue.build());
}
configPolicyCase_ = 1;
return this;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeAllowedConfigList(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList
value) {
if (allowedConfigListBuilder_ == null) {
if (configPolicyCase_ == 1
&& configPolicy_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance()) {
configPolicy_ =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.newBuilder(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
configPolicy_)
.mergeFrom(value)
.buildPartial();
} else {
configPolicy_ = value;
}
onChanged();
} else {
if (configPolicyCase_ == 1) {
allowedConfigListBuilder_.mergeFrom(value);
} else {
allowedConfigListBuilder_.setMessage(value);
}
}
configPolicyCase_ = 1;
return this;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearAllowedConfigList() {
if (allowedConfigListBuilder_ == null) {
if (configPolicyCase_ == 1) {
configPolicyCase_ = 0;
configPolicy_ = null;
onChanged();
}
} else {
if (configPolicyCase_ == 1) {
configPolicyCase_ = 0;
configPolicy_ = null;
}
allowedConfigListBuilder_.clear();
}
return this;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.Builder
getAllowedConfigListBuilder() {
return getAllowedConfigListFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigListOrBuilder
getAllowedConfigListOrBuilder() {
if ((configPolicyCase_ == 1) && (allowedConfigListBuilder_ != null)) {
return allowedConfigListBuilder_.getMessageOrBuilder();
} else {
if (configPolicyCase_ == 1) {
return (com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
configPolicy_;
}
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance();
}
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList allowed_config_list = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigListOrBuilder>
getAllowedConfigListFieldBuilder() {
if (allowedConfigListBuilder_ == null) {
if (!(configPolicyCase_ == 1)) {
configPolicy_ =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.getDefaultInstance();
}
allowedConfigListBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigListOrBuilder>(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedConfigList)
configPolicy_,
getParentForChildren(),
isClean());
configPolicy_ = null;
}
configPolicyCase_ = 1;
onChanged();
return allowedConfigListBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>
overwriteConfigValuesBuilder_;
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the overwriteConfigValues field is set.
*/
@java.lang.Override
public boolean hasOverwriteConfigValues() {
return configPolicyCase_ == 2;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The overwriteConfigValues.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
getOverwriteConfigValues() {
if (overwriteConfigValuesBuilder_ == null) {
if (configPolicyCase_ == 2) {
return (com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper)
configPolicy_;
}
return com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
.getDefaultInstance();
} else {
if (configPolicyCase_ == 2) {
return overwriteConfigValuesBuilder_.getMessage();
}
return com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
.getDefaultInstance();
}
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setOverwriteConfigValues(
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper value) {
if (overwriteConfigValuesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
configPolicy_ = value;
onChanged();
} else {
overwriteConfigValuesBuilder_.setMessage(value);
}
configPolicyCase_ = 2;
return this;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setOverwriteConfigValues(
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder
builderForValue) {
if (overwriteConfigValuesBuilder_ == null) {
configPolicy_ = builderForValue.build();
onChanged();
} else {
overwriteConfigValuesBuilder_.setMessage(builderForValue.build());
}
configPolicyCase_ = 2;
return this;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeOverwriteConfigValues(
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper value) {
if (overwriteConfigValuesBuilder_ == null) {
if (configPolicyCase_ == 2
&& configPolicy_
!= com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
.getDefaultInstance()) {
configPolicy_ =
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.newBuilder(
(com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper)
configPolicy_)
.mergeFrom(value)
.buildPartial();
} else {
configPolicy_ = value;
}
onChanged();
} else {
if (configPolicyCase_ == 2) {
overwriteConfigValuesBuilder_.mergeFrom(value);
} else {
overwriteConfigValuesBuilder_.setMessage(value);
}
}
configPolicyCase_ = 2;
return this;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearOverwriteConfigValues() {
if (overwriteConfigValuesBuilder_ == null) {
if (configPolicyCase_ == 2) {
configPolicyCase_ = 0;
configPolicy_ = null;
onChanged();
}
} else {
if (configPolicyCase_ == 2) {
configPolicyCase_ = 0;
configPolicy_ = null;
}
overwriteConfigValuesBuilder_.clear();
}
return this;
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder
getOverwriteConfigValuesBuilder() {
return getOverwriteConfigValuesFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder
getOverwriteConfigValuesOrBuilder() {
if ((configPolicyCase_ == 2) && (overwriteConfigValuesBuilder_ != null)) {
return overwriteConfigValuesBuilder_.getMessageOrBuilder();
} else {
if (configPolicyCase_ == 2) {
return (com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper)
configPolicy_;
}
return com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
.getDefaultInstance();
}
}
/**
*
*
* <pre>
* Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]
* will use the provided configuration values, overwriting any requested
* configuration values.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.ReusableConfigWrapper overwrite_config_values = 2 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>
getOverwriteConfigValuesFieldBuilder() {
if (overwriteConfigValuesBuilder_ == null) {
if (!(configPolicyCase_ == 2)) {
configPolicy_ =
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper
.getDefaultInstance();
}
overwriteConfigValuesBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.Builder,
com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperOrBuilder>(
(com.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper) configPolicy_,
getParentForChildren(),
isClean());
configPolicy_ = null;
}
configPolicyCase_ = 2;
onChanged();
return overwriteConfigValuesBuilder_;
}
private java.util.List<com.google.cloud.security.privateca.v1beta1.Subject>
allowedLocationsAndOrganizations_ = java.util.Collections.emptyList();
private void ensureAllowedLocationsAndOrganizationsIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
allowedLocationsAndOrganizations_ =
new java.util.ArrayList<com.google.cloud.security.privateca.v1beta1.Subject>(
allowedLocationsAndOrganizations_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.Subject,
com.google.cloud.security.privateca.v1beta1.Subject.Builder,
com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder>
allowedLocationsAndOrganizationsBuilder_;
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public java.util.List<com.google.cloud.security.privateca.v1beta1.Subject>
getAllowedLocationsAndOrganizationsList() {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
return java.util.Collections.unmodifiableList(allowedLocationsAndOrganizations_);
} else {
return allowedLocationsAndOrganizationsBuilder_.getMessageList();
}
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public int getAllowedLocationsAndOrganizationsCount() {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
return allowedLocationsAndOrganizations_.size();
} else {
return allowedLocationsAndOrganizationsBuilder_.getCount();
}
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.Subject
getAllowedLocationsAndOrganizations(int index) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
return allowedLocationsAndOrganizations_.get(index);
} else {
return allowedLocationsAndOrganizationsBuilder_.getMessage(index);
}
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setAllowedLocationsAndOrganizations(
int index, com.google.cloud.security.privateca.v1beta1.Subject value) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.set(index, value);
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setAllowedLocationsAndOrganizations(
int index, com.google.cloud.security.privateca.v1beta1.Subject.Builder builderForValue) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.set(index, builderForValue.build());
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder addAllowedLocationsAndOrganizations(
com.google.cloud.security.privateca.v1beta1.Subject value) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.add(value);
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder addAllowedLocationsAndOrganizations(
int index, com.google.cloud.security.privateca.v1beta1.Subject value) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.add(index, value);
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder addAllowedLocationsAndOrganizations(
com.google.cloud.security.privateca.v1beta1.Subject.Builder builderForValue) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.add(builderForValue.build());
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder addAllowedLocationsAndOrganizations(
int index, com.google.cloud.security.privateca.v1beta1.Subject.Builder builderForValue) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.add(index, builderForValue.build());
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder addAllAllowedLocationsAndOrganizations(
java.lang.Iterable<? extends com.google.cloud.security.privateca.v1beta1.Subject>
values) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
ensureAllowedLocationsAndOrganizationsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, allowedLocationsAndOrganizations_);
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearAllowedLocationsAndOrganizations() {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
allowedLocationsAndOrganizations_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.clear();
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder removeAllowedLocationsAndOrganizations(int index) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
ensureAllowedLocationsAndOrganizationsIsMutable();
allowedLocationsAndOrganizations_.remove(index);
onChanged();
} else {
allowedLocationsAndOrganizationsBuilder_.remove(index);
}
return this;
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.Subject.Builder
getAllowedLocationsAndOrganizationsBuilder(int index) {
return getAllowedLocationsAndOrganizationsFieldBuilder().getBuilder(index);
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder
getAllowedLocationsAndOrganizationsOrBuilder(int index) {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
return allowedLocationsAndOrganizations_.get(index);
} else {
return allowedLocationsAndOrganizationsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public java.util.List<? extends com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder>
getAllowedLocationsAndOrganizationsOrBuilderList() {
if (allowedLocationsAndOrganizationsBuilder_ != null) {
return allowedLocationsAndOrganizationsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(allowedLocationsAndOrganizations_);
}
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.Subject.Builder
addAllowedLocationsAndOrganizationsBuilder() {
return getAllowedLocationsAndOrganizationsFieldBuilder()
.addBuilder(com.google.cloud.security.privateca.v1beta1.Subject.getDefaultInstance());
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.Subject.Builder
addAllowedLocationsAndOrganizationsBuilder(int index) {
return getAllowedLocationsAndOrganizationsFieldBuilder()
.addBuilder(
index, com.google.cloud.security.privateca.v1beta1.Subject.getDefaultInstance());
}
/**
*
*
* <pre>
* Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty
* field, any value will be allowed for that field.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.Subject allowed_locations_and_organizations = 3 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public java.util.List<com.google.cloud.security.privateca.v1beta1.Subject.Builder>
getAllowedLocationsAndOrganizationsBuilderList() {
return getAllowedLocationsAndOrganizationsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.Subject,
com.google.cloud.security.privateca.v1beta1.Subject.Builder,
com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder>
getAllowedLocationsAndOrganizationsFieldBuilder() {
if (allowedLocationsAndOrganizationsBuilder_ == null) {
allowedLocationsAndOrganizationsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.Subject,
com.google.cloud.security.privateca.v1beta1.Subject.Builder,
com.google.cloud.security.privateca.v1beta1.SubjectOrBuilder>(
allowedLocationsAndOrganizations_,
((bitField0_ & 0x00000004) != 0),
getParentForChildren(),
isClean());
allowedLocationsAndOrganizations_ = null;
}
return allowedLocationsAndOrganizationsBuilder_;
}
private com.google.protobuf.LazyStringArrayList allowedCommonNames_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureAllowedCommonNamesIsMutable() {
if (!allowedCommonNames_.isModifiable()) {
allowedCommonNames_ = new com.google.protobuf.LazyStringArrayList(allowedCommonNames_);
}
bitField0_ |= 0x00000008;
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return A list containing the allowedCommonNames.
*/
public com.google.protobuf.ProtocolStringList getAllowedCommonNamesList() {
allowedCommonNames_.makeImmutable();
return allowedCommonNames_;
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The count of allowedCommonNames.
*/
public int getAllowedCommonNamesCount() {
return allowedCommonNames_.size();
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the element to return.
* @return The allowedCommonNames at the given index.
*/
public java.lang.String getAllowedCommonNames(int index) {
return allowedCommonNames_.get(index);
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedCommonNames at the given index.
*/
public com.google.protobuf.ByteString getAllowedCommonNamesBytes(int index) {
return allowedCommonNames_.getByteString(index);
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param index The index to set the value at.
* @param value The allowedCommonNames to set.
* @return This builder for chaining.
*/
public Builder setAllowedCommonNames(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedCommonNamesIsMutable();
allowedCommonNames_.set(index, value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param value The allowedCommonNames to add.
* @return This builder for chaining.
*/
public Builder addAllowedCommonNames(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAllowedCommonNamesIsMutable();
allowedCommonNames_.add(value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param values The allowedCommonNames to add.
* @return This builder for chaining.
*/
public Builder addAllAllowedCommonNames(java.lang.Iterable<java.lang.String> values) {
ensureAllowedCommonNamesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedCommonNames_);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearAllowedCommonNames() {
allowedCommonNames_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If any value is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match at least one listed value. If no value is specified, all values
* will be allowed for this fied. Glob patterns are also supported.
* </pre>
*
* <code>repeated string allowed_common_names = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @param value The bytes of the allowedCommonNames to add.
* @return This builder for chaining.
*/
public Builder addAllowedCommonNamesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureAllowedCommonNamesIsMutable();
allowedCommonNames_.add(value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
allowedSans_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNamesOrBuilder>
allowedSansBuilder_;
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedSans field is set.
*/
public boolean hasAllowedSans() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedSans.
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
getAllowedSans() {
if (allowedSansBuilder_ == null) {
return allowedSans_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.getDefaultInstance()
: allowedSans_;
} else {
return allowedSansBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setAllowedSans(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
value) {
if (allowedSansBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
allowedSans_ = value;
} else {
allowedSansBuilder_.setMessage(value);
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setAllowedSans(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.Builder
builderForValue) {
if (allowedSansBuilder_ == null) {
allowedSans_ = builderForValue.build();
} else {
allowedSansBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeAllowedSans(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames
value) {
if (allowedSansBuilder_ == null) {
if (((bitField0_ & 0x00000010) != 0)
&& allowedSans_ != null
&& allowedSans_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.getDefaultInstance()) {
getAllowedSansBuilder().mergeFrom(value);
} else {
allowedSans_ = value;
}
} else {
allowedSansBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearAllowedSans() {
bitField0_ = (bitField0_ & ~0x00000010);
allowedSans_ = null;
if (allowedSansBuilder_ != null) {
allowedSansBuilder_.dispose();
allowedSansBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.Builder
getAllowedSansBuilder() {
bitField0_ |= 0x00000010;
onChanged();
return getAllowedSansFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNamesOrBuilder
getAllowedSansOrBuilder() {
if (allowedSansBuilder_ != null) {
return allowedSansBuilder_.getMessageOrBuilder();
} else {
return allowedSans_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.getDefaultInstance()
: allowedSans_;
}
}
/**
*
*
* <pre>
* Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must
* match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value
* is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames]
* field.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames allowed_sans = 5 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNamesOrBuilder>
getAllowedSansFieldBuilder() {
if (allowedSansBuilder_ == null) {
allowedSansBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNames.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.AllowedSubjectAltNamesOrBuilder>(
getAllowedSans(), getParentForChildren(), isClean());
allowedSans_ = null;
}
return allowedSansBuilder_;
}
private com.google.protobuf.Duration maximumLifetime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
maximumLifetimeBuilder_;
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the maximumLifetime field is set.
*/
public boolean hasMaximumLifetime() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The maximumLifetime.
*/
public com.google.protobuf.Duration getMaximumLifetime() {
if (maximumLifetimeBuilder_ == null) {
return maximumLifetime_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: maximumLifetime_;
} else {
return maximumLifetimeBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setMaximumLifetime(com.google.protobuf.Duration value) {
if (maximumLifetimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
maximumLifetime_ = value;
} else {
maximumLifetimeBuilder_.setMessage(value);
}
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setMaximumLifetime(com.google.protobuf.Duration.Builder builderForValue) {
if (maximumLifetimeBuilder_ == null) {
maximumLifetime_ = builderForValue.build();
} else {
maximumLifetimeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeMaximumLifetime(com.google.protobuf.Duration value) {
if (maximumLifetimeBuilder_ == null) {
if (((bitField0_ & 0x00000020) != 0)
&& maximumLifetime_ != null
&& maximumLifetime_ != com.google.protobuf.Duration.getDefaultInstance()) {
getMaximumLifetimeBuilder().mergeFrom(value);
} else {
maximumLifetime_ = value;
}
} else {
maximumLifetimeBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearMaximumLifetime() {
bitField0_ = (bitField0_ & ~0x00000020);
maximumLifetime_ = null;
if (maximumLifetimeBuilder_ != null) {
maximumLifetimeBuilder_.dispose();
maximumLifetimeBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.protobuf.Duration.Builder getMaximumLifetimeBuilder() {
bitField0_ |= 0x00000020;
onChanged();
return getMaximumLifetimeFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.protobuf.DurationOrBuilder getMaximumLifetimeOrBuilder() {
if (maximumLifetimeBuilder_ != null) {
return maximumLifetimeBuilder_.getMessageOrBuilder();
} else {
return maximumLifetime_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: maximumLifetime_;
}
}
/**
*
*
* <pre>
* Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that
* if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s
* requested maximum_lifetime, the effective lifetime will be explicitly
* truncated.
* </pre>
*
* <code>
* .google.protobuf.Duration maximum_lifetime = 6 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
getMaximumLifetimeFieldBuilder() {
if (maximumLifetimeBuilder_ == null) {
maximumLifetimeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>(
getMaximumLifetime(), getParentForChildren(), isClean());
maximumLifetime_ = null;
}
return maximumLifetimeBuilder_;
}
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
allowedIssuanceModes_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModesOrBuilder>
allowedIssuanceModesBuilder_;
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the allowedIssuanceModes field is set.
*/
public boolean hasAllowedIssuanceModes() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The allowedIssuanceModes.
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
getAllowedIssuanceModes() {
if (allowedIssuanceModesBuilder_ == null) {
return allowedIssuanceModes_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.getDefaultInstance()
: allowedIssuanceModes_;
} else {
return allowedIssuanceModesBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setAllowedIssuanceModes(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
value) {
if (allowedIssuanceModesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
allowedIssuanceModes_ = value;
} else {
allowedIssuanceModesBuilder_.setMessage(value);
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setAllowedIssuanceModes(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.Builder
builderForValue) {
if (allowedIssuanceModesBuilder_ == null) {
allowedIssuanceModes_ = builderForValue.build();
} else {
allowedIssuanceModesBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeAllowedIssuanceModes(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes
value) {
if (allowedIssuanceModesBuilder_ == null) {
if (((bitField0_ & 0x00000040) != 0)
&& allowedIssuanceModes_ != null
&& allowedIssuanceModes_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.getDefaultInstance()) {
getAllowedIssuanceModesBuilder().mergeFrom(value);
} else {
allowedIssuanceModes_ = value;
}
} else {
allowedIssuanceModesBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearAllowedIssuanceModes() {
bitField0_ = (bitField0_ & ~0x00000040);
allowedIssuanceModes_ = null;
if (allowedIssuanceModesBuilder_ != null) {
allowedIssuanceModesBuilder_.dispose();
allowedIssuanceModesBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.Builder
getAllowedIssuanceModesBuilder() {
bitField0_ |= 0x00000040;
onChanged();
return getAllowedIssuanceModesFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModesOrBuilder
getAllowedIssuanceModesOrBuilder() {
if (allowedIssuanceModesBuilder_ != null) {
return allowedIssuanceModesBuilder_.getMessageOrBuilder();
} else {
return allowedIssuanceModes_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.getDefaultInstance()
: allowedIssuanceModes_;
}
}
/**
*
*
* <pre>
* Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be
* used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes allowed_issuance_modes = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModesOrBuilder>
getAllowedIssuanceModesFieldBuilder() {
if (allowedIssuanceModesBuilder_ == null) {
allowedIssuanceModesBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModes.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.IssuanceModesOrBuilder>(
getAllowedIssuanceModes(), getParentForChildren(), isClean());
allowedIssuanceModes_ = null;
}
return allowedIssuanceModesBuilder_;
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy)
}
// @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy)
private static final com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy();
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<CertificateAuthorityPolicy> PARSER =
new com.google.protobuf.AbstractParser<CertificateAuthorityPolicy>() {
@java.lang.Override
public CertificateAuthorityPolicy parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<CertificateAuthorityPolicy> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<CertificateAuthorityPolicy> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface AccessUrlsOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @return The caCertificateAccessUrl.
*/
java.lang.String getCaCertificateAccessUrl();
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @return The bytes for caCertificateAccessUrl.
*/
com.google.protobuf.ByteString getCaCertificateAccessUrlBytes();
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @return The crlAccessUrl.
*/
java.lang.String getCrlAccessUrl();
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @return The bytes for crlAccessUrl.
*/
com.google.protobuf.ByteString getCrlAccessUrlBytes();
}
/**
*
*
* <pre>
* URLs where a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will publish content.
* </pre>
*
* Protobuf type {@code google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls}
*/
public static final class AccessUrls extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls)
AccessUrlsOrBuilder {
private static final long serialVersionUID = 0L;
// Use AccessUrls.newBuilder() to construct.
private AccessUrls(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AccessUrls() {
caCertificateAccessUrl_ = "";
crlAccessUrl_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AccessUrls();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_AccessUrls_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_AccessUrls_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.Builder
.class);
}
public static final int CA_CERTIFICATE_ACCESS_URL_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object caCertificateAccessUrl_ = "";
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @return The caCertificateAccessUrl.
*/
@java.lang.Override
public java.lang.String getCaCertificateAccessUrl() {
java.lang.Object ref = caCertificateAccessUrl_;
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();
caCertificateAccessUrl_ = s;
return s;
}
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @return The bytes for caCertificateAccessUrl.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCaCertificateAccessUrlBytes() {
java.lang.Object ref = caCertificateAccessUrl_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
caCertificateAccessUrl_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CRL_ACCESS_URL_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object crlAccessUrl_ = "";
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @return The crlAccessUrl.
*/
@java.lang.Override
public java.lang.String getCrlAccessUrl() {
java.lang.Object ref = crlAccessUrl_;
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();
crlAccessUrl_ = s;
return s;
}
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @return The bytes for crlAccessUrl.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCrlAccessUrlBytes() {
java.lang.Object ref = crlAccessUrl_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
crlAccessUrl_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(caCertificateAccessUrl_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, caCertificateAccessUrl_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(crlAccessUrl_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, crlAccessUrl_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(caCertificateAccessUrl_)) {
size +=
com.google.protobuf.GeneratedMessageV3.computeStringSize(1, caCertificateAccessUrl_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(crlAccessUrl_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, crlAccessUrl_);
}
size += getUnknownFields().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.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls)) {
return super.equals(obj);
}
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls other =
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls) obj;
if (!getCaCertificateAccessUrl().equals(other.getCaCertificateAccessUrl())) return false;
if (!getCrlAccessUrl().equals(other.getCrlAccessUrl())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CA_CERTIFICATE_ACCESS_URL_FIELD_NUMBER;
hash = (53 * hash) + getCaCertificateAccessUrl().hashCode();
hash = (37 * hash) + CRL_ACCESS_URL_FIELD_NUMBER;
hash = (53 * hash) + getCrlAccessUrl().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
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.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
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.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
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.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
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.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls 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>
* URLs where a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will publish content.
* </pre>
*
* Protobuf type {@code google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls)
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrlsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_AccessUrls_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_AccessUrls_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.Builder
.class);
}
// Construct using
// com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
caCertificateAccessUrl_ = "";
crlAccessUrl_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_AccessUrls_descriptor;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
getDefaultInstanceForType() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls build() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls result =
buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
buildPartial() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls result =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.caCertificateAccessUrl_ = caCertificateAccessUrl_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.crlAccessUrl_ = crlAccessUrl_;
}
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls) {
return mergeFrom(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls other) {
if (other
== com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
.getDefaultInstance()) return this;
if (!other.getCaCertificateAccessUrl().isEmpty()) {
caCertificateAccessUrl_ = other.caCertificateAccessUrl_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getCrlAccessUrl().isEmpty()) {
crlAccessUrl_ = other.crlAccessUrl_;
bitField0_ |= 0x00000002;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
caCertificateAccessUrl_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
crlAccessUrl_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object caCertificateAccessUrl_ = "";
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @return The caCertificateAccessUrl.
*/
public java.lang.String getCaCertificateAccessUrl() {
java.lang.Object ref = caCertificateAccessUrl_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
caCertificateAccessUrl_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @return The bytes for caCertificateAccessUrl.
*/
public com.google.protobuf.ByteString getCaCertificateAccessUrlBytes() {
java.lang.Object ref = caCertificateAccessUrl_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
caCertificateAccessUrl_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @param value The caCertificateAccessUrl to set.
* @return This builder for chaining.
*/
public Builder setCaCertificateAccessUrl(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
caCertificateAccessUrl_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @return This builder for chaining.
*/
public Builder clearCaCertificateAccessUrl() {
caCertificateAccessUrl_ = getDefaultInstance().getCaCertificateAccessUrl();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is
* published. This will only be set for CAs that have been activated.
* </pre>
*
* <code>string ca_certificate_access_url = 1;</code>
*
* @param value The bytes for caCertificateAccessUrl to set.
* @return This builder for chaining.
*/
public Builder setCaCertificateAccessUrlBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
caCertificateAccessUrl_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object crlAccessUrl_ = "";
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @return The crlAccessUrl.
*/
public java.lang.String getCrlAccessUrl() {
java.lang.Object ref = crlAccessUrl_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
crlAccessUrl_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @return The bytes for crlAccessUrl.
*/
public com.google.protobuf.ByteString getCrlAccessUrlBytes() {
java.lang.Object ref = crlAccessUrl_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
crlAccessUrl_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @param value The crlAccessUrl to set.
* @return This builder for chaining.
*/
public Builder setCrlAccessUrl(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
crlAccessUrl_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @return This builder for chaining.
*/
public Builder clearCrlAccessUrl() {
crlAccessUrl_ = getDefaultInstance().getCrlAccessUrl();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
* <pre>
* The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This
* will only be set for CAs that have been activated.
* </pre>
*
* <code>string crl_access_url = 2;</code>
*
* @param value The bytes for crlAccessUrl to set.
* @return This builder for chaining.
*/
public Builder setCrlAccessUrlBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
crlAccessUrl_ = value;
bitField0_ |= 0x00000002;
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:google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls)
}
// @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls)
private static final com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls();
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AccessUrls> PARSER =
new com.google.protobuf.AbstractParser<AccessUrls>() {
@java.lang.Override
public AccessUrls parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<AccessUrls> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AccessUrls> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface KeyVersionSpecOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return Whether the cloudKmsKeyVersion field is set.
*/
boolean hasCloudKmsKeyVersion();
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The cloudKmsKeyVersion.
*/
java.lang.String getCloudKmsKeyVersion();
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The bytes for cloudKmsKeyVersion.
*/
com.google.protobuf.ByteString getCloudKmsKeyVersionBytes();
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return Whether the algorithm field is set.
*/
boolean hasAlgorithm();
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The enum numeric value on the wire for algorithm.
*/
int getAlgorithmValue();
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The algorithm.
*/
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
getAlgorithm();
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.KeyVersionCase
getKeyVersionCase();
}
/**
*
*
* <pre>
* A Cloud KMS key configuration that a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will use.
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec}
*/
public static final class KeyVersionSpec extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec)
KeyVersionSpecOrBuilder {
private static final long serialVersionUID = 0L;
// Use KeyVersionSpec.newBuilder() to construct.
private KeyVersionSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private KeyVersionSpec() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new KeyVersionSpec();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_KeyVersionSpec_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_KeyVersionSpec_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.Builder.class);
}
private int keyVersionCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object keyVersion_;
public enum KeyVersionCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
CLOUD_KMS_KEY_VERSION(1),
ALGORITHM(2),
KEYVERSION_NOT_SET(0);
private final int value;
private KeyVersionCase(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 KeyVersionCase valueOf(int value) {
return forNumber(value);
}
public static KeyVersionCase forNumber(int value) {
switch (value) {
case 1:
return CLOUD_KMS_KEY_VERSION;
case 2:
return ALGORITHM;
case 0:
return KEYVERSION_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public KeyVersionCase getKeyVersionCase() {
return KeyVersionCase.forNumber(keyVersionCase_);
}
public static final int CLOUD_KMS_KEY_VERSION_FIELD_NUMBER = 1;
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return Whether the cloudKmsKeyVersion field is set.
*/
public boolean hasCloudKmsKeyVersion() {
return keyVersionCase_ == 1;
}
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The cloudKmsKeyVersion.
*/
public java.lang.String getCloudKmsKeyVersion() {
java.lang.Object ref = "";
if (keyVersionCase_ == 1) {
ref = keyVersion_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (keyVersionCase_ == 1) {
keyVersion_ = s;
}
return s;
}
}
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The bytes for cloudKmsKeyVersion.
*/
public com.google.protobuf.ByteString getCloudKmsKeyVersionBytes() {
java.lang.Object ref = "";
if (keyVersionCase_ == 1) {
ref = keyVersion_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (keyVersionCase_ == 1) {
keyVersion_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ALGORITHM_FIELD_NUMBER = 2;
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return Whether the algorithm field is set.
*/
public boolean hasAlgorithm() {
return keyVersionCase_ == 2;
}
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The enum numeric value on the wire for algorithm.
*/
public int getAlgorithmValue() {
if (keyVersionCase_ == 2) {
return (java.lang.Integer) keyVersion_;
}
return 0;
}
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The algorithm.
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
getAlgorithm() {
if (keyVersionCase_ == 2) {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm result =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
.forNumber((java.lang.Integer) keyVersion_);
return result == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
.UNRECOGNIZED
: result;
}
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
.SIGN_HASH_ALGORITHM_UNSPECIFIED;
}
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 (keyVersionCase_ == 1) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, keyVersion_);
}
if (keyVersionCase_ == 2) {
output.writeEnum(2, ((java.lang.Integer) keyVersion_));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (keyVersionCase_ == 1) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, keyVersion_);
}
if (keyVersionCase_ == 2) {
size +=
com.google.protobuf.CodedOutputStream.computeEnumSize(
2, ((java.lang.Integer) keyVersion_));
}
size += getUnknownFields().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.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec)) {
return super.equals(obj);
}
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec other =
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec) obj;
if (!getKeyVersionCase().equals(other.getKeyVersionCase())) return false;
switch (keyVersionCase_) {
case 1:
if (!getCloudKmsKeyVersion().equals(other.getCloudKmsKeyVersion())) return false;
break;
case 2:
if (getAlgorithmValue() != other.getAlgorithmValue()) return false;
break;
case 0:
default:
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
switch (keyVersionCase_) {
case 1:
hash = (37 * hash) + CLOUD_KMS_KEY_VERSION_FIELD_NUMBER;
hash = (53 * hash) + getCloudKmsKeyVersion().hashCode();
break;
case 2:
hash = (37 * hash) + ALGORITHM_FIELD_NUMBER;
hash = (53 * hash) + getAlgorithmValue();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
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.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
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.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
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.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
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.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec 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 Cloud KMS key configuration that a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will use.
* </pre>
*
* Protobuf type {@code
* google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec)
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpecOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_KeyVersionSpec_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_KeyVersionSpec_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.Builder.class);
}
// Construct using
// com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
keyVersionCase_ = 0;
keyVersion_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_KeyVersionSpec_descriptor;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
getDefaultInstanceForType() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
build() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec result =
buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
buildPartial() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec result =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec(
this);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec result) {
int from_bitField0_ = bitField0_;
}
private void buildPartialOneofs(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec result) {
result.keyVersionCase_ = keyVersionCase_;
result.keyVersion_ = this.keyVersion_;
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec) {
return mergeFrom(
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec)
other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec other) {
if (other
== com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.getDefaultInstance()) return this;
switch (other.getKeyVersionCase()) {
case CLOUD_KMS_KEY_VERSION:
{
keyVersionCase_ = 1;
keyVersion_ = other.keyVersion_;
onChanged();
break;
}
case ALGORITHM:
{
setAlgorithmValue(other.getAlgorithmValue());
break;
}
case KEYVERSION_NOT_SET:
{
break;
}
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
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();
keyVersionCase_ = 1;
keyVersion_ = s;
break;
} // case 10
case 16:
{
int rawValue = input.readEnum();
keyVersionCase_ = 2;
keyVersion_ = rawValue;
break;
} // case 16
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int keyVersionCase_ = 0;
private java.lang.Object keyVersion_;
public KeyVersionCase getKeyVersionCase() {
return KeyVersionCase.forNumber(keyVersionCase_);
}
public Builder clearKeyVersion() {
keyVersionCase_ = 0;
keyVersion_ = null;
onChanged();
return this;
}
private int bitField0_;
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return Whether the cloudKmsKeyVersion field is set.
*/
@java.lang.Override
public boolean hasCloudKmsKeyVersion() {
return keyVersionCase_ == 1;
}
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The cloudKmsKeyVersion.
*/
@java.lang.Override
public java.lang.String getCloudKmsKeyVersion() {
java.lang.Object ref = "";
if (keyVersionCase_ == 1) {
ref = keyVersion_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (keyVersionCase_ == 1) {
keyVersion_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The bytes for cloudKmsKeyVersion.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCloudKmsKeyVersionBytes() {
java.lang.Object ref = "";
if (keyVersionCase_ == 1) {
ref = keyVersion_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (keyVersionCase_ == 1) {
keyVersion_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The cloudKmsKeyVersion to set.
* @return This builder for chaining.
*/
public Builder setCloudKmsKeyVersion(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
keyVersionCase_ = 1;
keyVersion_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return This builder for chaining.
*/
public Builder clearCloudKmsKeyVersion() {
if (keyVersionCase_ == 1) {
keyVersionCase_ = 0;
keyVersion_ = null;
onChanged();
}
return this;
}
/**
*
*
* <pre>
* Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the
* format
* `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
* This option enables full flexibility in the key's capabilities and
* properties.
* </pre>
*
* <code>string cloud_kms_key_version = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The bytes for cloudKmsKeyVersion to set.
* @return This builder for chaining.
*/
public Builder setCloudKmsKeyVersionBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
keyVersionCase_ = 1;
keyVersion_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return Whether the algorithm field is set.
*/
@java.lang.Override
public boolean hasAlgorithm() {
return keyVersionCase_ == 2;
}
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The enum numeric value on the wire for algorithm.
*/
@java.lang.Override
public int getAlgorithmValue() {
if (keyVersionCase_ == 2) {
return ((java.lang.Integer) keyVersion_).intValue();
}
return 0;
}
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @param value The enum numeric value on the wire for algorithm to set.
* @return This builder for chaining.
*/
public Builder setAlgorithmValue(int value) {
keyVersionCase_ = 2;
keyVersion_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The algorithm.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
getAlgorithm() {
if (keyVersionCase_ == 2) {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
result =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
.forNumber((java.lang.Integer) keyVersion_);
return result == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
.UNRECOGNIZED
: result;
}
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
.SIGN_HASH_ALGORITHM_UNSPECIFIED;
}
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @param value The algorithm to set.
* @return This builder for chaining.
*/
public Builder setAlgorithm(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm
value) {
if (value == null) {
throw new NullPointerException();
}
keyVersionCase_ = 2;
keyVersion_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The algorithm to use for creating a managed Cloud KMS key for a for a
* simplified experience. All managed keys will be have their
* [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearAlgorithm() {
if (keyVersionCase_ == 2) {
keyVersionCase_ = 0;
keyVersion_ = null;
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:google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec)
}
// @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec)
private static final com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.KeyVersionSpec
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec();
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<KeyVersionSpec> PARSER =
new com.google.protobuf.AbstractParser<KeyVersionSpec>() {
@java.lang.Override
public KeyVersionSpec parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<KeyVersionSpec> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<KeyVersionSpec> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int NAME_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object name_ = "";
/**
*
*
* <pre>
* Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the
* format `projects/*/locations/*/certificateAuthorities/*`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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>
* Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the
* format `projects/*/locations/*/certificateAuthorities/*`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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 TYPE_FIELD_NUMBER = 2;
private int type_ = 0;
/**
*
*
* <pre>
* Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override
public int getTypeValue() {
return type_;
}
/**
*
*
* <pre>
* Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The type.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type getType() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type result =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.forNumber(type_);
return result == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.UNRECOGNIZED
: result;
}
public static final int TIER_FIELD_NUMBER = 3;
private int tier_ = 0;
/**
*
*
* <pre>
* Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The enum numeric value on the wire for tier.
*/
@java.lang.Override
public int getTierValue() {
return tier_;
}
/**
*
*
* <pre>
* Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The tier.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier getTier() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier result =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier.forNumber(tier_);
return result == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier.UNRECOGNIZED
: result;
}
public static final int CONFIG_FIELD_NUMBER = 4;
private com.google.cloud.security.privateca.v1beta1.CertificateConfig config_;
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return Whether the config field is set.
*/
@java.lang.Override
public boolean hasConfig() {
return config_ != null;
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The config.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateConfig getConfig() {
return config_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateConfig.getDefaultInstance()
: config_;
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateConfigOrBuilder
getConfigOrBuilder() {
return config_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateConfig.getDefaultInstance()
: config_;
}
public static final int LIFETIME_FIELD_NUMBER = 5;
private com.google.protobuf.Duration lifetime_;
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return Whether the lifetime field is set.
*/
@java.lang.Override
public boolean hasLifetime() {
return lifetime_ != null;
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The lifetime.
*/
@java.lang.Override
public com.google.protobuf.Duration getLifetime() {
return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_;
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];</code>
*/
@java.lang.Override
public com.google.protobuf.DurationOrBuilder getLifetimeOrBuilder() {
return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_;
}
public static final int KEY_SPEC_FIELD_NUMBER = 6;
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec keySpec_;
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return Whether the keySpec field is set.
*/
@java.lang.Override
public boolean hasKeySpec() {
return keySpec_ != null;
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The keySpec.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
getKeySpec() {
return keySpec_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.getDefaultInstance()
: keySpec_;
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpecOrBuilder
getKeySpecOrBuilder() {
return keySpec_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.getDefaultInstance()
: keySpec_;
}
public static final int CERTIFICATE_POLICY_FIELD_NUMBER = 7;
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
certificatePolicy_;
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the certificatePolicy field is set.
*/
@java.lang.Override
public boolean hasCertificatePolicy() {
return certificatePolicy_ != null;
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The certificatePolicy.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
getCertificatePolicy() {
return certificatePolicy_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.getDefaultInstance()
: certificatePolicy_;
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicyOrBuilder
getCertificatePolicyOrBuilder() {
return certificatePolicy_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.getDefaultInstance()
: certificatePolicy_;
}
public static final int ISSUING_OPTIONS_FIELD_NUMBER = 8;
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
issuingOptions_;
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the issuingOptions field is set.
*/
@java.lang.Override
public boolean hasIssuingOptions() {
return issuingOptions_ != null;
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The issuingOptions.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
getIssuingOptions() {
return issuingOptions_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.getDefaultInstance()
: issuingOptions_;
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptionsOrBuilder
getIssuingOptionsOrBuilder() {
return issuingOptions_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.getDefaultInstance()
: issuingOptions_;
}
public static final int SUBORDINATE_CONFIG_FIELD_NUMBER = 19;
private com.google.cloud.security.privateca.v1beta1.SubordinateConfig subordinateConfig_;
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the subordinateConfig field is set.
*/
@java.lang.Override
public boolean hasSubordinateConfig() {
return subordinateConfig_ != null;
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The subordinateConfig.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.SubordinateConfig getSubordinateConfig() {
return subordinateConfig_ == null
? com.google.cloud.security.privateca.v1beta1.SubordinateConfig.getDefaultInstance()
: subordinateConfig_;
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.SubordinateConfigOrBuilder
getSubordinateConfigOrBuilder() {
return subordinateConfig_ == null
? com.google.cloud.security.privateca.v1beta1.SubordinateConfig.getDefaultInstance()
: subordinateConfig_;
}
public static final int STATE_FIELD_NUMBER = 10;
private int state_ = 0;
/**
*
*
* <pre>
* Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
/**
*
*
* <pre>
* Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The state.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State getState() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State result =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.forNumber(state_);
return result == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.UNRECOGNIZED
: result;
}
public static final int PEM_CA_CERTIFICATES_FIELD_NUMBER = 9;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList pemCaCertificates_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return A list containing the pemCaCertificates.
*/
public com.google.protobuf.ProtocolStringList getPemCaCertificatesList() {
return pemCaCertificates_;
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The count of pemCaCertificates.
*/
public int getPemCaCertificatesCount() {
return pemCaCertificates_.size();
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param index The index of the element to return.
* @return The pemCaCertificates at the given index.
*/
public java.lang.String getPemCaCertificates(int index) {
return pemCaCertificates_.get(index);
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the pemCaCertificates at the given index.
*/
public com.google.protobuf.ByteString getPemCaCertificatesBytes(int index) {
return pemCaCertificates_.getByteString(index);
}
public static final int CA_CERTIFICATE_DESCRIPTIONS_FIELD_NUMBER = 12;
@SuppressWarnings("serial")
private java.util.List<com.google.cloud.security.privateca.v1beta1.CertificateDescription>
caCertificateDescriptions_;
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public java.util.List<com.google.cloud.security.privateca.v1beta1.CertificateDescription>
getCaCertificateDescriptionsList() {
return caCertificateDescriptions_;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public java.util.List<
? extends com.google.cloud.security.privateca.v1beta1.CertificateDescriptionOrBuilder>
getCaCertificateDescriptionsOrBuilderList() {
return caCertificateDescriptions_;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public int getCaCertificateDescriptionsCount() {
return caCertificateDescriptions_.size();
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateDescription
getCaCertificateDescriptions(int index) {
return caCertificateDescriptions_.get(index);
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateDescriptionOrBuilder
getCaCertificateDescriptionsOrBuilder(int index) {
return caCertificateDescriptions_.get(index);
}
public static final int GCS_BUCKET_FIELD_NUMBER = 13;
@SuppressWarnings("serial")
private volatile java.lang.Object gcsBucket_ = "";
/**
*
*
* <pre>
* Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will
* publish content, such as the CA certificate and CRLs. This must be a bucket
* name, without any prefixes (such as `gs://`) or suffixes (such as
* `.googleapis.com`). For example, to use a bucket named `my-bucket`, you
* would simply specify `my-bucket`. If not specified, a managed bucket will
* be created.
* </pre>
*
* <code>string gcs_bucket = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
*
* @return The gcsBucket.
*/
@java.lang.Override
public java.lang.String getGcsBucket() {
java.lang.Object ref = gcsBucket_;
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();
gcsBucket_ = s;
return s;
}
}
/**
*
*
* <pre>
* Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will
* publish content, such as the CA certificate and CRLs. This must be a bucket
* name, without any prefixes (such as `gs://`) or suffixes (such as
* `.googleapis.com`). For example, to use a bucket named `my-bucket`, you
* would simply specify `my-bucket`. If not specified, a managed bucket will
* be created.
* </pre>
*
* <code>string gcs_bucket = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
*
* @return The bytes for gcsBucket.
*/
@java.lang.Override
public com.google.protobuf.ByteString getGcsBucketBytes() {
java.lang.Object ref = gcsBucket_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
gcsBucket_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ACCESS_URLS_FIELD_NUMBER = 14;
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls accessUrls_;
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the accessUrls field is set.
*/
@java.lang.Override
public boolean hasAccessUrls() {
return accessUrls_ != null;
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The accessUrls.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
getAccessUrls() {
return accessUrls_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
.getDefaultInstance()
: accessUrls_;
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrlsOrBuilder
getAccessUrlsOrBuilder() {
return accessUrls_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
.getDefaultInstance()
: accessUrls_;
}
public static final int CREATE_TIME_FIELD_NUMBER = 15;
private com.google.protobuf.Timestamp createTime_;
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>.google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the createTime field is set.
*/
@java.lang.Override
public boolean hasCreateTime() {
return createTime_ != null;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>.google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The createTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getCreateTime() {
return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>.google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
}
public static final int UPDATE_TIME_FIELD_NUMBER = 16;
private com.google.protobuf.Timestamp updateTime_;
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>.google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the updateTime field is set.
*/
@java.lang.Override
public boolean hasUpdateTime() {
return updateTime_ != null;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>.google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The updateTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getUpdateTime() {
return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>.google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
}
public static final int DELETE_TIME_FIELD_NUMBER = 17;
private com.google.protobuf.Timestamp deleteTime_;
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>.google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the deleteTime field is set.
*/
@java.lang.Override
public boolean hasDeleteTime() {
return deleteTime_ != null;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>.google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The deleteTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getDeleteTime() {
return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>.google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() {
return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_;
}
public static final int LABELS_FIELD_NUMBER = 18;
private static final class LabelsDefaultEntryHolder {
static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_LabelsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;
private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
if (labels_ == null) {
return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
}
return labels_;
}
public int getLabelsCount() {
return internalGetLabels().getMap().size();
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
@java.lang.Override
public boolean containsLabels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLabels().getMap().containsKey(key);
}
/** Use {@link #getLabelsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map<java.lang.String, java.lang.String> getLabels() {
return getLabelsMap();
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
@java.lang.Override
public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
return internalGetLabels().getMap();
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
@java.lang.Override
public /* nullable */ java.lang.String getLabelsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
@java.lang.Override
public java.lang.String getLabelsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (type_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.TYPE_UNSPECIFIED
.getNumber()) {
output.writeEnum(2, type_);
}
if (tier_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier.TIER_UNSPECIFIED
.getNumber()) {
output.writeEnum(3, tier_);
}
if (config_ != null) {
output.writeMessage(4, getConfig());
}
if (lifetime_ != null) {
output.writeMessage(5, getLifetime());
}
if (keySpec_ != null) {
output.writeMessage(6, getKeySpec());
}
if (certificatePolicy_ != null) {
output.writeMessage(7, getCertificatePolicy());
}
if (issuingOptions_ != null) {
output.writeMessage(8, getIssuingOptions());
}
for (int i = 0; i < pemCaCertificates_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 9, pemCaCertificates_.getRaw(i));
}
if (state_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.STATE_UNSPECIFIED
.getNumber()) {
output.writeEnum(10, state_);
}
for (int i = 0; i < caCertificateDescriptions_.size(); i++) {
output.writeMessage(12, caCertificateDescriptions_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsBucket_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 13, gcsBucket_);
}
if (accessUrls_ != null) {
output.writeMessage(14, getAccessUrls());
}
if (createTime_ != null) {
output.writeMessage(15, getCreateTime());
}
if (updateTime_ != null) {
output.writeMessage(16, getUpdateTime());
}
if (deleteTime_ != null) {
output.writeMessage(17, getDeleteTime());
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 18);
if (subordinateConfig_ != null) {
output.writeMessage(19, getSubordinateConfig());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (type_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.TYPE_UNSPECIFIED
.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_);
}
if (tier_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier.TIER_UNSPECIFIED
.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, tier_);
}
if (config_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getConfig());
}
if (lifetime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getLifetime());
}
if (keySpec_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getKeySpec());
}
if (certificatePolicy_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCertificatePolicy());
}
if (issuingOptions_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getIssuingOptions());
}
{
int dataSize = 0;
for (int i = 0; i < pemCaCertificates_.size(); i++) {
dataSize += computeStringSizeNoTag(pemCaCertificates_.getRaw(i));
}
size += dataSize;
size += 1 * getPemCaCertificatesList().size();
}
if (state_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.STATE_UNSPECIFIED
.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, state_);
}
for (int i = 0; i < caCertificateDescriptions_.size(); i++) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
12, caCertificateDescriptions_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsBucket_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, gcsBucket_);
}
if (accessUrls_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getAccessUrls());
}
if (createTime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getCreateTime());
}
if (updateTime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getUpdateTime());
}
if (deleteTime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getDeleteTime());
}
for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
internalGetLabels().getMap().entrySet()) {
com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
LabelsDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, labels__);
}
if (subordinateConfig_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getSubordinateConfig());
}
size += getUnknownFields().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.cloud.security.privateca.v1beta1.CertificateAuthority)) {
return super.equals(obj);
}
com.google.cloud.security.privateca.v1beta1.CertificateAuthority other =
(com.google.cloud.security.privateca.v1beta1.CertificateAuthority) obj;
if (!getName().equals(other.getName())) return false;
if (type_ != other.type_) return false;
if (tier_ != other.tier_) return false;
if (hasConfig() != other.hasConfig()) return false;
if (hasConfig()) {
if (!getConfig().equals(other.getConfig())) return false;
}
if (hasLifetime() != other.hasLifetime()) return false;
if (hasLifetime()) {
if (!getLifetime().equals(other.getLifetime())) return false;
}
if (hasKeySpec() != other.hasKeySpec()) return false;
if (hasKeySpec()) {
if (!getKeySpec().equals(other.getKeySpec())) return false;
}
if (hasCertificatePolicy() != other.hasCertificatePolicy()) return false;
if (hasCertificatePolicy()) {
if (!getCertificatePolicy().equals(other.getCertificatePolicy())) return false;
}
if (hasIssuingOptions() != other.hasIssuingOptions()) return false;
if (hasIssuingOptions()) {
if (!getIssuingOptions().equals(other.getIssuingOptions())) return false;
}
if (hasSubordinateConfig() != other.hasSubordinateConfig()) return false;
if (hasSubordinateConfig()) {
if (!getSubordinateConfig().equals(other.getSubordinateConfig())) return false;
}
if (state_ != other.state_) return false;
if (!getPemCaCertificatesList().equals(other.getPemCaCertificatesList())) return false;
if (!getCaCertificateDescriptionsList().equals(other.getCaCertificateDescriptionsList()))
return false;
if (!getGcsBucket().equals(other.getGcsBucket())) return false;
if (hasAccessUrls() != other.hasAccessUrls()) return false;
if (hasAccessUrls()) {
if (!getAccessUrls().equals(other.getAccessUrls())) return false;
}
if (hasCreateTime() != other.hasCreateTime()) return false;
if (hasCreateTime()) {
if (!getCreateTime().equals(other.getCreateTime())) return false;
}
if (hasUpdateTime() != other.hasUpdateTime()) return false;
if (hasUpdateTime()) {
if (!getUpdateTime().equals(other.getUpdateTime())) return false;
}
if (hasDeleteTime() != other.hasDeleteTime()) return false;
if (hasDeleteTime()) {
if (!getDeleteTime().equals(other.getDeleteTime())) return false;
}
if (!internalGetLabels().equals(other.internalGetLabels())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
hash = (37 * hash) + TIER_FIELD_NUMBER;
hash = (53 * hash) + tier_;
if (hasConfig()) {
hash = (37 * hash) + CONFIG_FIELD_NUMBER;
hash = (53 * hash) + getConfig().hashCode();
}
if (hasLifetime()) {
hash = (37 * hash) + LIFETIME_FIELD_NUMBER;
hash = (53 * hash) + getLifetime().hashCode();
}
if (hasKeySpec()) {
hash = (37 * hash) + KEY_SPEC_FIELD_NUMBER;
hash = (53 * hash) + getKeySpec().hashCode();
}
if (hasCertificatePolicy()) {
hash = (37 * hash) + CERTIFICATE_POLICY_FIELD_NUMBER;
hash = (53 * hash) + getCertificatePolicy().hashCode();
}
if (hasIssuingOptions()) {
hash = (37 * hash) + ISSUING_OPTIONS_FIELD_NUMBER;
hash = (53 * hash) + getIssuingOptions().hashCode();
}
if (hasSubordinateConfig()) {
hash = (37 * hash) + SUBORDINATE_CONFIG_FIELD_NUMBER;
hash = (53 * hash) + getSubordinateConfig().hashCode();
}
hash = (37 * hash) + STATE_FIELD_NUMBER;
hash = (53 * hash) + state_;
if (getPemCaCertificatesCount() > 0) {
hash = (37 * hash) + PEM_CA_CERTIFICATES_FIELD_NUMBER;
hash = (53 * hash) + getPemCaCertificatesList().hashCode();
}
if (getCaCertificateDescriptionsCount() > 0) {
hash = (37 * hash) + CA_CERTIFICATE_DESCRIPTIONS_FIELD_NUMBER;
hash = (53 * hash) + getCaCertificateDescriptionsList().hashCode();
}
hash = (37 * hash) + GCS_BUCKET_FIELD_NUMBER;
hash = (53 * hash) + getGcsBucket().hashCode();
if (hasAccessUrls()) {
hash = (37 * hash) + ACCESS_URLS_FIELD_NUMBER;
hash = (53 * hash) + getAccessUrls().hashCode();
}
if (hasCreateTime()) {
hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
hash = (53 * hash) + getCreateTime().hashCode();
}
if (hasUpdateTime()) {
hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER;
hash = (53 * hash) + getUpdateTime().hashCode();
}
if (hasDeleteTime()) {
hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER;
hash = (53 * hash) + getDeleteTime().hashCode();
}
if (!internalGetLabels().getMap().isEmpty()) {
hash = (37 * hash) + LABELS_FIELD_NUMBER;
hash = (53 * hash) + internalGetLabels().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority 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.cloud.security.privateca.v1beta1.CertificateAuthority parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority 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.cloud.security.privateca.v1beta1.CertificateAuthority parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority 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.cloud.security.privateca.v1beta1.CertificateAuthority parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority 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.cloud.security.privateca.v1beta1.CertificateAuthority 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 [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] represents an individual Certificate Authority.
* A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] can be used to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate].
* </pre>
*
* Protobuf type {@code google.cloud.security.privateca.v1beta1.CertificateAuthority}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.CertificateAuthority)
com.google.cloud.security.privateca.v1beta1.CertificateAuthorityOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(int number) {
switch (number) {
case 18:
return internalGetLabels();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
switch (number) {
case 18:
return internalGetMutableLabels();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.class,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Builder.class);
}
// Construct using com.google.cloud.security.privateca.v1beta1.CertificateAuthority.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
name_ = "";
type_ = 0;
tier_ = 0;
config_ = null;
if (configBuilder_ != null) {
configBuilder_.dispose();
configBuilder_ = null;
}
lifetime_ = null;
if (lifetimeBuilder_ != null) {
lifetimeBuilder_.dispose();
lifetimeBuilder_ = null;
}
keySpec_ = null;
if (keySpecBuilder_ != null) {
keySpecBuilder_.dispose();
keySpecBuilder_ = null;
}
certificatePolicy_ = null;
if (certificatePolicyBuilder_ != null) {
certificatePolicyBuilder_.dispose();
certificatePolicyBuilder_ = null;
}
issuingOptions_ = null;
if (issuingOptionsBuilder_ != null) {
issuingOptionsBuilder_.dispose();
issuingOptionsBuilder_ = null;
}
subordinateConfig_ = null;
if (subordinateConfigBuilder_ != null) {
subordinateConfigBuilder_.dispose();
subordinateConfigBuilder_ = null;
}
state_ = 0;
pemCaCertificates_ = com.google.protobuf.LazyStringArrayList.emptyList();
if (caCertificateDescriptionsBuilder_ == null) {
caCertificateDescriptions_ = java.util.Collections.emptyList();
} else {
caCertificateDescriptions_ = null;
caCertificateDescriptionsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000800);
gcsBucket_ = "";
accessUrls_ = null;
if (accessUrlsBuilder_ != null) {
accessUrlsBuilder_.dispose();
accessUrlsBuilder_ = null;
}
createTime_ = null;
if (createTimeBuilder_ != null) {
createTimeBuilder_.dispose();
createTimeBuilder_ = null;
}
updateTime_ = null;
if (updateTimeBuilder_ != null) {
updateTimeBuilder_.dispose();
updateTimeBuilder_ = null;
}
deleteTime_ = null;
if (deleteTimeBuilder_ != null) {
deleteTimeBuilder_.dispose();
deleteTimeBuilder_ = null;
}
internalGetMutableLabels().clear();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
.internal_static_google_cloud_security_privateca_v1beta1_CertificateAuthority_descriptor;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
getDefaultInstanceForType() {
return com.google.cloud.security.privateca.v1beta1.CertificateAuthority.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority build() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority buildPartial() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority result =
new com.google.cloud.security.privateca.v1beta1.CertificateAuthority(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority result) {
if (caCertificateDescriptionsBuilder_ == null) {
if (((bitField0_ & 0x00000800) != 0)) {
caCertificateDescriptions_ =
java.util.Collections.unmodifiableList(caCertificateDescriptions_);
bitField0_ = (bitField0_ & ~0x00000800);
}
result.caCertificateDescriptions_ = caCertificateDescriptions_;
} else {
result.caCertificateDescriptions_ = caCertificateDescriptionsBuilder_.build();
}
}
private void buildPartial0(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.name_ = name_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.type_ = type_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.tier_ = tier_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.config_ = configBuilder_ == null ? config_ : configBuilder_.build();
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.lifetime_ = lifetimeBuilder_ == null ? lifetime_ : lifetimeBuilder_.build();
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.keySpec_ = keySpecBuilder_ == null ? keySpec_ : keySpecBuilder_.build();
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.certificatePolicy_ =
certificatePolicyBuilder_ == null
? certificatePolicy_
: certificatePolicyBuilder_.build();
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.issuingOptions_ =
issuingOptionsBuilder_ == null ? issuingOptions_ : issuingOptionsBuilder_.build();
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.subordinateConfig_ =
subordinateConfigBuilder_ == null
? subordinateConfig_
: subordinateConfigBuilder_.build();
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.state_ = state_;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
pemCaCertificates_.makeImmutable();
result.pemCaCertificates_ = pemCaCertificates_;
}
if (((from_bitField0_ & 0x00001000) != 0)) {
result.gcsBucket_ = gcsBucket_;
}
if (((from_bitField0_ & 0x00002000) != 0)) {
result.accessUrls_ = accessUrlsBuilder_ == null ? accessUrls_ : accessUrlsBuilder_.build();
}
if (((from_bitField0_ & 0x00004000) != 0)) {
result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build();
}
if (((from_bitField0_ & 0x00008000) != 0)) {
result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build();
}
if (((from_bitField0_ & 0x00010000) != 0)) {
result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build();
}
if (((from_bitField0_ & 0x00020000) != 0)) {
result.labels_ = internalGetLabels();
result.labels_.makeImmutable();
}
}
@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.cloud.security.privateca.v1beta1.CertificateAuthority) {
return mergeFrom((com.google.cloud.security.privateca.v1beta1.CertificateAuthority) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority other) {
if (other
== com.google.cloud.security.privateca.v1beta1.CertificateAuthority.getDefaultInstance())
return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (other.tier_ != 0) {
setTierValue(other.getTierValue());
}
if (other.hasConfig()) {
mergeConfig(other.getConfig());
}
if (other.hasLifetime()) {
mergeLifetime(other.getLifetime());
}
if (other.hasKeySpec()) {
mergeKeySpec(other.getKeySpec());
}
if (other.hasCertificatePolicy()) {
mergeCertificatePolicy(other.getCertificatePolicy());
}
if (other.hasIssuingOptions()) {
mergeIssuingOptions(other.getIssuingOptions());
}
if (other.hasSubordinateConfig()) {
mergeSubordinateConfig(other.getSubordinateConfig());
}
if (other.state_ != 0) {
setStateValue(other.getStateValue());
}
if (!other.pemCaCertificates_.isEmpty()) {
if (pemCaCertificates_.isEmpty()) {
pemCaCertificates_ = other.pemCaCertificates_;
bitField0_ |= 0x00000400;
} else {
ensurePemCaCertificatesIsMutable();
pemCaCertificates_.addAll(other.pemCaCertificates_);
}
onChanged();
}
if (caCertificateDescriptionsBuilder_ == null) {
if (!other.caCertificateDescriptions_.isEmpty()) {
if (caCertificateDescriptions_.isEmpty()) {
caCertificateDescriptions_ = other.caCertificateDescriptions_;
bitField0_ = (bitField0_ & ~0x00000800);
} else {
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.addAll(other.caCertificateDescriptions_);
}
onChanged();
}
} else {
if (!other.caCertificateDescriptions_.isEmpty()) {
if (caCertificateDescriptionsBuilder_.isEmpty()) {
caCertificateDescriptionsBuilder_.dispose();
caCertificateDescriptionsBuilder_ = null;
caCertificateDescriptions_ = other.caCertificateDescriptions_;
bitField0_ = (bitField0_ & ~0x00000800);
caCertificateDescriptionsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getCaCertificateDescriptionsFieldBuilder()
: null;
} else {
caCertificateDescriptionsBuilder_.addAllMessages(other.caCertificateDescriptions_);
}
}
}
if (!other.getGcsBucket().isEmpty()) {
gcsBucket_ = other.gcsBucket_;
bitField0_ |= 0x00001000;
onChanged();
}
if (other.hasAccessUrls()) {
mergeAccessUrls(other.getAccessUrls());
}
if (other.hasCreateTime()) {
mergeCreateTime(other.getCreateTime());
}
if (other.hasUpdateTime()) {
mergeUpdateTime(other.getUpdateTime());
}
if (other.hasDeleteTime()) {
mergeDeleteTime(other.getDeleteTime());
}
internalGetMutableLabels().mergeFrom(other.internalGetLabels());
bitField0_ |= 0x00020000;
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
name_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 16:
{
type_ = input.readEnum();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24:
{
tier_ = input.readEnum();
bitField0_ |= 0x00000004;
break;
} // case 24
case 34:
{
input.readMessage(getConfigFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000008;
break;
} // case 34
case 42:
{
input.readMessage(getLifetimeFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000010;
break;
} // case 42
case 50:
{
input.readMessage(getKeySpecFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000020;
break;
} // case 50
case 58:
{
input.readMessage(
getCertificatePolicyFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000040;
break;
} // case 58
case 66:
{
input.readMessage(getIssuingOptionsFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000080;
break;
} // case 66
case 74:
{
java.lang.String s = input.readStringRequireUtf8();
ensurePemCaCertificatesIsMutable();
pemCaCertificates_.add(s);
break;
} // case 74
case 80:
{
state_ = input.readEnum();
bitField0_ |= 0x00000200;
break;
} // case 80
case 98:
{
com.google.cloud.security.privateca.v1beta1.CertificateDescription m =
input.readMessage(
com.google.cloud.security.privateca.v1beta1.CertificateDescription.parser(),
extensionRegistry);
if (caCertificateDescriptionsBuilder_ == null) {
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.add(m);
} else {
caCertificateDescriptionsBuilder_.addMessage(m);
}
break;
} // case 98
case 106:
{
gcsBucket_ = input.readStringRequireUtf8();
bitField0_ |= 0x00001000;
break;
} // case 106
case 114:
{
input.readMessage(getAccessUrlsFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00002000;
break;
} // case 114
case 122:
{
input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00004000;
break;
} // case 122
case 130:
{
input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00008000;
break;
} // case 130
case 138:
{
input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00010000;
break;
} // case 138
case 146:
{
com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
input.readMessage(
LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableLabels()
.getMutableMap()
.put(labels__.getKey(), labels__.getValue());
bitField0_ |= 0x00020000;
break;
} // case 146
case 154:
{
input.readMessage(
getSubordinateConfigFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000100;
break;
} // case 154
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
*
* <pre>
* Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the
* format `projects/*/locations/*/certificateAuthorities/*`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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>
* Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the
* format `projects/*/locations/*/certificateAuthorities/*`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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>
* Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the
* format `projects/*/locations/*/certificateAuthorities/*`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the
* format `projects/*/locations/*/certificateAuthorities/*`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the
* format `projects/*/locations/*/certificateAuthorities/*`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private int type_ = 0;
/**
*
*
* <pre>
* Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override
public int getTypeValue() {
return type_;
}
/**
*
*
* <pre>
* Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @param value The enum numeric value on the wire for type to set.
* @return This builder for chaining.
*/
public Builder setTypeValue(int value) {
type_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The type.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type getType() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type result =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.forNumber(type_);
return result == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.UNRECOGNIZED
: result;
}
/**
*
*
* <pre>
* Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Type type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000002);
type_ = 0;
onChanged();
return this;
}
private int tier_ = 0;
/**
*
*
* <pre>
* Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The enum numeric value on the wire for tier.
*/
@java.lang.Override
public int getTierValue() {
return tier_;
}
/**
*
*
* <pre>
* Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @param value The enum numeric value on the wire for tier to set.
* @return This builder for chaining.
*/
public Builder setTierValue(int value) {
tier_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The tier.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier getTier() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier result =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier.forNumber(tier_);
return result == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier.UNRECOGNIZED
: result;
}
/**
*
*
* <pre>
* Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @param value The tier to set.
* @return This builder for chaining.
*/
public Builder setTier(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
tier_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearTier() {
bitField0_ = (bitField0_ & ~0x00000004);
tier_ = 0;
onChanged();
return this;
}
private com.google.cloud.security.privateca.v1beta1.CertificateConfig config_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateConfig,
com.google.cloud.security.privateca.v1beta1.CertificateConfig.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateConfigOrBuilder>
configBuilder_;
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return Whether the config field is set.
*/
public boolean hasConfig() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The config.
*/
public com.google.cloud.security.privateca.v1beta1.CertificateConfig getConfig() {
if (configBuilder_ == null) {
return config_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateConfig.getDefaultInstance()
: config_;
} else {
return configBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public Builder setConfig(com.google.cloud.security.privateca.v1beta1.CertificateConfig value) {
if (configBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
config_ = value;
} else {
configBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public Builder setConfig(
com.google.cloud.security.privateca.v1beta1.CertificateConfig.Builder builderForValue) {
if (configBuilder_ == null) {
config_ = builderForValue.build();
} else {
configBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public Builder mergeConfig(
com.google.cloud.security.privateca.v1beta1.CertificateConfig value) {
if (configBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0)
&& config_ != null
&& config_
!= com.google.cloud.security.privateca.v1beta1.CertificateConfig
.getDefaultInstance()) {
getConfigBuilder().mergeFrom(value);
} else {
config_ = value;
}
} else {
configBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public Builder clearConfig() {
bitField0_ = (bitField0_ & ~0x00000008);
config_ = null;
if (configBuilder_ != null) {
configBuilder_.dispose();
configBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateConfig.Builder
getConfigBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getConfigFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateConfigOrBuilder
getConfigOrBuilder() {
if (configBuilder_ != null) {
return configBuilder_.getMessageOrBuilder();
} else {
return config_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateConfig.getDefaultInstance()
: config_;
}
}
/**
*
*
* <pre>
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateConfig,
com.google.cloud.security.privateca.v1beta1.CertificateConfig.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateConfigOrBuilder>
getConfigFieldBuilder() {
if (configBuilder_ == null) {
configBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateConfig,
com.google.cloud.security.privateca.v1beta1.CertificateConfig.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateConfigOrBuilder>(
getConfig(), getParentForChildren(), isClean());
config_ = null;
}
return configBuilder_;
}
private com.google.protobuf.Duration lifetime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
lifetimeBuilder_;
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return Whether the lifetime field is set.
*/
public boolean hasLifetime() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The lifetime.
*/
public com.google.protobuf.Duration getLifetime() {
if (lifetimeBuilder_ == null) {
return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_;
} else {
return lifetimeBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder setLifetime(com.google.protobuf.Duration value) {
if (lifetimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
lifetime_ = value;
} else {
lifetimeBuilder_.setMessage(value);
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder setLifetime(com.google.protobuf.Duration.Builder builderForValue) {
if (lifetimeBuilder_ == null) {
lifetime_ = builderForValue.build();
} else {
lifetimeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder mergeLifetime(com.google.protobuf.Duration value) {
if (lifetimeBuilder_ == null) {
if (((bitField0_ & 0x00000010) != 0)
&& lifetime_ != null
&& lifetime_ != com.google.protobuf.Duration.getDefaultInstance()) {
getLifetimeBuilder().mergeFrom(value);
} else {
lifetime_ = value;
}
} else {
lifetimeBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public Builder clearLifetime() {
bitField0_ = (bitField0_ & ~0x00000010);
lifetime_ = null;
if (lifetimeBuilder_ != null) {
lifetimeBuilder_.dispose();
lifetimeBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public com.google.protobuf.Duration.Builder getLifetimeBuilder() {
bitField0_ |= 0x00000010;
onChanged();
return getLifetimeFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
public com.google.protobuf.DurationOrBuilder getLifetimeOrBuilder() {
if (lifetimeBuilder_ != null) {
return lifetimeBuilder_.getMessageOrBuilder();
} else {
return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_;
}
}
/**
*
*
* <pre>
* Required. The desired lifetime of the CA certificate. Used to create the
* "not_before_time" and "not_after_time" fields inside an X.509
* certificate.
* </pre>
*
* <code>.google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
getLifetimeFieldBuilder() {
if (lifetimeBuilder_ == null) {
lifetimeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>(
getLifetime(), getParentForChildren(), isClean());
lifetime_ = null;
}
return lifetimeBuilder_;
}
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
keySpec_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.KeyVersionSpecOrBuilder>
keySpecBuilder_;
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return Whether the keySpec field is set.
*/
public boolean hasKeySpec() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*
* @return The keySpec.
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
getKeySpec() {
if (keySpecBuilder_ == null) {
return keySpec_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.getDefaultInstance()
: keySpec_;
} else {
return keySpecBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public Builder setKeySpec(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec value) {
if (keySpecBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
keySpec_ = value;
} else {
keySpecBuilder_.setMessage(value);
}
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public Builder setKeySpec(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.Builder
builderForValue) {
if (keySpecBuilder_ == null) {
keySpec_ = builderForValue.build();
} else {
keySpecBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public Builder mergeKeySpec(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec value) {
if (keySpecBuilder_ == null) {
if (((bitField0_ & 0x00000020) != 0)
&& keySpec_ != null
&& keySpec_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.getDefaultInstance()) {
getKeySpecBuilder().mergeFrom(value);
} else {
keySpec_ = value;
}
} else {
keySpecBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public Builder clearKeySpec() {
bitField0_ = (bitField0_ & ~0x00000020);
keySpec_ = null;
if (keySpecBuilder_ != null) {
keySpecBuilder_.dispose();
keySpecBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.Builder
getKeySpecBuilder() {
bitField0_ |= 0x00000020;
onChanged();
return getKeySpecFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpecOrBuilder
getKeySpecOrBuilder() {
if (keySpecBuilder_ != null) {
return keySpecBuilder_.getMessageOrBuilder();
} else {
return keySpec_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.getDefaultInstance()
: keySpec_;
}
}
/**
*
*
* <pre>
* Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key
* is also used to sign the self-signed CA certificate. Otherwise, it
* is used to sign a CSR.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec key_spec = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.KeyVersionSpecOrBuilder>
getKeySpecFieldBuilder() {
if (keySpecBuilder_ == null) {
keySpecBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec
.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.KeyVersionSpecOrBuilder>(getKeySpec(), getParentForChildren(), isClean());
keySpec_ = null;
}
return keySpecBuilder_;
}
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
certificatePolicy_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicyOrBuilder>
certificatePolicyBuilder_;
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the certificatePolicy field is set.
*/
public boolean hasCertificatePolicy() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The certificatePolicy.
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy
getCertificatePolicy() {
if (certificatePolicyBuilder_ == null) {
return certificatePolicy_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.getDefaultInstance()
: certificatePolicy_;
} else {
return certificatePolicyBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setCertificatePolicy(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
value) {
if (certificatePolicyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
certificatePolicy_ = value;
} else {
certificatePolicyBuilder_.setMessage(value);
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setCertificatePolicy(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
.Builder
builderForValue) {
if (certificatePolicyBuilder_ == null) {
certificatePolicy_ = builderForValue.build();
} else {
certificatePolicyBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeCertificatePolicy(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy
value) {
if (certificatePolicyBuilder_ == null) {
if (((bitField0_ & 0x00000040) != 0)
&& certificatePolicy_ != null
&& certificatePolicy_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.getDefaultInstance()) {
getCertificatePolicyBuilder().mergeFrom(value);
} else {
certificatePolicy_ = value;
}
} else {
certificatePolicyBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearCertificatePolicy() {
bitField0_ = (bitField0_ & ~0x00000040);
certificatePolicy_ = null;
if (certificatePolicyBuilder_ != null) {
certificatePolicyBuilder_.dispose();
certificatePolicyBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.Builder
getCertificatePolicyBuilder() {
bitField0_ |= 0x00000040;
onChanged();
return getCertificatePolicyFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicyOrBuilder
getCertificatePolicyOrBuilder() {
if (certificatePolicyBuilder_ != null) {
return certificatePolicyBuilder_.getMessageOrBuilder();
} else {
return certificatePolicy_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.getDefaultInstance()
: certificatePolicy_;
}
}
/**
*
*
* <pre>
* Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing
* [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy certificate_policy = 7 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicyOrBuilder>
getCertificatePolicyFieldBuilder() {
if (certificatePolicyBuilder_ == null) {
certificatePolicyBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicy.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.CertificateAuthorityPolicyOrBuilder>(
getCertificatePolicy(), getParentForChildren(), isClean());
certificatePolicy_ = null;
}
return certificatePolicyBuilder_;
}
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
issuingOptions_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.IssuingOptionsOrBuilder>
issuingOptionsBuilder_;
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the issuingOptions field is set.
*/
public boolean hasIssuingOptions() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The issuingOptions.
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
getIssuingOptions() {
if (issuingOptionsBuilder_ == null) {
return issuingOptions_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.getDefaultInstance()
: issuingOptions_;
} else {
return issuingOptionsBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setIssuingOptions(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions value) {
if (issuingOptionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
issuingOptions_ = value;
} else {
issuingOptionsBuilder_.setMessage(value);
}
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setIssuingOptions(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.Builder
builderForValue) {
if (issuingOptionsBuilder_ == null) {
issuingOptions_ = builderForValue.build();
} else {
issuingOptionsBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeIssuingOptions(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions value) {
if (issuingOptionsBuilder_ == null) {
if (((bitField0_ & 0x00000080) != 0)
&& issuingOptions_ != null
&& issuingOptions_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.getDefaultInstance()) {
getIssuingOptionsBuilder().mergeFrom(value);
} else {
issuingOptions_ = value;
}
} else {
issuingOptionsBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearIssuingOptions() {
bitField0_ = (bitField0_ & ~0x00000080);
issuingOptions_ = null;
if (issuingOptionsBuilder_ != null) {
issuingOptionsBuilder_.dispose();
issuingOptionsBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.Builder
getIssuingOptionsBuilder() {
bitField0_ |= 0x00000080;
onChanged();
return getIssuingOptionsFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptionsOrBuilder
getIssuingOptionsOrBuilder() {
if (issuingOptionsBuilder_ != null) {
return issuingOptionsBuilder_.getMessageOrBuilder();
} else {
return issuingOptions_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.getDefaultInstance()
: issuingOptions_;
}
}
/**
*
*
* <pre>
* Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate]
* from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions issuing_options = 8 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.IssuingOptionsOrBuilder>
getIssuingOptionsFieldBuilder() {
if (issuingOptionsBuilder_ == null) {
issuingOptionsBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions
.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.IssuingOptionsOrBuilder>(
getIssuingOptions(), getParentForChildren(), isClean());
issuingOptions_ = null;
}
return issuingOptionsBuilder_;
}
private com.google.cloud.security.privateca.v1beta1.SubordinateConfig subordinateConfig_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.SubordinateConfig,
com.google.cloud.security.privateca.v1beta1.SubordinateConfig.Builder,
com.google.cloud.security.privateca.v1beta1.SubordinateConfigOrBuilder>
subordinateConfigBuilder_;
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the subordinateConfig field is set.
*/
public boolean hasSubordinateConfig() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The subordinateConfig.
*/
public com.google.cloud.security.privateca.v1beta1.SubordinateConfig getSubordinateConfig() {
if (subordinateConfigBuilder_ == null) {
return subordinateConfig_ == null
? com.google.cloud.security.privateca.v1beta1.SubordinateConfig.getDefaultInstance()
: subordinateConfig_;
} else {
return subordinateConfigBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setSubordinateConfig(
com.google.cloud.security.privateca.v1beta1.SubordinateConfig value) {
if (subordinateConfigBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
subordinateConfig_ = value;
} else {
subordinateConfigBuilder_.setMessage(value);
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setSubordinateConfig(
com.google.cloud.security.privateca.v1beta1.SubordinateConfig.Builder builderForValue) {
if (subordinateConfigBuilder_ == null) {
subordinateConfig_ = builderForValue.build();
} else {
subordinateConfigBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeSubordinateConfig(
com.google.cloud.security.privateca.v1beta1.SubordinateConfig value) {
if (subordinateConfigBuilder_ == null) {
if (((bitField0_ & 0x00000100) != 0)
&& subordinateConfig_ != null
&& subordinateConfig_
!= com.google.cloud.security.privateca.v1beta1.SubordinateConfig
.getDefaultInstance()) {
getSubordinateConfigBuilder().mergeFrom(value);
} else {
subordinateConfig_ = value;
}
} else {
subordinateConfigBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearSubordinateConfig() {
bitField0_ = (bitField0_ & ~0x00000100);
subordinateConfig_ = null;
if (subordinateConfigBuilder_ != null) {
subordinateConfigBuilder_.dispose();
subordinateConfigBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.SubordinateConfig.Builder
getSubordinateConfigBuilder() {
bitField0_ |= 0x00000100;
onChanged();
return getSubordinateConfigFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.SubordinateConfigOrBuilder
getSubordinateConfigOrBuilder() {
if (subordinateConfigBuilder_ != null) {
return subordinateConfigBuilder_.getMessageOrBuilder();
} else {
return subordinateConfig_ == null
? com.google.cloud.security.privateca.v1beta1.SubordinateConfig.getDefaultInstance()
: subordinateConfig_;
}
}
/**
*
*
* <pre>
* Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set
* with the subordinate configuration, which describes its issuers. This may
* be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.SubordinateConfig subordinate_config = 19 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.SubordinateConfig,
com.google.cloud.security.privateca.v1beta1.SubordinateConfig.Builder,
com.google.cloud.security.privateca.v1beta1.SubordinateConfigOrBuilder>
getSubordinateConfigFieldBuilder() {
if (subordinateConfigBuilder_ == null) {
subordinateConfigBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.SubordinateConfig,
com.google.cloud.security.privateca.v1beta1.SubordinateConfig.Builder,
com.google.cloud.security.privateca.v1beta1.SubordinateConfigOrBuilder>(
getSubordinateConfig(), getParentForChildren(), isClean());
subordinateConfig_ = null;
}
return subordinateConfigBuilder_;
}
private int state_ = 0;
/**
*
*
* <pre>
* Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
/**
*
*
* <pre>
* Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param value The enum numeric value on the wire for state to set.
* @return This builder for chaining.
*/
public Builder setStateValue(int value) {
state_ = value;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The state.
*/
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State getState() {
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State result =
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.forNumber(state_);
return result == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.UNRECOGNIZED
: result;
}
/**
*
*
* <pre>
* Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param value The state to set.
* @return This builder for chaining.
*/
public Builder setState(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.State value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000200;
state_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearState() {
bitField0_ = (bitField0_ & ~0x00000200);
state_ = 0;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList pemCaCertificates_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensurePemCaCertificatesIsMutable() {
if (!pemCaCertificates_.isModifiable()) {
pemCaCertificates_ = new com.google.protobuf.LazyStringArrayList(pemCaCertificates_);
}
bitField0_ |= 0x00000400;
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return A list containing the pemCaCertificates.
*/
public com.google.protobuf.ProtocolStringList getPemCaCertificatesList() {
pemCaCertificates_.makeImmutable();
return pemCaCertificates_;
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The count of pemCaCertificates.
*/
public int getPemCaCertificatesCount() {
return pemCaCertificates_.size();
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param index The index of the element to return.
* @return The pemCaCertificates at the given index.
*/
public java.lang.String getPemCaCertificates(int index) {
return pemCaCertificates_.get(index);
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param index The index of the value to return.
* @return The bytes of the pemCaCertificates at the given index.
*/
public com.google.protobuf.ByteString getPemCaCertificatesBytes(int index) {
return pemCaCertificates_.getByteString(index);
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param index The index to set the value at.
* @param value The pemCaCertificates to set.
* @return This builder for chaining.
*/
public Builder setPemCaCertificates(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensurePemCaCertificatesIsMutable();
pemCaCertificates_.set(index, value);
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param value The pemCaCertificates to add.
* @return This builder for chaining.
*/
public Builder addPemCaCertificates(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensurePemCaCertificatesIsMutable();
pemCaCertificates_.add(value);
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param values The pemCaCertificates to add.
* @return This builder for chaining.
*/
public Builder addAllPemCaCertificates(java.lang.Iterable<java.lang.String> values) {
ensurePemCaCertificatesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pemCaCertificates_);
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearPemCaCertificates() {
pemCaCertificates_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000400);
;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current
* [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer
* is the final element (consistent with RFC 5246). For a self-signed CA, this
* will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate.
* </pre>
*
* <code>repeated string pem_ca_certificates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @param value The bytes of the pemCaCertificates to add.
* @return This builder for chaining.
*/
public Builder addPemCaCertificatesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensurePemCaCertificatesIsMutable();
pemCaCertificates_.add(value);
bitField0_ |= 0x00000400;
onChanged();
return this;
}
private java.util.List<com.google.cloud.security.privateca.v1beta1.CertificateDescription>
caCertificateDescriptions_ = java.util.Collections.emptyList();
private void ensureCaCertificateDescriptionsIsMutable() {
if (!((bitField0_ & 0x00000800) != 0)) {
caCertificateDescriptions_ =
new java.util.ArrayList<
com.google.cloud.security.privateca.v1beta1.CertificateDescription>(
caCertificateDescriptions_);
bitField0_ |= 0x00000800;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateDescription,
com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateDescriptionOrBuilder>
caCertificateDescriptionsBuilder_;
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public java.util.List<com.google.cloud.security.privateca.v1beta1.CertificateDescription>
getCaCertificateDescriptionsList() {
if (caCertificateDescriptionsBuilder_ == null) {
return java.util.Collections.unmodifiableList(caCertificateDescriptions_);
} else {
return caCertificateDescriptionsBuilder_.getMessageList();
}
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public int getCaCertificateDescriptionsCount() {
if (caCertificateDescriptionsBuilder_ == null) {
return caCertificateDescriptions_.size();
} else {
return caCertificateDescriptionsBuilder_.getCount();
}
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateDescription
getCaCertificateDescriptions(int index) {
if (caCertificateDescriptionsBuilder_ == null) {
return caCertificateDescriptions_.get(index);
} else {
return caCertificateDescriptionsBuilder_.getMessage(index);
}
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setCaCertificateDescriptions(
int index, com.google.cloud.security.privateca.v1beta1.CertificateDescription value) {
if (caCertificateDescriptionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.set(index, value);
onChanged();
} else {
caCertificateDescriptionsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setCaCertificateDescriptions(
int index,
com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder
builderForValue) {
if (caCertificateDescriptionsBuilder_ == null) {
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.set(index, builderForValue.build());
onChanged();
} else {
caCertificateDescriptionsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder addCaCertificateDescriptions(
com.google.cloud.security.privateca.v1beta1.CertificateDescription value) {
if (caCertificateDescriptionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.add(value);
onChanged();
} else {
caCertificateDescriptionsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder addCaCertificateDescriptions(
int index, com.google.cloud.security.privateca.v1beta1.CertificateDescription value) {
if (caCertificateDescriptionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.add(index, value);
onChanged();
} else {
caCertificateDescriptionsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder addCaCertificateDescriptions(
com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder
builderForValue) {
if (caCertificateDescriptionsBuilder_ == null) {
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.add(builderForValue.build());
onChanged();
} else {
caCertificateDescriptionsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder addCaCertificateDescriptions(
int index,
com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder
builderForValue) {
if (caCertificateDescriptionsBuilder_ == null) {
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.add(index, builderForValue.build());
onChanged();
} else {
caCertificateDescriptionsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder addAllCaCertificateDescriptions(
java.lang.Iterable<
? extends com.google.cloud.security.privateca.v1beta1.CertificateDescription>
values) {
if (caCertificateDescriptionsBuilder_ == null) {
ensureCaCertificateDescriptionsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, caCertificateDescriptions_);
onChanged();
} else {
caCertificateDescriptionsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder clearCaCertificateDescriptions() {
if (caCertificateDescriptionsBuilder_ == null) {
caCertificateDescriptions_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000800);
onChanged();
} else {
caCertificateDescriptionsBuilder_.clear();
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder removeCaCertificateDescriptions(int index) {
if (caCertificateDescriptionsBuilder_ == null) {
ensureCaCertificateDescriptionsIsMutable();
caCertificateDescriptions_.remove(index);
onChanged();
} else {
caCertificateDescriptionsBuilder_.remove(index);
}
return this;
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder
getCaCertificateDescriptionsBuilder(int index) {
return getCaCertificateDescriptionsFieldBuilder().getBuilder(index);
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateDescriptionOrBuilder
getCaCertificateDescriptionsOrBuilder(int index) {
if (caCertificateDescriptionsBuilder_ == null) {
return caCertificateDescriptions_.get(index);
} else {
return caCertificateDescriptionsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public java.util.List<
? extends com.google.cloud.security.privateca.v1beta1.CertificateDescriptionOrBuilder>
getCaCertificateDescriptionsOrBuilderList() {
if (caCertificateDescriptionsBuilder_ != null) {
return caCertificateDescriptionsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(caCertificateDescriptions_);
}
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder
addCaCertificateDescriptionsBuilder() {
return getCaCertificateDescriptionsFieldBuilder()
.addBuilder(
com.google.cloud.security.privateca.v1beta1.CertificateDescription
.getDefaultInstance());
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder
addCaCertificateDescriptionsBuilder(int index) {
return getCaCertificateDescriptionsFieldBuilder()
.addBuilder(
index,
com.google.cloud.security.privateca.v1beta1.CertificateDescription
.getDefaultInstance());
}
/**
*
*
* <pre>
* Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate
* and its issuers. Ordered as self-to-root.
* </pre>
*
* <code>
* repeated .google.cloud.security.privateca.v1beta1.CertificateDescription ca_certificate_descriptions = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public java.util.List<
com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder>
getCaCertificateDescriptionsBuilderList() {
return getCaCertificateDescriptionsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateDescription,
com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateDescriptionOrBuilder>
getCaCertificateDescriptionsFieldBuilder() {
if (caCertificateDescriptionsBuilder_ == null) {
caCertificateDescriptionsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateDescription,
com.google.cloud.security.privateca.v1beta1.CertificateDescription.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateDescriptionOrBuilder>(
caCertificateDescriptions_,
((bitField0_ & 0x00000800) != 0),
getParentForChildren(),
isClean());
caCertificateDescriptions_ = null;
}
return caCertificateDescriptionsBuilder_;
}
private java.lang.Object gcsBucket_ = "";
/**
*
*
* <pre>
* Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will
* publish content, such as the CA certificate and CRLs. This must be a bucket
* name, without any prefixes (such as `gs://`) or suffixes (such as
* `.googleapis.com`). For example, to use a bucket named `my-bucket`, you
* would simply specify `my-bucket`. If not specified, a managed bucket will
* be created.
* </pre>
*
* <code>string gcs_bucket = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
*
* @return The gcsBucket.
*/
public java.lang.String getGcsBucket() {
java.lang.Object ref = gcsBucket_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
gcsBucket_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will
* publish content, such as the CA certificate and CRLs. This must be a bucket
* name, without any prefixes (such as `gs://`) or suffixes (such as
* `.googleapis.com`). For example, to use a bucket named `my-bucket`, you
* would simply specify `my-bucket`. If not specified, a managed bucket will
* be created.
* </pre>
*
* <code>string gcs_bucket = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
*
* @return The bytes for gcsBucket.
*/
public com.google.protobuf.ByteString getGcsBucketBytes() {
java.lang.Object ref = gcsBucket_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
gcsBucket_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will
* publish content, such as the CA certificate and CRLs. This must be a bucket
* name, without any prefixes (such as `gs://`) or suffixes (such as
* `.googleapis.com`). For example, to use a bucket named `my-bucket`, you
* would simply specify `my-bucket`. If not specified, a managed bucket will
* be created.
* </pre>
*
* <code>string gcs_bucket = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
*
* @param value The gcsBucket to set.
* @return This builder for chaining.
*/
public Builder setGcsBucket(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
gcsBucket_ = value;
bitField0_ |= 0x00001000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will
* publish content, such as the CA certificate and CRLs. This must be a bucket
* name, without any prefixes (such as `gs://`) or suffixes (such as
* `.googleapis.com`). For example, to use a bucket named `my-bucket`, you
* would simply specify `my-bucket`. If not specified, a managed bucket will
* be created.
* </pre>
*
* <code>string gcs_bucket = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
*
* @return This builder for chaining.
*/
public Builder clearGcsBucket() {
gcsBucket_ = getDefaultInstance().getGcsBucket();
bitField0_ = (bitField0_ & ~0x00001000);
onChanged();
return this;
}
/**
*
*
* <pre>
* Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will
* publish content, such as the CA certificate and CRLs. This must be a bucket
* name, without any prefixes (such as `gs://`) or suffixes (such as
* `.googleapis.com`). For example, to use a bucket named `my-bucket`, you
* would simply specify `my-bucket`. If not specified, a managed bucket will
* be created.
* </pre>
*
* <code>string gcs_bucket = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
*
* @param value The bytes for gcsBucket to set.
* @return This builder for chaining.
*/
public Builder setGcsBucketBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
gcsBucket_ = value;
bitField0_ |= 0x00001000;
onChanged();
return this;
}
private com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls accessUrls_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrlsOrBuilder>
accessUrlsBuilder_;
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the accessUrls field is set.
*/
public boolean hasAccessUrls() {
return ((bitField0_ & 0x00002000) != 0);
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The accessUrls.
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
getAccessUrls() {
if (accessUrlsBuilder_ == null) {
return accessUrls_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
.getDefaultInstance()
: accessUrls_;
} else {
return accessUrlsBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setAccessUrls(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls value) {
if (accessUrlsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
accessUrls_ = value;
} else {
accessUrlsBuilder_.setMessage(value);
}
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setAccessUrls(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.Builder
builderForValue) {
if (accessUrlsBuilder_ == null) {
accessUrls_ = builderForValue.build();
} else {
accessUrlsBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder mergeAccessUrls(
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls value) {
if (accessUrlsBuilder_ == null) {
if (((bitField0_ & 0x00002000) != 0)
&& accessUrls_ != null
&& accessUrls_
!= com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
.getDefaultInstance()) {
getAccessUrlsBuilder().mergeFrom(value);
} else {
accessUrls_ = value;
}
} else {
accessUrlsBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder clearAccessUrls() {
bitField0_ = (bitField0_ & ~0x00002000);
accessUrls_ = null;
if (accessUrlsBuilder_ != null) {
accessUrlsBuilder_.dispose();
accessUrlsBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.Builder
getAccessUrlsBuilder() {
bitField0_ |= 0x00002000;
onChanged();
return getAccessUrlsFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrlsOrBuilder
getAccessUrlsOrBuilder() {
if (accessUrlsBuilder_ != null) {
return accessUrlsBuilder_.getMessageOrBuilder();
} else {
return accessUrls_ == null
? com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls
.getDefaultInstance()
: accessUrls_;
}
}
/**
*
*
* <pre>
* Output only. URLs for accessing content published by this CA, such as the CA certificate
* and CRLs.
* </pre>
*
* <code>
* .google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls access_urls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrlsOrBuilder>
getAccessUrlsFieldBuilder() {
if (accessUrlsBuilder_ == null) {
accessUrlsBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.Builder,
com.google.cloud.security.privateca.v1beta1.CertificateAuthority
.AccessUrlsOrBuilder>(getAccessUrls(), getParentForChildren(), isClean());
accessUrls_ = null;
}
return accessUrlsBuilder_;
}
private com.google.protobuf.Timestamp createTime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
createTimeBuilder_;
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the createTime field is set.
*/
public boolean hasCreateTime() {
return ((bitField0_ & 0x00004000) != 0);
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The createTime.
*/
public com.google.protobuf.Timestamp getCreateTime() {
if (createTimeBuilder_ == null) {
return createTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: createTime_;
} else {
return createTimeBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setCreateTime(com.google.protobuf.Timestamp value) {
if (createTimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
createTime_ = value;
} else {
createTimeBuilder_.setMessage(value);
}
bitField0_ |= 0x00004000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
if (createTimeBuilder_ == null) {
createTime_ = builderForValue.build();
} else {
createTimeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00004000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
if (createTimeBuilder_ == null) {
if (((bitField0_ & 0x00004000) != 0)
&& createTime_ != null
&& createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
getCreateTimeBuilder().mergeFrom(value);
} else {
createTime_ = value;
}
} else {
createTimeBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00004000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder clearCreateTime() {
bitField0_ = (bitField0_ & ~0x00004000);
createTime_ = null;
if (createTimeBuilder_ != null) {
createTimeBuilder_.dispose();
createTimeBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
bitField0_ |= 0x00004000;
onChanged();
return getCreateTimeFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
if (createTimeBuilder_ != null) {
return createTimeBuilder_.getMessageOrBuilder();
} else {
return createTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: createTime_;
}
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp create_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
getCreateTimeFieldBuilder() {
if (createTimeBuilder_ == null) {
createTimeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>(
getCreateTime(), getParentForChildren(), isClean());
createTime_ = null;
}
return createTimeBuilder_;
}
private com.google.protobuf.Timestamp updateTime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
updateTimeBuilder_;
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the updateTime field is set.
*/
public boolean hasUpdateTime() {
return ((bitField0_ & 0x00008000) != 0);
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The updateTime.
*/
public com.google.protobuf.Timestamp getUpdateTime() {
if (updateTimeBuilder_ == null) {
return updateTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: updateTime_;
} else {
return updateTimeBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setUpdateTime(com.google.protobuf.Timestamp value) {
if (updateTimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
updateTime_ = value;
} else {
updateTimeBuilder_.setMessage(value);
}
bitField0_ |= 0x00008000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
if (updateTimeBuilder_ == null) {
updateTime_ = builderForValue.build();
} else {
updateTimeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00008000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) {
if (updateTimeBuilder_ == null) {
if (((bitField0_ & 0x00008000) != 0)
&& updateTime_ != null
&& updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
getUpdateTimeBuilder().mergeFrom(value);
} else {
updateTime_ = value;
}
} else {
updateTimeBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00008000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder clearUpdateTime() {
bitField0_ = (bitField0_ & ~0x00008000);
updateTime_ = null;
if (updateTimeBuilder_ != null) {
updateTimeBuilder_.dispose();
updateTimeBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() {
bitField0_ |= 0x00008000;
onChanged();
return getUpdateTimeFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
if (updateTimeBuilder_ != null) {
return updateTimeBuilder_.getMessageOrBuilder();
} else {
return updateTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: updateTime_;
}
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated.
* </pre>
*
* <code>
* .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
getUpdateTimeFieldBuilder() {
if (updateTimeBuilder_ == null) {
updateTimeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>(
getUpdateTime(), getParentForChildren(), isClean());
updateTime_ = null;
}
return updateTimeBuilder_;
}
private com.google.protobuf.Timestamp deleteTime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
deleteTimeBuilder_;
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the deleteTime field is set.
*/
public boolean hasDeleteTime() {
return ((bitField0_ & 0x00010000) != 0);
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The deleteTime.
*/
public com.google.protobuf.Timestamp getDeleteTime() {
if (deleteTimeBuilder_ == null) {
return deleteTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: deleteTime_;
} else {
return deleteTimeBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setDeleteTime(com.google.protobuf.Timestamp value) {
if (deleteTimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
deleteTime_ = value;
} else {
deleteTimeBuilder_.setMessage(value);
}
bitField0_ |= 0x00010000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) {
if (deleteTimeBuilder_ == null) {
deleteTime_ = builderForValue.build();
} else {
deleteTimeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00010000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) {
if (deleteTimeBuilder_ == null) {
if (((bitField0_ & 0x00010000) != 0)
&& deleteTime_ != null
&& deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
getDeleteTimeBuilder().mergeFrom(value);
} else {
deleteTime_ = value;
}
} else {
deleteTimeBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00010000;
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder clearDeleteTime() {
bitField0_ = (bitField0_ & ~0x00010000);
deleteTime_ = null;
if (deleteTimeBuilder_ != null) {
deleteTimeBuilder_.dispose();
deleteTimeBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() {
bitField0_ |= 0x00010000;
onChanged();
return getDeleteTimeFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() {
if (deleteTimeBuilder_ != null) {
return deleteTimeBuilder_.getMessageOrBuilder();
} else {
return deleteTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: deleteTime_;
}
}
/**
*
*
* <pre>
* Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if
* scheduled for deletion.
* </pre>
*
* <code>
* .google.protobuf.Timestamp delete_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
getDeleteTimeFieldBuilder() {
if (deleteTimeBuilder_ == null) {
deleteTimeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>(
getDeleteTime(), getParentForChildren(), isClean());
deleteTime_ = null;
}
return deleteTimeBuilder_;
}
private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;
private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
if (labels_ == null) {
return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
}
return labels_;
}
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetMutableLabels() {
if (labels_ == null) {
labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
}
if (!labels_.isMutable()) {
labels_ = labels_.copy();
}
bitField0_ |= 0x00020000;
onChanged();
return labels_;
}
public int getLabelsCount() {
return internalGetLabels().getMap().size();
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
@java.lang.Override
public boolean containsLabels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLabels().getMap().containsKey(key);
}
/** Use {@link #getLabelsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map<java.lang.String, java.lang.String> getLabels() {
return getLabelsMap();
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
@java.lang.Override
public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
return internalGetLabels().getMap();
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
@java.lang.Override
public /* nullable */ java.lang.String getLabelsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
@java.lang.Override
public java.lang.String getLabelsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearLabels() {
bitField0_ = (bitField0_ & ~0x00020000);
internalGetMutableLabels().getMutableMap().clear();
return this;
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
public Builder removeLabels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableLabels().getMutableMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() {
bitField0_ |= 0x00020000;
return internalGetMutableLabels().getMutableMap();
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
public Builder putLabels(java.lang.String key, java.lang.String value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableLabels().getMutableMap().put(key, value);
bitField0_ |= 0x00020000;
return this;
}
/**
*
*
* <pre>
* Optional. Labels with user-defined metadata.
* </pre>
*
* <code>map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
internalGetMutableLabels().getMutableMap().putAll(values);
bitField0_ |= 0x00020000;
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:google.cloud.security.privateca.v1beta1.CertificateAuthority)
}
// @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.CertificateAuthority)
private static final com.google.cloud.security.privateca.v1beta1.CertificateAuthority
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.security.privateca.v1beta1.CertificateAuthority();
}
public static com.google.cloud.security.privateca.v1beta1.CertificateAuthority
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<CertificateAuthority> PARSER =
new com.google.protobuf.AbstractParser<CertificateAuthority>() {
@java.lang.Override
public CertificateAuthority parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<CertificateAuthority> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<CertificateAuthority> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.security.privateca.v1beta1.CertificateAuthority
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| true |
ed4beec226ba413db8148ed20343431a1d66cb13 | Java | zhangzaixing/eddue-jms | /eddue-jms-kafka/src/main/java/com/eddue/jms/core/kafka/partitions/RandomPartitioner.java | UTF-8 | 780 | 2.390625 | 2 | [] | no_license | package com.eddue.jms.core.kafka.partitions;
import com.eddue.jms.core.utils.RandomUtils;
import kafka.producer.Partitioner;
import kafka.utils.VerifiableProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author cruise.xu
*
*/
@SuppressWarnings("deprecation")
public class RandomPartitioner implements Partitioner {
private final static Logger logger = LoggerFactory.getLogger(RandomPartitioner.class);
public RandomPartitioner(VerifiableProperties props) {
}
@Override
public int partition(Object key, int numPartitions) {
int partition = RandomUtils.genRandom(numPartitions);
if(logger.isDebugEnabled()) {
logger.debug("The numPartitions = " + numPartitions + " and Random partition = " + partition);
}
return partition;
}
}
| true |
ea4f27c2e44b7a53d7ae8ee4c7dded3c45022390 | Java | king5585618/epop | /epop-service/src/main/java/com/huotu/epop/service/ServiceConfig.java | UTF-8 | 1,127 | 1.734375 | 2 | [] | no_license | /*
* 版权所有:杭州火图科技有限公司
* 地址:浙江省杭州市滨江区西兴街道阡陌路智慧E谷B幢4楼
*
* (c) Copyright Hangzhou Hot Technology Co., Ltd.
* Floor 4,Block B,Wisdom E Valley,Qianmo Road,Binjiang District
* 2013-2016. All rights reserved.
*/
package com.huotu.epop.service;
import com.huotu.epop.service.support.BaseRepositoryFactoryBean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* Created by jinzj on 2016/6/8.
*/
@Configuration
@ComponentScan({"com.huotu.epop.service.service","com.huotu.epop.service.aspect"})
/**
* 使用自定义的repository
*/
@EnableJpaRepositories(value = {"com.huotu.epop.service.repository"},repositoryFactoryBeanClass = BaseRepositoryFactoryBean.class)
@EnableAspectJAutoProxy
@EnableTransactionManagement
public class ServiceConfig {
}
| true |
a1ac13db7a2a68b07de58c14211f6f4ef2f2aba8 | Java | brandonruoff8/pokemon-battle | /src/DefaultPokemon/Pokemon.java | UTF-8 | 1,656 | 3.25 | 3 | [] | no_license | package DefaultPokemon;
public class Pokemon {
private String name;
private Type type1;
private Type type2;
private final int level = 50;
private int stats[] = new int[6];
private int currentHP;
private Move moves[] = new Move[4];
public Pokemon(){
name = "NoName";
type1 = new Type();
type2 = new Type();
}
public Pokemon(String tempName,
Type tempType1,
Type tempType2,
int hpStat,
int attackStat,
int defenseStat,
int spAtkStat,
int spDefStat,
int speedStat,
Move move1,
Move move2,
Move move3,
Move move4) {
name = tempName;
type1 = tempType1;
type2 = tempType2;
stats[0] = hpStat;
stats[1] = attackStat;
stats[2] = defenseStat;
stats[3] = spAtkStat;
stats[4] = spDefStat;
stats[5] = speedStat;
currentHP = stats[0];
moves[0] = move1;
moves[1] = move2;
moves[2] = move3;
moves[3] = move4;
}
public String getName() {
return name;
}
public void changeName(String tempName) {
name = tempName;
}
public Type getType1() {
return type1;
}
public Type getType2() {
return type2;
}
public int getLevel() {
return level;
}
public int getCurrentHP() {
return currentHP;
}
public int getHP() {
return stats[0];
}
public int getAttack() {
return stats[1];
}
public int getDefense() {
return stats[2];
}
public int getSpAtk() {
return stats[3];
}
public int getSpDef() {
return stats[4];
}
public int getSpeed() {
return stats[5];
}
public Move[] getMoves() {
return moves;
}
}
| true |
af14abbdc134d54d9cef41963bda0d341c31cc12 | Java | JurajKub/ElasticAppender | /src/main/java/com/jkubinyi/elasticappender/NodeConnection.java | UTF-8 | 2,865 | 2.578125 | 3 | [] | no_license | package com.jkubinyi.elasticappender;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Node;
import java.net.InetAddress;
import org.apache.http.HttpHost;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
import org.apache.logging.log4j.core.config.plugins.validation.constraints.ValidHost;
import org.apache.logging.log4j.core.config.plugins.validation.constraints.ValidPort;
import org.apache.logging.log4j.status.StatusLogger;
@Plugin(name = "NodeConnection", category = Node.CATEGORY, printObject = true)
public class NodeConnection {
private HttpHost httpHost;
private static final Logger LOGGER = StatusLogger.getLogger();
private NodeConnection(InetAddress host, int port, String scheme) {
this.httpHost = new HttpHost(host, port, scheme);
}
public static NodeConnection fromLocalhost() {
return new NodeConnection(InetAddress.getLoopbackAddress(), 9200, "http");
}
public HttpHost getHttpHost() {
return this.httpHost;
}
@PluginBuilderFactory
public static Builder newBuilder() {
return new Builder();
}
/**
* @return A short description of the NodeConnection. The format is
* NOT specified and is subject to change without further notices.
* The following example may be shown as standard:
* "ELASTICSEARCH: NodeConnection[http://localhost:9200]"
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("ELASTICSEARCH:NodeConnection[")
.append(httpHost.toString())
.append("]");
return sb.toString();
}
public static class Builder
implements org.apache.logging.log4j.core.util.Builder<NodeConnection> {
@PluginBuilderAttribute
private String scheme;
@PluginBuilderAttribute
@ValidHost
private InetAddress host; // Localhost
@PluginBuilderAttribute
@ValidPort
private int port = 9200; // Default Elasticsearch listening REST port
public Builder setScheme(String scheme) {
this.scheme = scheme;
return this;
}
public Builder setHost(InetAddress host) {
this.host = host;
return this;
}
public Builder setPort(int port) {
this.port = port;
return this;
}
@Override
public NodeConnection build() {
if(this.scheme == null) {
LOGGER.warn("Scheme was not set for NodeConnection. Using http as default.");
this.scheme = "http";
}
return new NodeConnection(this.host, this.port, this.scheme);
}
}
}
| true |
9d49384eaa0ec5cda83d2cc811b99c8b2a4a6e31 | Java | yanzhy1001/alogic | /alogic-doer/src/main/java/com/alogic/doer/core/TaskDispatcher.java | UTF-8 | 590 | 2.265625 | 2 | [] | no_license | package com.alogic.doer.core;
import com.alogic.timer.core.Task;
import com.anysoft.util.Configurable;
import com.anysoft.util.Reportable;
import com.anysoft.util.XMLConfigurable;
/**
* 任务分发器
*
* @author duanyy
* @since 1.6.3.4
* @version 1.6.9.2 [20170601 duanyy] <br>
* - 改造TaskCenter模型,以便提供分布式任务处理支持; <br>
*/
public interface TaskDispatcher extends XMLConfigurable,Configurable, Reportable {
/**
* 分发任务
*
* @param queue 队列
* @param task 任务实例
*
*/
public void dispatch(String queue,Task task);
}
| true |
f92cc9d0e1e8e36fcaa36ab3b2d7fbd96c6621cd | Java | asac-geeks/childbook-frontend | /spring-websocket-chat/src/main/java/com/javamaster/controller/MessageController.java | UTF-8 | 1,028 | 2.328125 | 2 | [
"MIT"
] | permissive | package com.javamaster.controller;
import com.javamaster.model.AxisModel;
import com.javamaster.model.MessageModel;
import com.javamaster.storage.UserStorage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.DestinationVariable;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class MessageController {
@Autowired
private SimpMessagingTemplate simpMessagingTemplate;
@MessageMapping("/chat/{to}")
public void sendMessage(@DestinationVariable String to, MessageModel message) {
System.out.println("handling send message: " + message + " to: " + to);
boolean isExists = UserStorage.getInstance().getUsers().contains(to);
if (isExists) {
simpMessagingTemplate.convertAndSend("/topic/messages/" + to, message);
}
}
}
| true |
ff1bf9f0d0251b060a37b2f26f977874db353fa8 | Java | girishydv/Bntm-Processor | /src/main/java/com/bntm/app/dao/impl/ProductPackageDaoImpl.java | UTF-8 | 1,657 | 2.234375 | 2 | [] | no_license | package com.bntm.app.dao.impl;
import org.springframework.stereotype.*;
import com.bntm.app.dao.*;
@Component
public class ProductPackageDaoImpl implements IProductPackageDao {
/*
@PersistenceContext(unitName = "urudb")
EntityManager em;
@Autowired
EntityToModelUtil e2m;
@Autowired
ModelToEntityUtil m2e;
@Override
@Transactional
public String createProduct(EcomProductModel ecomProductModel) {
if(ecomProductModel == null) {
throw new BntmApplicationException("Illegal Product data. Product creation failed.");
}
EcomProduct entity = m2e.convertProductTypeModelToEntity(ecomProductModel);
em.persist(entity);
return entity.getProductId().toString();
}
@Override
@Transactional
public boolean updateProduct(EcomProductModel ecomProductModel) {
if(ecomProductModel == null) {
throw new BntmApplicationException("Illegal Product data. Product creation failed.");
}
EcomProduct entity = m2e.convertProductTypeModelToEntity(ecomProductModel);
em.merge(entity);
return true;
}
@Override
@Transactional
public boolean deleteProduct(EcomProductModel ecomProductModel) {
if(ecomProductModel == null) {
throw new BntmApplicationException("Illegal Product data. Product creation failed.");
}
EcomProduct entity = em.find(EcomProduct.class,ecomProductModel.getProductId());
em.remove(entity);
return true;
}
@Override
public List<EcomCatalogModel> getProductsByCategory(String categoryId) {
// TODO Auto-generated method stub
return null;
}
*/
}
| true |
6bab89fec8c0be1ad2e543ae49d26602ee6c9575 | Java | led-os/guoguoxueyuan | /app/src/main/java/com/test720/grasshoppercollege/module/shuXue/kouSuan/KouSuanTiOneFragment.java | UTF-8 | 7,281 | 2.03125 | 2 | [] | no_license | package com.test720.grasshoppercollege.module.shuXue.kouSuan;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.test720.grasshoppercollege.R;
import com.test720.grasshoppercollege.untils.musicMedia.MusicUntil;
import butterknife.BindView;
import butterknife.OnClick;
/**
* Created by 水东流 on 2018/7/27.
*/
public class KouSuanTiOneFragment extends KouSuanTiMufragment {
StringBuffer stringBuffer = new StringBuffer();
@BindView(R.id.quesitionImg)
ImageView quesitionImg;
MusicUntil musicUntil = new MusicUntil();
@Override
public void onDestroy() {
super.onDestroy();
musicUntil.canlce();
}
@Override
public void TongGuan() {
}
@Override
public String GXShareTitile() {
return "口算练习";
}
@Override
public String corrId() {
return getListBean().getCorr_id();
}
@Override
public String questionId() {
return getListBean().getQuestion_id();
}
@Override
public void initData() {
}
@Override
public void onStart() {
super.onStart();
if (getListBean() != null) {
if (getListBean().getQuestion_content_type().equals("2")) {
quesitionImg.setVisibility(View.VISIBLE);
Glide.with(getActivity()).load(getListBean().getQuestion_content()).into(quesitionImg);
} else {
quesitionImg.setVisibility(View.GONE);
question.setText(getListBean().getQuestion_content());
}
}
}
@Override
public int setlayoutResID() {
// return R.layout.kou_suan_ti_mu;
return R.layout.kou_suan_biao_ge;
}
/*回答*/
private void Toanswer() {
KouSuanTiMuActivity kouSuanTiMuActivity = (KouSuanTiMuActivity) getBaseTiMuActivity();
if (!kouSuanTiMuActivity.isStartplay()) {
ShowToast("点击“开始”按钮,进行口算练习哦!");
return;
}
/*已经作答,则切换下一题*/
if (isAnswer) {
if (getViewPager().getCurrentItem() < getViewPager().getAdapter().getCount() - 1) {
if (kouSuanTiMuActivity.getTimeInt() == 0) {
ShowToast("考核时间到!");
return;
}
getViewPager().setCurrentItem(getViewPager().getCurrentItem() + 1);
} else {
AddGuoGuoDou();
}
} else {
// okText.setTextSize(20);
ok.setTextSize(20);
// okText.setText("下一题");
ok.setText("下一题");
/*如果是订正模式,则订正*/
if (stringBuffer.toString().equals(getListBean().getAnswer().get(0))) {
rightOrWrong.setText("回答正确");
musicUntil.playRaw(getContext(), R.raw.righten);
setAnswerIsRight(true);
getBaseTiMuActivity().setFen(getBaseTiMuActivity().getFen() + 1);
} else {
setAnswerIsRight(false);
rightOrWrong.setText("回答错误");
musicUntil.playRaw(getContext(), R.raw.wrong);
rightOrWrong.setTextColor(getResources().getColor(R.color.red));
if (kouSuanTiMuActivity.getTimeInt() == 0) {
ShowToast("考核时间到!");
return;
}
}
isAnswer = true;
}
}
@OnClick({R.id.fenhao, R.id.dian, R.id.dele, R.id.ok, R.id.one, R.id.two, R.id.three, R.id.four, R.id.five, R.id.six, R.id.seven, R.id.eight, R.id.nine, R.id.zero})
public void onViewClicked(View view) {
if (isAnswer && view.getId() != R.id.ok) return;
switch (view.getId()) {
case R.id.fenhao:
if (stringBuffer.length() > 0 && stringBuffer.indexOf(".") == -1 && stringBuffer.indexOf("/") == -1) {
stringBuffer.append("/");
answer.setText(stringBuffer.toString());
}
break;
case R.id.dian:
if (stringBuffer.length() > 0 && stringBuffer.indexOf(".") == -1 && stringBuffer.indexOf("/") == -1) {
stringBuffer.append(".");
answer.setText(stringBuffer.toString());
}
if (stringBuffer.length() == 0) {
stringBuffer.append("0.");
answer.setText(stringBuffer.toString());
}
break;
case R.id.dele:
if (stringBuffer.length() > 0) {
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
answer.setText(stringBuffer.toString());
}
break;
case R.id.ok:
Toanswer();
break;
case R.id.one:
stringBuffer.append("1");
answer.setText(stringBuffer.toString());
break;
case R.id.two:
stringBuffer.append("2");
answer.setText(stringBuffer.toString());
break;
case R.id.three:
stringBuffer.append("3");
answer.setText(stringBuffer.toString());
break;
case R.id.four:
stringBuffer.append("4");
answer.setText(stringBuffer.toString());
break;
case R.id.five:
stringBuffer.append("5");
answer.setText(stringBuffer.toString());
break;
case R.id.six:
stringBuffer.append("6");
answer.setText(stringBuffer.toString());
break;
case R.id.seven:
stringBuffer.append("7");
answer.setText(stringBuffer.toString());
break;
case R.id.eight:
stringBuffer.append("8");
answer.setText(stringBuffer.toString());
break;
case R.id.nine:
stringBuffer.append("9");
answer.setText(stringBuffer.toString());
break;
case R.id.zero:
stringBuffer.append("0");
answer.setText(stringBuffer.toString());
break;
}
}
@BindView(R.id.question)
TextView question;
@BindView(R.id.answer)
TextView answer;
@BindView(R.id.rightOrWrong)
TextView rightOrWrong;
@BindView(R.id.dian)
Button dian;
@BindView(R.id.dele)
Button dele;
/* @BindView(R.id.okText)
TextView okText;*/
@BindView(R.id.ok)
Button ok;
@BindView(R.id.one)
Button one;
@BindView(R.id.two)
Button two;
@BindView(R.id.three)
Button three;
@BindView(R.id.four)
Button four;
@BindView(R.id.five)
Button five;
@BindView(R.id.six)
Button six;
@BindView(R.id.seven)
Button seven;
@BindView(R.id.eight)
Button eight;
@BindView(R.id.nine)
Button nine;
@BindView(R.id.zero)
Button zero;
}
| true |
3e58f98a05bf0a7a3e4efdcb80ca884fd7cf2720 | Java | chanceramey/Ticket-Functional-Files | /mainSQLite/java/db/daos/SQLAuthTokenDao.java | UTF-8 | 3,857 | 2.640625 | 3 | [] | no_license | package db.daos;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import database.AbstractDaoFactory.DatabaseException;
import database.IAuthTokenDao;
import model.AuthToken;
/**
* Created by tjense25 on 4/9/18.
*/
public class SQLAuthTokenDao extends IAuthTokenDao {
private Connection connection;
public SQLAuthTokenDao(Connection connection) throws DatabaseException {
this.connection = connection;
PreparedStatement stmt = null;
try {
String create = "CREATE TABLE IF NOT EXISTS authtoken (token TEXT PRIMARY KEY NOT NULL, " +
"user TEXT NOT NULL, timestamp DATETIME DEFAULT CURRENT_TIMESTAMP);";
stmt = connection.prepareStatement(create);
stmt.executeUpdate();
} catch (SQLException e) {
throw new DatabaseException();
} finally {
if (stmt != null) try {
stmt.close();
} catch (SQLException e) {
throw new DatabaseException();
}
}
}
@Override
public void addAuth(AuthToken auth) throws DatabaseException {
PreparedStatement stmt = null;
try {
String insert = "INSERT INTO authtoken (token, user) VALUES (?, ?);";
stmt = connection.prepareStatement(insert);
stmt.setString(1, auth.getToken());
stmt.setString(2, auth.getUser());
stmt.executeUpdate();
} catch (SQLException e) {
throw new DatabaseException();
} finally {
if (stmt != null) try {
stmt.close();
} catch (SQLException e) {
throw new DatabaseException();
}
}
}
@Override
public void deleteAuth(String token) throws DatabaseException {
PreparedStatement stmt = null;
try {
String delete = "DELETE FROM authtoken WHERE token = ?;";
stmt = connection.prepareStatement(delete);
stmt.setString(1, token);
stmt.executeUpdate();
} catch (SQLException e) {
throw new DatabaseException();
} finally {
if (stmt != null) try {
stmt.close();
} catch (SQLException e) {
throw new DatabaseException();
}
}
}
@Override
public String getUsername(String token) throws DatabaseException {
PreparedStatement stmt = null;
String userName = null;
ResultSet rs = null;
try {
String query = "SELECT user FROM authtoken WHERE token = ?;";
stmt = connection.prepareStatement(query);
stmt.setString(1, token);
rs = stmt.executeQuery();
if(rs.next()) {
userName = rs.getString(1);
}
} catch (SQLException e) {
throw new DatabaseException();
} finally {
try {
if (stmt != null) stmt.close();
if (rs != null) rs.close();
} catch (SQLException e) {
throw new DatabaseException();
}
}
return userName;
}
@Override
public int clear() throws DatabaseException {
PreparedStatement stmt = null;
int updates = 0;
try {
String delete = "DELETE FROM authtoken;";
stmt = connection.prepareStatement(delete);;
updates = stmt.executeUpdate();
} catch (SQLException e) {
throw new DatabaseException();
} finally {
if (stmt != null) try {
stmt.close();
} catch (SQLException e) {
throw new DatabaseException();
}
}
return updates;
}
}
| true |
946dab7e5b25dc24bda21b72f3a0149109c97fa6 | Java | iKraud/StudyRep | /src/hw02Task3/Person.java | UTF-8 | 1,999 | 3.71875 | 4 | [] | no_license | package hw02Task3;
import java.util.Comparator;
class Person implements Comparable {
private int age;
private String name;
private Sex sex;
public void setAge (int age) {
if (age >= 0 && age <=100) {
this.age = age;
}
}
public int getAge () {
return age;
}
public void setName (int name) {
this.name =
String.valueOf(Character.forDigit (name+10,36)) +
String.valueOf(Character.forDigit (name+11,36)) +
String.valueOf(Character.forDigit (name+12,36)) +
String.valueOf(Character.forDigit (name+13,36)) +
String.valueOf(Character.forDigit (name+14,36)) +
String.valueOf(Character.forDigit (name+15,36));
}
public String getName () {
return name;
}
public void setSex (int sex) {
if (sex == 0) {
this.sex = Sex.MAN;
} else {
this.sex = Sex.WOMAN;
}
}
public Sex getSex () {
return sex;
}
public Person (int age, int name, int sex) {
setAge(age);
setName(name);
setSex(sex);
}
public static void Compare (Person[] p, int element) throws SameNameSameAgeException {
for (int i = 0; i <=element; i++) {
if (i != element) {
if ((p[i].getAge()==p[element].getAge()) &
(p[i].getName().equals(p[element].getName()))) {
throw new SameNameSameAgeException ("У людей с ID "+i+" и "+element+" возраст и имя совпали");
}
}
}
}
@Override
public String toString () {
return ("age="+age +", name="+name +", sex="+sex);
}
@Override
public int compareTo(Object o) {
Person p = (Person)o;
return Comparator.comparing(Person::getSex)
.thenComparing(Person::getAge)
.thenComparing(Person::getName)
.compare(this, p);
}
}
| true |
248080a7390a426719d0f6609b82922eff6fa9b6 | Java | DmitriyShaplov/job4j_fullstack | /notification/src/main/java/ru/shaplov/shop/service/ReadMailImpl.java | UTF-8 | 2,359 | 2.328125 | 2 | [
"Apache-2.0"
] | permissive | package ru.shaplov.shop.service;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import ru.shaplov.shop.domain.Notification;
import javax.mail.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
/**
* @author shaplov
* @since 17.09.2019
*/
@Service
public class ReadMailImpl implements ReadMail {
private static final Logger LOG = LogManager.getLogger(ReadMailImpl.class);
private final String host;
private final String user;
private final String password;
public ReadMailImpl(@Value("${spring.mail.imap.host}") String host,
@Value("${spring.mail.username}") String user,
@Value("${spring.mail.password}") String password) {
this.host = host;
this.user = user;
this.password = password;
}
@Override
public List<Notification> receiveMessage() {
final var msgs = new ArrayList<Notification>();
try {
Properties properties = new Properties();
properties.setProperty("mail.imap.host", host);
Session emailSession = Session.getDefaultInstance(properties);
Store store = emailSession.getStore("imaps");
store.connect(host, user, password);
Folder inbox = store.getFolder("INBOX");
inbox.open(Folder.READ_ONLY);
for (var msg : inbox.getMessages()) {
String body = "";
Object content = msg.getContent();
if (content instanceof String) {
body = (String) content;
} else if (content instanceof Multipart) {
Multipart multipart = (Multipart) content;
Object o = multipart.getBodyPart(0).getContent();
if (o instanceof String) {
body = (String) o;
}
}
msgs.add(new Notification(null, msg.getFrom()[0].toString(),
msg.getSubject(), body));
}
inbox.close(false);
store.close();
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
return msgs;
}
}
| true |
3cb01be745b7ffffe17d6e8134b0ce780ca1f7eb | Java | abtt-decompiled/abtracetogether_1.0.0.apk_disassembled | /sources\com\google\common\collect\ConcurrentHashMultiset.java | UTF-8 | 14,309 | 2.140625 | 2 | [] | no_license | package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.collect.Multiset.Entry;
import com.google.common.math.IntMath;
import com.google.common.primitives.Ints;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
public final class ConcurrentHashMultiset<E> extends AbstractMultiset<E> implements Serializable {
private static final long serialVersionUID = 1;
/* access modifiers changed from: private */
public final transient ConcurrentMap<E, AtomicInteger> countMap;
private class EntrySet extends EntrySet {
private EntrySet() {
super();
}
/* access modifiers changed from: 0000 */
public ConcurrentHashMultiset<E> multiset() {
return ConcurrentHashMultiset.this;
}
public Object[] toArray() {
return snapshot().toArray();
}
public <T> T[] toArray(T[] tArr) {
return snapshot().toArray(tArr);
}
private List<Entry<E>> snapshot() {
ArrayList newArrayListWithExpectedSize = Lists.newArrayListWithExpectedSize(size());
Iterators.addAll(newArrayListWithExpectedSize, iterator());
return newArrayListWithExpectedSize;
}
}
private static class FieldSettersHolder {
static final FieldSetter<ConcurrentHashMultiset> COUNT_MAP_FIELD_SETTER = Serialization.getFieldSetter(ConcurrentHashMultiset.class, "countMap");
private FieldSettersHolder() {
}
}
public /* bridge */ /* synthetic */ boolean contains(@NullableDecl Object obj) {
return super.contains(obj);
}
public /* bridge */ /* synthetic */ Set elementSet() {
return super.elementSet();
}
public /* bridge */ /* synthetic */ Set entrySet() {
return super.entrySet();
}
public static <E> ConcurrentHashMultiset<E> create() {
return new ConcurrentHashMultiset<>(new ConcurrentHashMap());
}
public static <E> ConcurrentHashMultiset<E> create(Iterable<? extends E> iterable) {
ConcurrentHashMultiset<E> create = create();
Iterables.addAll(create, iterable);
return create;
}
public static <E> ConcurrentHashMultiset<E> create(ConcurrentMap<E, AtomicInteger> concurrentMap) {
return new ConcurrentHashMultiset<>(concurrentMap);
}
ConcurrentHashMultiset(ConcurrentMap<E, AtomicInteger> concurrentMap) {
Preconditions.checkArgument(concurrentMap.isEmpty(), "the backing map (%s) must be empty", (Object) concurrentMap);
this.countMap = concurrentMap;
}
public int count(@NullableDecl Object obj) {
AtomicInteger atomicInteger = (AtomicInteger) Maps.safeGet(this.countMap, obj);
if (atomicInteger == null) {
return 0;
}
return atomicInteger.get();
}
public int size() {
long j = 0;
for (AtomicInteger atomicInteger : this.countMap.values()) {
j += (long) atomicInteger.get();
}
return Ints.saturatedCast(j);
}
public Object[] toArray() {
return snapshot().toArray();
}
public <T> T[] toArray(T[] tArr) {
return snapshot().toArray(tArr);
}
private List<E> snapshot() {
ArrayList newArrayListWithExpectedSize = Lists.newArrayListWithExpectedSize(size());
for (Entry entry : entrySet()) {
Object element = entry.getElement();
for (int count = entry.getCount(); count > 0; count--) {
newArrayListWithExpectedSize.add(element);
}
}
return newArrayListWithExpectedSize;
}
/* JADX WARNING: Code restructure failed: missing block: B:19:0x005a, code lost:
r2 = new java.util.concurrent.atomic.AtomicInteger(r6);
*/
/* JADX WARNING: Code restructure failed: missing block: B:20:0x0065, code lost:
if (r4.countMap.putIfAbsent(r5, r2) == null) goto L_0x006f;
*/
public int add(E e, int i) {
AtomicInteger atomicInteger;
AtomicInteger atomicInteger2;
Preconditions.checkNotNull(e);
if (i == 0) {
return count(e);
}
CollectPreconditions.checkPositive(i, "occurences");
do {
atomicInteger = (AtomicInteger) Maps.safeGet(this.countMap, e);
if (atomicInteger == null) {
atomicInteger = (AtomicInteger) this.countMap.putIfAbsent(e, new AtomicInteger(i));
if (atomicInteger == null) {
return 0;
}
}
while (true) {
int i2 = atomicInteger.get();
if (i2 == 0) {
break;
}
try {
if (atomicInteger.compareAndSet(i2, IntMath.checkedAdd(i2, i))) {
return i2;
}
} catch (ArithmeticException unused) {
StringBuilder sb = new StringBuilder();
sb.append("Overflow adding ");
sb.append(i);
sb.append(" occurrences to a count of ");
sb.append(i2);
throw new IllegalArgumentException(sb.toString());
}
}
} while (!this.countMap.replace(e, atomicInteger, atomicInteger2));
return 0;
}
public int remove(@NullableDecl Object obj, int i) {
int i2;
int max;
if (i == 0) {
return count(obj);
}
CollectPreconditions.checkPositive(i, "occurences");
AtomicInteger atomicInteger = (AtomicInteger) Maps.safeGet(this.countMap, obj);
if (atomicInteger == null) {
return 0;
}
do {
i2 = atomicInteger.get();
if (i2 == 0) {
return 0;
}
max = Math.max(0, i2 - i);
} while (!atomicInteger.compareAndSet(i2, max));
if (max == 0) {
this.countMap.remove(obj, atomicInteger);
}
return i2;
}
public boolean removeExactly(@NullableDecl Object obj, int i) {
int i2;
int i3;
if (i == 0) {
return true;
}
CollectPreconditions.checkPositive(i, "occurences");
AtomicInteger atomicInteger = (AtomicInteger) Maps.safeGet(this.countMap, obj);
if (atomicInteger == null) {
return false;
}
do {
i2 = atomicInteger.get();
if (i2 < i) {
return false;
}
i3 = i2 - i;
} while (!atomicInteger.compareAndSet(i2, i3));
if (i3 == 0) {
this.countMap.remove(obj, atomicInteger);
}
return true;
}
/* JADX WARNING: Code restructure failed: missing block: B:10:0x002c, code lost:
if (r6 != 0) goto L_0x002f;
*/
/* JADX WARNING: Code restructure failed: missing block: B:11:0x002e, code lost:
return 0;
*/
/* JADX WARNING: Code restructure failed: missing block: B:12:0x002f, code lost:
r2 = new java.util.concurrent.atomic.AtomicInteger(r6);
*/
/* JADX WARNING: Code restructure failed: missing block: B:13:0x003a, code lost:
if (r4.countMap.putIfAbsent(r5, r2) == null) goto L_0x0044;
*/
public int setCount(E e, int i) {
AtomicInteger atomicInteger;
AtomicInteger atomicInteger2;
Preconditions.checkNotNull(e);
CollectPreconditions.checkNonnegative(i, "count");
do {
atomicInteger = (AtomicInteger) Maps.safeGet(this.countMap, e);
if (atomicInteger == null) {
if (i == 0) {
return 0;
}
atomicInteger = (AtomicInteger) this.countMap.putIfAbsent(e, new AtomicInteger(i));
if (atomicInteger == null) {
return 0;
}
}
while (true) {
int i2 = atomicInteger.get();
if (i2 == 0) {
break;
} else if (atomicInteger.compareAndSet(i2, i)) {
if (i == 0) {
this.countMap.remove(e, atomicInteger);
}
return i2;
}
}
} while (!this.countMap.replace(e, atomicInteger, atomicInteger2));
return 0;
}
public boolean setCount(E e, int i, int i2) {
Preconditions.checkNotNull(e);
CollectPreconditions.checkNonnegative(i, "oldCount");
CollectPreconditions.checkNonnegative(i2, "newCount");
AtomicInteger atomicInteger = (AtomicInteger) Maps.safeGet(this.countMap, e);
boolean z = false;
if (atomicInteger != null) {
int i3 = atomicInteger.get();
if (i3 == i) {
if (i3 == 0) {
if (i2 == 0) {
this.countMap.remove(e, atomicInteger);
return true;
}
AtomicInteger atomicInteger2 = new AtomicInteger(i2);
if (this.countMap.putIfAbsent(e, atomicInteger2) == null || this.countMap.replace(e, atomicInteger, atomicInteger2)) {
z = true;
}
return z;
} else if (atomicInteger.compareAndSet(i3, i2)) {
if (i2 == 0) {
this.countMap.remove(e, atomicInteger);
}
return true;
}
}
return false;
} else if (i != 0) {
return false;
} else {
if (i2 == 0) {
return true;
}
if (this.countMap.putIfAbsent(e, new AtomicInteger(i2)) == null) {
z = true;
}
return z;
}
}
/* access modifiers changed from: 0000 */
public Set<E> createElementSet() {
final Set keySet = this.countMap.keySet();
return new ForwardingSet<E>() {
/* access modifiers changed from: protected */
public Set<E> delegate() {
return keySet;
}
public boolean contains(@NullableDecl Object obj) {
return obj != null && Collections2.safeContains(keySet, obj);
}
public boolean containsAll(Collection<?> collection) {
return standardContainsAll(collection);
}
public boolean remove(Object obj) {
return obj != null && Collections2.safeRemove(keySet, obj);
}
public boolean removeAll(Collection<?> collection) {
return standardRemoveAll(collection);
}
};
}
/* access modifiers changed from: 0000 */
public Iterator<E> elementIterator() {
throw new AssertionError("should never be called");
}
@Deprecated
public Set<Entry<E>> createEntrySet() {
return new EntrySet();
}
/* access modifiers changed from: 0000 */
public int distinctElements() {
return this.countMap.size();
}
public boolean isEmpty() {
return this.countMap.isEmpty();
}
/* access modifiers changed from: 0000 */
public Iterator<Entry<E>> entryIterator() {
final AnonymousClass2 r0 = new AbstractIterator<Entry<E>>() {
private final Iterator<Map.Entry<E, AtomicInteger>> mapEntries = ConcurrentHashMultiset.this.countMap.entrySet().iterator();
/* access modifiers changed from: protected */
public Entry<E> computeNext() {
while (this.mapEntries.hasNext()) {
Map.Entry entry = (Map.Entry) this.mapEntries.next();
int i = ((AtomicInteger) entry.getValue()).get();
if (i != 0) {
return Multisets.immutableEntry(entry.getKey(), i);
}
}
return (Entry) endOfData();
}
};
return new ForwardingIterator<Entry<E>>() {
@NullableDecl
private Entry<E> last;
/* access modifiers changed from: protected */
public Iterator<Entry<E>> delegate() {
return r0;
}
public Entry<E> next() {
Entry<E> entry = (Entry) super.next();
this.last = entry;
return entry;
}
public void remove() {
CollectPreconditions.checkRemove(this.last != null);
ConcurrentHashMultiset.this.setCount(this.last.getElement(), 0);
this.last = null;
}
};
}
public Iterator<E> iterator() {
return Multisets.iteratorImpl(this);
}
public void clear() {
this.countMap.clear();
}
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
objectOutputStream.defaultWriteObject();
objectOutputStream.writeObject(this.countMap);
}
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
objectInputStream.defaultReadObject();
FieldSettersHolder.COUNT_MAP_FIELD_SETTER.set(this, (Object) (ConcurrentMap) objectInputStream.readObject());
}
}
| true |
537bc22a989bfc160f5e57ac347cb5c474b3d89f | Java | stevenwhatever123/Chip-s-Challenge-Assignment | /src/LeaderBoardController.java | UTF-8 | 3,026 | 2.765625 | 3 | [] | no_license | import java.io.IOException;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
/**
* This class represents as the controller for LeaderBoard.fxml. It produce the
* screen of the leaderboard menu.
*
* @author Steven Ho
* @version 1.1
*/
public class LeaderBoardController {
@FXML
private Button level1Button;
@FXML
private Button level2button;
@FXML
private Button level3Button;
@FXML
private Button menuButton;
/**
* Handles the mouse event if the user clicked into the level 1 button.
*
* @param event The mouse click.
* @throws IOException if there is no files to read in.
*/
@FXML
void handleLevel1Action(MouseEvent event) throws IOException {
System.out.println("Mouse clicked");
/*
* Setting up new stage to switch from
*/
Stage stage;
Parent root;
stage = (Stage) menuButton.getScene().getWindow();
root = FXMLLoader.load(getClass().getResource("Level1LeaderBoard.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
scene.getRoot().requestFocus();
stage.show();
}
/**
* Handles the mouse event if the user clicked into the level 2 button.
*
* @param event The mouse click.
* @throws IOException If there is no files to read in.
*/
@FXML
void handleLevel2Action(MouseEvent event) throws IOException {
System.out.println("Mouse clicked");
/*
* Setting up new stage to switch from
*/
Stage stage;
Parent root;
stage = (Stage) menuButton.getScene().getWindow();
root = FXMLLoader.load(getClass().getResource("Level2LeaderBoard.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
scene.getRoot().requestFocus();
stage.show();
}
/**
* Handles the mouse event if the user clicked into the level 3 button.
*
* @param event The mouse click.
* @throws IOException If there is no files to read in.
*/
@FXML
void handleLevel3Action(MouseEvent event) throws IOException {
System.out.println("Mouse clicked");
/*
* Setting up new stage to switch from
*/
Stage stage;
Parent root;
stage = (Stage) menuButton.getScene().getWindow();
root = FXMLLoader.load(getClass().getResource("Level3LeaderBoard.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
scene.getRoot().requestFocus();
stage.show();
}
/**
* Handles the mouse event if the user clicked into the menu button.
*
* @param event The mouse click.
* @throws IOException If there is no files to read in.
*/
@FXML
void handleMenuAction(MouseEvent event) throws IOException {
System.out.println("Mouse clicked");
/*
* Setting up new stage to switch from
*/
Stage stage;
Parent root;
stage = (Stage) menuButton.getScene().getWindow();
root = FXMLLoader.load(getClass().getResource("MainMenu.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
scene.getRoot().requestFocus();
stage.show();
}
}
| true |
15c002ba2df99c86a0150129eac02b2146a9140a | Java | Panineduard/Automobile-Site-Trade-In | /src/main/java/com/helpers/PasswordHelper.java | UTF-8 | 573 | 2.453125 | 2 | [] | no_license | package com.helpers;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.security.crypto.password.PasswordEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* Created by volkswagen1 on 17.12.2015.
*/
public class PasswordHelper implements PasswordEncoder {
public String encode(CharSequence charSequence) {
return DigestUtils.md5Hex(charSequence.toString());
}
public boolean matches(CharSequence charSequence, String s) {
return (encode(charSequence)).equals(s);
}
} | true |
1d32ccbca80a014d802ca56d6a685e54ab9c96d3 | Java | kamjony/JavaX | /Car Park/src/CarPark/Vehicle.java | UTF-8 | 3,094 | 3.03125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package CarPark;
/**
*
* @author w1535035
*/
public abstract class Vehicle implements Comparable<Vehicle> {
protected String IDplate;
protected String brand;
protected DateTime duration;
public Vehicle(String IDplate, String brand) {
this.IDplate = IDplate;
this.brand = brand;
}
public void setIdplate(String IDplate) {
this.IDplate = IDplate;
}
public void setBrand(String brand) {
this.brand = brand;
}
public DateTime getDuration() {
return duration;
}
public void setDuration(DateTime duration) {
this.duration = duration;
}
public String getIDplate() {
return IDplate;
}
public String getBrand() {
return brand;
}
public String toString() {
return IDplate + "," + brand + ", " + duration;
}
public abstract String getType();
@Override
public int compareTo(Vehicle other) {
int returnvalue = 0;
int year1 = this.getDuration().getYear();
int year2 = other.getDuration().getYear();
if (year1 < year2) {
returnvalue = 1;
} else if (year1 > year2) {
returnvalue = -1;
} else if (year1 == year2) {
returnvalue = 0;
int month1 = this.getDuration().getMonth();
int month2 = other.getDuration().getMonth();
if (month1 < month2) {
returnvalue = 1;
} else if (month1 > month2) {
returnvalue = -1;
} else if (month1 == month2) {
returnvalue = 0;
int day1 = this.getDuration().getDay();
int day2 = other.getDuration().getDay();
if (day1 < day2) {
returnvalue = 1;
} else if (day1 > day2) {
returnvalue = -1;
} else if (day1 == day2) {
returnvalue = 0;
int hours1 = this.getDuration().getHours();
int hours2 = other.getDuration().getHours();
if (hours1 < hours2) {
returnvalue = 1;
} else if (hours1 > hours2) {
returnvalue = -1;
} else if (hours1 == hours2) {
returnvalue = 0;
int mins1 = this.getDuration().getMins();
int mins2 = other.getDuration().getMins();
if (mins1 < mins2) {
returnvalue = 1;
} else if (mins1 > mins2) {
returnvalue = -1;
} else if (mins1 == mins2) {
returnvalue = 0;
}
}
}
}
}return returnvalue;
}
}
| true |
3bcf8bdb58c23560f2cb04276f5d1bffc970f5e3 | Java | denisredzhebov/Car-Store | /src/car_store/car/SportsCar.java | UTF-8 | 353 | 2.4375 | 2 | [] | no_license | package car_store.car;
import car_store.enums.EngineType;
import car_store.enums.Model;
import car_store.enums.Region;
public class SportsCar extends Car {
public SportsCar(Model model, int year, int price, EngineType engineType,
Region region) {
super(model, year, price, engineType, region);
}
}
| true |
c3ed7e09cff5ef79ed356620e8f5f40935816d22 | Java | UniveIngSw2020/ReCiak | /app/src/main/java/it/unive/reciak/webrtc/connection/RTCPeerConnection.java | UTF-8 | 14,908 | 2.015625 | 2 | [] | no_license | package it.unive.reciak.webrtc.connection;
import android.content.Context;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.json.JSONObject;
import org.webrtc.DataChannel;
import org.webrtc.IceCandidate;
import org.webrtc.MediaConstraints;
import org.webrtc.MediaStream;
import org.webrtc.MediaStreamTrack;
import org.webrtc.PeerConnection;
import org.webrtc.RtpReceiver;
import org.webrtc.RtpSender;
import org.webrtc.SdpObserver;
import org.webrtc.SessionDescription;
import org.webrtc.VideoTrack;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import it.unive.reciak.R;
import it.unive.reciak.socket.CallSocket;
import it.unive.reciak.socket.TCPChannelClient;
import it.unive.reciak.webrtc.PeerInfo;
import it.unive.reciak.webrtc.record.RecordChannel;
/**
* Gestore connessione a un peer.
*
* @see <a href="https://webrtc.googlesource.com/src/+/master/sdk/android/">Libreria utilizzata</a>
*/
class RTCPeerConnection implements SdpObserver, PeerConnection.Observer, TCPChannelClient.TCPChannelEvents {
private static final String TAG = "RTCPeerConnection";
// Gestore connessioni WebRTC
@NonNull
private final RTCRoomConnection room;
// Informazioni del peer
@NonNull
private final PeerInfo peerInfo;
// Executor gestione socket e registrazione
@NonNull
private final ExecutorService executor;
// Socket per la negoziazione della chiamata
@NonNull
private CallSocket callSocket;
// Gestore della connessione con l'altro peer
@Nullable
private PeerConnection peerConnection;
// Gestori invio flusso video e audio all'altro peer
@Nullable
private RtpSender videoSender;
@Nullable
private RtpSender audioSender;
@NonNull
private final Context context;
public RTCPeerConnection(@NonNull RTCRoomConnection room, @NonNull PeerInfo peerInfo, @NonNull Context context) {
this.room = room;
this.peerInfo = peerInfo;
this.context = context;
executor = Executors.newSingleThreadExecutor();
callSocket = new CallSocket(executor, this, peerInfo);
}
/**
* Avvia la connessione al peer.
*/
public void start() {
Log.i(TAG, "start");
if (room.peerConnectionFactory == null)
onError(new Throwable("Impossibile connettersi al peer"));
// Si connette all'altro peer
peerConnection = room.peerConnectionFactory.createPeerConnection(room.rtcConfig, this);
if (peerConnection == null)
onError(new Throwable("Impossibile connettersi al peer"));
// Se sono l'amministratore mostro i pulsanti e la mia fotocamera
if (room.isServer() && peerInfo.isInitiator() && room.videoTrack != null) {
room.videoTrack.addSink(room.mainView);
room.runOnUiThread(() -> {
room.mainView.setVisibility(View.VISIBLE);
room.btnRecord.setVisibility(View.VISIBLE);
room.btnSwitch.setVisibility(View.VISIBLE);
});
}
}
/**
* Avvia condivisione video.
*/
public void startVideo() {
Log.i(TAG, "startVideo");
// Se non sta già condividendo qualcosa
if (videoSender == null && audioSender == null && peerConnection != null) {
ArrayList<String> mediaStreamLabels = new ArrayList<>();
mediaStreamLabels.add("ARDAMS");
// Invia il proprio flusso video al peer
videoSender = peerConnection.addTrack(room.videoTrack, mediaStreamLabels);
audioSender = peerConnection.addTrack(room.audioTrack, mediaStreamLabels);
if (room.videoTrack == null)
onError(new Throwable(context.getString(R.string.camera_error)));
// Nasconde la view più piccola
room.runOnUiThread(() -> room.rightView.setVisibility(View.INVISIBLE));
// Visualizza la propria fotocamera nella view centrale
room.videoTrack.addSink(room.mainView);
executor.execute(() -> room.startRecording(RecordChannel.INPUT));
// Ha avviato la condivisione video
room.setRecordingButton(true);
}
}
/**
* Termina condivisione video
*/
public void stopVideo() {
Log.i(TAG, "stopVideo");
// Termina la registrazione
room.stopRecording();
// Rimuove il flusso video dalle view
room.mainView.clearImage();
room.rightView.clearImage();
if (room.videoTrack != null) {
room.videoTrack.removeSink(room.mainView);
room.videoTrack.removeSink(room.rightView);
}
if (room.remoteVideoTrack != null) {
room.remoteVideoTrack.removeSink(room.mainView);
room.remoteVideoTrack.removeSink(room.rightView);
}
// Interrompe la condivisione video
if (videoSender != null && audioSender != null) {
room.rightView.clearImage();
room.runOnUiThread(() -> room.rightView.setVisibility(View.VISIBLE));
if (peerConnection != null) {
peerConnection.removeTrack(videoSender);
videoSender = null;
peerConnection.removeTrack(audioSender);
audioSender = null;
}
}
}
/**
* Il dispositivo deve iniziare la negoziazione.
*
* @return true se il dispositivo deve iniziare la negoziazione
*/
public boolean isInitiator() {
return peerInfo.isInitiator();
}
/**
* Invia l'indirizzo di un nuovo peer a un dispositivo connesso all'amministratore.
*
* @param ip IP del nuovo peer
* @param port porta del nuovo peer
* @param isInitiator true se il dispositivo a cui invio le informazione del nuovo peer deve inizare la negoziazione
*/
public void addUser(String ip, int port, boolean isInitiator) {
// Invia le informazioni del terzo peer
callSocket.sendAddUser(ip, port, isInitiator);
}
/**
* Ritorna l'indirizzo IP del peer con cui il dispositivo è connesso.
*
* @return IP del peer
*/
public String getIp() {
return peerInfo.getIp();
}
/**
* Gestione errori.
*
* @param error eccezione
*/
private void onError(@NonNull Throwable error) {
error.printStackTrace();
room.runOnUiThread(() -> Toast.makeText(context, error.getMessage(), Toast.LENGTH_SHORT).show());
// Chiude la connessione con l'altro peer
dispose();
}
/**
* Chiude la connessione con il peer.
*/
public void dispose() {
Log.i(TAG, "dispose");
// Interrompe la condivisione
stopVideo();
// Disconnessione
if (peerConnection != null) {
peerConnection.dispose();
peerConnection = null;
}
// Chiude il socket
callSocket.disconnect();
executor.shutdown();
}
/**
* Inizia la negoziazione con l'altro peer.
*/
public void createOffer() {
Log.i(TAG, "createOffer");
if (peerConnection != null) {
MediaConstraints constraints = new MediaConstraints();
peerConnection.createOffer(this, constraints);
}
}
/**
* Gestione della SessionDescription remota.
* Salva la SessionDescription del peer e risponde.
*
* @param description messaggio di tipo SessionDescription
* @param type offer/answer
*/
private void setRemoteDescription(String description, String type) {
if (peerConnection != null) {
SessionDescription sessionDescription = new SessionDescription(SessionDescription.Type.fromCanonicalForm(type), description);
// Salva la SessionDescription remota
peerConnection.setRemoteDescription(this, sessionDescription);
// Risponde al peer
MediaConstraints constraints = new MediaConstraints();
peerConnection.createAnswer(this, constraints);
}
}
// Negoziazione iniziata: viene generata una SessionDescription locale
@Override
public void onCreateSuccess(SessionDescription sessionDescription) {
Log.i(TAG, "onCreateSuccess");
if (peerConnection != null) {
// Salva la propria SessionDescription e la invia al peer
peerConnection.setLocalDescription(this, sessionDescription);
callSocket.sendSessionDescription(sessionDescription, sessionDescription.type.toString().toLowerCase());
}
}
@Override
public void onSetSuccess() {
}
@Override
public void onCreateFailure(@NonNull String s) {
}
@Override
public void onSetFailure(@NonNull String s) {
}
// Se c'è un dispositivo pronto invia il proprio ICE
@Override
public void onIceCandidate(@NonNull IceCandidate iceCandidate) {
Log.i(TAG, "onIceCandidate");
callSocket.sendIceCandidate(iceCandidate);
}
@Override
public void onDataChannel(@NonNull DataChannel dataChannel) {
}
@Override
public void onIceConnectionReceivingChange(boolean receivingChange) {
}
@Override
public void onIceConnectionChange(@NonNull PeerConnection.IceConnectionState state) {
}
@Override
public void onIceGatheringChange(@NonNull PeerConnection.IceGatheringState state) {
}
@Override
public void onAddStream(@NonNull MediaStream mediaStream) {
}
@Override
public void onSignalingChange(@NonNull PeerConnection.SignalingState signalingState) {
}
@Override
public void onIceCandidatesRemoved(@NonNull IceCandidate[] list) {
}
@Override
public void onRemoveStream(@NonNull MediaStream mediaStream) {
}
@Override
public void onRenegotiationNeeded() {
}
// Quando riceve una traccia remota
@Override
public void onAddTrack(@NonNull RtpReceiver receiver, @NonNull MediaStream[] mediaStreams) {
Log.i(TAG, "onAddTrack");
@Nullable
MediaStreamTrack track = receiver.track();
// Se è una traccia video
if (track instanceof VideoTrack) {
// Termina condivisione video
room.stopVideo();
// Cambia l'icona del pulsante di registrazione
room.setRecordingButton(false);
// Visualizza il flusso video nella view principale
room.remoteVideoTrack = (VideoTrack) track;
room.remoteVideoTrack.addSink(room.mainView);
// Mostra la propria fotocamera nella view più piccola
if (room.videoTrack != null)
room.videoTrack.addSink(room.rightView);
// Avvia la registrazione
executor.execute(() -> room.startRecording(RecordChannel.OUTPUT));
room.runOnUiThread(() -> {
// Mostra le view
room.mainView.setVisibility(View.VISIBLE);
room.rightView.setVisibility(View.VISIBLE);
room.btnRecord.setVisibility(View.VISIBLE);
room.btnSwitch.setVisibility(View.VISIBLE);
// Avvisa l'utente della nuova registrazione
Toast toast = Toast.makeText(context, R.string.recording, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 50);
toast.show();
});
}
}
// Connesso al socket dell'altro peer
@Override
public void onTCPConnected() {
Log.i(TAG, "onTCPConnected");
// Se sono l'amministratore
if (peerInfo.isInitiator()) {
// Avvio il peer
start();
}
// Notifica la presenza di altri peer al dispositivo appena connesso
room.addUser(this);
}
// Il dispositivo ha ricevuto un messaggio dal peer
@Override
public void onTCPMessage(@NonNull JSONObject message) {
try {
String action = message.getString("action");
// Risponde in base al messaggio ricevuto
switch (action) {
// Riceve informazioni di trasmissione del peer
case "setSessionDescription":
JSONObject sessionDescriptionJson = message.getJSONObject("value");
String type = sessionDescriptionJson.getString("type");
String sessionDescription = sessionDescriptionJson.getString("sessionDescription");
// Se non sono l'amministratore e ricevo un'offerta, avvio il peer
if (!peerInfo.isInitiator() && peerConnection == null)
start();
// Salva la SessionDescription remota
setRemoteDescription(sessionDescription, type);
break;
// Informazioni sull'indirizzo del peer
case "addIceCandidate":
JSONObject iceCandidateJson = message.getJSONObject("value");
String sdp = iceCandidateJson.getString("sdp");
int sdpMLineIndex = iceCandidateJson.getInt("sdpMLineIndex");
String sdpMid = iceCandidateJson.getString("sdpMid");
// Salva l'indirizzo del peer
IceCandidate iceCandidate = new IceCandidate(sdpMid, sdpMLineIndex, sdp);
if (peerConnection != null)
peerConnection.addIceCandidate(iceCandidate);
break;
// Informazioni di un altro peer connesso all'amministratore
case "addUser":
JSONObject userJson = message.getJSONObject("value");
String newPartnerIp = userJson.getString("partnerIp");
int newPartnerPort = userJson.getInt("partnerPort");
boolean newIsInitiator = userJson.getBoolean("isInitiator");
// Crea un nuovo peer
ArrayList<PeerInfo> newPeerInfo = new ArrayList<>();
newPeerInfo.add(new PeerInfo(newPartnerIp, newPartnerPort, newIsInitiator));
room.addPeers(newPeerInfo);
break;
}
} catch (Exception e) {
e.printStackTrace();
}
}
// Creazione del socket fallita
@Override
public void onTCPError() {
Log.i(TAG, "onTCPError");
// Riavvia il socket
callSocket.disconnect();
callSocket = new CallSocket(executor, this, peerInfo);
}
// Se il socket viene chiuso, avvia il rendering
@Override
public void onTCPClose() {
room.callActivity();
}
}
| true |
0b013b0f3a639e8f90262e93e0a33766539d3d04 | Java | controversial/APCS | /codingbat/Array-1/maxTriple.java | UTF-8 | 188 | 2.734375 | 3 | [
"MIT"
] | permissive | public int maxTriple(int[] nums) {
int largest = nums[0];
largest = Math.max(largest, nums[nums.length / 2]);
largest = Math.max(largest, nums[nums.length - 1]);
return largest;
}
| true |
1e28a2c5b3c096f8b564be8426af104d31e3e5a0 | Java | JszCloud/WxAuth | /src/com/wx/auth/util/AuthUtil.java | UTF-8 | 1,126 | 2.1875 | 2 | [] | no_license | package com.wx.auth.util;
import java.io.IOException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import net.sf.json.JSONObject;
public class AuthUtil {
public static String APPID="wx3e96c17405f2c598";
public static String APPSECRET="65e48dc0db01f650da5785676c505e51";
/* public static String APPID="wx5922bbc0a2fadb69";
public static String APPSECRET="cbbde311b2028c20202258d0f87c41e8";
*/
public static JSONObject doGetJson(String url) throws ClientProtocolException, IOException{
JSONObject jsonObject = null;
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpGet httpGet= new HttpGet(url);
HttpResponse response=httpClient.execute(httpGet);
HttpEntity enyity=response.getEntity();
if (enyity != null) {
String result=EntityUtils.toString(enyity,"UTF-8");
jsonObject=JSONObject.fromObject(result);
}
httpGet.releaseConnection();
return jsonObject;
}
}
| true |
e2108e08e4c9f48fe95d50555101bdd8fade5586 | Java | daple1997/Exam2Practice | /src/java/filters/AuthenticationFilter.java | UTF-8 | 1,337 | 2.53125 | 3 | [] | no_license | package filters;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
public class AuthenticationFilter implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
// this code will execute before HomeServlet and UsersServlet
HttpServletRequest r = (HttpServletRequest)request;
HttpSession session = r.getSession();
if (session.getAttribute("username") != null) {
// if they are authenticated, i.e. have a username in the session,
// then allow them to continue on to the servlet
chain.doFilter(request, response);
} else {
// they do not have a username in the sesion
// so, send them to login page
HttpServletResponse resp = (HttpServletResponse)response;
resp.sendRedirect("login");
}
// this code will execute after HomeServlet and UsersServlet
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void destroy() {
}
}
| true |
218d1b8ad9c953ebc445aef96024a8705bc4db41 | Java | AniketDeshpandeGit/Hackathon-Management-Web-Application-Spring-Boot-Rest-APIs-React-AWS | /server/online-hackathon-project/src/main/java/com/openHack/service/impl/JoinRequestServiceImpl.java | UTF-8 | 4,266 | 2.3125 | 2 | [] | no_license | package com.openHack.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import javax.persistence.Column;
import org.hibernate.annotations.Where;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;
import com.openHack.io.entity.OrganizationEntity;
import com.openHack.io.entity.UserEntity;
import com.openHack.io.repository.OrganizationRepository;
import com.openHack.io.repository.UserRepository;
import com.openHack.service.JoinRequestService;
import com.openHack.shared.dto.HackathonDto;
import com.openHack.shared.dto.JoinRequestDto;
import com.openHack.shared.dto.UserDto;
@Service
public class JoinRequestServiceImpl implements JoinRequestService{
@Autowired
UserRepository userRepository;
@Autowired
OrganizationRepository organizationRepository;
// user send request to any organization
@Override
public void createRequest(JoinRequestDto joinRequestDto) {
// Fetch user details
UserEntity userEntity = userRepository.findById(joinRequestDto.getUser_id());
// To check if user is associated with any organization or not
if(userEntity.getOrganizationEntity() != null)
throw new RuntimeException("User is already joined with any organization ... ");
// Fetch organization details
OrganizationEntity organizationEntity = organizationRepository.findById(joinRequestDto.getOrganization_id());
// adding organization details in user entity
userEntity.addOrganization(organizationEntity);
// Repository method (save) to save UserEntity object to table users
userRepository.save(userEntity);
}
// organization accept the join request of user
@Override
public void acceptRequest(JoinRequestDto joinRequestDto) {
// Fetch organization details
OrganizationEntity organizationEntity = organizationRepository.findById(joinRequestDto.getOrganization_id());
// Fetch user details
UserEntity userEntity = userRepository.findById(joinRequestDto.getUser_id());
// adding organization details in user entity
userEntity.setOrganizationEntity(organizationEntity);
// discarding all the send request of user
userEntity.setOrganizations(null);
// Repository method (save) to save UserEntity object to table users
userRepository.save(userEntity);
}
// Get all the organizations, to which user has sent the request
// show all sent request of user to organization(s)
@Override
public List<OrganizationEntity> getOrganizations(long id) {
// Fetch user details
UserEntity userEntity = userRepository.findById(id);
//System.out.println(userEntity);
//System.out.println(userEntity.getOrganizations());
// return all the organizations from join table
return userEntity.getOrganizations();
}
// show all request from users to any organization
// Get all the Users, by organization to check the request
@Override
public HashMap<String,ArrayList<UserDto>> getUsers(long id) {
HashMap<String,ArrayList<UserDto>> requestsForOrg =new HashMap<String,ArrayList<UserDto>>();
ArrayList<OrganizationEntity> userOrganisations = new ArrayList<OrganizationEntity>();
ArrayList<UserDto> allUserDtos = new ArrayList<UserDto>();
ArrayList<Integer> userIds = new ArrayList<Integer>();
userOrganisations = organizationRepository.findByOwnerId(id);
for(OrganizationEntity organisation: userOrganisations)
{
userIds = organizationRepository.getUserIds(organisation.getId());
UserEntity singleUserEntity ;
UserDto singleUserDto;
for(long userid: userIds)
{
singleUserEntity = new UserEntity();
singleUserDto = new UserDto();
singleUserEntity = userRepository.findUserById(userid);
BeanUtils.copyProperties(singleUserEntity, singleUserDto);
allUserDtos.add(singleUserDto);
}
//add value to org key
requestsForOrg.put(organisation.getName(),allUserDtos);
}
// return all the users from join table
return requestsForOrg;
}
}
| true |
c22bfbcc69dbd98c0491a3462cfb5675aebd7b5a | Java | penguin-statistics/backend | /src/main/java/io/penguinstats/enums/DropMatrixElementType.java | UTF-8 | 216 | 2.03125 | 2 | [
"MIT"
] | permissive | package io.penguinstats.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum DropMatrixElementType {
REGULAR("reular"), TREND("trend");
private String name;
}
| true |
1eb204094f7f6a45d362fe429ecafdc41a5407cb | Java | H6yV7Um/pop.hc.static | /help-center-web/src/main/java/com/jd/help/customer/web/VenderSecurityInterceptor.java | UTF-8 | 6,581 | 1.703125 | 2 | [] | no_license | package com.jd.help.customer.web;
import com.jd.common.struts.context.LoginContext;
import com.jd.common.struts.interceptor.JdInterceptor;
import com.jd.common.web.url.JdUrl;
import com.jd.common.web.url.JdUrlUtils;
import com.jd.help.SysLoginContext;
import com.jd.help.center.web.util.ShopWebHelper;
import com.jd.pop.module.utils.JsonUtils;
import com.jd.pop.vender.center.domain.auth.LoginResult;
import com.jd.pop.vender.center.domain.seller.constants.SellerConstants;
import com.jd.pop.vender.center.service.auth.AuthSafService;
import com.jd.pop.vender.center.service.auth.dto.AuthLoginExt;
import com.jd.pop.vender.center.service.auth.dto.AuthLoginExtResult;
import com.jd.pop.vender.center.service.auth.dto.AuthRequest;
import com.jd.pop.vender.usercenter.domain.LoginAccountConstants;
import com.jd.ump.profiler.CallerInfo;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsStatics;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLDecoder;
import java.util.Enumeration;
/**
* Created by lipengfei5 on 2016/11/2.
*/
public class VenderSecurityInterceptor extends JdInterceptor {
private Log log= LogFactory.getLog(VenderSecurityInterceptor.class);
protected JdUrlUtils jdUrlUtils;
protected String homeModule = "homeModule";
@Resource
AuthSafService authSafServiceOutOfUsercenter;
@Override
public String intercept(ActionInvocation actionInvocation) throws Exception {
ActionContext actionContext = actionInvocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest) actionContext.get(StrutsStatics.HTTP_REQUEST);
HttpServletResponse response = (HttpServletResponse) actionContext.get(StrutsStatics.HTTP_RESPONSE);
if(LoginContext.getLoginContext() == null){
return actionInvocation.invoke();
}
SysLoginContext.remove();
String userPin = ShopWebHelper.getPin();
initVenderInfo(userPin);
SysLoginContext.setUserPin(userPin);
log.info("SysLoginContext----" + JsonUtils.toJson(SysLoginContext.context.get()));
return actionInvocation.invoke();
}
private void initVenderInfo(String pin) {
LoginResult loginResult = null;
CallerInfo callerInfo = com.jd.ump.profiler.proxy.Profiler.registerInfo(LoginAccountConstants.UMP_KEY_VENDER_LOOKUP_USER, false, true);
try {
loginResult = newGetLoginResult(pin);
} catch (Exception e) {
log.error("vender.help.customer.orderService.getOrderInfo",e);
com.jd.ump.profiler.proxy.Profiler.functionError(callerInfo);
} finally {
com.jd.ump.profiler.proxy.Profiler.registerInfoEnd(callerInfo);
}
// SysLoginContext.setNick(ShopWebHelper.getNick());
// SysLoginContext.setUserId(ShopWebHelper.getUserId());
if (loginResult == null || loginResult.getUserName() == null) {
return;
} else if (loginResult.getStatus() == LoginAccountConstants.LOGIN_ACCOUNT_STATUS_STOP) {
return;
} else if (loginResult.getVenderStatus() != SellerConstants.SELLER_STATUS_HAS_STRAT) {
return;
} else if (loginResult.getShopStatus() == 3) {
return;
}
CallerInfo info = com.jd.ump.profiler.proxy.Profiler.registerInfo(LoginAccountConstants.UMP_KEY_VENDER_LONG, true, true);
//SysLoginContext.setUserPin(loginResult.getPin());
SysLoginContext.setVenderId(loginResult.getUserId());
try {
SysLoginContext.setNick(ShopWebHelper.getNick());
SysLoginContext.setUserId(ShopWebHelper.getUserId());
SysLoginContext.setShopName(URLDecoder.decode(loginResult.getShopName(), "GBK"));
SysLoginContext.setCompanyName(URLDecoder.decode(loginResult.getCompanyName(), "GBK"));
SysLoginContext.setUserPin(URLDecoder.decode(pin, "GBK"));
} catch (Exception e) {
log.error("LoginAccountConstants.UMP_KEY_VENDER_LONG",e);
e.printStackTrace();
}
//SysLoginContext.setCompanyName(loginResult.getCompanyName());
SysLoginContext.setPreLoginTime(loginResult.getPreLoginTime());
SysLoginContext.setLoginTime(loginResult.getLoginTime());
log.error("vender_error___"+SysLoginContext.getVenderId()+"_____"+SysLoginContext.getUserPin());
return ;
}
private LoginResult newGetLoginResult(String pin) {
AuthLoginExtResult authLoginResult = authSafServiceOutOfUsercenter.lookupUserAndLoginTime(pin, new AuthRequest("index.action"), null, null);
LoginResult loginResult = new LoginResult();
if (authLoginResult != null && authLoginResult.isSuccess()) {
AuthLoginExt authLogin = authLoginResult.getAuthLoginExt();
loginResult.setUserName(authLogin.getPin());
loginResult.setUserId(authLogin.getVenderId());
loginResult.setCompanyId(authLogin.getCompanyId());
loginResult.setShopId(authLogin.getShopId());
loginResult.setShopName(authLogin.getShopName());
loginResult.setCompanyName(authLogin.getCompanyName());
loginResult.setStatus(authLogin.getStatus());
loginResult.setVenderStatus(authLogin.getVenderStatus());
loginResult.setShopStatus(authLogin.getShopStatus());
loginResult.setPreLoginTime(authLogin.getPreLoginTime());
loginResult.setLoginTime(authLogin.getLoginTime());
loginResult.setColType(authLogin.getColType());
loginResult.setUserType(authLogin.getUserType());
}
return loginResult;
}
protected String getCurrentUrl(HttpServletRequest request) {
JdUrl venderUrl = jdUrlUtils.getJdUrl(homeModule);
venderUrl.getTarget(request.getRequestURI());
Enumeration parameterNames = request.getParameterNames();
while (parameterNames.hasMoreElements()) {
String key = (String) parameterNames.nextElement();
venderUrl.addQueryData(key, request.getParameterValues(key));
}
return venderUrl.toString();
}
public void setJdUrlUtils(JdUrlUtils jdUrlUtils) {
this.jdUrlUtils = jdUrlUtils;
}
public void setHomeModule(String homeModule) {
this.homeModule = homeModule;
}
}
| true |
f132adfbd3d481e0604e2be0d9d1850d827c0279 | Java | XeHHXe/skeleton-sp15 | /dis7/parkinglot/ParkingLot.java | UTF-8 | 192 | 1.664063 | 2 | [] | no_license | package parkinglot;
public class ParkingLot {
Space[] spaces;
Car[] cars;
public ParkingLot(Space[] spaces) {
this.spaces = spaces;
}
public static void main(String[] args) {
}
} | true |
b16be2b4c5e2ddcefb4fcbf0e21ca62c6152de84 | Java | Hlabeli/picketlink | /modules/idm/tests/src/test/java/org/picketlink/test/idm/token/TokenIdentityStoreTestCase.java | UTF-8 | 4,340 | 1.617188 | 2 | [
"Apache-2.0"
] | permissive | /*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.picketlink.test.idm.token;
import org.junit.Before;
import org.junit.Test;
import org.picketlink.idm.IdentityManager;
import org.picketlink.idm.PartitionManager;
import org.picketlink.idm.config.IdentityConfigurationBuilder;
import org.picketlink.idm.credential.Credentials;
import org.picketlink.idm.internal.DefaultPartitionManager;
import org.picketlink.idm.model.basic.Realm;
import org.picketlink.idm.model.basic.User;
import org.picketlink.idm.spi.ContextInitializer;
import org.picketlink.idm.spi.IdentityContext;
import org.picketlink.idm.spi.IdentityStore;
import static org.junit.Assert.assertEquals;
/**
* @author Pedro Igor
*/
public class TokenIdentityStoreTestCase {
private PartitionManager serviceProviderPartitionManager;
private PartitionManager identityProviderPartitionManager;
private CredentialsContextInitializer credentialsContextInitializer = new CredentialsContextInitializer();
@Before
public void onBefore() {
IdentityConfigurationBuilder identityProviderConfigBuilder = new IdentityConfigurationBuilder();
identityProviderConfigBuilder
.named("idp.config")
.stores()
.file()
.supportAllFeatures();
this.identityProviderPartitionManager = new DefaultPartitionManager(identityProviderConfigBuilder.buildAll());
this.identityProviderPartitionManager.add(new Realm(Realm.DEFAULT_REALM));
IdentityConfigurationBuilder serviceProviderConfigBuilder = new IdentityConfigurationBuilder();
serviceProviderConfigBuilder
.named("sp.config")
.stores()
.token()
.tokenConsumer(new TokenAConsumer())
.addContextInitializer(this.credentialsContextInitializer)
.supportAllFeatures();
this.serviceProviderPartitionManager = new DefaultPartitionManager(serviceProviderConfigBuilder.buildAll());
}
@Test
public void testValidateCredential() {
User account = createAccount();
TokenAProvider tokenAProvider = new TokenAProvider(this.identityProviderPartitionManager);
TokenA token = tokenAProvider.issue(account);
IdentityManager identityManager = this.serviceProviderPartitionManager.createIdentityManager();
TokenACredential credentials = new TokenACredential(token);
this.credentialsContextInitializer.setCredentials(credentials);
identityManager.validateCredentials(credentials);
assertEquals(Credentials.Status.VALID, credentials.getStatus());
}
private User createAccount() {
IdentityManager identityManager = this.identityProviderPartitionManager.createIdentityManager();
User account = new User("john");
identityManager.add(account);
return account;
}
public static class CredentialsContextInitializer implements ContextInitializer {
private Credentials credentials;
@Override
public void initContextForStore(IdentityContext context, IdentityStore<?> store) {
context.setParameter(IdentityContext.CREDENTIALS, this.credentials);
}
public void setCredentials(Credentials credentials) {
this.credentials = credentials;
}
}
}
| true |
d878171c356372f99e0bb84c2689a969988da8e5 | Java | gagazhang/tyni_spring_study | /src/test/java/com/iflytek/spring/study/test/BeanInitializationLogger.java | UTF-8 | 634 | 2.3125 | 2 | [] | no_license | package com.iflytek.spring.study.test;
import com.iflytek.spring.study.beans.BeanPostProcessor;
/**
* @author : wei
* @date : 2018/3/7
*/
public class BeanInitializationLogger implements BeanPostProcessor {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws Exception {
System.out.println("Initialize bean " + beanName + " start!");
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws Exception {
System.out.println("Initialize bean " + beanName + " end!");
return bean;
}
}
| true |
1f11e6c364307719f9500d6545c2943bf66fe7f1 | Java | umar07/class_10_codes | /loops/p1.java | UTF-8 | 523 | 2.84375 | 3 | [
"MIT"
] | permissive | package loops;
public class p1
{
public static void main (String [] args)
{
int i,j,a,b,p=5;
char x='*';
for(i=1;i<=5;i++)
{
{ for(b=1;b<=p;b++)
{
System.out.print(" ");
}
for(j=1;j<=i;j++)
{
System.out.print(x);
}
}
for(a=2;a<=i;a++)
{
System.out.print(x);
}
System.out.println();
p--;
}
} /*question is *
***
*****
*******
********* */
}
| true |
a2000d42337228b598986a51a748ab36380a4e32 | Java | rlviana/pricegrabber-app | /pricegrabber-model/src/main/java/net/rlviana/pricegrabber/model/repository/core/ItemTypeRepository.java | UTF-8 | 800 | 2.234375 | 2 | [
"MIT"
] | permissive | /**
*
*/
package net.rlviana.pricegrabber.model.repository.core;
import net.rlviana.pricegrabber.model.entity.core.ItemType;
import net.rlviana.pricegrabber.model.repository.AbstractJpaObjectRepository;
import net.rlviana.pricegrabber.model.search.entity.core.ItemTypeSearchCriteria;
/**
* JPA Repository Implementation for Item Type Entity
*
* @author ramon
*
*/
public class ItemTypeRepository extends AbstractJpaObjectRepository<ItemType, Integer> {
/**
* Constructor
*/
public ItemTypeRepository() {
super(ItemType.class);
}
/**
*
* @see net.rlviana.pricegrabber.model.repository.AbstractBaseJpaReadOnlyObjectRepository#getCriteriaAll()
*/
@Override
protected ItemTypeSearchCriteria getCriteriaAll() {
return new ItemTypeSearchCriteria();
}
}
| true |
dd958c81d908475757220e24f742588a74f6e3e0 | Java | awworthy/property-assessments | /M2Projects/305_Dakota/test/ca/dakota/cmpt305/NeighbourhoodTest.java | UTF-8 | 1,050 | 2.65625 | 3 | [] | no_license | package ca.dakota.cmpt305;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class NeighbourhoodTest {
private Neighbourhood neighbourhood1;
@BeforeEach
void setUp() {
neighbourhood1 = new Neighbourhood("10", "Hamptons", "Ward 3");
}
@Test
void getNeighbourhoodId() {
String expResult = "10";
String result = neighbourhood1.getNeighbourhoodId();
assertEquals(expResult, result);
}
@Test
void getNeighbourhood() {
String expResult = "Hamptons";
String result = neighbourhood1.getNeighbourhood();
assertEquals(expResult, result);
}
@Test
void getWard() {
String expResult = "Ward 3";
String result = neighbourhood1.getWard();
assertEquals(expResult, result);
}
@Test
void testToString() {
String expResult = "Hamptons";
String result = neighbourhood1.toString();
assertEquals(expResult, result);
}
} | true |
f8d22d06d9b036c1a8d9390870761acdd192de8b | Java | seven-org/zh_demo | /zh_project/src/main/java/code/seven/zh_project/domain/ProductTypeMenu.java | UTF-8 | 2,383 | 1.984375 | 2 | [] | no_license | package code.seven.zh_project.domain;
import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* The persistent class for the t_product_type_menu database table.
*
*/
@Entity
@Table(name="t_product_type_menu")
@NamedQuery(name="ProductTypeMenu.findAll", query="SELECT p FROM ProductTypeMenu p")
public class ProductTypeMenu extends DefaultDomain implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="menu_id")
private String menuId;
@Column(name="create_date")
private Timestamp createDate;
@Column(name="menu_code")
private String menuCode;
@Column(name="menu_icon")
private String menuIcon;
@Column(name="menu_icon_after")
private String menuIconAfter;
@Column(name="menu_level")
private String menuLevel;
@Column(name="menu_name")
private String menuName;
@Column(name="menu_type")
private String menuType;
@Column(name="set_top")
private String setTop;
private String state;
public ProductTypeMenu() {
}
public String getMenuId() {
return this.menuId;
}
public void setMenuId(String menuId) {
this.menuId = menuId;
}
public Timestamp getCreateDate() {
return this.createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
public String getMenuCode() {
return this.menuCode;
}
public void setMenuCode(String menuCode) {
this.menuCode = menuCode;
}
public String getMenuIcon() {
return this.menuIcon;
}
public void setMenuIcon(String menuIcon) {
this.menuIcon = menuIcon;
}
public String getMenuIconAfter() {
return this.menuIconAfter;
}
public void setMenuIconAfter(String menuIconAfter) {
this.menuIconAfter = menuIconAfter;
}
public String getMenuLevel() {
return this.menuLevel;
}
public void setMenuLevel(String menuLevel) {
this.menuLevel = menuLevel;
}
public String getMenuName() {
return this.menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
public String getMenuType() {
return this.menuType;
}
public void setMenuType(String menuType) {
this.menuType = menuType;
}
public String getSetTop() {
return this.setTop;
}
public void setSetTop(String setTop) {
this.setTop = setTop;
}
public String getState() {
return this.state;
}
public void setState(String state) {
this.state = state;
}
} | true |
61bf1719ef5c1ef16d91d17c5e920aad257c3d35 | Java | J-Lement/courseDesign | /spring课设/hospital_system/src/main/java/com/nchu/hospital_system/controller/patient/RegisterController.java | UTF-8 | 5,796 | 2.375 | 2 | [] | no_license | package com.nchu.hospital_system.controller.patient;
import com.nchu.hospital_system.bean.*;
import com.nchu.hospital_system.service.patient.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
public class RegisterController {
@Autowired
RegisterService registerService;
@RequestMapping("/patient_index")
public String index(){
return "patient/patient_index";
}
/**
* @Author Lement
* @Description //检测是否由相同用户名,返回相同用户名的个数
* @Date 20:49 2019/6/22
* @Param [account]
* @return java.lang.String
**/
@RequestMapping("/patientRegiste")
@ResponseBody
public String register(@RequestParam("account")String account){
int i = registerService.checkPatientAccount(account);
return i + "";
}
/**
* @Author Lement
* @Description //注册功能,由于thymeleaf的值不能为空,所以第一次访问给页面送一个空的patient对象,跳到注册界面
* 如果注册信息经过了前端的验证跳转到此,就直接存入数据库,完成后跳转到登录界面
* @Date 20:50 2019/6/22
* @Param [patient, model]
* @return java.lang.String
**/
@RequestMapping("/doRegiste")
public String doRegiste(Patient patient, Model model){
System.out.println("patientName:" + patient.getName());
if(patient.getName() == null){
model.addAttribute("patient",patient);
return "patient/register";
}
else {
registerService.insertPatient(patient);
System.out.println("病人姓名:" + patient.getName());
return "login";
}
}
/**
* @Author Lement
* @Description //从数据库中查询获取所有科室的信息,然后跳转到科室选择界面
* @Date 20:53 2019/6/22
* @Param [model]
* @return java.lang.String
**/
@RequestMapping("/selectDepartment")
public String selectDepartment(Model model){
List<Dept> list = registerService.queryAllDepartment();
model.addAttribute("deptList",list);
return "patient/selectDepartment";
}
/**
* @Author Lement
* @Description //通过点击某一个科室跳转到此,查询此科室下的所有医生信息,然后跳转到医生选择界面
* @Date 20:55 2019/6/22
* @Param [dept, model]
* @return java.lang.String
**/
@RequestMapping("/selectDoctor")
public String selectDoctor(@RequestParam("dept")String dept, Model model){
List<Doctor> list = registerService.queryDoctorByDept(dept);
model.addAttribute("dList",list);
return "patient/selectDoctor";
}
/**
* @Author Lement
* @Description //Test,测试数据库
* @Date 12:59 2019/6/22
* @Param [model]
* @return java.lang.String
**/
@RequestMapping("/Doctor")
public String selectDoctor(Model model){
List<Doctor> list = registerService.queryAllDoctor();
model.addAttribute("dList",list);
return "patient/selectDoctor";
}
/**
* @Author Lement
* @Description //在医生选择界面点击某个医生,传入医生账号,通过账号查询该医生的可预约时间信息,跳转到预约界面
* @Date 20:57 2019/6/22
* @Param [account, model]
* @return java.lang.String
**/
@RequestMapping("/orderTime")
public String orderTime(@RequestParam("account")String account, Model model){
List<OrderTime> orderList = registerService.queryOrderTime(account);
model.addAttribute("orderList", orderList);
return "patient/orderTime";
}
/**
* @Author Lement
* @Description //通过ajax访问此类,根据传入的医生账号、日期、上下午时间,查询可预约的号码,返回号码数组
* @Date 20:59 2019/6/22
* @Param [doctorAccount, date, time]
* @return java.util.List<java.lang.Integer>
**/
@RequestMapping("/allOrderNumber")
@ResponseBody
public List<Integer> allOrderNumber(@RequestParam("doctorAccount") String doctorAccount, @RequestParam("date") String date, @RequestParam("time") int time){
System.out.println("account:" + doctorAccount + " date:" + date + " time:" + time);
return registerService.queryOrderNumber(doctorAccount, date, time);
}
/**
* @Author Lement
* @Description //确认预约,将数据存入数据库中
* @Date 21:02 2019/6/22
* @Param [number, doctorAccount, date, time]
* @return java.lang.String
**/
@RequestMapping("/doOrder")
public String doOrder(@RequestParam("number") int number, @RequestParam("doctorAccount") String doctorAccount, @RequestParam("date") String date, @RequestParam("week") int week, @RequestParam("time") int time,@RequestParam("patient")String patient, Model model){
int is_order = 1; //修改号码预约状态
registerService.updateOrderInfo(doctorAccount, date, time, number,is_order);
registerService.updateOrderTime(doctorAccount, week, time);
registerService.insertAssignment(patient ,doctorAccount, date, number);
System.out.println("bingrena 病人啊:" + patient);
List<Assignments> aList = registerService.queryAssignmentByPatient(patient);
model.addAttribute("aList",aList);
return "patient/patient_index";
}
}
| true |
79bcc3864784c24df5340e72d4be1218197af92a | Java | sofay/wechat | /wechat-common/src/main/java/cn/fay/wechat/common/entity/WXMsg.java | UTF-8 | 756 | 1.96875 | 2 | [] | no_license | package cn.fay.wechat.common.entity;
import java.util.Date;
/**
* @author fay fay9395@gmail.com
* @date 2018/4/13 下午4:56.
*/
public abstract class WXMsg {
private String toUserName;
private String fromUserName;
private Date createTime;
public String getToUserName() {
return toUserName;
}
public void setToUserName(String toUserName) {
this.toUserName = toUserName;
}
public String getFromUserName() {
return fromUserName;
}
public void setFromUserName(String fromUserName) {
this.fromUserName = fromUserName;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
| true |
80e096cd5c0d8b89ab88d98ae867123c54366ada | Java | mengzhuoyou/LeetCode | /Leetcode_255_verifyPreOrderInBST.java | UTF-8 | 2,234 | 3.609375 | 4 | [] | no_license | package com.company;
public class Leetcode_255_verifyPreOrderInBST {
/*
对于一个搜索二叉树的前序序列来说, 如果某段序列为一个递减序列, 说明这是一段沿着左子树的路径.
直到碰到一个比前一个大的值, 说明此时已经来到某个结点的右子树上了, 而此时可以得出一个此后序列的下界值,
也就是此后序列的任意一个值必须要比这个结点的父结点的值大, 因为对于搜索二叉树来说根节点左边的都比根节点小,
而根节点右边的都比根节点大, 所以既然现在已经来到某个结点(设为A)的右子树上, 那么此后任何结点的值必然比A的值大.
那么当我们碰到一个比之前结点大的值如何找到他的父结点呢? 可以借助一个栈,
即如果当前结点比栈顶元素小, 就入栈, 如果当前值大于栈顶值, 则让所有比当前结点小的值都出栈,
直到栈顶元素比当前结点大, 则最后一个出栈的比当前结点小的值就是当前结点的父结点,
我们只要在栈元素出栈的时候更新最小下界再将当前元素入栈即可. 另外这样的时间和空间复杂度都是O(n),
但是对于空间复杂度来说, 很容易复用原数组模拟栈来优化.
*/
/*
method 1 :
class Solution {
public boolean verifyPreorder(int[] preorder) {
Stack<Integer> stack = new Stack<>();
int low = Integer.MIN_VALUE; // the current minimum threshold
for(int p : preorder) {
if(p < low) {
return false;
}
while(!stack.isEmpty() && p > stack.peek()) {
low = stack.pop();
}
stack.push(p);
}
return true;
}
}
*/
class Solution {
public boolean verifyPreorder(int[] preorder) {
int k = -1, low = Integer.MIN_VALUE;
for (int p : preorder) {
if (p < low) {
return false;
}
while (k >= 0 && p > preorder[k]) {
low = preorder[k];
k--;
}
k++;
preorder[k] = p;
}
return true;
}
}
}
| true |
dd73e55fec4a4b39fbe7a555475b709ed3210df5 | Java | odininon/FES | /src/main/java/com/freyja/FES/utils/Utils.java | UTF-8 | 833 | 2.109375 | 2 | [] | no_license | package com.freyja.FES.utils;
import com.freyja.FES.FES;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/**
* @author Freyja
* Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
*/
public class Utils {
public static void RegisterRecipes()
{
GameRegistry.addRecipe(new ItemStack(FES.blockReceptacle()), "III", "I I", "IRI", 'I', new ItemStack(Item.ingotIron), 'R', new ItemStack(Item.redstone));
GameRegistry.addRecipe(new ItemStack(FES.blockInjector()), "IRI", "I I", "III", 'I', new ItemStack(Item.ingotIron), 'R', new ItemStack(Item.redstone));
GameRegistry.addRecipe(new ItemStack(FES.blockLine(), 6), "II", "IR", 'I', new ItemStack(Item.ingotIron), 'R', new ItemStack(Item.redstone));
}
}
| true |
b1feaf37b45315fed54b6542d17534eecad1b381 | Java | dmodi2/E-commerce-Web-Project | /CSP 595 Assignment 5/src/bean/User.java | UTF-8 | 1,482 | 2.46875 | 2 | [] | no_license | package bean;
import java.io.Serializable;
public class User implements Serializable{
private String username;
private String email;
private String address;
private String dob;
private int userId;
private String pass;
private int cartSize;
public User(String username, String email, String address, String dob,
int userId, String pass, int cartSize) {
super();
this.username = username;
this.email = email;
this.address = address;
this.dob = dob;
this.userId = userId;
this.pass = pass;
this.cartSize = cartSize;
}
public User() {
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
public int getCartSize() {
return cartSize;
}
public void setCartSize(int cartSize) {
this.cartSize = cartSize;
}
}
| true |
e449ee4c5eccf449265af27c1eda437a744e22da | Java | xusheng199318/MyBatis | /src/main/java/com/arthur/lazyloading/OrderMapper.java | UTF-8 | 386 | 1.867188 | 2 | [] | no_license | package com.arthur.lazyloading;
import com.arthur.pojo.Order;
import com.arthur.pojo.User;
import com.arthur.pojo.UserDTO;
import java.util.List;
public interface OrderMapper {
/*List<Order> getOrderList();
List<UserDTO> getUserOrderList();
Order getOrderById(Integer orderId);*/
User getUserById(Integer userId);
Order findOrdersAndUser(Integer orderId);
}
| true |
e359a24c3339a099c2667836513246765d3b7c35 | Java | InitialMind/YakerBlog | /First/src/main/java/first/first/CustomerController/DetailArticleController.java | UTF-8 | 10,547 | 1.945313 | 2 | [] | no_license | package first.first.CustomerController;
import first.first.Entity.*;
import first.first.Enum.AdmireStatusEnum;
import first.first.Enum.AdmireTypeEnum;
import first.first.Enum.InformStatusEnum;
import first.first.Enum.ReplyTypeEnum;
import first.first.Form.ArticleForm;
import first.first.Form.CommentForm;
import first.first.Form.ReplyForm;
import first.first.Repository.CommentRepository;
import first.first.Repository.ReplyRepository;
import first.first.Service.*;
import first.first.VO.DetailArticleVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.server.Session;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;
/**
* @创建人 weizc
* @创建时间 2018/9/26 8:39
*/
@Controller
@RequestMapping("/customer/detail")
public class DetailArticleController {
@Autowired
ArticleService articleService;
@Autowired
UserService userService;
@Autowired
ArticleCategoryService articleCategoryService;
@Autowired
InformService informService;
@Autowired
NoticeService noticeService;
@Autowired
AdmireService admireService;
@Autowired
CommentRepository commentRepository;
@Autowired
CommentService commentService;
@Autowired
ReplyRepository replyRepository;
@Autowired
ReplyService replyService;
@Autowired
ChatBoxService chatBoxService;
@GetMapping("/article")
public String article(@RequestParam("id") Integer id, HttpSession session, Model model) {
User master = new User();
Integer count = 0;
if (!ObjectUtils.isEmpty(session.getAttribute("username"))) {
master = userService.findByUserName(session.getAttribute("username").toString());
for (ChatBox chatBox : chatBoxService.findByMasterId(master.getUserId())) {
count += chatBox.getUnReadCount();
}
model.addAttribute("user", master);
model.addAttribute("informs", informService.findByAuthorIdAndStatus(master.getUserId(), InformStatusEnum.UNREAD.getStatus()).size() + count);
}
Article article = articleService.findByArticleId(id);
if (!ObjectUtils.isEmpty(article)) {
model.addAttribute("article", article);
User user = userService.findOne(article.getAuthorId());
if (!ObjectUtils.isEmpty(user)) {
model.addAttribute("author", user.getNickName());
} else {
model.addAttribute("author", "");
}
}
Admire admire = admireService.findByTypeAndAimIdAndUserId(AdmireTypeEnum.ARTICLE.getType(), article.getArticleId(), master.getUserId());
if (ObjectUtils.isEmpty(admire) || admire.getAdmireStatus().equals(AdmireStatusEnum.NO.getStatus())) {
model.addAttribute("admireStatus", "N");
} else {
model.addAttribute("admireStatus", "Y");
}
PageRequest request = PageRequest.of(0, 5);
model.addAttribute("notices", noticeService.findAll(request).getContent());
model.addAttribute("categorys", articleCategoryService.findAll());
return "thymeleaf/customer/detail/article";
}
@GetMapping("/getUser")
@ResponseBody
public User getUser() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
HttpSession session = request.getSession();
if (!ObjectUtils.isEmpty(session.getAttribute("username"))) {
return userService.findByUserName(session.getAttribute("username").toString());
}
return null;
}
@GetMapping("/article/api/list")
@ResponseBody
public String article_api(@RequestParam(value = "page") Integer page, @RequestParam("id") Integer id,
HttpSession session) {
User user = userService.findByUserName(session.getAttribute("username").toString());
PageRequest request = PageRequest.of(page - 1, 10, new Sort(Sort.Direction.DESC, "admireCount"));
return DetailArticleVO.getArticleDetail(articleService.findByArticleId(id), request, user);
}
@PostMapping("/article/admire")
@ResponseBody
public boolean article_admire(@RequestParam("aimId") Integer id, @RequestParam("action") String action,
@RequestParam("type") String type) {
User user = getUser();
if (!ObjectUtils.isEmpty(user)) {
if (action.equals("cancel")) {
if (type.equals("article")) {
Admire admire = admireService.findByTypeAndAimIdAndUserId(AdmireTypeEnum.ARTICLE.getType(), id, user.getUserId());
if (!ObjectUtils.isEmpty(admire) && admire.getAdmireStatus().equals(AdmireStatusEnum.YES.getStatus())) {
admireService.deleteByAdmireId(user.getUserId(), id, AdmireTypeEnum.ARTICLE.getType());
return true;
}
} else if (type.equals("comment")) {
Admire admire = admireService.findByTypeAndAimIdAndUserId(AdmireTypeEnum.COMMENT.getType(), id, user.getUserId());
if (!ObjectUtils.isEmpty(admire) && admire.getAdmireStatus().equals(AdmireStatusEnum.YES.getStatus())) {
admireService.deleteByAdmireId(user.getUserId(), id, AdmireTypeEnum.COMMENT.getType());
return true;
}
} else if (type.equals("reply")) {
Admire admire = admireService.findByTypeAndAimIdAndUserId(AdmireTypeEnum.REPLY.getType(), id, user.getUserId());
if (!ObjectUtils.isEmpty(admire) && admire.getAdmireStatus().equals(AdmireStatusEnum.YES.getStatus())) {
admireService.deleteByAdmireId(user.getUserId(), id, AdmireTypeEnum.REPLY.getType());
return true;
}
}
} else if (action.equals("admire")) {
if (type.equals("article")) {
admireService.admire(id, user.getUserId(), AdmireTypeEnum.ARTICLE.getType());
return true;
} else if (type.equals("comment")) {
admireService.admire(id, user.getUserId(), AdmireTypeEnum.COMMENT.getType());
return true;
} else if (type.equals("reply")) {
admireService.admire(id, user.getUserId(), AdmireTypeEnum.REPLY.getType());
return true;
}
}
}
return false;
}
@PostMapping("/article/comment")
@ResponseBody
public boolean article_comment(@RequestParam("articleId") Integer id, @RequestParam("content") String content) {
User user = getUser();
if (!ObjectUtils.isEmpty(user)) {
CommentForm form = new CommentForm();
form.setArticleId(id);
form.setContent(content);
form.setUserId(user.getUserId());
commentService.createComment(form);
return true;
}
return false;
}
@PostMapping("/article/reply")
@ResponseBody
public boolean comment_reply(@RequestParam("content") String content, @RequestParam("id") Integer id,
@RequestParam("commentId") Integer commentId, @RequestParam("type") String type) {
User user = getUser();
if (!ObjectUtils.isEmpty(user)) {
if (type.equals(ReplyTypeEnum.COMMENT.getMessage())) {
Comment comment = commentService.findByCommenId(id);
if (ObjectUtils.isEmpty(comment)) {
return false;
}
}
if (type.equals(ReplyTypeEnum.REPLY.getMessage())) {
Reply reply = replyService.findByReplyId(id);
if (ObjectUtils.isEmpty(reply)) {
return false;
}
}
ReplyForm form = new ReplyForm();
form.setReplyType(type);
form.setAimId(id);
form.setUserId(user.getUserId());
form.setContent(content);
form.setCommentId(commentId);
replyService.createReply(form);
return true;
}
return false;
}
@PostMapping("/article/delete")
@ResponseBody
public boolean delete_reply(@RequestParam("id") Integer id, @RequestParam("type") String type) {
if (!ObjectUtils.isEmpty(getUser())) {
if (type.equals("comment")) {
commentService.deleteComment(id);
return true;
} else if (type.equals("reply")) {
replyService.deleteReply(id);
return true;
}
}
return false;
}
@GetMapping("/article/pub")
public String pub_article(Model model) {
User master = getUser();
if (!ObjectUtils.isEmpty(master)) {
model.addAttribute("user", master);
model.addAttribute("informs", informService.findByAuthorIdAndStatus(master.getUserId(), InformStatusEnum.UNREAD.getStatus()).size());
List<ArticleCategory> list = articleCategoryService.findAll();
model.addAttribute("categorys", list);
}
return "thymeleaf/customer/detail/pub_article";
}
@PostMapping("/article/pub_main")
@ResponseBody
public String pub_main(@RequestParam("title") String title,
@RequestParam("content") String content,
@RequestParam("category") String category) {
User user = getUser();
if (!ObjectUtils.isEmpty(user)) {
ArticleForm form = new ArticleForm();
form.setAuthorId(user.getUserId());
form.setTitle(title);
form.setContent(content);
form.setArticleCategory(category);
return articleService.publish(form).getArticleId().toString();
}
return null;
}
}
| true |
1af4335f70d13f4b17569527d1f27beb480ed9d8 | Java | mikko-apo/jpulsar | /jpulsar/src/test/java/jpulsar/util/JacksonHelper.java | UTF-8 | 2,642 | 2.5625 | 3 | [] | no_license | package jpulsar.util;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.function.Function;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class JacksonHelper {
private final ObjectMapper mapper;
private JacksonHelper(ObjectMapper mapper) {
this.mapper = mapper;
}
public <A, B> void jsonEquals(A a, B b) {
assertEquals(jsonPretty(a), jsonPretty(b));
}
public String jsonPretty(Object a) {
try {
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(a);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
static public JacksonHelper initializeJackson() {
ObjectMapper mapper = new ObjectMapper();
mapper.enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY);
mapper.enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS);
return new JacksonHelper(mapper);
}
static public JacksonHelper initializeScannerJackson() {
JacksonHelper jacksonHelper = initializeJackson();
SimpleModule module = new SimpleModule();
module.addSerializer(Method.class, createObjectStringSerializer(Method::toGenericString));
module.addSerializer(Constructor.class, createObjectStringSerializer(Constructor::toGenericString));
jacksonHelper.mapper.registerModule(module);
return jacksonHelper;
}
private static <T> JsonSerializer<T> createObjectStringSerializer(final Function<T, String> asString) {
return new JsonSerializer<T>() {
@Override
public void serialize(T t, JsonGenerator jgen, SerializerProvider serializerProvider) throws IOException {
jgen.writeString(asString.apply(t));
}
};
}
} | true |
adb5d6f58e3c81d4e17b01c9e06e19fbf840b270 | Java | messiasfernandes/api-Sistema-comercial | /src/main/java/br/com/sistemadegestao/model/CondicaoPagamento.java | UTF-8 | 2,344 | 2.171875 | 2 | [] | no_license | package br.com.sistemadegestao.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;
@Entity
public class CondicaoPagamento implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long codigo;
@NotNull(message = "o Campo descrição é obrigatório!!")
@Column(length = 50)
private String descricao;
/// @Fetch(FetchMode.SUBSELECT)
// @ElementCollection
// @CollectionTable(name = "parcela_codicao", joinColumns = @JoinColumn(name = "condicao_parcela"))
// @AttributeOverrides({ @AttributeOverride(name = "numeroparcela", column = @Column(name = "numparcela")) })
@OneToMany(fetch = FetchType.EAGER, mappedBy = "condicaopagamento", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Parcelas> parcelas = new ArrayList<>();
private Integer qtdeparcelas;
public String getDescricao() {
return descricao;
}
public Integer getQtdeparcelas() {
return qtdeparcelas;
}
public void setQtdeparcelas(Integer qtdeparcelas) {
this.qtdeparcelas = qtdeparcelas;
}
public Long getCodigo() {
return codigo;
}
public void setCodigo(Long codigo) {
this.codigo = codigo;
}
public List<Parcelas> getParcelas() {
return parcelas;
}
public void setParcelas(List<Parcelas> parcelas) {
this.parcelas = parcelas;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((codigo == null) ? 0 : codigo.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CondicaoPagamento other = (CondicaoPagamento) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
return false;
return true;
}
}
| true |
50e91caf42ea4f42c54b2628e5cdcf02553ce38b | Java | nesfit/pyspark-plaso-java-helpers | /src/main/java/tarzan/helpers/rdd/HalyardRDD.java | UTF-8 | 7,249 | 1.945313 | 2 | [
"MIT"
] | permissive | package tarzan.helpers.rdd;
import cz.vutbr.fit.ta.core.RDFConnector;
import cz.vutbr.fit.ta.core.ResourceFactory;
import cz.vutbr.fit.ta.halyard.RDFConnectorHalyard;
import cz.vutbr.fit.ta.ontology.Timeline;
import cz.vutbr.fit.ta.splaso.PlasoEntry;
import cz.vutbr.fit.ta.splaso.PlasoJsonParser;
import cz.vutbr.fit.ta.splaso.SparkPlasoSource;
import io.github.radkovo.rdf4j.builder.TargetModel;
import org.apache.spark.api.java.JavaRDD;
import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.impl.LinkedHashModel;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
public class HalyardRDD {
private static final String MODULE_NAME = "plaso";
private static final String PROFILE_ID = "plasotest";
private static final Charset JSON_ENCODING = StandardCharsets.US_ASCII;
private static final PlasoJsonParser PLASO_PARSER = new PlasoJsonParser();
protected static ByteArrayInputStream objectToByteArrayInputStream(Object object) throws IOException {
if (object instanceof String) {
// it is a String object
final String stringObject = (String) object;
final byte[] byteArray = stringObject.getBytes(JSON_ENCODING);
return new ByteArrayInputStream(byteArray);
} else {
// it is a cPickle object (see a debug file)
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream)) {
objectOutputStream.writeObject(object);
objectOutputStream.flush();
final byte[] byteArray = byteArrayOutputStream.toByteArray();
/* DEBUG *
try (FileOutputStream fileOutputStream
= new FileOutputStream("/tmp/objectToByteArrayInputStream_" + object.toString())) {
fileOutputStream.write(byteArray);
}
/* */
return new ByteArrayInputStream(byteArray);
}
}
}
/**
* Collects and save Plaso (Event, EventData) pairs into Halyard as RDF triplets.
*
* @param javaRDD a JavaRDD object of Plaso (Event, EventData) pairs
* @param tableName Halyard repository/HBase table
* @param hbaseZookeeperQuorumOrConfigPath HBase Zookeeper quorum of HBase config path
* @param hbaseZookeeperClientPort the Zookeeper client port
* @return how long the processing took in nano-seconds
*/
public static long saveToHalyard(JavaRDD<Object> javaRDD, String tableName, String hbaseZookeeperQuorumOrConfigPath,
Integer hbaseZookeeperClientPort) throws IOException {
long startTime = System.nanoTime();
javaRDD.map(jsonString -> PLASO_PARSER.parseSingleEntry(HalyardRDD.objectToByteArrayInputStream(jsonString)))
.foreachPartition(plasoEntryIterator -> HalyardRDD.foreachPartitionFunction(plasoEntryIterator,
tableName, hbaseZookeeperQuorumOrConfigPath, hbaseZookeeperClientPort));
long estimatedTime = System.nanoTime() - startTime;
return estimatedTime;
}
/**
* Collects and save Plaso (Event, EventData) pairs into Halyard as RDF triplets.
*
* @param javaRDD a JavaRDD object of Plaso (Event, EventData) pairs
* @param tableName Halyard repository/HBase table
* @param configPath HBase config path
* @return how long the processing took in nano-seconds
*/
public static long saveToHalyard(JavaRDD<Object> javaRDD, String tableName, String configPath) throws IOException {
return HalyardRDD.saveToHalyard(javaRDD, tableName, configPath, null);
}
/**
* Collects and save Plaso (Event, EventData) pairs into Halyard as RDF triplets.
*
* @param javaRDD a JavaRDD object of Plaso (Event, EventData) pairs
* @param tableName Halyard repository/HBase table
* @return how long the processing took in nano-seconds
*/
public static long saveToHalyard(JavaRDD<Object> javaRDD, String tableName) throws IOException {
return HalyardRDD.saveToHalyard(javaRDD, tableName, null, null);
}
protected static Resource getContext() {
final DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
final Date today = Calendar.getInstance().getTime();
final String stamp = df.format(today);
return ResourceFactory.createResourceIRI(MODULE_NAME, "context", stamp);
}
protected static RDFConnector createRDFConnector(String tableName, String hbaseZookeeperQuorumOrConfigPath, Integer hbaseZookeeperClientPort) throws IOException {
if ((hbaseZookeeperQuorumOrConfigPath != null) && (hbaseZookeeperClientPort != null)) {
return new RDFConnectorHalyard(hbaseZookeeperQuorumOrConfigPath, hbaseZookeeperClientPort, tableName);
} else if (hbaseZookeeperQuorumOrConfigPath != null) {
return new RDFConnectorHalyard(hbaseZookeeperQuorumOrConfigPath, tableName);
} else {
return new RDFConnectorHalyard(tableName);
}
}
/**
* Function usable in RDD.forEachPartition(...) to iterate through a list of Plaso's Entries and insert them into Halyard.
* The RDFConnector must be created here, i.e., at particular workers (not at driver).
*
* @param plasoEntryIterator an iterator through the Plase Entries
* @param tableName Halyard repository/HBase table
* @param hbaseZookeeperQuorumOrConfigPath HBase Zookeeper quorum of HBase config path
* @param hbaseZookeeperClientPort the Zookeeper client port
* @throws IOException RDFConnector cannot be created
*/
protected static void foreachPartitionFunction(Iterator<PlasoEntry> plasoEntryIterator,
String tableName, String hbaseZookeeperQuorumOrConfigPath,
Integer hbaseZookeeperClientPort) throws IOException {
final RDFConnector rdfConnector = HalyardRDD.createRDFConnector(tableName, hbaseZookeeperQuorumOrConfigPath, hbaseZookeeperClientPort);
final List<PlasoEntry> plasoEntriesList =
StreamSupport.stream(Spliterators.spliteratorUnknownSize(plasoEntryIterator, Spliterator.ORDERED), false)
.collect(Collectors.toList());
final SparkPlasoSource sparkPlasoSource = new SparkPlasoSource(PROFILE_ID, plasoEntriesList);
final Timeline timeline = sparkPlasoSource.getTimeline();
final TargetModel targetModel = new TargetModel(new LinkedHashModel());
targetModel.add(timeline);
rdfConnector.add(targetModel.getModel(), getContext());
rdfConnector.close();
}
}
| true |
5a1b43dba99c0b991c19829eddc83a483f56cf01 | Java | yuanmenghaixin/spring-cloud-study | /2018-Finchley/microservice-consumer-movie-ribbon-hystrix/src/main/java/com/cloud/user/controller/MovieController.java | UTF-8 | 2,529 | 2.125 | 2 | [] | no_license | package com.cloud.user.controller;
import com.cloud.user.entity.User;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
/**
* @author zhouli
*/
@RestController
public class MovieController {
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(MovieController.class);
@Autowired
private RestTemplate restTemplate;
@Autowired
private LoadBalancerClient loadBalancerClient;
/* @HystrixCommand(fallbackMethod = "findByIdFallback",
commandProperties = {@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "15000")
*//* , @HystrixProperty(name = "hystrix.command.HystrixCommandKey.metrics.rollingStats.timeInMilliseconds", value = "10000")},
threadPoolProperties = {@HystrixProperty(name = "coreSize", value = "2")
, @HystrixProperty(name = "maxQueueSize", value = "10")*//*})*/
@HystrixCommand(fallbackMethod = "findByIdFallback", commandProperties = {@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "3000")})
@GetMapping("/users/{id}")
@ResponseBody
public User findById(@PathVariable Long id) {
// 这里用到了RestTemplate的占位符能力
User user = this.restTemplate.getForObject("http://microservice-provider-user/users/{id}", User.class, id);
// ...电影微服务的业务...
System.out.println(user);
return user;
}
@GetMapping("/logInstance")
@ResponseBody
public void logUserInstance() {
ServiceInstance serviceInstance = loadBalancerClient.choose("microservice-provider-user");
LOGGER.info("调用的服务信息-{}:{}:{}", serviceInstance.getServiceId(), serviceInstance.getHost(), serviceInstance.getPort());
}
public User findByIdFallback(Long id) {
User user = new User(-1, "默认用户");
return user;
}
}
| true |
0118a12bd4ff2f39e76a003972679c4803d97de2 | Java | saikrishna9542/Playground | /Chalk/Main.java | UTF-8 | 167 | 1.820313 | 2 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n,v;
cin>>n;
v= sqrt(n);
cout<<(n+v+1);
return 0;
//Type your code here.
} | true |
05bc6df722601d678b811f6e643e597e01866451 | Java | estebancasas9817/IngeSoft2.0 | /app/src/main/java/com/company/workpeace/Reciclador/HelperAdapter.java | UTF-8 | 2,118 | 2.140625 | 2 | [] | no_license | package com.company.workpeace.Reciclador;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import com.company.workpeace.R;
import java.util.List;
public class HelperAdapter extends RecyclerView.Adapter {
List<FetchData> fetchData;
public HelperAdapter(List<FetchData> fetchData) {
this.fetchData = fetchData;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item,parent,false);
ViewHolderClass viewHolderClass = new ViewHolderClass(view);
return viewHolderClass;
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) {
ViewHolderClass viewHolderClass = (ViewHolderClass)holder;
final FetchData fetchDataList = fetchData.get(position);
viewHolderClass.textView.setText(fetchDataList.getName());
viewHolderClass.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(),SecondActivity.class);
Bundle bundle = new Bundle();
bundle.putSerializable("key",fetchDataList);
intent.putExtras(bundle);
v.getContext().startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return fetchData.size();
}
public class ViewHolderClass extends RecyclerView.ViewHolder{
TextView textView;
public ViewHolderClass(@NonNull View itemView) {
super(itemView);
textView = itemView.findViewById(R.id.primerTexto);
}
}
}
| true |
0298b552ed086b9a1f44d4c6ac1685b7d3892a86 | Java | yixiaolunhui/OnActivityResult | /onactivityresult/src/main/java/onactivityresult/ActivityResult.java | UTF-8 | 2,786 | 2.40625 | 2 | [
"Apache-2.0"
] | permissive | package onactivityresult;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import onactivityresult.internal.IOnActivityResult;
public final class ActivityResult {
private static final String ACTIVITY_RESULT_CLASS_SUFFIX = "$$OnActivityResult";
static IOnActivityResult<Object> createOnActivityResultClassFor(final Object object) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
final Class<?> target = object.getClass();
final String targetClassName = target.getName();
final Class<?> activityResultClass = Class.forName(targetClassName + ACTIVITY_RESULT_CLASS_SUFFIX);
// noinspection unchecked
return (IOnActivityResult<Object>) activityResultClass.newInstance();
}
public static OnResult onResult(final int requestCode, final int resultCode, @Nullable final Intent intent) {
return new OnResult(requestCode, resultCode, intent);
}
private ActivityResult() {
throw new AssertionError("No instances.");
}
public static final class OnResult {
private final int mRequestCode;
private final int mResultCode;
@Nullable private final Intent mIntent;
OnResult(final int requestCode, final int resultCode, @Nullable final Intent intent) {
mRequestCode = requestCode;
mResultCode = resultCode;
mIntent = intent;
}
public <T> void into(@NonNull final T object) {
final IOnActivityResult<Object> onActivityResult;
try {
onActivityResult = ActivityResult.createOnActivityResultClassFor(object);
} catch (final ClassNotFoundException classNotFound) {
throw new ActivityResultRuntimeException("Could not find OnActivityResult class for " + object.getClass().getName(), classNotFound);
} catch (final IllegalAccessException illegalAccessException) {
throw new ActivityResultRuntimeException("Can't create OnActivityResult class for " + object.getClass().getName(), illegalAccessException);
} catch (final InstantiationException instantiationException) {
throw new ActivityResultRuntimeException("Exception when handling IOnActivityResult " + instantiationException.getMessage(), instantiationException);
}
onActivityResult.onResult(object, mRequestCode, mResultCode, mIntent);
}
}
public static class ActivityResultRuntimeException extends RuntimeException {
public ActivityResultRuntimeException(final String detailMessage, final Throwable throwable) {
super(detailMessage, throwable);
}
}
}
| true |
cbef4fe95bb3818b58723dee8c7ba2681fe5da3c | Java | MrDva/DUcenter | /service-entity/src/main/java/com/ithujiaze/entity/Role.java | UTF-8 | 333 | 1.835938 | 2 | [] | no_license | package com.ithujiaze.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Role {
private int role_Id;
private String role_Name;
private int role_Level;
private List<Authority> authoritys;
}
| true |
f6e83e2628d772c2ddfff99941991970abe3abad | Java | DmytroAksonenko/quick_room | /src/com/aksonenko/messenger/controllers/RoomUIController.java | UTF-8 | 1,895 | 2.734375 | 3 | [] | no_license | package com.aksonenko.messenger.controllers;
import java.io.PrintStream;
import com.aksonenko.messenger.client.Client;
import com.aksonenko.messenger.network.TCPConnection;
import com.aksonenko.messenger.server.RoomServer;
import com.aksonenko.messenger.service.Console;
import com.aksonenko.messenger.service.SceneService;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
//This controller is responsible for connecting the client to the server, inputting and outputting messages.
public class RoomUIController {
private TCPConnection connection;
private String ip;
private int port;
private String nickname;
private boolean serverIsRunning = false;
@FXML
private Label connectionNameLabel;
@FXML
private Button disconnectButton;
@FXML
private TextField text_field;
@FXML
private TextArea textArea;
private PrintStream ps;
@FXML
public void initialize() {
ps = new PrintStream(new Console(textArea), true);
System.setOut(ps);
System.setErr(ps);
connection = ConnectionUIController.getConnection();
ip = ConnectionUIController.getIp();
port = ConnectionUIController.getPort();
nickname = ConnectionUIController.getNickname();
new Client(connection, ip, port, nickname);
connection = Client.getConnection();
connectionNameLabel.setText(nickname);
serverIsRunning = RoomServer.isServerIsRunning();
disconnectButton.setOnAction(event -> {
connection.disconnect();
SceneService sceneService = new SceneService();
sceneService.openScene(disconnectButton, "/views/main.fxml");
});
text_field.setOnAction(event -> {
String textField = text_field.getText().trim();
if (!textField.equals("")) {
connection.sendMessage(nickname + ": " + textField);
text_field.clear();
}
});
}
}
| true |
d84ea7b0bf77e53c653439dc6dfa508cc4b15f71 | Java | naveenhn/spring-projects | /mybuildguru/mbg-api-service/mbg-api-gateway/src/main/java/com/sarvah/mbg/rest/catalog/model/ProductsStatusUpdateResponse.java | UTF-8 | 1,551 | 2.140625 | 2 | [] | no_license | /**
*
*/
package com.sarvah.mbg.rest.catalog.model;
import java.util.Set;
/**
* @author Shivu
*
*/
public class ProductsStatusUpdateResponse {
private String subCategory;
private String brand;
private String status;
private Set<String> productIds;
private String newStatus;
/**
* @return the subCategory
*/
public String getSubCategory() {
return subCategory;
}
/**
* @param subCategory
* the subCategory to set
*/
public void setSubCategory(String subCategory) {
this.subCategory = subCategory;
}
/**
* @return the brand
*/
public String getBrand() {
return brand;
}
/**
* @param brand
* the brand to set
*/
public void setBrand(String brand) {
this.brand = brand;
}
/**
* @return the status
*/
public String getStatus() {
return status;
}
/**
* @param status
* the status to set
*/
public void setStatus(String status) {
this.status = status;
}
/**
* @return the productIds
*/
public Set<String> getProductIds() {
return productIds;
}
/**
* @param productIds
* the productIds to set
*/
public void setProductIds(Set<String> productIds) {
this.productIds = productIds;
}
/**
* @return the newStatus
*/
public String getNewStatus() {
return newStatus;
}
/**
* @param newStatus
* the newStatus to set
*/
public void setNewStatus(String newStatus) {
this.newStatus = newStatus;
}
}
| true |
a856b88826d789373f1a557783c690cc59a45740 | Java | xqkjTeam/myPrpject | /OCRS/src/com/minit/aeap/modules/plan/forms/PlanHeadquartersForm.java | UTF-8 | 1,955 | 1.851563 | 2 | [] | no_license | package com.minit.aeap.modules.plan.forms;
import com.minit.aeap.bases.ModulesBaseBeanForm;
import com.minit.aeap.modules.plan.models.PlanHeadquarters;
public class PlanHeadquartersForm extends ModulesBaseBeanForm {
/**
*
*/
private static final long serialVersionUID = -5629093079991681516L;
private PlanHeadquarters planheadquarters = new PlanHeadquarters();
public PlanHeadquarters getPlanHeadquarters() {
return planheadquarters;
}
public void setPlanHeadquarters(PlanHeadquarters planheadquarters) {
this.planheadquarters = planheadquarters;
}
public String getHeadquartersid() {
return planheadquarters.getHeadquartersid();
}
public void setHeadquartersid(String headquartersid) {
planheadquarters.setHeadquartersid(headquartersid);
}
public String getPlanid() {
return planheadquarters.getPlanid();
}
public void setPlanid(String planid) {
planheadquarters.setPlanid(planid);
}
public String getHqname() {
return planheadquarters.getHqname();
}
public void setHqname(String hqname) {
planheadquarters.setHqname(hqname);
}
public String getHqduty() {
return planheadquarters.getHqduty();
}
public void setHqduty(String hqduty) {
planheadquarters.setHqduty(hqduty);
}
public String getCreatedate() {
return planheadquarters.getCreatedate();
}
public void setCreatedate(String createdate) {
planheadquarters.setCreatedate(createdate);
}
public String getNotes() {
return planheadquarters.getNotes();
}
public void setNotes(String notes) {
planheadquarters.setNotes(notes);
}
public String getStartid() {
return planheadquarters.getStartid();
}
public void setStartid(String startid) {
planheadquarters.setStartid(startid);
}
public String getHqtpe() {
return planheadquarters.getHqtpe();
}
public void setHqtpe(String hqtpe) {
planheadquarters.setHqtpe(hqtpe);
}
}
| true |
4ca2b36d37c47c3ff1043d54682f636a529e9b15 | Java | 5hasis/KhAcademy | /day05/src/condition/Test02_1.java | UTF-8 | 950 | 3.6875 | 4 | [] | no_license | package condition;
import java.lang.*;
import java.util.Scanner;
public class Test02_1 {
public static void main(String[] args) {
//Q : 사용자에게 소지금을 입력받아 주문 가능한 메뉴를 출력
//입력
Scanner sc = new Scanner(System.in);
System.out.println("소지금을 입력하세요");
int money = sc.nextInt();
sc.close();
//계산
boolean ttobbokki = money >= 3000;
boolean omrais = money >= 5000;
boolean jajang = money >= 7000;
boolean chicken = money >= 15000;
//출력
// a == true 에서 == true 는 *1 , +0과 같이 의미 없는 코드이다.
System.out.println("추천 메뉴");
if(ttobbokki){
System.out.println("떡볶이(3000원)");
}
if(omrais) {
System.out.println("자장면(5000원)");
}
if(jajang) {
System.out.println("오므라이스(7000원)");
}
if(chicken) {
System.out.println("치킨(15000원)");
}
}
} | true |
7e4fe3a9de453a7a70a2d02b1f113e57ce04327f | Java | fondorg/mytrack-srv | /src/main/java/ru/fondorg/mytracksrv/service/ProjectIssuesPreDeletion.java | UTF-8 | 641 | 1.953125 | 2 | [] | no_license | package ru.fondorg.mytracksrv.service;
import lombok.RequiredArgsConstructor;
import org.springframework.lang.Nullable;
import ru.fondorg.mytracksrv.exception.ModelDeleteException;
import ru.fondorg.mytracksrv.repo.IssueRepository;
/**
* Deletes all project issues before project deletion
*/
@RequiredArgsConstructor
public class ProjectIssuesPreDeletion extends ProjectPreDeletionAction {
private final IssueRepository issueRepository;
@Override
public boolean preDelete(Long targetId, @Nullable String userId) throws ModelDeleteException {
issueRepository.deleteByProjectId(targetId);
return true;
}
}
| true |
989ec533898123164a43a8e3f1d96a038d4053dd | Java | MoriMorou/Spring_Framework | /HomeworkOne/src/main/java/ru/morou/Classic/Doctor.java | UTF-8 | 84 | 1.898438 | 2 | [] | no_license | package ru.morou.Classic;
public interface Doctor {
void patientAdmission();
}
| true |
a2ce5496111859c5bffe7441337bf576884ac8bc | Java | imbkj/BMSbate | /src/Controller/EmResidencePermit/Emrp_FeeManagerController.java | UTF-8 | 7,469 | 1.539063 | 2 | [] | no_license | package Controller.EmResidencePermit;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Grid;
import org.zkoss.zul.ListModelList;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Window;
import service.ExcelService;
import Model.EmCAFFeeInfoModel;
import Model.EmResidencePermitInfoModel;
import Util.DateStringChange;
import Util.FileOperate;
import Util.UserInfo;
import Util.plyUtil;
import bll.EmResidencePermit.Emrp_FeeOperateBll;
import bll.EmResidencePermit.Emrp_FeeSelectBll;
import bll.EmResidencePermit.Emrp_ListBll;
public class Emrp_FeeManagerController {
private Emrp_FeeSelectBll bll = new Emrp_FeeSelectBll();
private String sqls=" and erpi_fee is not null and erpi_fee>0";
private List<EmResidencePermitInfoModel> list = bll.getFeeList(sqls);
private List<String> clientlist = bll.getClient();
private EmResidencePermitInfoModel model = new EmResidencePermitInfoModel();
private Date erpi_wd_loan_date, erpi_ri_date;
private List<EmResidencePermitInfoModel> cklist = new ArrayList<EmResidencePermitInfoModel>();
@Command
@NotifyChange("list")
public void search(@BindingParam("ownmonth") Date ownmonth) {
if (ownmonth != null) {
DateStringChange c = new DateStringChange();
model.setOwnmonth(c.DatetoSting(ownmonth, "yyyyMM"));
} else {
model.setOwnmonth("");
}
if (erpi_wd_loan_date != null) {
DateStringChange c = new DateStringChange();
model.setErpi_wd_loan_date(c.DatetoSting(erpi_wd_loan_date,
"yyyy-MM-dd"));
} else {
model.setErpi_wd_loan_date("");
}
if (erpi_ri_date != null) {
DateStringChange c = new DateStringChange();
model.setErpi_ri_date(c.DatetoSting(erpi_ri_date, "yyyy-MM-dd"));
} else {
model.setErpi_ri_date("");
}
list = bll.getFeeInfoList(model);
}
// 生成费用明细单号
public Integer createnumber(Grid gd) {
Integer k = 0;
// 检查是否有勾选数据
if (cklist.size() > 0) {
String number = "WJZZ" + GetNowDate();
String addname = UserInfo.getUsername();
Emrp_FeeOperateBll obll = new Emrp_FeeOperateBll();
for (EmResidencePermitInfoModel m : cklist) {
EmCAFFeeInfoModel model = new EmCAFFeeInfoModel();
model.setGid(m.getGid());
model.setCid(m.getCid());
model.setOwnmonth(Integer.parseInt(m.getOwnmonth()));
model.setEcfi_caf_id(m.getErpi_id());
model.setEcfi_cl_number(number);
model.setEcfi_payment_kind(m.getErpi_payment_kind());
model.setEcfi_payment_state(m.getErpi_payment_state());
model.setEcfi_fee(m.getErpi_fee());
model.setEcfi_addname(addname);
m.setErpi_cl_number(number);
if (m.getErpi_fee()!=null&&m.getErpi_fee() > 0) {
k = k + obll.EmCAFFeeInfoAdd(model);
}
}
} else {
Messagebox.show("请选择数据", "提示", Messagebox.OK, Messagebox.ERROR);
}
return k;
}
// 全选
@Command
public void checkall(@BindingParam("gd") Grid gd,
@BindingParam("ck") Checkbox ck) {
if (!cklist.isEmpty()) {
cklist.clear();
}
Integer num = gd.getRows().getChildren().size();
for (int i = 0; i < num; i++) {
if (gd.getCell(i, 13) != null) {
Checkbox cb = (Checkbox) gd.getCell(i, 13).getChildren().get(0);
cb.setChecked(ck.isChecked());
if (cb.isChecked()) {
EmResidencePermitInfoModel m = cb.getValue();
cklist.add(m);
}
}
}
}
// 单选
@Command
public void checkck(@BindingParam("gd") Grid gd) {
if (!cklist.isEmpty()) {
cklist.clear();
}
Integer num = gd.getRows().getChildren().size();
for (int i = 0; i < num; i++) {
if (gd.getCell(i, 13) != null) {
Checkbox ck = (Checkbox) gd.getCell(i, 13).getChildren().get(0);
EmResidencePermitInfoModel m = ck.getValue();
if (ck.isChecked()) {
cklist.add(m);
}
}
}
}
// 生成支付明细excel
@Command
@NotifyChange("list")
public void Export(@BindingParam("gd") Grid gd, HttpServletResponse response)
throws Exception {
if (cklist.size() > 0) {
Integer k = createnumber(gd);
if (k > 0) {
plyUtil ply = new plyUtil();
String path = "/../../EmResidencePermit/file/";
String paths = "EmResidencePermit/downloadfile/";
String absolutePath = FileOperate.getAbsolutePath();
String filename = "hdmx.xls";
String number = "WJZZ" + GetNowDate();
// 创建当前日子
Date date = new Date();
// 格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
// 格式化日期(产生文件名)
String newfilename = "居住证明细" + sdf.format(date) + ".xls";
// 获取绝对路径
String solpath = ply.getAbsolutePath(path, filename, this);// 获取模板路径
// 创建文件
// File file = new File(path);
// file.createNewFile();
try {
File f = new File(absolutePath + paths + newfilename);
if (f.isFile()) {
f.delete();
}
ExcelService exl = new newExcelImpl(solpath, absolutePath
+ paths + newfilename, cklist, number);
exl.writeExcel();
list = bll.getFeeInfoList(model);
} catch (Exception e) {
System.out.println(e.toString());
}
FileOperate.download(paths + newfilename);
} else {
Messagebox.show("生成支付明细失败", "提示", Messagebox.OK,
Messagebox.ERROR);
}
} else {
Messagebox.show("请选择数据", "提示", Messagebox.OK, Messagebox.ERROR);
}
}
// 详情
@Command("detail")
public void detail(@BindingParam("each") EmResidencePermitInfoModel m,
@BindingParam("role") String role) {
String url = "Emrp_Detail.zul";
Map<String, Object> map = new HashMap<String, Object>();
map.put("daid", m.getErpi_id());
map.put("role", role);
Window win = (Window) Executions.createComponents(url, null, map);
win.doModal();
}
public String GetNowDate() {
String temp_str = "";
Date dt = new Date();
// 最后的aa表示“上午”或“下午” HH表示24小时制 如果换成hh表示12小时制
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
temp_str = sdf.format(dt);
return temp_str;
}
public List<EmResidencePermitInfoModel> getList() {
return list;
}
public void setList(List<EmResidencePermitInfoModel> list) {
this.list = list;
}
public EmResidencePermitInfoModel getModel() {
return model;
}
public void setModel(EmResidencePermitInfoModel model) {
this.model = model;
}
public List<String> getClientlist() {
return clientlist;
}
public void setClientlist(List<String> clientlist) {
this.clientlist = clientlist;
}
public Date getErpi_wd_loan_date() {
return erpi_wd_loan_date;
}
public void setErpi_wd_loan_date(Date erpi_wd_loan_date) {
this.erpi_wd_loan_date = erpi_wd_loan_date;
}
public Date getErpi_ri_date() {
return erpi_ri_date;
}
public void setErpi_ri_date(Date erpi_ri_date) {
this.erpi_ri_date = erpi_ri_date;
}
}
| true |
40df96e86055436102c8e55229af17dca074cc69 | Java | SanketG12/Demo1 | /src/OtherPackage/ExceptionHandling.java | UTF-8 | 910 | 3.53125 | 4 | [] | no_license | package OtherPackage;
public class ExceptionHandling {
public static void main(String[] args) {
int a=5;
int b=0;
int k=0;
try
{
// k= a/b;
//System.out.println(k)
int array[]=new int[5];
System.out.println(array[7]);
}
catch(ArithmeticException et)
{
System.out.println("ArithmeticException is handle by catch block");
}
catch(IndexOutOfBoundsException ets)
{
System.out.println("IndexOutOfBoundsException is handle by catch block");
}
catch(Exception e)
{
System.out.println("Exception is handle by catch block");
}
finally
{
System.out.println("Finally block will always exexute irrespective of error thrown or not");
System.out.println("Without try and catch blocks Finally block will not work ");
System.out.println("Finally block execution will stop only when we stop JVM forcefully");
}
}
}
| true |
e5991999142dba669ea19ace3f9cf9af07e388d3 | Java | soldiers1989/comsui | /Barclays/src/main/java/com/suidifu/barclays/unionpay/model/GZUnionPayRtnInfo.java | UTF-8 | 1,560 | 1.851563 | 2 | [] | no_license | package com.suidifu.barclays.unionpay.model;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@XStreamAlias("INFO")
public class GZUnionPayRtnInfo {
@XStreamAlias("TRX_CODE")
private String trxCode; //交易代码
@XStreamAlias("VERSION")
private String version; //版本
@XStreamAlias("DATA_TYPE")
private String dataType; //数据格式
@XStreamAlias("REQ_SN")
private String reqSn; //交易流水号
@XStreamAlias("RET_CODE")
private String retCode; //返回代码
@XStreamAlias("ERR_MSG")
private String errMsg; //错误信息
@XStreamAlias("SIGNED_MSG")
private String signMsg; //签名信息
public String getTrxCode() {
return trxCode;
}
public void setTrxCode(String trxCode) {
this.trxCode = trxCode;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getReqSn() {
return reqSn;
}
public void setReqSn(String reqSn) {
this.reqSn = reqSn;
}
public String getRetCode() {
return retCode;
}
public void setRetCode(String retCode) {
this.retCode = retCode;
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public String getSignMsg() {
return signMsg;
}
public void setSignMsg(String signMsg) {
this.signMsg = signMsg;
}
public boolean isSuc(){
return "0000".equals(retCode);
}
}
| true |
2ed7f8b8fa98c1c3e379a8fcb785634a870eaa12 | Java | OpenAPITools/openapi-generator | /modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java | UTF-8 | 5,495 | 1.617188 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
* Copyright 2018 SmartBear Software
*
* 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
*
* https://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.openapitools.codegen.languages;
import org.openapitools.codegen.*;
import org.openapitools.codegen.meta.features.*;
import java.io.File;
import java.util.EnumSet;
public class StaticDocCodegen extends DefaultCodegen implements CodegenConfig {
protected String invokerPackage = "org.openapitools.client";
protected String groupId = "org.openapitools";
protected String artifactId = "openapi-client";
protected String artifactVersion = "1.0.0";
protected String sourceFolder = "docs";
public StaticDocCodegen() {
super();
modifyFeatureSet(features -> features
.documentationFeatures(EnumSet.allOf(DocumentationFeature.class))
.dataTypeFeatures(EnumSet.allOf(DataTypeFeature.class))
.wireFormatFeatures(EnumSet.allOf(WireFormatFeature.class))
.securityFeatures(EnumSet.allOf(SecurityFeature.class))
.globalFeatures(EnumSet.allOf(GlobalFeature.class))
.parameterFeatures(EnumSet.allOf(ParameterFeature.class))
.schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class))
);
// clear import mapping (from default generator) as this generator does not use it
// at the moment
importMapping.clear();
outputFolder = "docs";
modelTemplateFiles.put("model.mustache", ".html");
apiTemplateFiles.put("operation.mustache", ".html");
embeddedTemplateDir = templateDir = "openapi-static";
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
additionalProperties.put(CodegenConstants.GROUP_ID, groupId);
additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
supportingFiles.add(new SupportingFile("package.mustache", "", "package.json"));
supportingFiles.add(new SupportingFile("main.mustache", "", "main.js"));
supportingFiles.add(new SupportingFile("assets/css/bootstrap-responsive.css",
outputFolder + "/assets/css", "bootstrap-responsive.css"));
supportingFiles.add(new SupportingFile("assets/css/bootstrap.css",
outputFolder + "/assets/css", "bootstrap.css"));
supportingFiles.add(new SupportingFile("assets/css/style.css",
outputFolder + "/assets/css", "style.css"));
supportingFiles.add(new SupportingFile("assets/images/logo.png",
outputFolder + "/assets/images", "logo.png"));
supportingFiles.add(new SupportingFile("assets/js/bootstrap.js",
outputFolder + "/assets/js", "bootstrap.js"));
supportingFiles.add(new SupportingFile("assets/js/jquery-1.8.3.min.js",
outputFolder + "/assets/js", "jquery-1.8.3.min.js"));
supportingFiles.add(new SupportingFile("assets/js/main.js",
outputFolder + "/assets/js", "main.js"));
supportingFiles.add(new SupportingFile("index.mustache",
outputFolder, "index.html"));
instantiationTypes.put("array", "ArrayList");
instantiationTypes.put("map", "HashMap");
}
@Override
public CodegenType getTag() {
return CodegenType.DOCUMENTATION;
}
@Override
public String getName() {
return "dynamic-html";
}
@Override
public String getHelp() {
return "Generates a dynamic HTML site.";
}
@Override
public String escapeReservedWord(String name) {
if (this.reservedWordsMappings().containsKey(name)) {
return this.reservedWordsMappings().get(name);
}
return "_" + name;
}
@Override
public String apiFileFolder() {
return outputFolder + File.separator + sourceFolder + File.separator + "operations";
}
@Override
public String modelFileFolder() {
return outputFolder + File.separator + sourceFolder + File.separator + "models";
}
@Override
public String escapeQuotationMark(String input) {
// just return the original string
return input;
}
@Override
public String escapeUnsafeCharacters(String input) {
// just return the original string
return input;
}
@Override
public GeneratorLanguage generatorLanguage() { return null; }
}
| true |
d5a4511841da351bbfd50ca7b845729d60bef553 | Java | pratikpatelx/Flashy | /app/src/test/java/comp3350/flashy/tests/integration/UserIntegration.java | UTF-8 | 1,651 | 2.578125 | 3 | [] | no_license | package comp3350.flashy.tests.integration;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import comp3350.flashy.logic.UserManager;
import comp3350.flashy.persistence.DatabaseImplementations.HSQLDB.UserDatabaseHSQLDB;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
public class UserIntegration {
private UserManager userM;
private File testDB;
private String user, password;
@Before
public void setUp() throws IOException {
this.testDB = DatabaseDuplicator.copyDB();
final UserDatabaseHSQLDB userDB= new UserDatabaseHSQLDB(this.testDB.getAbsolutePath().replace(".script", ""));
this.userM = new UserManager(userDB);
user = "user";
password = "hunter2";
}
@Test
public void userIntegrationTest(){
Collection users = userM.getAllProfiles();
assertEquals(0,users.size());
userM.addUserToDatabase(user,password);
users = userM.getAllProfiles();
assertEquals(1,users.size());
assertTrue(userM.verifyUserPassword(user,password));
assertFalse(userM.verifyUserPassword(user,"admin123"));
userM.removeUserFromDatabase(user);
users = new ArrayList<String>(userM.getAllProfiles());
assertEquals(0,users.size());
System.out.println("UserManager Integration test complete.");
}
@After
public void tearDown(){
testDB.delete();
}
}
| true |
9052c0a236c3ac397db7e5462b4780180fc8f195 | Java | shixk/javaDemo | /src/main/java/com/xuekai/algorithm/LeetcodeMindepth.java | UTF-8 | 999 | 2.90625 | 3 | [] | no_license | package com.xuekai.algorithm;
import com.xuekai.entity.TreeNode;
import java.util.LinkedList;
import java.util.Queue;
/**
* @Author shixuekai
* @CreateDate 2021/3/30
* @Description
**/
public class LeetcodeMindepth {
private int solution(TreeNode root){
if(root==null){
return 0;
}
Queue<TreeNode> queue = new LinkedList<>();
queue.offer(root);
int result=0;
while (!queue.isEmpty()){
result++;
int size = queue.size();
for(int i=0;i<size;i++){
TreeNode node = queue.poll();
if(node.getRight()==null&&node.getLeft()==null){
return result;
}
if(node.getLeft()!=null){
queue.offer(node.getLeft());
}
if(node.getRight()!=null){
queue.offer(node.getRight());
}
}
}
return result;
}
}
| true |
a2cf8d9e66bf76ae598d1d5fe36dff884b893664 | Java | fyl19920820/lovers-website | /src/main/java/cn/fengyunxiao/nest/entity/Chat.java | UTF-8 | 921 | 2.421875 | 2 | [] | no_license | package cn.fengyunxiao.nest.entity;
import java.sql.Timestamp;
public class Chat {
private Integer cid;
private Byte male; // 性别,0宝宝,1我,2游客
private String content;
private Timestamp pubtime;
public Integer getCid() {
return cid;
}
public void setCid(Integer cid) {
this.cid = cid;
}
public Byte getMale() {
return male;
}
public void setMale(Byte male) {
this.male = male;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Timestamp getPubtime() {
return pubtime;
}
public void setPubtime(Timestamp pubtime) {
this.pubtime = pubtime;
}
@Override
public String toString() {
return "Chat{" +
"cid=" + cid +
'}';
}
}
| true |
29cad9b58959b84defa904661c5f557a9a007088 | Java | tsuzcx/qq_apk | /com.tencent.mm/classes.jar/com/google/android/gms/wearable/internal/zzl.java | UTF-8 | 7,035 | 1.914063 | 2 | [] | no_license | package com.google.android.gms.wearable.internal;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import com.tencent.matrix.trace.core.AppMethodBeat;
public final class zzl
extends AbstractSafeParcelable
{
public static final Parcelable.Creator<zzl> CREATOR;
private int id;
private final String packageName;
private final String zzbf;
private final String zzbg;
private final String zzbh;
private final String zzbi;
private final String zzbj;
private final String zzbk;
private final byte zzbl;
private final byte zzbm;
private final byte zzbn;
private final byte zzbo;
static
{
AppMethodBeat.i(101436);
CREATOR = new zzm();
AppMethodBeat.o(101436);
}
public zzl(int paramInt, String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, byte paramByte1, byte paramByte2, byte paramByte3, byte paramByte4, String paramString7)
{
this.id = paramInt;
this.zzbf = paramString1;
this.zzbg = paramString2;
this.zzbh = paramString3;
this.zzbi = paramString4;
this.zzbj = paramString5;
this.zzbk = paramString6;
this.zzbl = paramByte1;
this.zzbm = paramByte2;
this.zzbn = paramByte3;
this.zzbo = paramByte4;
this.packageName = paramString7;
}
public final boolean equals(Object paramObject)
{
AppMethodBeat.i(101434);
if (this == paramObject)
{
AppMethodBeat.o(101434);
return true;
}
if ((paramObject == null) || (getClass() != paramObject.getClass()))
{
AppMethodBeat.o(101434);
return false;
}
paramObject = (zzl)paramObject;
if (this.id != paramObject.id)
{
AppMethodBeat.o(101434);
return false;
}
if (this.zzbl != paramObject.zzbl)
{
AppMethodBeat.o(101434);
return false;
}
if (this.zzbm != paramObject.zzbm)
{
AppMethodBeat.o(101434);
return false;
}
if (this.zzbn != paramObject.zzbn)
{
AppMethodBeat.o(101434);
return false;
}
if (this.zzbo != paramObject.zzbo)
{
AppMethodBeat.o(101434);
return false;
}
if (!this.zzbf.equals(paramObject.zzbf))
{
AppMethodBeat.o(101434);
return false;
}
if (this.zzbg != null)
{
if (this.zzbg.equals(paramObject.zzbg)) {}
}
else {
while (paramObject.zzbg != null)
{
AppMethodBeat.o(101434);
return false;
}
}
if (!this.zzbh.equals(paramObject.zzbh))
{
AppMethodBeat.o(101434);
return false;
}
if (!this.zzbi.equals(paramObject.zzbi))
{
AppMethodBeat.o(101434);
return false;
}
if (!this.zzbj.equals(paramObject.zzbj))
{
AppMethodBeat.o(101434);
return false;
}
if (this.zzbk != null)
{
if (this.zzbk.equals(paramObject.zzbk)) {}
}
else {
while (paramObject.zzbk != null)
{
AppMethodBeat.o(101434);
return false;
}
}
if (this.packageName != null)
{
boolean bool = this.packageName.equals(paramObject.packageName);
AppMethodBeat.o(101434);
return bool;
}
if (paramObject.packageName == null)
{
AppMethodBeat.o(101434);
return true;
}
AppMethodBeat.o(101434);
return false;
}
public final int hashCode()
{
int k = 0;
AppMethodBeat.i(101435);
int m = this.id;
int n = this.zzbf.hashCode();
int i;
int i1;
int i2;
int i3;
if (this.zzbg != null)
{
i = this.zzbg.hashCode();
i1 = this.zzbh.hashCode();
i2 = this.zzbi.hashCode();
i3 = this.zzbj.hashCode();
if (this.zzbk == null) {
break label197;
}
}
label197:
for (int j = this.zzbk.hashCode();; j = 0)
{
int i4 = this.zzbl;
int i5 = this.zzbm;
int i6 = this.zzbn;
int i7 = this.zzbo;
if (this.packageName != null) {
k = this.packageName.hashCode();
}
AppMethodBeat.o(101435);
return (((((j + ((((i + ((m + 31) * 31 + n) * 31) * 31 + i1) * 31 + i2) * 31 + i3) * 31) * 31 + i4) * 31 + i5) * 31 + i6) * 31 + i7) * 31 + k;
i = 0;
break;
}
}
public final String toString()
{
AppMethodBeat.i(101433);
int i = this.id;
String str1 = this.zzbf;
String str2 = this.zzbg;
String str3 = this.zzbh;
String str4 = this.zzbi;
String str5 = this.zzbj;
String str6 = this.zzbk;
int j = this.zzbl;
int k = this.zzbm;
int m = this.zzbn;
int n = this.zzbo;
String str7 = this.packageName;
str1 = String.valueOf(str1).length() + 211 + String.valueOf(str2).length() + String.valueOf(str3).length() + String.valueOf(str4).length() + String.valueOf(str5).length() + String.valueOf(str6).length() + String.valueOf(str7).length() + "AncsNotificationParcelable{, id=" + i + ", appId='" + str1 + '\'' + ", dateTime='" + str2 + '\'' + ", notificationText='" + str3 + '\'' + ", title='" + str4 + '\'' + ", subtitle='" + str5 + '\'' + ", displayName='" + str6 + '\'' + ", eventId=" + j + ", eventFlags=" + k + ", categoryId=" + m + ", categoryCount=" + n + ", packageName='" + str7 + '\'' + '}';
AppMethodBeat.o(101433);
return str1;
}
public final void writeToParcel(Parcel paramParcel, int paramInt)
{
AppMethodBeat.i(101432);
paramInt = SafeParcelWriter.beginObjectHeader(paramParcel);
SafeParcelWriter.writeInt(paramParcel, 2, this.id);
SafeParcelWriter.writeString(paramParcel, 3, this.zzbf, false);
SafeParcelWriter.writeString(paramParcel, 4, this.zzbg, false);
SafeParcelWriter.writeString(paramParcel, 5, this.zzbh, false);
SafeParcelWriter.writeString(paramParcel, 6, this.zzbi, false);
SafeParcelWriter.writeString(paramParcel, 7, this.zzbj, false);
if (this.zzbk == null) {}
for (String str = this.zzbf;; str = this.zzbk)
{
SafeParcelWriter.writeString(paramParcel, 8, str, false);
SafeParcelWriter.writeByte(paramParcel, 9, this.zzbl);
SafeParcelWriter.writeByte(paramParcel, 10, this.zzbm);
SafeParcelWriter.writeByte(paramParcel, 11, this.zzbn);
SafeParcelWriter.writeByte(paramParcel, 12, this.zzbo);
SafeParcelWriter.writeString(paramParcel, 13, this.packageName, false);
SafeParcelWriter.finishObjectHeader(paramParcel, paramInt);
AppMethodBeat.o(101432);
return;
}
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes7.jar
* Qualified Name: com.google.android.gms.wearable.internal.zzl
* JD-Core Version: 0.7.0.1
*/ | true |
c07f5a89cd9186c3919eef2c60777fe5265d5114 | Java | SergeyBurlaka/DevelopersAndroidPlayerDemo | /app/src/main/java/com/oliverstudio/developersandroidplayer/ui/main_screen/videos_fragment/view/adapters/RecyclerToFragment.java | UTF-8 | 278 | 1.820313 | 2 | [] | no_license | package com.oliverstudio.developersandroidplayer.ui.main_screen.videos_fragment.view.adapters;
import com.oliverstudio.developersandroidplayer.data.model.Video;
public interface RecyclerToFragment {
void insertVideoToDB(Video video);
void openVideo(int position);
}
| true |
304d4a573e2e22ccaef78d027e69568c10091ad4 | Java | sbreidba/nter.portal-core-devel | /portlet/catalog/catalog-portlet/src/main/java/org/nterlearning/course/search/ResultAndScorePair.java | UTF-8 | 1,384 | 2.109375 | 2 | [] | no_license | /*
National Training and Education Resource (NTER)
Copyright (C) 2012 SRI International
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
package org.nterlearning.course.search;
/**
* And immutable object pair containing Liferay Search ResultRow and it's
* associated search score as a double.
*
* @author bblonski
*
*/
public class ResultAndScorePair {
private final OpenSearchResult resultRow;
private final double score;
public ResultAndScorePair(OpenSearchResult resultRow, double score) {
this.resultRow = resultRow;
this.score = score;
}
public OpenSearchResult getResultRow() {
return resultRow;
}
public double getSearchScore() {
return score;
}
} | true |