blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
d516c5f665417bfae83db97560dfb1594d3f00bc
e3f778bff4ff856de0dabccff672da420810c462
/src/a/array/search/BinarySearch.java
4639010fb3d078772eca94f1d3658c623cadb14f
[]
no_license
junjunlei/data-structures-alogrithms
b8157a6746ca27e0203b8364d2d18fc42d8dd7e2
c21615babb66bbe2008bf1cace0a9ca3331f6db1
refs/heads/master
2023-01-27T22:30:53.781631
2020-12-07T01:51:29
2020-12-07T01:51:29
311,261,691
0
0
null
null
null
null
UTF-8
Java
false
false
1,869
java
package a.array.search; /** * 二分查找算法 * <p> * 思路:while循环或者递归 * * 效率 log(n) * * @author junjun.lei * @create 2020-11-09 16:15 */ public class BinarySearch { public static void main(String[] args) { int[] arr = {1, 2, 3, 4, 5, 6, 7}; int i = binarySearchWhile(arr, 8); int i2 = binarySearchRecursion(arr, 0, arr.length - 1, 7); System.out.println(i); System.out.println(i2); } /** * while循环二分查找 * * @param source 源数组 * @param target 查找目标值 * @return */ private static int binarySearchWhile(int[] source, int target) { int mid; int low = 0; int high = source.length - 1; while (true) { mid = (high + low) / 2; if (source[mid] == target) { return source[mid]; } else if (low > high) { return -1; } else { if (target > source[mid]) { low = mid + 1; } else { high = mid - 1; } } } } /** * 递归二分查找 * * @param source 源数组 * @param low 最小坐标 * @param high 最大坐标 * @param target 目标值 * @return */ private static int binarySearchRecursion(int[] source, int low, int high, int target) { int mid = (low + high) / 2; if (source[mid] == target) { return source[mid]; } else if (low > high) { return -1; } else { if (source[mid] > target) { return binarySearchRecursion(source, low, mid - 1, target); } else { return binarySearchRecursion(source, mid + 1, high, target); } } } }
80e3903bd38047ea8ebde95028282c7d8178d47c
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Closure-110/com.google.javascript.jscomp.ScopedAliases/BBC-F0-opt-80/7/com/google/javascript/jscomp/ScopedAliases_ESTest.java
4ffcafacb157374be4212b25bd6b06699eba2af0
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
7,745
java
/* * This file was automatically generated by EvoSuite * Wed Oct 13 16:44:19 GMT 2021 */ package com.google.javascript.jscomp; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import com.google.javascript.jscomp.AbstractCompiler; import com.google.javascript.jscomp.Compiler; import com.google.javascript.jscomp.CompilerOptions; import com.google.javascript.jscomp.PreprocessorSymbolTable; import com.google.javascript.jscomp.ScopedAliases; import com.google.javascript.jscomp.SyntheticAst; import com.google.javascript.rhino.Node; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class ScopedAliases_ESTest extends ScopedAliases_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { Compiler compiler0 = new Compiler(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = CompilerOptions.NULL_ALIAS_TRANSFORMATION_HANDLER; ScopedAliases scopedAliases0 = new ScopedAliases(compiler0, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); Node node0 = Node.newString((-335), ">{wUXB_qCmsgX]b'"); Node node1 = node0.getAncestor(3231); scopedAliases0.process(node1, node0); assertFalse(node0.isArrayLit()); } @Test(timeout = 4000) public void test1() throws Throwable { Compiler compiler0 = new Compiler(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = CompilerOptions.NULL_ALIAS_TRANSFORMATION_HANDLER; ScopedAliases scopedAliases0 = new ScopedAliases(compiler0, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); // Undeclared exception! // try { scopedAliases0.process((Node) null, (Node) null); // fail("Expecting exception: RuntimeException"); // } catch(RuntimeException e) { // // // // INTERNAL COMPILER ERROR. // // Please report this problem. // // null // // // verifyException("com.google.common.base.Preconditions", e); // } } @Test(timeout = 4000) public void test2() throws Throwable { CompilerOptions compilerOptions0 = new CompilerOptions(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = compilerOptions0.getAliasTransformationHandler(); ScopedAliases scopedAliases0 = new ScopedAliases((AbstractCompiler) null, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); Node node0 = Node.newNumber(0.0, 1736, (-2003)); // Undeclared exception! // try { scopedAliases0.process(node0, node0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.NodeTraversal", e); // } } @Test(timeout = 4000) public void test3() throws Throwable { Compiler compiler0 = new Compiler(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = CompilerOptions.NULL_ALIAS_TRANSFORMATION_HANDLER; ScopedAliases scopedAliases0 = new ScopedAliases(compiler0, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); // Undeclared exception! // try { scopedAliases0.hotSwapScript((Node) null, (Node) null); // fail("Expecting exception: RuntimeException"); // } catch(RuntimeException e) { // // // // INTERNAL COMPILER ERROR. // // Please report this problem. // // null // // // verifyException("com.google.common.base.Preconditions", e); // } } @Test(timeout = 4000) public void test4() throws Throwable { CompilerOptions compilerOptions0 = new CompilerOptions(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = compilerOptions0.getAliasTransformationHandler(); ScopedAliases scopedAliases0 = new ScopedAliases((AbstractCompiler) null, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); SyntheticAst syntheticAst0 = new SyntheticAst("Yj0's6l_XG .&`g;w<"); Node node0 = syntheticAst0.getAstRoot((AbstractCompiler) null); // Undeclared exception! // try { scopedAliases0.hotSwapScript(node0, node0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.NodeTraversal", e); // } } @Test(timeout = 4000) public void test5() throws Throwable { Compiler compiler0 = new Compiler(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = CompilerOptions.NULL_ALIAS_TRANSFORMATION_HANDLER; ScopedAliases scopedAliases0 = new ScopedAliases(compiler0, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); // Undeclared exception! // try { compiler0.parseTestCode("goog.scope"); // // fail("Expecting exception: IllegalArgumentException"); // Unstable assertion // } catch(IllegalArgumentException e) { // // // // Multiple entries with same key: constructor=NOT_IMPLEMENTED and constructor=CONSTRUCTOR // // // verifyException("com.google.common.collect.ImmutableMap", e); // } } @Test(timeout = 4000) public void test6() throws Throwable { Compiler compiler0 = new Compiler(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = CompilerOptions.NULL_ALIAS_TRANSFORMATION_HANDLER; ScopedAliases scopedAliases0 = new ScopedAliases(compiler0, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); Node node0 = new Node(105); Node node1 = new Node(53, node0, node0, node0, node0); scopedAliases0.hotSwapScript(node1, node1); assertEquals(0, Node.SIDE_EFFECTS_ALL); } @Test(timeout = 4000) public void test7() throws Throwable { Compiler compiler0 = new Compiler(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = CompilerOptions.NULL_ALIAS_TRANSFORMATION_HANDLER; ScopedAliases scopedAliases0 = new ScopedAliases(compiler0, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); Node node0 = new Node(105); Node node1 = new Node(53, node0, node0, node0, node0); scopedAliases0.hotSwapScript(node0, node0); assertEquals(30, Node.VAR_ARGS_NAME); } @Test(timeout = 4000) public void test8() throws Throwable { Compiler compiler0 = new Compiler(); CompilerOptions.AliasTransformationHandler compilerOptions_AliasTransformationHandler0 = CompilerOptions.NULL_ALIAS_TRANSFORMATION_HANDLER; ScopedAliases scopedAliases0 = new ScopedAliases(compiler0, (PreprocessorSymbolTable) null, compilerOptions_AliasTransformationHandler0); Node node0 = Node.newString("The body of a goog.scope function cannot use 'throw'."); Node node1 = new Node(37, node0, node0, node0, node0); scopedAliases0.hotSwapScript(node1, node0); assertFalse(node0.isSetterDef()); } }
5c0fd6e3251322295166746f3997c96561a06a3f
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.qqlite/classes.jar/com/tencent/mobileqq/activity/photo/MediaFileFilter$2.java
a20a5ce6eab7802970f4ed80f0432c3b3f44be23
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
619
java
package com.tencent.mobileqq.activity.photo; enum MediaFileFilter$2 { MediaFileFilter$2() { super(str, i, null); } public boolean filter(String paramString) { paramString = MimeHelper.a(paramString); return (paramString == null) || (!"image".equals(paramString[0])) || (!MimeHelper.a(paramString[1])); } public boolean showVideo() { return false; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.qqlite\classes.jar * Qualified Name: com.tencent.mobileqq.activity.photo.MediaFileFilter.2 * JD-Core Version: 0.7.0.1 */
fe1d3ae02836411bdc8dd767f9e1743aab7e7922
9710069ab25df4f29a816a31cc4f827f38bc5d40
/src/Acceso_Datos/SeccionJpaController.java
1c00fe1e447a2b2ae12f03977720fd0db5f9da22
[]
no_license
ChristianNunz/ControlDeNotas-JJB
7880f19b57241804ad97e50186bcac8f9daec11f
778ff33f70b930a64aaa5f20f30f166c757f4cb5
refs/heads/master
2020-07-06T13:56:20.334901
2020-03-17T23:28:05
2020-03-17T23:28:05
203,039,302
1
1
null
null
null
null
UTF-8
Java
false
false
6,211
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Acceso_Datos; import Acceso_Datos.exceptions.NonexistentEntityException; import Acceso_Datos.exceptions.PreexistingEntityException; import Logica_Negocios.Seccion; import java.io.Serializable; import java.math.BigDecimal; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Query; import javax.persistence.EntityNotFoundException; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Root; /** * * @author Jorge Villanueva */ public class SeccionJpaController implements Serializable { public SeccionJpaController(EntityManagerFactory emf) { this.emf = emf; } private EntityManagerFactory emf = null; public EntityManager getEntityManager() { return emf.createEntityManager(); } public void create(Seccion seccion) throws PreexistingEntityException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); em.persist(seccion); em.getTransaction().commit(); } catch (Exception ex) { if (findSeccion(seccion.getIdSeccion()) != null) { throw new PreexistingEntityException("Seccion " + seccion + " already exists.", ex); } throw ex; } finally { if (em != null) { em.close(); } } } public void edit(Seccion seccion) throws NonexistentEntityException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); seccion = em.merge(seccion); em.getTransaction().commit(); } catch (Exception ex) { String msg = ex.getLocalizedMessage(); if (msg == null || msg.length() == 0) { BigDecimal id = seccion.getIdSeccion(); if (findSeccion(id) == null) { throw new NonexistentEntityException("The seccion with id " + id + " no longer exists."); } } throw ex; } finally { if (em != null) { em.close(); } } } public void destroy(BigDecimal id) throws NonexistentEntityException { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); Seccion seccion; try { seccion = em.getReference(Seccion.class, id); seccion.getIdSeccion(); } catch (EntityNotFoundException enfe) { throw new NonexistentEntityException("The seccion with id " + id + " no longer exists.", enfe); } em.remove(seccion); em.getTransaction().commit(); } finally { if (em != null) { em.close(); } } } public List<Seccion> findSeccionEntities() { return findSeccionEntities(true, -1, -1); } public List<Seccion> findSeccionEntities(int maxResults, int firstResult) { return findSeccionEntities(false, maxResults, firstResult); } private List<Seccion> findSeccionEntities(boolean all, int maxResults, int firstResult) { EntityManager em = getEntityManager(); try { CriteriaQuery cq = em.getCriteriaBuilder().createQuery(); cq.select(cq.from(Seccion.class)); Query q = em.createQuery(cq); if (!all) { q.setMaxResults(maxResults); q.setFirstResult(firstResult); } return q.getResultList(); } finally { em.close(); } } public Seccion findSeccion(BigDecimal id) { EntityManager em = getEntityManager(); try { return em.find(Seccion.class, id); } finally { em.close(); } } public int getSeccionCount() { EntityManager em = getEntityManager(); try { CriteriaQuery cq = em.getCriteriaBuilder().createQuery(); Root<Seccion> rt = cq.from(Seccion.class); cq.select(em.getCriteriaBuilder().count(rt)); Query q = em.createQuery(cq); return ((Long) q.getSingleResult()).intValue(); } finally { em.close(); } } public List<String> GetSecciones(String IdLog,Connection con){ try { //ConectionDB con = new ConectionDB(); List<String> secciones = new ArrayList<>(); Statement st = con.createStatement(); ResultSet resultSet = st.executeQuery("SELECT S.NOMBRE_SECCION FROM MATERIA_GRADO M " + "INNER JOIN SECCION S ON M.ID_SECCION= S.ID_SECCION " + "WHERE ID_DOCENTE ="+IdLog+" " + "GROUP BY NOMBRE_SECCION"); while(resultSet.next()){ String sec = resultSet.getString(1); secciones.add(sec); } st.close(); return secciones; } catch (Exception e) { } return null; } public BigDecimal GetIdSeccion(String NombreS,Connection con){ try { // ConectionDB con = new ConectionDB(); Statement st = con.createStatement(); ResultSet resultSet = st.executeQuery("SELECT ID_SECCION FROM SECCION WHERE NOMBRE_SECCION= '"+(NombreS)+"'"); resultSet.next(); int iddd = Integer.parseInt(resultSet.getString(1)); BigDecimal id = new BigDecimal(iddd); st.close(); return id; } catch (Exception e) { return null; } } }
db61d38de2fc89c3e9d3fc4d0e231261c0114cba
9af89e6a56cb6daac61e445eec47688c4610dec2
/SpringBootSecurityJwt/src/main/java/cogent/demo/payload/response/MessageResponse.java
889a74c42107a0df864bff5c7b352fcd6a4f6d21
[]
no_license
rahmed14/WalkingFootwear
436ca7573ecdec514e648f0f0afa91acf4c78ea8
b0aaed61fab6ee35160ff18e1af0fddd5138734b
refs/heads/master
2023-01-16T01:38:04.229064
2020-11-12T04:50:40
2020-11-12T04:50:40
310,379,012
1
0
null
null
null
null
UTF-8
Java
false
false
298
java
package cogent.demo.payload.response; public class MessageResponse { private String message; public MessageResponse(String message) { this.message = message; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
cc178937856a934022015371cef50ca92d584fd9
82a89a3fdb3422053ab39e76f0fb8ca36b8c261f
/leetcode/src/main/java/com/db117/example/leetcode/solution13/Solution1346.java
49987139a28a0daba6c0550cbabe7bb3d0050aac
[ "Apache-2.0" ]
permissive
db117/example
f0dc692e9b81bc287fbb18e055d2d65e55ebba04
ce0b32dbb2a0a28b6a2f72de175c9e2a65201a62
refs/heads/master
2023-04-14T13:59:38.642034
2023-04-07T02:03:56
2023-04-07T02:03:56
149,304,840
2
0
null
null
null
null
UTF-8
Java
false
false
2,320
java
//给你一个整数数组 arr,请你检查是否存在两个整数 N 和 M,满足 N 是 M 的两倍(即,N = 2 * M)。 // // 更正式地,检查是否存在两个下标 i 和 j 满足: // // // i != j // 0 <= i, j < arr.length // arr[i] == 2 * arr[j] // // // // // 示例 1: // // 输入:arr = [10,2,5,3] //输出:true //解释:N = 10 是 M = 5 的两倍,即 10 = 2 * 5 。 // // // 示例 2: // // 输入:arr = [7,1,14,11] //输出:true //解释:N = 14 是 M = 7 的两倍,即 14 = 2 * 7 。 // // // 示例 3: // // 输入:arr = [3,1,7,11] //输出:false //解释:在该情况下不存在 N 和 M 满足 N = 2 * M 。 // // // // // 提示: // // // 2 <= arr.length <= 500 // -10^3 <= arr[i] <= 10^3 // // Related Topics 数组 // 👍 30 👎 0 package com.db117.example.leetcode.solution13; import java.util.Arrays; /** * 1346.检查整数及其两倍数是否存在.check-if-n-and-its-double-exist * * @author db117 * @since 2020-12-17 15:30:08 **/ public class Solution1346 { public static void main(String[] args) { Solution solution = new Solution1346().new Solution(); System.out.println(solution.checkIfExist(new int[]{ -2, 0, 10, -19, 4, 6, -8 })); } //leetcode submit region begin(Prohibit modification and deletion) class Solution { public boolean checkIfExist(int[] arr) { Arrays.sort(arr); for (int i = 0; i < arr.length; i++) { int bs = bs(arr, arr[i] * 2); // 找到且不是自己,(0*2=0) if (bs != -1 && bs != i) { return true; } } return false; } private int bs(int[] arr, int target) { int left = 0, right = arr.length - 1; while (left <= right) { int mid = left + ((right - left) >> 1); int n = arr[mid]; if (n == target) { return mid; } else if (n < target) { left = mid + 1; } else { right = mid - 1; } } return -1; } } //leetcode submit region end(Prohibit modification and deletion) }
3efb2c2e33375fb5068dfdfa5921d11e45095f96
09df7bbdc51d242d787822da24e4a6f6b785bd7e
/common/src/main/java/org/anyway/common/ProcesserConfig.java
6912d61265fe6c50ca407511ddcc00ff13f55980
[]
no_license
wengfujia/anyway-project
66b39e40ba081147fd2e8e2a17bc7d130add811a
40a96119de3c355d3a226315dc98a5bc104ee68f
refs/heads/master
2021-05-03T17:46:29.306275
2017-10-17T05:50:35
2017-10-17T05:50:35
67,350,617
3
2
null
null
null
null
UTF-8
Java
false
false
5,470
java
/** * processer服务的配置信息 */ package org.anyway.common; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.anyway.common.utils.FileUtil; import org.anyway.common.utils.LoggerUtil; import com.nikhaldimann.inieditor.IniEditor; /** * @author wengfj * */ public class ProcesserConfig extends NettyServerConfig{ public final static String CONFIG_FILE_NAME = "./cfg/setting.properties"; private static ProcesserConfig instance = null; //插件包 /** * 业务执行包 */ private String Logic_ExecutorPack = "com.business.executor"; /** * 业务执行消息包 */ private String Logic_MessagePack = "com.business.message"; //业务标识、版本配置信息 private Map<String, String> _pValueList = new HashMap<String, String>(); private Map<String, String> _pBodyList = new HashMap<String, String>(); private Map<String, String> _pVerList = new HashMap<String, String>(); private String HBASE_CONF_DIR = ""; //hbase配置目录(目前不支持) private int DEF_RESPONSE = 0; //默认返回的业务标识号,如果没有找到业务逻辑执行类,则查找是否有默认的业务逻辑类 //WEB站点配置信息 private int Web_Port = 80; //WEB端端口 private boolean Web_IsHttps = false; //是否启用HTTPS true启用 false不启用 private boolean Web_IsUse = false; //是否启用WEB public static ProcesserConfig getInstance() { if (null == instance) { synchronized (ProcesserConfig.class) { if (null == instance) { instance = new ProcesserConfig(); } } } return instance; } /** * Load config inifile * @throws Exception */ public void loadNettyConfig() { List<String> list = new ArrayList<String>(); IniEditor inifile = new IniEditor(); try { inifile.load(FileUtil.toFileName(CONFIG_FILE_NAME)); //读取全局配置信息 SystemConfig.CharsetName = inifile.get("SET", "CharsetName"); SystemConfig.DEBUG = inifile.get("SET", "DEBUG").equals("1") ? true:false; this.Logic_ExecutorPack = inifile.get("SET", "LogicExecutorPack"); this.Logic_MessagePack = inifile.get("SET", "LogicMessagePack"); //读取socket相关的配置信息 setUSPort(Integer.parseInt(inifile.get("UCI_SOCK", "PORT"))); setUSWaitTimeOut(Integer.parseInt(inifile.get("UCI_SOCK", "WaitTime"))); setUSIdleTimeOut(Integer.parseInt(inifile.get("UCI_SOCK", "IdleTimeOut"))); setUSRWTimeOut(Integer.parseInt(inifile.get("UCI_SOCK", "RWTimeOut"))); setUSWorkThreadCount(Integer.parseInt(inifile.get("UCI_SOCK", "WorkThreadCount"))); setUSMaxSendBufferSize(Integer.parseInt(inifile.get("UCI_SOCK", "MaxSendBufferSize"))); setUSMaxReadBufferSize(Integer.parseInt(inifile.get("UCI_SOCK", "MaxReaddBufferSize"))); setUSActive(inifile.get("UCI_SOCK", "Active").equals("1") ? true:false); //读取Http相关的配置信息 setHTPort(Integer.parseInt(inifile.get("HTTP", "PORT"))); setHTWaitTimeOut(Integer.parseInt(inifile.get("HTTP", "WaitTime"))); setHTWorkThreadCount(Integer.parseInt(inifile.get("HTTP", "WorkThreadCount"))); setHTActive(inifile.get("HTTP", "Active").equals("1") ? true : false); //WEB配置信息 this.Web_Port = Integer.parseInt(inifile.get("WEB", "PORT")); this.Web_IsHttps = inifile.get("WEB", "HTTPS").equals("1") ? true : false; this.Web_IsUse = inifile.get("WEB", "Active").equals("1") ? true : false; //获取消息调用存储过程配置信息 list = inifile.optionNames("OTHERS"); this._pValueList.clear(); for (int i=0; i<list.size(); i++) { String key = list.get(i); this._pValueList.put(key.toUpperCase(), inifile.get("OTHERS", key));//key+"="+inifile.get("OTHERS", key) } //获取消息体格式配置信息 list = inifile.optionNames("BODY"); this._pBodyList.clear(); for (int i=0; i<list.size(); i++) { String key = list.get(i); this._pBodyList.put(key.toUpperCase(), inifile.get("BODY", key)); } list = inifile.optionNames("VERSION"); this._pVerList.clear(); for (int i=0; i<list.size(); i++) { String key = list.get(i); this._pVerList.put(key.toUpperCase(), inifile.get("VERSION", key)); } } catch (IOException e) { LoggerUtil.getLogger().error("加载{}出错,{}", CONFIG_FILE_NAME, e.getMessage()); } finally { inifile = null; list = null; } } public String GetValue(String section, String key) { return this._pValueList.get(key.toUpperCase()); } public String GetBodyValue(String section, String key) { return this._pBodyList.get(key.toUpperCase()); } public String GetVerValue(String section, String key) { return this._pVerList.get(key.toUpperCase()); } public String getLogicExecutorPack() { return this.Logic_ExecutorPack; } public String getLogicMessagePack() { return this.Logic_MessagePack; } public String getHbaseConfigDir() { return this.HBASE_CONF_DIR; } public int getDefaultResponseCommandId() { return this.DEF_RESPONSE; } //WEB站点配置信息 public int getWebPort() { return this.Web_Port; } public boolean getWebIsHttps() { return this.Web_IsHttps; } public boolean getWebIsUse() { return this.Web_IsUse; } }
377ad1ff711dc7ba030ba43cd8e4dc4d224de55f
09e9e10bf174f31201bef424dae0c647c668332e
/Laboratorio 4/Tarea/Lab04-Tarea/src/Supermercado/Producto.java
ba563a0e5a580c77855dad351cad75ed60872db7
[]
no_license
LilNoob23/Algoritmica-II
be11bcdf840752fb2e5890feeea79d1005f7b400
8c8d124fd9929829966bf53d037b4219a0eca917
refs/heads/master
2020-12-19T19:38:59.886732
2020-02-25T02:43:11
2020-02-25T02:43:11
235,831,413
0
0
null
null
null
null
UTF-8
Java
false
false
50
java
package Supermercado; public class Producto { }
92962af5e6cf7a3e9c5bef34a288125114750e11
1381dad04e4ba6dcdd854b378cb6a264adf98383
/MIDIDriverSample/src/jp/kshoji/driver/midi/sample/MIDIDriverMultipleSampleActivity.java
0abf2c53b08d3aa1762590308de6ca1043df326b
[ "Apache-2.0" ]
permissive
with-dream/YAMAHA_key_mapping
415a892f1d11471cd2e6d1874b831afe0a2d4baa
57f8dd2048606dddc6d9a2cb89c289dfbf8fdd57
refs/heads/master
2020-03-26T04:39:29.618322
2018-08-13T01:33:50
2018-08-13T01:33:50
144,514,896
0
0
null
null
null
null
UTF-8
Java
false
false
23,816
java
package jp.kshoji.driver.midi.sample; import android.graphics.PorterDuff.Mode; import android.hardware.usb.UsbDevice; import android.media.AudioFormat; import android.media.AudioManager; import android.media.AudioTrack; import android.os.Bundle; import android.os.Handler; import android.os.Handler.Callback; import android.os.Message; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Spinner; import android.widget.Toast; import android.widget.ToggleButton; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.Timer; import java.util.TimerTask; import jp.kshoji.driver.midi.activity.AbstractMultipleMidiActivity; import jp.kshoji.driver.midi.device.MidiInputDevice; import jp.kshoji.driver.midi.device.MidiOutputDevice; import jp.kshoji.driver.midi.sample.util.SoundMaker; import jp.kshoji.driver.midi.sample.util.Tone; /** * Sample Activity for MIDI Driver library * * @author K.Shoji */ public class MIDIDriverMultipleSampleActivity extends AbstractMultipleMidiActivity { // User interface final Handler midiInputEventHandler = new Handler(new Callback() { @Override public boolean handleMessage(Message msg) { if (midiInputEventAdapter != null) { midiInputEventAdapter.add((String)msg.obj); } // message handled successfully return true; } }); final Handler midiOutputEventHandler = new Handler(new Callback() { @Override public boolean handleMessage(Message msg) { if (midiOutputEventAdapter != null) { midiOutputEventAdapter.add((String)msg.obj); } // message handled successfully return true; } }); ArrayAdapter<String> midiInputEventAdapter; ArrayAdapter<String> midiOutputEventAdapter; private ToggleButton thruToggleButton; Spinner cableIdSpinner; Spinner deviceSpinner; ArrayAdapter<UsbDevice> connectedDevicesAdapter; // Play sounds AudioTrack audioTrack; Timer timer; TimerTask timerTask; SoundMaker soundMaker; final Set<Tone> tones = new HashSet<Tone>(); int currentProgram = 0; /** * Choose device from spinner * * @return the MidiOutputDevice from spinner */ @Nullable MidiOutputDevice getMidiOutputDeviceFromSpinner() { if (deviceSpinner != null && deviceSpinner.getSelectedItemPosition() >= 0 && connectedDevicesAdapter != null && !connectedDevicesAdapter.isEmpty()) { UsbDevice device = connectedDevicesAdapter.getItem(deviceSpinner.getSelectedItemPosition()); if (device != null) { Set<MidiOutputDevice> midiOutputDevices = getMidiOutputDevices(); if (midiOutputDevices.size() > 0) { // returns the first one. return (MidiOutputDevice) midiOutputDevices.toArray()[0]; } } } return null; } @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ListView midiInputEventListView = (ListView) findViewById(R.id.midiInputEventListView); midiInputEventAdapter = new ArrayAdapter<String>(this, R.layout.midi_event, R.id.midiEventDescriptionTextView); midiInputEventListView.setAdapter(midiInputEventAdapter); ListView midiOutputEventListView = (ListView) findViewById(R.id.midiOutputEventListView); midiOutputEventAdapter = new ArrayAdapter<String>(this, R.layout.midi_event, R.id.midiEventDescriptionTextView); midiOutputEventListView.setAdapter(midiOutputEventAdapter); thruToggleButton = (ToggleButton) findViewById(R.id.toggleButtonThru); cableIdSpinner = (Spinner) findViewById(R.id.cableIdSpinner); deviceSpinner = (Spinner) findViewById(R.id.deviceNameSpinner); connectedDevicesAdapter = new ArrayAdapter<UsbDevice>(getApplicationContext(), android.R.layout.simple_spinner_dropdown_item, android.R.id.text1, new ArrayList<UsbDevice>()); deviceSpinner.setAdapter(connectedDevicesAdapter); OnTouchListener onToneButtonTouchListener = new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { MidiOutputDevice midiOutputDevice = getMidiOutputDeviceFromSpinner(); if (midiOutputDevice == null) { return false; } int note = 60 + Integer.parseInt((String) v.getTag()); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: midiOutputDevice.sendMidiNoteOn(cableIdSpinner.getSelectedItemPosition(), 0, note, 127); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "NoteOn to: " + midiOutputDevice.getUsbDevice().getDeviceName() + ", cableId: " + cableIdSpinner.getSelectedItemPosition() + ", note: " + note + ", velocity: 127")); break; case MotionEvent.ACTION_UP: midiOutputDevice.sendMidiNoteOff(cableIdSpinner.getSelectedItemPosition(), 0, note, 127); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "NoteOff to: " + midiOutputDevice.getUsbDevice().getDeviceName() + ", cableId: " + cableIdSpinner.getSelectedItemPosition() + ", note: " + note + ", velocity: 127")); break; default: // do nothing. break; } return false; } }; findViewById(R.id.buttonC).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonCis).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonD).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonDis).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonE).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonF).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonFis).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonG).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonGis).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonA).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonAis).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonB).setOnTouchListener(onToneButtonTouchListener); findViewById(R.id.buttonC2).setOnTouchListener(onToneButtonTouchListener); int whiteKeyColor = 0xFFFFFFFF; int blackKeyColor = 0xFF808080; findViewById(R.id.buttonC).getBackground().setColorFilter(whiteKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonCis).getBackground().setColorFilter(blackKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonD).getBackground().setColorFilter(whiteKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonDis).getBackground().setColorFilter(blackKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonE).getBackground().setColorFilter(whiteKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonF).getBackground().setColorFilter(whiteKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonFis).getBackground().setColorFilter(blackKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonG).getBackground().setColorFilter(whiteKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonGis).getBackground().setColorFilter(blackKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonA).getBackground().setColorFilter(whiteKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonAis).getBackground().setColorFilter(blackKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonB).getBackground().setColorFilter(whiteKeyColor, Mode.MULTIPLY); findViewById(R.id.buttonC2).getBackground().setColorFilter(whiteKeyColor, Mode.MULTIPLY); soundMaker = SoundMaker.getInstance(); final int bufferSize = AudioTrack.getMinBufferSize(soundMaker.getSamplingRate(), AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); int timerRate = bufferSize * 1000 / soundMaker.getSamplingRate() / 2; final short[] wav = new short[bufferSize / 2]; audioTrack = prepareAudioTrack(soundMaker.getSamplingRate()); timer = new Timer(); timerTask = new TimerTask() { @Override public void run() { if (soundMaker != null) { synchronized (tones) { for (int i = 0; i < wav.length; i++) { wav[i] = (short) (soundMaker.makeWaveStream(tones) * 1024); } } try { if (audioTrack != null) { audioTrack.write(wav, 0, wav.length); } } catch (NullPointerException e) { // do nothing } } } }; timer.scheduleAtFixedRate(timerTask, 10, timerRate); } @Override protected void onDestroy() { super.onDestroy(); if (timer != null) { try { timer.cancel(); timer.purge(); } catch (Throwable t) { // do nothing } finally { timer = null; } } if (audioTrack != null) { try { audioTrack.stop(); audioTrack.flush(); audioTrack.release(); } catch (Throwable t) { // do nothing } finally { audioTrack = null; } } } /** * Prepare the AudioTrack instance * * @param samplingRate the sampling rate of AudioTrack * @return AudioTrack */ private static @NonNull AudioTrack prepareAudioTrack(int samplingRate) { AudioTrack result = new AudioTrack(AudioManager.STREAM_MUSIC, samplingRate, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, AudioTrack.getMinBufferSize(samplingRate, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT), AudioTrack.MODE_STREAM); result.setStereoVolume(1f, 1f); result.play(); return result; } @Override public void onDeviceAttached(@NonNull UsbDevice usbDevice) { // deprecated method. // do nothing } @Override public void onMidiInputDeviceAttached(@NonNull MidiInputDevice midiInputDevice) { } @Override public void onMidiOutputDeviceAttached(@NonNull final MidiOutputDevice midiOutputDevice) { if (connectedDevicesAdapter != null) { connectedDevicesAdapter.remove(midiOutputDevice.getUsbDevice()); connectedDevicesAdapter.add(midiOutputDevice.getUsbDevice()); connectedDevicesAdapter.notifyDataSetChanged(); } Toast.makeText(MIDIDriverMultipleSampleActivity.this, "USB MIDI Device " + midiOutputDevice.getUsbDevice().getDeviceName() + " has been attached.", Toast.LENGTH_LONG).show(); } @Override public void onDeviceDetached(@NonNull UsbDevice usbDevice) { // deprecated method. // do nothing } @Override public void onMidiInputDeviceDetached(@NonNull MidiInputDevice midiInputDevice) { } @Override public void onMidiOutputDeviceDetached(@NonNull final MidiOutputDevice midiOutputDevice) { if (connectedDevicesAdapter != null) { connectedDevicesAdapter.remove(midiOutputDevice.getUsbDevice()); connectedDevicesAdapter.notifyDataSetChanged(); } Toast.makeText(MIDIDriverMultipleSampleActivity.this, "USB MIDI Device " + midiOutputDevice.getUsbDevice().getDeviceName() + " has been detached.", Toast.LENGTH_LONG).show(); } @Override public void onMidiNoteOff(@NonNull final MidiInputDevice sender, int cable, int channel, int note, int velocity) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "NoteOff from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", note: " + note + ", velocity: " + velocity)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiNoteOff(cable, channel, note, velocity); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "NoteOff from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", note: " + note + ", velocity: " + velocity)); } synchronized (tones) { Iterator<Tone> it = tones.iterator(); while (it.hasNext()) { Tone tone = it.next(); if (tone.getNote() == note) { it.remove(); } } } } @Override public void onMidiNoteOn(@NonNull final MidiInputDevice sender, int cable, int channel, int note, int velocity) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "NoteOn from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", note: " + note + ", velocity: " + velocity)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiNoteOn(cable, channel, note, velocity); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "NoteOn from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", note: " + note + ", velocity: " + velocity)); } synchronized (tones) { if (velocity == 0) { Iterator<Tone> it = tones.iterator(); while (it.hasNext()) { Tone tone = it.next(); if (tone.getNote() == note) { it.remove(); } } } else { tones.add(new Tone(note, velocity / 127.0, currentProgram)); } } } @Override public void onMidiPolyphonicAftertouch(@NonNull final MidiInputDevice sender, int cable, int channel, int note, int pressure) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "PolyphonicAftertouch from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", note: " + note + ", pressure: " + pressure)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiPolyphonicAftertouch(cable, channel, note, pressure); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "PolyphonicAftertouch from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", note: " + note + ", pressure: " + pressure)); } } @Override public void onMidiControlChange(@NonNull final MidiInputDevice sender, int cable, int channel, int function, int value) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "ControlChange from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", function: " + function + ", value: " + value)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiControlChange(cable, channel, function, value); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "ControlChange from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", function: " + function + ", value: " + value)); } } @Override public void onMidiProgramChange(@NonNull final MidiInputDevice sender, int cable, int channel, int program) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "ProgramChange from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", program: " + program)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiProgramChange(cable, channel, program); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "ProgramChange from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", program: " + program)); } currentProgram = program % Tone.FORM_MAX; synchronized (tones) { for (Tone tone : tones) { tone.setForm(currentProgram); } } } @Override public void onMidiChannelAftertouch(@NonNull final MidiInputDevice sender, int cable, int channel, int pressure) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "ChannelAftertouch from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", pressure: " + pressure)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiChannelAftertouch(cable, channel, pressure); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "ChannelAftertouch from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", pressure: " + pressure)); } } @Override public void onMidiPitchWheel(@NonNull final MidiInputDevice sender, int cable, int channel, int amount) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "PitchWheel from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", amount: " + amount)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiPitchWheel(cable, channel, amount); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "PitchWheel from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", channel: " + channel + ", amount: " + amount)); } } @Override public void onMidiSystemExclusive(@NonNull final MidiInputDevice sender, int cable, final byte[] systemExclusive) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "SystemExclusive from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", data:" + Arrays.toString(systemExclusive))); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiSystemExclusive(cable, systemExclusive); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "SystemExclusive from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", data:" + Arrays.toString(systemExclusive))); } } @Override public void onMidiSystemCommonMessage(@NonNull final MidiInputDevice sender, int cable, final byte[] bytes) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "SystemCommonMessage from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", bytes: " + Arrays.toString(bytes))); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiSystemCommonMessage(cable, bytes); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "SystemCommonMessage from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", bytes: " + Arrays.toString(bytes))); } } @Override public void onMidiSingleByte(@NonNull final MidiInputDevice sender, int cable, int byte1) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "SingleByte from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", data: " + byte1)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiSingleByte(cable, byte1); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "SingleByte from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", data: " + byte1)); } } @Override public void onMidiTimeCodeQuarterFrame(@NonNull MidiInputDevice sender, int cable, int timing) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "TimeCodeQuarterFrame from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", timing: " + timing)); } @Override public void onMidiSongSelect(@NonNull MidiInputDevice sender, int cable, int song) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "SongSelect from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", song: " + song)); } @Override public void onMidiSongPositionPointer(@NonNull MidiInputDevice sender, int cable, int position) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "SongPositionPointer from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", position: " + position)); } @Override public void onMidiTuneRequest(@NonNull MidiInputDevice sender, int cable) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "TuneRequest from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable)); } @Override public void onMidiTimingClock(@NonNull MidiInputDevice sender, int cable) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "TimingClock from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable)); } @Override public void onMidiStart(@NonNull MidiInputDevice sender, int cable) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "Start from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable)); } @Override public void onMidiContinue(@NonNull MidiInputDevice sender, int cable) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "Continue from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable)); } @Override public void onMidiStop(@NonNull MidiInputDevice sender, int cable) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "Stop from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable)); } @Override public void onMidiActiveSensing(@NonNull MidiInputDevice sender, int cable) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "ActiveSensing from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable)); } @Override public void onMidiReset(@NonNull MidiInputDevice sender, int cable) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "Reset from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable)); } @Override public void onMidiMiscellaneousFunctionCodes(@NonNull final MidiInputDevice sender, int cable, int byte1, int byte2, int byte3) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "MiscellaneousFunctionCodes from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", byte1: " + byte1 + ", byte2: " + byte2 + ", byte3: " + byte3)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiMiscellaneousFunctionCodes(cable, byte1, byte2, byte3); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "MiscellaneousFunctionCodes from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", byte1: " + byte1 + ", byte2: " + byte2 + ", byte3: " + byte3)); } } @Override public void onMidiCableEvents(@NonNull final MidiInputDevice sender, int cable, int byte1, int byte2, int byte3) { midiInputEventHandler.sendMessage(Message.obtain(midiInputEventHandler, 0, "CableEvents from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", byte1: " + byte1 + ", byte2: " + byte2 + ", byte3: " + byte3)); if (thruToggleButton != null && thruToggleButton.isChecked() && getMidiOutputDeviceFromSpinner() != null) { getMidiOutputDeviceFromSpinner().sendMidiCableEvents(cable, byte1, byte2, byte3); midiOutputEventHandler.sendMessage(Message.obtain(midiOutputEventHandler, 0, "CableEvents from: " + sender.getUsbDevice().getDeviceName() + ", cable: " + cable + ", byte1: " + byte1 + ", byte2: " + byte2 + ", byte3: " + byte3)); } } }
a05133694714232102878c01f4350ecba7fc43f3
3e85b71ef3ba3d6083311b98feb40dcc545b734c
/app/build/generated/source/r/debug/android/support/graphics/drawable/animated/R.java
b72100fc4a3a51e3e2ddea05972f8fef1edc1393
[]
no_license
dravgit/MRZreader
951f5a0220c1cf90db2be3676c6b656bb4a5a077
30ac57f50a60dbc15154e6af2045bc6f9f32f05f
refs/heads/master
2020-09-20T01:42:52.947289
2019-11-27T05:16:48
2019-11-27T05:16:48
224,343,956
0
0
null
null
null
null
UTF-8
Java
false
false
9,882
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.graphics.drawable.animated; public final class R { public static final class attr { public static final int coordinatorLayoutStyle = 0x7f040078; public static final int font = 0x7f0400ca; public static final int fontProviderAuthority = 0x7f0400cd; public static final int fontProviderCerts = 0x7f0400ce; public static final int fontProviderFetchStrategy = 0x7f0400cf; public static final int fontProviderFetchTimeout = 0x7f0400d0; public static final int fontProviderPackage = 0x7f0400d1; public static final int fontProviderQuery = 0x7f0400d2; public static final int fontStyle = 0x7f0400d3; public static final int fontWeight = 0x7f0400d4; public static final int keylines = 0x7f0400f8; public static final int layout_anchor = 0x7f0400fb; public static final int layout_anchorGravity = 0x7f0400fc; public static final int layout_behavior = 0x7f0400fd; public static final int layout_dodgeInsetEdges = 0x7f040129; public static final int layout_insetEdge = 0x7f040132; public static final int layout_keyline = 0x7f040133; public static final int statusBarBackground = 0x7f0401af; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f050000; } public static final class color { public static final int notification_action_color_filter = 0x7f060059; public static final int notification_icon_bg_color = 0x7f06005a; public static final int ripple_material_light = 0x7f060068; public static final int secondary_text_default_material_light = 0x7f06006b; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f07004e; public static final int compat_button_inset_vertical_material = 0x7f07004f; public static final int compat_button_padding_horizontal_material = 0x7f070050; public static final int compat_button_padding_vertical_material = 0x7f070051; public static final int compat_control_corner_material = 0x7f070052; public static final int notification_action_icon_size = 0x7f070090; public static final int notification_action_text_size = 0x7f070091; public static final int notification_big_circle_margin = 0x7f070092; public static final int notification_content_margin_start = 0x7f070093; public static final int notification_large_icon_height = 0x7f070094; public static final int notification_large_icon_width = 0x7f070095; public static final int notification_main_column_padding_top = 0x7f070096; public static final int notification_media_narrow_margin = 0x7f070097; public static final int notification_right_icon_size = 0x7f070098; public static final int notification_right_side_padding_top = 0x7f070099; public static final int notification_small_icon_background_padding = 0x7f07009a; public static final int notification_small_icon_size_as_large = 0x7f07009b; public static final int notification_subtext_size = 0x7f07009c; public static final int notification_top_pad = 0x7f07009d; public static final int notification_top_pad_large_text = 0x7f07009e; } public static final class drawable { public static final int notification_action_background = 0x7f0800cd; public static final int notification_bg = 0x7f0800ce; public static final int notification_bg_low = 0x7f0800cf; public static final int notification_bg_low_normal = 0x7f0800d0; public static final int notification_bg_low_pressed = 0x7f0800d1; public static final int notification_bg_normal = 0x7f0800d2; public static final int notification_bg_normal_pressed = 0x7f0800d3; public static final int notification_icon_background = 0x7f0800d4; public static final int notification_template_icon_bg = 0x7f0800d5; public static final int notification_template_icon_low_bg = 0x7f0800d6; public static final int notification_tile_bg = 0x7f0800d7; public static final int notify_panel_notification_icon_bg = 0x7f0800d8; } public static final class id { public static final int action_container = 0x7f090016; public static final int action_divider = 0x7f090019; public static final int action_image = 0x7f09001a; public static final int action_text = 0x7f090020; public static final int actions = 0x7f090021; public static final int async = 0x7f09002f; public static final int blocking = 0x7f090038; public static final int bottom = 0x7f090039; public static final int chronometer = 0x7f09004e; public static final int end = 0x7f090091; public static final int forever = 0x7f0900a0; public static final int icon = 0x7f0900b0; public static final int icon_group = 0x7f0900b2; public static final int info = 0x7f0900c1; public static final int italic = 0x7f0900d1; public static final int left = 0x7f0900dc; public static final int line1 = 0x7f0900e2; public static final int line3 = 0x7f0900e3; public static final int none = 0x7f090102; public static final int normal = 0x7f090103; public static final int notification_background = 0x7f090104; public static final int notification_main_column = 0x7f090105; public static final int notification_main_column_container = 0x7f090106; public static final int right = 0x7f090131; public static final int right_icon = 0x7f090132; public static final int right_side = 0x7f090133; public static final int start = 0x7f090166; public static final int tag_transition_group = 0x7f09018d; public static final int text = 0x7f09018e; public static final int text2 = 0x7f09018f; public static final int time = 0x7f0901a4; public static final int title = 0x7f0901a5; public static final int top = 0x7f0901a9; } public static final class integer { public static final int status_bar_notification_info_maxnum = 0x7f0a0009; } public static final class layout { public static final int notification_action = 0x7f0b0057; public static final int notification_action_tombstone = 0x7f0b0058; public static final int notification_template_custom_big = 0x7f0b005f; public static final int notification_template_icon_group = 0x7f0b0060; public static final int notification_template_part_chronometer = 0x7f0b0064; public static final int notification_template_part_time = 0x7f0b0065; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f0f04e8; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f10012f; public static final int TextAppearance_Compat_Notification_Info = 0x7f100130; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f100132; public static final int TextAppearance_Compat_Notification_Time = 0x7f100135; public static final int TextAppearance_Compat_Notification_Title = 0x7f100137; public static final int Widget_Compat_NotificationActionContainer = 0x7f1001af; public static final int Widget_Compat_NotificationActionText = 0x7f1001b0; public static final int Widget_Support_CoordinatorLayout = 0x7f1001bc; } public static final class styleable { public static final int[] CoordinatorLayout = { 0x7f0400f8, 0x7f0401af }; public static final int CoordinatorLayout_keylines = 0; public static final int CoordinatorLayout_statusBarBackground = 1; public static final int[] CoordinatorLayout_Layout = { 0x010100b3, 0x7f0400fb, 0x7f0400fc, 0x7f0400fd, 0x7f040129, 0x7f040132, 0x7f040133 }; public static final int CoordinatorLayout_Layout_android_layout_gravity = 0; public static final int CoordinatorLayout_Layout_layout_anchor = 1; public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2; public static final int CoordinatorLayout_Layout_layout_behavior = 3; public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4; public static final int CoordinatorLayout_Layout_layout_insetEdge = 5; public static final int CoordinatorLayout_Layout_layout_keyline = 6; public static final int[] FontFamily = { 0x7f0400cd, 0x7f0400ce, 0x7f0400cf, 0x7f0400d0, 0x7f0400d1, 0x7f0400d2 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x01010532, 0x01010533, 0x0101053f, 0x7f0400ca, 0x7f0400d3, 0x7f0400d4 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_font = 3; public static final int FontFamilyFont_fontStyle = 4; public static final int FontFamilyFont_fontWeight = 5; } }
0e0b4f3fe47cb9ac1ef6f478bd2eb9d3cf6b5c8f
1ab5ee3b3e2064705bc619e627c8b7ed2d68a781
/src/main/java/io/oconsent/api/OcConsentAnalyticsApiController.java
453d5b247591e244cb55a717276d00949f9da7c3
[]
no_license
OConsent/oc-openapi
5a456a6826c4614764c4addecd1316b10ab6d235
03e67299dff8ec271317359f33cebd3179ee7ffc
refs/heads/main
2023-02-24T05:00:15.896593
2021-01-30T09:27:25
2021-01-30T09:27:25
334,371,764
0
0
null
null
null
null
UTF-8
Java
false
false
8,691
java
package io.oconsent.api; import io.oconsent.model.InlineResponse200; import io.oconsent.model.NewOcConsentAnalytics; import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.media.Schema; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import javax.validation.Valid; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.util.List; @RestController public class OcConsentAnalyticsApiController implements OcConsentAnalyticsApi { private static final Logger log = LoggerFactory.getLogger(OcConsentAnalyticsApiController.class); private final ObjectMapper objectMapper; private final HttpServletRequest request; @org.springframework.beans.factory.annotation.Autowired public OcConsentAnalyticsApiController(ObjectMapper objectMapper, HttpServletRequest request) { this.objectMapper = objectMapper; this.request = request; } public ResponseEntity<InlineResponse200> ocConsentAnalyticsCountGet() { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { return new ResponseEntity<InlineResponse200>(objectMapper.readValue("{\n \"foo\" : \"foo\"\n}", InlineResponse200.class), HttpStatus.NOT_IMPLEMENTED); } catch (IOException e) { log.error("Couldn't serialize response for content type application/json", e); return new ResponseEntity<InlineResponse200>(HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<InlineResponse200>(HttpStatus.NOT_IMPLEMENTED); } public ResponseEntity<InlineResponse200> ocConsentAnalyticsGet(@Parameter(in = ParameterIn.QUERY, description = "Maximum number of results possible" ,schema=@Schema()) @Valid @RequestParam(value = "_limit", required = false) Integer _limit,@Parameter(in = ParameterIn.QUERY, description = "Sort according to a specific field." ,schema=@Schema()) @Valid @RequestParam(value = "_sort", required = false) String _sort,@Parameter(in = ParameterIn.QUERY, description = "Skip a specific number of entries (especially useful for pagination)" ,schema=@Schema()) @Valid @RequestParam(value = "_start", required = false) Integer _start,@Parameter(in = ParameterIn.QUERY, description = "Get entries that matches exactly your input" ,schema=@Schema()) @Valid @RequestParam(value = "&#x3D;", required = false) String ,@Parameter(in = ParameterIn.QUERY, description = "Get records that are not equals to something" ,schema=@Schema()) @Valid @RequestParam(value = "_ne", required = false) String _ne,@Parameter(in = ParameterIn.QUERY, description = "Get record that are lower than a value" ,schema=@Schema()) @Valid @RequestParam(value = "_lt", required = false) String _lt,@Parameter(in = ParameterIn.QUERY, description = "Get records that are lower than or equal to a value" ,schema=@Schema()) @Valid @RequestParam(value = "_lte", required = false) String _lte,@Parameter(in = ParameterIn.QUERY, description = "Get records that are greater than a value" ,schema=@Schema()) @Valid @RequestParam(value = "_gt", required = false) String _gt,@Parameter(in = ParameterIn.QUERY, description = "Get records that are greater than or equal a value" ,schema=@Schema()) @Valid @RequestParam(value = "_gte", required = false) String _gte,@Parameter(in = ParameterIn.QUERY, description = "Get records that contains a value" ,schema=@Schema()) @Valid @RequestParam(value = "_contains", required = false) String _contains,@Parameter(in = ParameterIn.QUERY, description = "Get records that contains (case sensitive) a value" ,schema=@Schema()) @Valid @RequestParam(value = "_containss", required = false) String _containss,@Parameter(in = ParameterIn.QUERY, description = "Get records that matches any value in the array of values" ,schema=@Schema()) @Valid @RequestParam(value = "_in", required = false) List<String> _in,@Parameter(in = ParameterIn.QUERY, description = "Get records that doesn't match any value in the array of values" ,schema=@Schema()) @Valid @RequestParam(value = "_nin", required = false) List<String> _nin) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { return new ResponseEntity<InlineResponse200>(objectMapper.readValue("{\n \"foo\" : \"foo\"\n}", InlineResponse200.class), HttpStatus.NOT_IMPLEMENTED); } catch (IOException e) { log.error("Couldn't serialize response for content type application/json", e); return new ResponseEntity<InlineResponse200>(HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<InlineResponse200>(HttpStatus.NOT_IMPLEMENTED); } public ResponseEntity<Long> ocConsentAnalyticsIdDelete(@Parameter(in = ParameterIn.PATH, description = "", required=true, schema=@Schema()) @PathVariable("id") String id) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { return new ResponseEntity<Long>(objectMapper.readValue("0", Long.class), HttpStatus.NOT_IMPLEMENTED); } catch (IOException e) { log.error("Couldn't serialize response for content type application/json", e); return new ResponseEntity<Long>(HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<Long>(HttpStatus.NOT_IMPLEMENTED); } public ResponseEntity<InlineResponse200> ocConsentAnalyticsIdGet(@Parameter(in = ParameterIn.PATH, description = "", required=true, schema=@Schema()) @PathVariable("id") String id) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { return new ResponseEntity<InlineResponse200>(objectMapper.readValue("{\n \"foo\" : \"foo\"\n}", InlineResponse200.class), HttpStatus.NOT_IMPLEMENTED); } catch (IOException e) { log.error("Couldn't serialize response for content type application/json", e); return new ResponseEntity<InlineResponse200>(HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<InlineResponse200>(HttpStatus.NOT_IMPLEMENTED); } public ResponseEntity<InlineResponse200> ocConsentAnalyticsIdPut(@Parameter(in = ParameterIn.PATH, description = "", required=true, schema=@Schema()) @PathVariable("id") String id,@Parameter(in = ParameterIn.DEFAULT, description = "", required=true, schema=@Schema()) @Valid @RequestBody NewOcConsentAnalytics body) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { return new ResponseEntity<InlineResponse200>(objectMapper.readValue("{\n \"foo\" : \"foo\"\n}", InlineResponse200.class), HttpStatus.NOT_IMPLEMENTED); } catch (IOException e) { log.error("Couldn't serialize response for content type application/json", e); return new ResponseEntity<InlineResponse200>(HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<InlineResponse200>(HttpStatus.NOT_IMPLEMENTED); } public ResponseEntity<InlineResponse200> ocConsentAnalyticsPost(@Parameter(in = ParameterIn.DEFAULT, description = "", required=true, schema=@Schema()) @Valid @RequestBody NewOcConsentAnalytics body) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { return new ResponseEntity<InlineResponse200>(objectMapper.readValue("{\n \"foo\" : \"foo\"\n}", InlineResponse200.class), HttpStatus.NOT_IMPLEMENTED); } catch (IOException e) { log.error("Couldn't serialize response for content type application/json", e); return new ResponseEntity<InlineResponse200>(HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<InlineResponse200>(HttpStatus.NOT_IMPLEMENTED); } }
4924e8e0f88a69310ce75b9f77ea5b62b61aa290
1e914120ee2d6577cff712b1d32b1f5ad7489183
/model/src/main/java/com/abiquo/server/core/enterprise/PrivilegesDto.java
1aee85ffde2a3bb024e1adf7d2bd188312e9865d
[]
no_license
david-lopez/abiquo
2d6b802c7de74ca4a6803ac90967678d4a4bd736
ae35b1e6589a36b52141053f9c64af9fef911915
refs/heads/master
2021-01-24T02:38:39.290136
2011-11-28T08:36:53
2011-11-28T08:36:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,291
java
/** * Abiquo community edition * cloud management application for hybrid clouds * Copyright (C) 2008-2010 - Abiquo Holdings S.L. * * This application 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 under * version 3 of the License * * 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 v.3 for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ package com.abiquo.server.core.enterprise; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import com.abiquo.model.transport.WrapperDto; @XmlRootElement(name = "privileges") public class PrivilegesDto extends WrapperDto<PrivilegeDto> { @Override @XmlElement(name = "privilege") public List<PrivilegeDto> getCollection() { return collection; } }
93c24176ec887da9bc004ce8d69c9077e865cb3b
4f8d3d322b9fe3a1e205579a17c55d611b1f671d
/app/src/main/java/com/techlead/bloodbank/RegisterActivity.java
03404505a9ba712db533f7060566e71f356166f4
[]
no_license
itsaashishrajput/BloodBank
ebc1f955d41019d89dfe3c65ac6b3d234cc382d6
ba925ce4bd4924240a6bd3dd5e225bf0f5c8d1e9
refs/heads/master
2023-06-06T07:58:22.607363
2021-06-27T11:59:29
2021-06-27T11:59:29
380,683,777
0
0
null
null
null
null
UTF-8
Java
false
false
4,922
java
package com.techlead.bloodbank; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.techlead.bloodbank.Utils.Endpoints; import com.techlead.bloodbank.Utils.VolleySingleton; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class RegisterActivity extends AppCompatActivity { private EditText nameText, cityText, mobileText, bloodGroupText, passwordText; private Button submitButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); nameText = findViewById(R.id.name); cityText = findViewById(R.id.city); mobileText = findViewById(R.id.mobile_number); bloodGroupText = findViewById(R.id.blood_group); passwordText = findViewById(R.id.password); submitButton = findViewById(R.id.submit_button); submitButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String name, city, mobile, blood_group, password; name = nameText.getText().toString().trim(); city = cityText.getText().toString().trim(); mobile = mobileText.getText().toString().trim(); blood_group = bloodGroupText.getText().toString().trim(); password = passwordText.getText().toString(); if (isValid(name,city,blood_group,password,mobile)){ register(name,city,blood_group,password,mobile); } } }); } private void register(final String name, final String city, final String blood_group, final String password, final String mobile){ StringRequest stringRequest = new StringRequest(Request.Method.POST, Endpoints.register_url, new Response.Listener<String>() { @Override public void onResponse(String response) { if(response.equals("Success")){ Toast.makeText(RegisterActivity.this,response,Toast.LENGTH_SHORT).show(); startActivity(new Intent(RegisterActivity.this,MainActivity.class)); RegisterActivity.this.finish(); } else { Toast.makeText(RegisterActivity.this,response,Toast.LENGTH_SHORT).show(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(RegisterActivity.this,"Something wrong",Toast.LENGTH_SHORT).show(); Log.d("Volley",error.getMessage()); } }){ @Nullable @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String,String> params = new HashMap<>(); params.put("name",name); params.put("city",city); params.put("blood_group", blood_group); params.put("password", password); params.put("number", mobile); return params; } }; VolleySingleton.getInstance(this).addToRequestQueue(stringRequest); } private boolean isValid(String name, String city,String blood_group,String password, String mobile){ List<String> valid_blood_group = new ArrayList<>(); valid_blood_group.add("A+"); valid_blood_group.add("B+"); valid_blood_group.add("O+"); valid_blood_group.add("AB+"); valid_blood_group.add("A-"); valid_blood_group.add("B-"); valid_blood_group.add("O-"); valid_blood_group.add("AB-"); if(name.isEmpty()){ showMessage("Name is required"); return false; } else if(city.isEmpty()){ showMessage("City name require is Invalid"); return false; } else if(!valid_blood_group.contains(blood_group)){ showMessage("Blood group is invalid choose from" + valid_blood_group); return false; } else if (mobile.length() != 10){ showMessage("Invalid mobile number, mobile number should be 10 digit"); return false; } return true; } private void showMessage(String msg){ Toast.makeText(this,msg,Toast.LENGTH_SHORT).show(); } }
ad38302c193ce2dc26f9eb1c818a7f9673dfd312
0c021f87c3a0f9adc28c003d73efa9cf6f4bd159
/doc-control-app/doc-control-app-spring/src/main/java/it/akademija/wizards/security/payload/JwtAuthenticationResponse.java
8605189f9163375c9abf77653effcc8cd0b4a8e4
[]
no_license
Aidas2/Dokumentu_valdymo_sistema_Others
8a21e7407e51fa1650af2d1f0512cbdb54b20684
a64d6ca49d52c4a11526a0fc01c62d1a76395a12
refs/heads/master
2022-06-14T23:58:27.693189
2021-03-20T13:20:37
2021-03-20T13:20:37
226,668,936
1
0
null
2022-06-01T09:35:11
2019-12-08T13:06:04
JavaScript
UTF-8
Java
false
false
603
java
package it.akademija.wizards.security.payload; public class JwtAuthenticationResponse { private String accessToken; private String tokenType = "Bearer "; public JwtAuthenticationResponse(String accessToken) { this.accessToken = accessToken; } public String getAccessToken() { return accessToken; } public void setAccessToken(String accessToken) { this.accessToken = accessToken; } public String getTokenType() { return tokenType; } public void setTokenType(String tokenType) { this.tokenType = tokenType; } }
38d001314c83110e65493c662d64bd22a1797d2e
a533596108f4fd67020ccaba02b40e455d31dda3
/ProgettoBriscolaProva - Versione 2.0/src/main/java/com/mycompany/progettobriscolaprova/JMazzo.java
6dad855ef4af82fcb1b3e1d314a5357d176566a0
[ "Apache-2.0" ]
permissive
Mattimbro01/Progetto-Gestioni-Briscola
69c6c3ad10fbd438660661d4fc53014ff5c41b1a
10c1b6932eee1dc0321354cf4e1357e657a48f7f
refs/heads/main
2023-02-03T14:05:07.647528
2020-12-22T11:15:44
2020-12-22T11:15:44
311,249,273
0
0
null
null
null
null
UTF-8
Java
false
false
1,185
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mycompany.progettobriscolaprova; /** * * @author HP */ public class JMazzo { public JMazzo() { mazzo = new JCarta[40]; numEl = 0; Mescola(); } public JCarta[] getMazzo() { return mazzo; } public void setMazzo(JCarta[] mazzo) { this.mazzo = mazzo; } public void Mescola() { int n = 0; JCarta temp = new JCarta(); for (int i = 0; i < numEl; i++) { n = (int) (Math.random() * numEl); temp = mazzo[i]; mazzo[i] = mazzo[n]; mazzo[n] = temp; } } public JCarta getCarta(int i) { return mazzo[i]; } public int getNumEl() { return numEl; } public void elimina(int pos) { for (int i = pos; i < numEl; i++) { mazzo[i] = mazzo[pos]; } numEl--; } private JCarta[] mazzo; private int numEl; }
4a27a21e6a526951acbd2fd464f66ef0ec3dc431
61140f6db4f91e188ceb1d41fc33280a9fd55133
/HandyApp/app/src/main/java/com/example/sudin/handyapp/nextpage.java
06302c36ef21e9e3d9e57bbcc30e105457a9768e
[]
no_license
sudeen/Android-Projects
396c2b801897a2d874f0cd45f8385f9a82b4d4dd
5d6e8865e5188a914ee72854cfd2e64ffebdf385
refs/heads/master
2020-03-28T05:41:44.048251
2018-09-07T08:08:19
2018-09-07T08:08:19
147,791,496
0
0
null
null
null
null
UTF-8
Java
false
false
1,659
java
package com.example.sudin.handyapp; import android.app.Activity; import android.app.ListActivity; import android.database.Cursor; import android.os.Bundle; import android.provider.ContactsContract; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.SimpleCursorAdapter; import android.widget.Toast; import static android.widget.AdapterView.*; /** * Created by SUNITA on 11/16/2016. */ public class nextpage extends ListActivity { @Override public int getSelectedItemPosition() { return super.getSelectedItemPosition(); } @Override public long getSelectedItemId() { return super.getSelectedItemId(); } Button button; ListView lv; Cursor cursor1; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); cursor1=getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null); startManagingCursor(cursor1); String [] from ={ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone._ID}; int [] to = {android.R.id.text1, android.R.id.text2}; SimpleCursorAdapter listadaptor = new SimpleCursorAdapter(this,android.R.layout.simple_list_item_2,cursor1,from, to); setListAdapter(listadaptor); lv= getListView(); lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); } }
46c6562bcf54c81174b173d380d7c21e1318b559
2b6a3a58315f9f1c76812e6a4c21e0a2f22f3b82
/src/main/java/mod/azure/dothack/items/ebwizadry/ItemEBWand6.java
1185199ae720fee3c323b599893a3dfe2ec4baa8
[ "MIT" ]
permissive
Darkhax-Forked/dotHackWeapons
3976cb5afc0795551a41a340abd722a13351c8df
0e01e43ced3f62525a99f84b07435dddf9c58541
refs/heads/master
2020-11-24T12:41:53.035628
2019-12-15T08:10:36
2019-12-15T08:10:36
228,148,431
0
0
MIT
2019-12-15T07:51:18
2019-12-15T07:51:17
null
UTF-8
Java
false
false
5,524
java
package mod.azure.dothack.items.ebwizadry; import java.util.Random; import electroblob.wizardry.Wizardry; import electroblob.wizardry.constants.Constants; import electroblob.wizardry.constants.Element; import electroblob.wizardry.constants.Tier; import electroblob.wizardry.item.IManaStoringItem; import electroblob.wizardry.item.IWorkbenchItem; import electroblob.wizardry.item.ItemWand; import electroblob.wizardry.registry.Spells; import electroblob.wizardry.registry.WizardryAdvancementTriggers; import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.spell.Spell; import electroblob.wizardry.util.ParticleBuilder; import electroblob.wizardry.util.SpellProperties; import electroblob.wizardry.util.WandHelper; import electroblob.wizardry.util.ParticleBuilder.Type; import mod.azure.dothack.DotHackMod; import mod.azure.dothack.registry.DotHackItems; import mod.azure.dothack.registry.DotHackTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.Vec3d; import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class ItemEBWand6 extends ItemWand { public ItemEBWand6(Tier tier, Element element) { super(tier, element); this.tier = tier; this.element = element; this.setCreativeTab(DotHackTabs.tabw); } @SubscribeEvent public boolean onApplyButtonPressed(EntityPlayer player, Slot centre, Slot crystals, Slot upgrade, Slot[] spellBooks){ boolean changed = false; if(upgrade.getStack().getItem() == WizardryItems.arcane_tome){ Tier tier = Tier.values()[upgrade.getStack().getItemDamage()]; if((player.isCreative() || Wizardry.settings.legacyWandLevelling || WandHelper.getProgression(centre.getStack()) >= tier.progression) && tier.ordinal() - 1 == this.tier.ordinal()){ WandHelper.setProgression(centre.getStack(), 0); ItemStack newWand = new ItemStack(DotHackItems.get6Wand(tier, this.element)); newWand.setTagCompound(centre.getStack().getTagCompound()); ((IManaStoringItem)newWand.getItem()).setMana(newWand, this.getMana(centre.getStack())); centre.putStack(newWand); upgrade.decrStackSize(1); changed = true; } }else if(WandHelper.isWandUpgrade(upgrade.getStack().getItem())){ Item specialUpgrade = upgrade.getStack().getItem(); if(WandHelper.getTotalUpgrades(centre.getStack()) < this.tier.upgradeLimit && WandHelper.getUpgradeLevel(centre.getStack(), specialUpgrade) < Constants.UPGRADE_STACK_LIMIT){ int prevMana = this.getMana(centre.getStack()); WandHelper.applyUpgrade(centre.getStack(), specialUpgrade); if(specialUpgrade == WizardryItems.storage_upgrade){ this.setMana(centre.getStack(), prevMana); }else if(specialUpgrade == WizardryItems.attunement_upgrade){ int newSlotCount = BASE_SPELL_SLOTS + WandHelper.getUpgradeLevel(centre.getStack(), WizardryItems.attunement_upgrade); Spell[] spells = WandHelper.getSpells(centre.getStack()); Spell[] newSpells = new Spell[newSlotCount]; for(int i = 0; i < newSpells.length; i++){ newSpells[i] = i < spells.length && spells[i] != null ? spells[i] : Spells.none; } WandHelper.setSpells(centre.getStack(), newSpells); int[] cooldowns = WandHelper.getCooldowns(centre.getStack()); int[] newCooldowns = new int[newSlotCount]; if(cooldowns.length > 0){ System.arraycopy(cooldowns, 0, newCooldowns, 0, cooldowns.length); } WandHelper.setCooldowns(centre.getStack(), newCooldowns); } upgrade.decrStackSize(1); WizardryAdvancementTriggers.special_upgrade.triggerFor(player); if(WandHelper.getTotalUpgrades(centre.getStack()) == Tier.MASTER.upgradeLimit){ WizardryAdvancementTriggers.max_out_wand.triggerFor(player); } changed = true; } } Spell[] spells = WandHelper.getSpells(centre.getStack()); if(spells.length <= 0){ spells = new Spell[BASE_SPELL_SLOTS]; } for(int i = 0; i < spells.length; i++){ if(spellBooks[i].getStack() != ItemStack.EMPTY){ Spell spell = Spell.byMetadata(spellBooks[i].getStack().getItemDamage()); if(!(spell.getTier().level > this.tier.level) && spells[i] != spell && spell.isEnabled(SpellProperties.Context.WANDS)){ spells[i] = spell; changed = true; } } } WandHelper.setSpells(centre.getStack(), spells); if(crystals.getStack() != ItemStack.EMPTY && !this.isManaFull(centre.getStack())){ int chargeDepleted = this.getManaCapacity(centre.getStack()) - this.getMana(centre.getStack()); int manaPerItem = Constants.MANA_PER_CRYSTAL; if(crystals.getStack().getItem() == WizardryItems.crystal_shard) manaPerItem = Constants.MANA_PER_SHARD; if(crystals.getStack().getItem() == WizardryItems.grand_crystal) manaPerItem = Constants.GRAND_CRYSTAL_MANA; if(crystals.getStack().getCount() * manaPerItem < chargeDepleted){ this.rechargeMana(centre.getStack(), crystals.getStack().getCount() * manaPerItem); crystals.decrStackSize(crystals.getStack().getCount()); }else{ this.setMana(centre.getStack(), this.getManaCapacity(centre.getStack())); crystals.decrStackSize((int)Math.ceil(((double)chargeDepleted) / manaPerItem)); } changed = true; } return changed; } }
877bb636a8dcb0f21784016cdb316a53179b6db6
d44c925adc62a8d24fb734578bef82f55de93be1
/src/main/java/br/csi/dao/AtividadeDAO.java
5fb147279a2a4b754414e57608b628cc33f61a0e
[]
no_license
adrianoluisalmeida/alunoDiarioSpring
65fe8c8e9258d7a5e696cd7b3c9468a8ede2e6fb
f09b9de96ec24c4727567d2d750b7191f575ba23
refs/heads/master
2021-08-22T05:59:06.849573
2017-11-29T12:31:16
2017-11-29T12:31:16
111,875,482
0
0
null
null
null
null
UTF-8
Java
false
false
3,862
java
package br.csi.dao; //import br.csi.modelo.Aluno; import br.csi.modelo.Atividade; import br.csi.modelo.Turma; import br.csi.util.ConectaPostgres; import java.util.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Time; import java.util.ArrayList; import org.springframework.stereotype.Component; @Component public class AtividadeDAO implements DAO<Atividade> { @Override public boolean atualizar(Atividade a) throws Exception { String sql = "update atividade set descricao=?, data=?, turma_id=?, hora=? " + "where id = ?"; PreparedStatement stmt = ConectaPostgres.getConexao() .prepareStatement(sql); stmt.setString(1, a.getDescricao()); stmt.setDate(2, new java.sql.Date(a.getData().getTime())); stmt.setInt(3, a.getTurma().getId()); stmt.setTime(4, a.getHora()); stmt.setInt(5, a.getId()); System.out.println("descricao:" + a.getDescricao() + " hora: " + a.getHora() + " turma" + a.getTurma().getId()); stmt.executeUpdate(); return true; } @Override public Atividade get(Integer id) throws Exception { String sql = "select atividade.*, turma.nome as turma_nome from atividade inner join turma on turma.id = atividade.turma_id where atividade.id =?"; PreparedStatement stmt = ConectaPostgres.getConexao().prepareCall(sql); stmt.setInt(1, id); ResultSet rs = stmt.executeQuery(); Atividade a = new Atividade(); while (rs.next()) { a.setDescricao(rs.getString("descricao")); a.setData(rs.getDate("data")); a.setHora(rs.getTime("hora")); a.setTurma(new Turma(rs.getInt("turma_id"), rs.getString("turma_nome"))); } return a; } @Override public boolean deletar(Atividade atividade) throws Exception { String sql = "DELETE from atividade where id =?"; PreparedStatement stmt = ConectaPostgres.getConexao().prepareStatement(sql); stmt.setInt(1, atividade.getId()); stmt.executeUpdate(); return true; } @Override public Integer inserir(Atividade atividade) throws Exception { String sql = "insert into atividade(descricao, data, turma_id, hora) " + "values(?, ?, ?, ?)"; PreparedStatement stmt = ConectaPostgres.getConexao().prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS); stmt.setString(1, atividade.getDescricao()); stmt.setDate(2, new java.sql.Date(atividade.getData().getTime())); stmt.setInt(3, atividade.getTurma().getId()); stmt.setTime(4, atividade.getHora()); stmt.executeUpdate(); ResultSet rs = stmt.getGeneratedKeys(); if (rs.next()) { return rs.getInt(1); } return 0; } @Override public ArrayList<Atividade> listar() throws Exception { ArrayList<Atividade> atividades = new ArrayList<>(); String sql = "select *, turma.nome as nome_turma from atividade inner join turma on atividade.turma_id = turma.id"; PreparedStatement stmt = ConectaPostgres.getConexao().prepareStatement(sql); ResultSet rs = stmt.executeQuery(); while (rs.next()) { Integer id = rs.getInt("id"); String descricao = rs.getString("descricao"); Date data = rs.getDate("data"); Turma turma = new Turma(rs.getInt("turma_id"), rs.getString("nome_turma")); Time hora = rs.getTime("hora"); Atividade atividade = new Atividade(id, descricao, data, turma, hora); atividades.add(atividade); } System.out.println("Metodo executado com sucesso..."); return atividades; } }
6b2b600d7fce29c11151e0e380f10536c7f59d50
29b72f6cc5730f990262cb24a336adf8d13a5a31
/sdk/src/test/java/com/finbourne/lusid/model/GetDataMapResponseTest.java
75b9ffd3a944efdddd5cf882c50d2958b6a27622
[ "MIT" ]
permissive
bogdanLicaFinbourne/lusid-sdk-java-preview
0c956b453f5dd37888f11e0128d8a2e32abda236
3e6d1ed20bf398fafed58364360895a1f2f0476f
refs/heads/master
2023-04-06T06:21:49.057202
2021-04-19T18:50:06
2021-04-19T18:50:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
31,068
java
/* * LUSID API * # Introduction This page documents the [LUSID APIs](https://www.lusid.com/api/swagger), which allows authorised clients to query and update their data within the LUSID platform. SDKs to interact with the LUSID APIs are available in the following languages and frameworks: * [C#](https://github.com/finbourne/lusid-sdk-csharp) * [Java](https://github.com/finbourne/lusid-sdk-java) * [JavaScript](https://github.com/finbourne/lusid-sdk-js) * [Python](https://github.com/finbourne/lusid-sdk-python) * [Angular](https://github.com/finbourne/lusid-sdk-angular) # Data Model The LUSID API has a relatively lightweight but extremely powerful data model. One of the goals of LUSID was not to enforce on clients a single rigid data model but rather to provide a flexible foundation onto which clients can map their own data models. The core entities in LUSID provide a minimal structure and set of relationships, and the data model can be extended using Properties. The LUSID data model is exposed through the LUSID APIs. The APIs provide access to both business objects and the meta data used to configure the systems behaviours. The key business entities are: - * **Portfolios** A portfolio is a container for transactions and holdings (a **Transaction Portfolio**) or constituents (a **Reference Portfolio**). * **Derived Portfolios**. Derived Portfolios allow Portfolios to be created based on other Portfolios, by overriding or adding specific items. * **Holdings** A Holding is a quantity of an Instrument or a balance of cash within a Portfolio. Holdings can only be adjusted via Transactions. * **Transactions** A Transaction is an economic event that occurs in a Portfolio, causing its holdings to change. * **Corporate Actions** A corporate action is a market event which occurs to an Instrument and thus applies to all portfolios which holding the instrument. Examples are stock splits or mergers. * **Constituents** A constituent is a record in a Reference Portfolio containing an Instrument and an associated weight. * **Instruments** An instrument represents a currency, tradable instrument or OTC contract that is attached to a transaction and a holding. * **Properties** All major entities allow additional user defined properties to be associated with them. For example, a Portfolio manager may be associated with a portfolio. Meta data includes: - * **Transaction Types** Transactions are booked with a specific transaction type. The types are client defined and are used to map the Transaction to a series of movements which update the portfolio holdings. * **Properties Types** Types of user defined properties used within the system. ## Scope All data in LUSID is segregated at the client level. Entities in LUSID are identifiable by a unique code. Every entity lives within a logical data partition known as a Scope. Scope is an identity namespace allowing two entities with the same unique code to co-exist within individual address spaces. For example, prices for equities from different vendors may be uploaded into different scopes such as `client/vendor1` and `client/vendor2`. A portfolio may then be valued using either of the price sources by referencing the appropriate scope. LUSID Clients cannot access scopes of other clients. ## Instruments LUSID has its own built-in instrument master which you can use to master your own instrument universe. Every instrument must be created with one or more unique market identifiers, such as [FIGI](https://openfigi.com/). For any non-listed instruments (eg OTCs), you can upload an instrument against a custom ID of your choosing. In addition, LUSID will allocate each instrument a unique 'LUSID instrument identifier'. The LUSID instrument identifier is what is used when uploading transactions, holdings, prices, etc. The API exposes an `instrument/lookup` endpoint which can be used to lookup these LUSID identifiers using their market identifiers. Cash can be referenced using the ISO currency code prefixed with \"`CCY_`\" e.g. `CCY_GBP` ## Instrument Data Instrument data can be uploaded to the system using the [Instrument Properties](#operation/UpsertInstrumentsProperties) endpoint. | Field|Type|Description | | ---|---|--- | | Key|propertykey|The key of the property. This takes the format {domain}/{scope}/{code} e.g. 'Instrument/system/Name' or 'Transaction/strategy/quantsignal'. | | Value|string|The value of the property. | | EffectiveFrom|datetimeoffset|The effective datetime from which the property is valid. | | EffectiveUntil|datetimeoffset|The effective datetime until which the property is valid. If not supplied this will be valid indefinitely, or until the next 'effectiveFrom' datetime of the property. | ## Transaction Portfolios Portfolios are the top-level entity containers within LUSID, containing transactions, corporate actions and holdings. The transactions build up the portfolio holdings on which valuations, analytics profit & loss and risk can be calculated. Properties can be associated with Portfolios to add in additional data. Portfolio properties can be changed over time, for example to allow a Portfolio Manager to be linked with a Portfolio. Additionally, portfolios can be securitised and held by other portfolios, allowing LUSID to perform \"drill-through\" into underlying fund holdings ### Derived Portfolios LUSID also allows for a portfolio to be composed of another portfolio via derived portfolios. A derived portfolio can contain its own transactions and also inherits any transactions from its parent portfolio. Any changes made to the parent portfolio are automatically reflected in derived portfolio. Derived portfolios in conjunction with scopes are a powerful construct. For example, to do pre-trade what-if analysis, a derived portfolio could be created a new namespace linked to the underlying live (parent) portfolio. Analysis can then be undertaken on the derived portfolio without affecting the live portfolio. ### Transactions A transaction represents an economic activity against a Portfolio. Transactions are processed according to a configuration. This will tell the LUSID engine how to interpret the transaction and correctly update the holdings. LUSID comes with a set of transaction types you can use out of the box, or you can configure your own set(s) of transactions. For more details see the [LUSID Getting Started Guide for transaction configuration.](https://support.lusid.com/configuring-transaction-types) | Field|Type|Description | | ---|---|--- | | TransactionId|string|The unique identifier for the transaction. | | Type|string|The type of the transaction e.g. 'Buy', 'Sell'. The transaction type should have been pre-configured via the System Configuration API endpoint. If it hasn't been pre-configured the transaction will still be updated or inserted however you will be unable to generate the resultant holdings for the portfolio that contains this transaction as LUSID does not know how to process it. | | InstrumentIdentifiers|map|A set of instrument identifiers to use to resolve the transaction to a unique instrument. | | TransactionDate|dateorcutlabel|The date of the transaction. | | SettlementDate|dateorcutlabel|The settlement date of the transaction. | | Units|decimal|The number of units transacted in the associated instrument. | | TransactionPrice|transactionprice|The price for each unit of the transacted instrument in the transaction currency. | | TotalConsideration|currencyandamount|The total value of the transaction in the settlement currency. | | ExchangeRate|decimal|The exchange rate between the transaction and settlement currency (settlement currency being represented by the TotalConsideration.Currency). For example if the transaction currency is in USD and the settlement currency is in GBP this this the USD/GBP rate. | | TransactionCurrency|currency|The transaction currency. | | Properties|map|Set of unique transaction properties and associated values to store with the transaction. Each property must be from the 'Transaction' domain. | | CounterpartyId|string|The identifier for the counterparty of the transaction. | | Source|string|The source of the transaction. This is used to look up the appropriate transaction group set in the transaction type configuration. | From these fields, the following values can be calculated * **Transaction value in Transaction currency**: TotalConsideration / ExchangeRate * **Transaction value in Portfolio currency**: Transaction value in Transaction currency * TradeToPortfolioRate #### Example Transactions ##### A Common Purchase Example Three example transactions are shown in the table below. They represent a purchase of USD denominated IBM shares within a Sterling denominated portfolio. * The first two transactions are for separate buy and fx trades * Buying 500 IBM shares for $71,480.00 * A spot foreign exchange conversion to fund the IBM purchase. (Buy $71,480.00 for &#163;54,846.60) * The third transaction is an alternate version of the above trades. Buying 500 IBM shares and settling directly in Sterling. | Column | Buy Trade | Fx Trade | Buy Trade with foreign Settlement | | ----- | ----- | ----- | ----- | | TransactionId | FBN00001 | FBN00002 | FBN00003 | | Type | Buy | FxBuy | Buy | | InstrumentIdentifiers | { \"figi\", \"BBG000BLNNH6\" } | { \"CCY\", \"CCY_USD\" } | { \"figi\", \"BBG000BLNNH6\" } | | TransactionDate | 2018-08-02 | 2018-08-02 | 2018-08-02 | | SettlementDate | 2018-08-06 | 2018-08-06 | 2018-08-06 | | Units | 500 | 71480 | 500 | | TransactionPrice | 142.96 | 1 | 142.96 | | TradeCurrency | USD | USD | USD | | ExchangeRate | 1 | 0.7673 | 0.7673 | | TotalConsideration.Amount | 71480.00 | 54846.60 | 54846.60 | | TotalConsideration.Currency | USD | GBP | GBP | | Trade/default/TradeToPortfolioRate&ast; | 0.7673 | 0.7673 | 0.7673 | [&ast; This is a property field] ##### A Forward FX Example LUSID has a flexible transaction modelling system, meaning there are a number of different ways of modelling forward fx trades. The default LUSID transaction types are FwdFxBuy and FwdFxSell. Using these transaction types, LUSID will generate two holdings for each Forward FX trade, one for each currency in the trade. An example Forward Fx trade to sell GBP for USD in a JPY-denominated portfolio is shown below: | Column | Forward 'Sell' Trade | Notes | | ----- | ----- | ---- | | TransactionId | FBN00004 | | | Type | FwdFxSell | | | InstrumentIdentifiers | { \"Instrument/default/Currency\", \"GBP\" } | | | TransactionDate | 2018-08-02 | | | SettlementDate | 2019-02-06 | Six month forward | | Units | 10000.00 | Units of GBP | | TransactionPrice | 1 | | | TradeCurrency | GBP | Currency being sold | | ExchangeRate | 1.3142 | Agreed rate between GBP and USD | | TotalConsideration.Amount | 13142.00 | Amount in the settlement currency, USD | | TotalConsideration.Currency | USD | Settlement currency | | Trade/default/TradeToPortfolioRate | 142.88 | Rate between trade currency, GBP and portfolio base currency, JPY | Please note that exactly the same economic behaviour could be modelled using the FwdFxBuy Transaction Type with the amounts and rates reversed. ### Holdings A holding represents a position in an instrument or cash on a given date. | Field|Type|Description | | ---|---|--- | | InstrumentUid|string|The unqiue Lusid Instrument Id (LUID) of the instrument that the holding is in. | | SubHoldingKeys|map|The sub-holding properties which identify the holding. Each property will be from the 'Transaction' domain. These are configured when a transaction portfolio is created. | | Properties|map|The properties which have been requested to be decorated onto the holding. These will be from the 'Instrument' or 'Holding' domain. | | HoldingType|string|The type of the holding e.g. Position, Balance, CashCommitment, Receivable, ForwardFX etc. | | Units|decimal|The total number of units of the holding. | | SettledUnits|decimal|The total number of settled units of the holding. | | Cost|currencyandamount|The total cost of the holding in the transaction currency. | | CostPortfolioCcy|currencyandamount|The total cost of the holding in the portfolio currency. | | Transaction|transaction|The transaction associated with an unsettled holding. | | Currency|currency|The holding currency. | ## Corporate Actions Corporate actions are represented within LUSID in terms of a set of instrument-specific 'transitions'. These transitions are used to specify the participants of the corporate action, and the effect that the corporate action will have on holdings in those participants. ### Corporate Action | Field|Type|Description | | ---|---|--- | | CorporateActionCode|code|The unique identifier of this corporate action | | Description|string| | | AnnouncementDate|datetimeoffset|The announcement date of the corporate action | | ExDate|datetimeoffset|The ex date of the corporate action | | RecordDate|datetimeoffset|The record date of the corporate action | | PaymentDate|datetimeoffset|The payment date of the corporate action | | Transitions|corporateactiontransition[]|The transitions that result from this corporate action | ### Transition | Field|Type|Description | | ---|---|--- | | InputTransition|corporateactiontransitioncomponent|Indicating the basis of the corporate action - which security and how many units | | OutputTransitions|corporateactiontransitioncomponent[]|What will be generated relative to the input transition | ### Example Corporate Action Transitions #### A Dividend Action Transition In this example, for each share of IBM, 0.20 units (or 20 pence) of GBP are generated. | Column | Input Transition | Output Transition | | ----- | ----- | ----- | | Instrument Identifiers | { \"figi\" : \"BBG000BLNNH6\" } | { \"ccy\" : \"CCY_GBP\" } | | Units Factor | 1 | 0.20 | | Cost Factor | 1 | 0 | #### A Split Action Transition In this example, for each share of IBM, we end up with 2 units (2 shares) of IBM, with total value unchanged. | Column | Input Transition | Output Transition | | ----- | ----- | ----- | | Instrument Identifiers | { \"figi\" : \"BBG000BLNNH6\" } | { \"figi\" : \"BBG000BLNNH6\" } | | Units Factor | 1 | 2 | | Cost Factor | 1 | 1 | #### A Spinoff Action Transition In this example, for each share of IBM, we end up with 1 unit (1 share) of IBM and 3 units (3 shares) of Celestica, with 85% of the value remaining on the IBM share, and 5% in each Celestica share (15% total). | Column | Input Transition | Output Transition 1 | Output Transition 2 | | ----- | ----- | ----- | ----- | | Instrument Identifiers | { \"figi\" : \"BBG000BLNNH6\" } | { \"figi\" : \"BBG000BLNNH6\" } | { \"figi\" : \"BBG000HBGRF3\" } | | Units Factor | 1 | 1 | 3 | | Cost Factor | 1 | 0.85 | 0.15 | ## Reference Portfolios Reference portfolios are portfolios that contain constituents with weights. They are designed to represent entities such as indices and benchmarks. ### Constituents | Field|Type|Description | | ---|---|--- | | InstrumentIdentifiers|map|Unique instrument identifiers | | InstrumentUid|string|LUSID's internal unique instrument identifier, resolved from the instrument identifiers | | Currency|decimal| | | Weight|decimal| | | FloatingWeight|decimal| | ## Portfolio Groups Portfolio groups allow the construction of a hierarchy from portfolios and groups. Portfolio operations on the group are executed on an aggregated set of portfolios in the hierarchy. For example: * Global Portfolios _(group)_ * APAC _(group)_ * Hong Kong _(portfolio)_ * Japan _(portfolio)_ * Europe _(group)_ * France _(portfolio)_ * Germany _(portfolio)_ * UK _(portfolio)_ In this example **Global Portfolios** is a group that consists of an aggregate of **Hong Kong**, **Japan**, **France**, **Germany** and **UK** portfolios. ## Properties Properties are key-value pairs that can be applied to any entity within a domain (where a domain is `trade`, `portfolio`, `security` etc). Properties must be defined before use with a `PropertyDefinition` and can then subsequently be added to entities. ## Schema A detailed description of the entities used by the API and parameters for endpoints which take a JSON document can be retrieved via the `schema` endpoint. ## Meta data The following headers are returned on all responses from LUSID | Name | Purpose | | --- | --- | | lusid-meta-duration | Duration of the request | | lusid-meta-success | Whether or not LUSID considered the request to be successful | | lusid-meta-requestId | The unique identifier for the request | | lusid-schema-url | Url of the schema for the data being returned | | lusid-property-schema-url | Url of the schema for any properties | # Error Codes | Code|Name|Description | | ---|---|--- | | <a name=\"-10\">-10</a>|Server Configuration Error| | | <a name=\"-1\">-1</a>|Unknown error|An unexpected error was encountered on our side. | | <a name=\"102\">102</a>|Version Not Found| | | <a name=\"103\">103</a>|Api Rate Limit Violation| | | <a name=\"104\">104</a>|Instrument Not Found| | | <a name=\"105\">105</a>|Property Not Found| | | <a name=\"106\">106</a>|Portfolio Recursion Depth| | | <a name=\"108\">108</a>|Group Not Found| | | <a name=\"109\">109</a>|Portfolio Not Found| | | <a name=\"110\">110</a>|Property Schema Not Found| | | <a name=\"111\">111</a>|Portfolio Ancestry Not Found| | | <a name=\"112\">112</a>|Portfolio With Id Already Exists| | | <a name=\"113\">113</a>|Orphaned Portfolio| | | <a name=\"119\">119</a>|Missing Base Claims| | | <a name=\"121\">121</a>|Property Not Defined| | | <a name=\"122\">122</a>|Cannot Delete System Property| | | <a name=\"123\">123</a>|Cannot Modify Immutable Property Field| | | <a name=\"124\">124</a>|Property Already Exists| | | <a name=\"125\">125</a>|Invalid Property Life Time| | | <a name=\"126\">126</a>|Property Constraint Style Excludes Properties| | | <a name=\"127\">127</a>|Cannot Modify Default Data Type| | | <a name=\"128\">128</a>|Group Already Exists| | | <a name=\"129\">129</a>|No Such Data Type| | | <a name=\"130\">130</a>|Undefined Value For Data Type| | | <a name=\"131\">131</a>|Unsupported Value Type Defined On Data Type| | | <a name=\"132\">132</a>|Validation Error| | | <a name=\"133\">133</a>|Loop Detected In Group Hierarchy| | | <a name=\"134\">134</a>|Undefined Acceptable Values| | | <a name=\"135\">135</a>|Sub Group Already Exists| | | <a name=\"138\">138</a>|Price Source Not Found| | | <a name=\"139\">139</a>|Analytic Store Not Found| | | <a name=\"141\">141</a>|Analytic Store Already Exists| | | <a name=\"143\">143</a>|Client Instrument Already Exists| | | <a name=\"144\">144</a>|Duplicate In Parameter Set| | | <a name=\"147\">147</a>|Results Not Found| | | <a name=\"148\">148</a>|Order Field Not In Result Set| | | <a name=\"149\">149</a>|Operation Failed| | | <a name=\"150\">150</a>|Elastic Search Error| | | <a name=\"151\">151</a>|Invalid Parameter Value| | | <a name=\"153\">153</a>|Command Processing Failure| | | <a name=\"154\">154</a>|Entity State Construction Failure| | | <a name=\"155\">155</a>|Entity Timeline Does Not Exist| | | <a name=\"156\">156</a>|Concurrency Conflict Failure| | | <a name=\"157\">157</a>|Invalid Request| | | <a name=\"158\">158</a>|Event Publish Unknown| | | <a name=\"159\">159</a>|Event Query Failure| | | <a name=\"160\">160</a>|Blob Did Not Exist| | | <a name=\"162\">162</a>|Sub System Request Failure| | | <a name=\"163\">163</a>|Sub System Configuration Failure| | | <a name=\"165\">165</a>|Failed To Delete| | | <a name=\"166\">166</a>|Upsert Client Instrument Failure| | | <a name=\"167\">167</a>|Illegal As At Interval| | | <a name=\"168\">168</a>|Illegal Bitemporal Query| | | <a name=\"169\">169</a>|Invalid Alternate Id| | | <a name=\"170\">170</a>|Cannot Add Source Portfolio Property Explicitly| | | <a name=\"171\">171</a>|Entity Already Exists In Group| | | <a name=\"173\">173</a>|Entity With Id Already Exists| | | <a name=\"174\">174</a>|Derived Portfolio Details Do Not Exist| | | <a name=\"176\">176</a>|Portfolio With Name Already Exists| | | <a name=\"177\">177</a>|Invalid Transactions| | | <a name=\"178\">178</a>|Reference Portfolio Not Found| | | <a name=\"179\">179</a>|Duplicate Id| | | <a name=\"180\">180</a>|Command Retrieval Failure| | | <a name=\"181\">181</a>|Data Filter Application Failure| | | <a name=\"182\">182</a>|Search Failed| | | <a name=\"183\">183</a>|Movements Engine Configuration Key Failure| | | <a name=\"184\">184</a>|Fx Rate Source Not Found| | | <a name=\"185\">185</a>|Accrual Source Not Found| | | <a name=\"186\">186</a>|Access Denied| | | <a name=\"187\">187</a>|Invalid Identity Token| | | <a name=\"188\">188</a>|Invalid Request Headers| | | <a name=\"189\">189</a>|Price Not Found| | | <a name=\"190\">190</a>|Invalid Sub Holding Keys Provided| | | <a name=\"191\">191</a>|Duplicate Sub Holding Keys Provided| | | <a name=\"192\">192</a>|Cut Definition Not Found| | | <a name=\"193\">193</a>|Cut Definition Invalid| | | <a name=\"194\">194</a>|Time Variant Property Deletion Date Unspecified| | | <a name=\"195\">195</a>|Perpetual Property Deletion Date Specified| | | <a name=\"196\">196</a>|Time Variant Property Upsert Date Unspecified| | | <a name=\"197\">197</a>|Perpetual Property Upsert Date Specified| | | <a name=\"200\">200</a>|Invalid Unit For Data Type| | | <a name=\"201\">201</a>|Invalid Type For Data Type| | | <a name=\"202\">202</a>|Invalid Value For Data Type| | | <a name=\"203\">203</a>|Unit Not Defined For Data Type| | | <a name=\"204\">204</a>|Units Not Supported On Data Type| | | <a name=\"205\">205</a>|Cannot Specify Units On Data Type| | | <a name=\"206\">206</a>|Unit Schema Inconsistent With Data Type| | | <a name=\"207\">207</a>|Unit Definition Not Specified| | | <a name=\"208\">208</a>|Duplicate Unit Definitions Specified| | | <a name=\"209\">209</a>|Invalid Units Definition| | | <a name=\"210\">210</a>|Invalid Instrument Identifier Unit| | | <a name=\"211\">211</a>|Holdings Adjustment Does Not Exist| | | <a name=\"212\">212</a>|Could Not Build Excel Url| | | <a name=\"213\">213</a>|Could Not Get Excel Version| | | <a name=\"214\">214</a>|Instrument By Code Not Found| | | <a name=\"215\">215</a>|Entity Schema Does Not Exist| | | <a name=\"216\">216</a>|Feature Not Supported On Portfolio Type| | | <a name=\"217\">217</a>|Quote Not Found| | | <a name=\"218\">218</a>|Invalid Quote Identifier| | | <a name=\"219\">219</a>|Invalid Metric For Data Type| | | <a name=\"220\">220</a>|Invalid Instrument Definition| | | <a name=\"221\">221</a>|Instrument Upsert Failure| | | <a name=\"222\">222</a>|Reference Portfolio Request Not Supported| | | <a name=\"223\">223</a>|Transaction Portfolio Request Not Supported| | | <a name=\"224\">224</a>|Invalid Property Value Assignment| | | <a name=\"230\">230</a>|Transaction Type Not Found| | | <a name=\"231\">231</a>|Transaction Type Duplication| | | <a name=\"232\">232</a>|Portfolio Does Not Exist At Given Date| | | <a name=\"233\">233</a>|Query Parser Failure| | | <a name=\"234\">234</a>|Duplicate Constituent| | | <a name=\"235\">235</a>|Unresolved Instrument Constituent| | | <a name=\"236\">236</a>|Unresolved Instrument In Transition| | | <a name=\"237\">237</a>|Missing Side Definitions| | | <a name=\"299\">299</a>|Invalid Recipe| | | <a name=\"300\">300</a>|Missing Recipe| | | <a name=\"301\">301</a>|Dependencies| | | <a name=\"304\">304</a>|Portfolio Preprocess Failure| | | <a name=\"310\">310</a>|Valuation Engine Failure| | | <a name=\"311\">311</a>|Task Factory Failure| | | <a name=\"312\">312</a>|Task Evaluation Failure| | | <a name=\"313\">313</a>|Task Generation Failure| | | <a name=\"314\">314</a>|Engine Configuration Failure| | | <a name=\"315\">315</a>|Model Specification Failure| | | <a name=\"320\">320</a>|Market Data Key Failure| | | <a name=\"321\">321</a>|Market Resolver Failure| | | <a name=\"322\">322</a>|Market Data Failure| | | <a name=\"330\">330</a>|Curve Failure| | | <a name=\"331\">331</a>|Volatility Surface Failure| | | <a name=\"332\">332</a>|Volatility Cube Failure| | | <a name=\"350\">350</a>|Instrument Failure| | | <a name=\"351\">351</a>|Cash Flows Failure| | | <a name=\"352\">352</a>|Reference Data Failure| | | <a name=\"360\">360</a>|Aggregation Failure| | | <a name=\"361\">361</a>|Aggregation Measure Failure| | | <a name=\"370\">370</a>|Result Retrieval Failure| | | <a name=\"371\">371</a>|Result Processing Failure| | | <a name=\"372\">372</a>|Vendor Result Processing Failure| | | <a name=\"373\">373</a>|Vendor Result Mapping Failure| | | <a name=\"374\">374</a>|Vendor Library Unauthorised| | | <a name=\"375\">375</a>|Vendor Connectivity Error| | | <a name=\"376\">376</a>|Vendor Interface Error| | | <a name=\"377\">377</a>|Vendor Pricing Failure| | | <a name=\"378\">378</a>|Vendor Translation Failure| | | <a name=\"379\">379</a>|Vendor Key Mapping Failure| | | <a name=\"380\">380</a>|Vendor Reflection Failure| | | <a name=\"390\">390</a>|Attempt To Upsert Duplicate Quotes| | | <a name=\"391\">391</a>|Corporate Action Source Does Not Exist| | | <a name=\"392\">392</a>|Corporate Action Source Already Exists| | | <a name=\"393\">393</a>|Instrument Identifier Already In Use| | | <a name=\"394\">394</a>|Properties Not Found| | | <a name=\"395\">395</a>|Batch Operation Aborted| | | <a name=\"400\">400</a>|Invalid Iso4217 Currency Code| | | <a name=\"401\">401</a>|Cannot Assign Instrument Identifier To Currency| | | <a name=\"402\">402</a>|Cannot Assign Currency Identifier To Non Currency| | | <a name=\"403\">403</a>|Currency Instrument Cannot Be Deleted| | | <a name=\"404\">404</a>|Currency Instrument Cannot Have Economic Definition| | | <a name=\"405\">405</a>|Currency Instrument Cannot Have Lookthrough Portfolio| | | <a name=\"406\">406</a>|Cannot Create Currency Instrument With Multiple Identifiers| | | <a name=\"407\">407</a>|Specified Currency Is Undefined| | | <a name=\"410\">410</a>|Index Does Not Exist| | | <a name=\"411\">411</a>|Sort Field Does Not Exist| | | <a name=\"413\">413</a>|Negative Pagination Parameters| | | <a name=\"414\">414</a>|Invalid Search Syntax| | | <a name=\"415\">415</a>|Filter Execution Timeout| | | <a name=\"420\">420</a>|Side Definition Inconsistent| | | <a name=\"450\">450</a>|Invalid Quote Access Metadata Rule| | | <a name=\"451\">451</a>|Access Metadata Not Found| | | <a name=\"452\">452</a>|Invalid Access Metadata Identifier| | | <a name=\"460\">460</a>|Standard Resource Not Found| | | <a name=\"461\">461</a>|Standard Resource Conflict| | | <a name=\"462\">462</a>|Calendar Not Found| | | <a name=\"463\">463</a>|Date In A Calendar Not Found| | | <a name=\"464\">464</a>|Invalid Date Source Data| | | <a name=\"465\">465</a>|Invalid Timezone| | | <a name=\"601\">601</a>|Person Identifier Already In Use| | | <a name=\"602\">602</a>|Person Not Found| | | <a name=\"603\">603</a>|Cannot Set Identifier| | | <a name=\"617\">617</a>|Invalid Recipe Specification In Request| | | <a name=\"618\">618</a>|Inline Recipe Deserialisation Failure| | | <a name=\"619\">619</a>|Identifier Types Not Set For Entity| | | <a name=\"620\">620</a>|Cannot Delete All Client Defined Identifiers| | | <a name=\"650\">650</a>|The Order requested was not found.| | | <a name=\"654\">654</a>|The Allocation requested was not found.| | | <a name=\"655\">655</a>|Cannot build the fx forward target with the given holdings.| | | <a name=\"656\">656</a>|Group does not contain expected entities.| | | <a name=\"667\">667</a>|Relation definition already exists| | | <a name=\"673\">673</a>|Missing entitlements for entities in Group| | | <a name=\"674\">674</a>|Next Best Action not found| | | <a name=\"676\">676</a>|Relation definition not defined| | | <a name=\"677\">677</a>|Invalid entity identifier for relation| | | <a name=\"681\">681</a>|Sorting by specified field not supported|One or more of the provided fields to order by were either invalid or not supported. | | <a name=\"682\">682</a>|Too many fields to sort by|The number of fields to sort the data by exceeds the number allowed by the endpoint | | <a name=\"684\">684</a>|Sequence Not Found| | | <a name=\"685\">685</a>|Sequence Already Exists| | | <a name=\"686\">686</a>|Non-cycling sequence has been exhausted| | | <a name=\"687\">687</a>|Legal Entity Identifier Already In Use| | | <a name=\"688\">688</a>|Legal Entity Not Found| | | <a name=\"689\">689</a>|The supplied pagination token is invalid| | | <a name=\"690\">690</a>|Property Type Is Not Supported| | | <a name=\"691\">691</a>|Multiple Tax-lots For Currency Type Is Not Supported| | | <a name=\"692\">692</a>|This endpoint does not support impersonation| | | <a name=\"693\">693</a>|Entity type is not supported for Relationship| | | <a name=\"694\">694</a>|Relationship Validation Failure| | | <a name=\"695\">695</a>|Relationship Not Found| | | <a name=\"697\">697</a>|Derived Property Formula No Longer Valid| | | <a name=\"698\">698</a>|Story is not available| | | <a name=\"703\">703</a>|Corporate Action Does Not Exist| | * * The version of the OpenAPI document: 0.11.2863 * Contact: [email protected] * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package com.finbourne.lusid.model; import com.finbourne.lusid.model.DataMapping; import com.finbourne.lusid.model.ErrorDetail; import com.finbourne.lusid.model.Link; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.net.URI; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; /** * Model tests for GetDataMapResponse */ public class GetDataMapResponseTest { private final GetDataMapResponse model = new GetDataMapResponse(); /** * Model tests for GetDataMapResponse */ @Test public void testGetDataMapResponse() { // TODO: test GetDataMapResponse } /** * Test the property 'href' */ @Test public void hrefTest() { // TODO: test href } /** * Test the property 'values' */ @Test public void valuesTest() { // TODO: test values } /** * Test the property 'failed' */ @Test public void failedTest() { // TODO: test failed } /** * Test the property 'links' */ @Test public void linksTest() { // TODO: test links } }
c718f9deaebd2005ce3bdbfbfae19a12abe0a5df
3b6218ff504e6afec1c99ce1d33ed301b910d2a1
/src/main/java/com/jfinal/template/stat/Lexer.java
016ce52f67f60e1b38b5fcab350de4e718e16b24
[ "Apache-2.0" ]
permissive
tcggy2/jfinal
2dff04907c068a416c14cab876f8952728812f82
15c2ac8eb07977edf632e00fde77a097185af659
refs/heads/master
2022-04-22T06:24:25.871795
2020-04-14T06:56:48
2020-04-14T06:56:48
255,533,452
0
0
Apache-2.0
2020-04-14T06:55:00
2020-04-14T06:54:59
null
UTF-8
Java
false
false
16,368
java
/** * Copyright (c) 2011-2019, James Zhan 詹波 ([email protected]). * * 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.jfinal.template.stat; import java.util.ArrayList; import java.util.List; import java.util.Set; /** * DKFF(Dynamic Key Feature Forward) Lexer */ class Lexer { static final char EOF = (char)-1; static final int TEXT_STATE_DIAGRAM = 999; char[] buf; int state = 0; int lexemeBegin = 0; int forward = 0; int beginRow = 1; int forwardRow = 1; TextToken previousTextToken = null; String fileName; Set<String> keepLineBlankDirectives; List<Token> tokens = new ArrayList<Token>(); public Lexer(StringBuilder content, String fileName, Set<String> keepLineBlankDirectives) { this.keepLineBlankDirectives = keepLineBlankDirectives; int len = content.length(); buf = new char[len + 1]; content.getChars(0, content.length(), buf, 0); buf[len] = EOF; this.fileName = fileName; } /** * 进入每个扫描方法之前 peek() 处于可用状态,不需要 next() * 每个扫描方法内部是否要 next() 移动,取决定具体情况 * 每个扫描方法成功返回前,将 forward 置于下一次扫描需要处理的地方 * 让下个扫描方法不必 next() * 紧靠 scanText() 之前的扫描方法在失败后必须保持住forward * 这是 scanText() 可以一直向前的保障 */ public List<Token> scan() { while (peek() != EOF) { if (peek() == '#') { if (scanDire()) { continue ; } if (scanSingleLineComment()) { continue ; } if (scanMultiLineComment()) { continue ; } if (scanNoParse()) { continue ; } } scanText(); } return tokens; } /** * 指令模式与解析规则 * 1:指令 pattern * #(p) * #id(p) * #define id(p) * #@id(p) / #@id?(p) * #else / #end * * 2:关键字类型指令在获取到关键字以后,必须要正确解析出后续内容,否则抛异常 * * 3:非关键字类型指令只有在本行内出现 # id ( 三个序列以后,才要求正确解析出后续内容 * 否则当成普通文本 */ boolean scanDire() { String id = null; StringBuilder para = null; Token idToken = null; Token paraToken = null; while (true) { switch (state) { case 0: if (peek() == '#') { // # next(); skipBlanks(); state = 1; continue ; } return fail(); case 1: if (peek() == '(') { // # ( para = scanPara(""); idToken = new Token(Symbol.OUTPUT, beginRow); paraToken = new ParaToken(para, beginRow); return addIdParaToken(idToken, paraToken); } if (CharTable.isLetter(peek())) { // # id state = 10; continue ; } if (peek() == '@') { // # @ next(); skipBlanks(); if (CharTable.isLetter(peek())) { // # @ id state = 20; continue ; } } return fail(); // ----------------------------------------------------- case 10: // # id id = scanId(); Symbol symbol = Symbol.getKeywordSym(id); // 非关键字指令 if (symbol == null) { state = 11; continue ; } // define 指令 if (symbol == Symbol.DEFINE) { state = 12; continue ; } // 在支持 #seleif 的基础上,支持 #else if if (symbol == Symbol.ELSE) { if (foundFollowingIf()) { id = "else if"; symbol = Symbol.ELSEIF; } } // 无参关键字指令 if (symbol.noPara()) { return addNoParaToken(new Token(symbol, id, beginRow)); } // 有参关键字指令 skipBlanks(); if (peek() == '(') { para = scanPara(id); idToken = new Token(symbol, beginRow); paraToken = new ParaToken(para, beginRow); return addIdParaToken(idToken, paraToken); } throw new ParseException("#" + id + " directive requires parentheses \"()\"", new Location(fileName, beginRow)); case 11: // 用户自定义指令必须有参数 skipBlanks(); if (peek() == '(') { para = scanPara(id); idToken = new Token(Symbol.ID, id, beginRow); paraToken = new ParaToken(para, beginRow); return addIdParaToken(idToken, paraToken); } return fail(); // 用户自定义指令在没有左括号的情况下当作普通文本 case 12: // 处理 "# define id (para)" 指令 skipBlanks(); if (CharTable.isLetter(peek())) { id = scanId(); // 模板函数名称 skipBlanks(); if (peek() == '(') { para = scanPara("define " + id); idToken = new Token(Symbol.DEFINE, id, beginRow); paraToken = new ParaToken(para, beginRow); return addIdParaToken(idToken, paraToken); } throw new ParseException("#define " + id + " : template function definition requires parentheses \"()\"", new Location(fileName, beginRow)); } throw new ParseException("#define directive requires identifier as a function name", new Location(fileName, beginRow)); case 20: // # @ id id = scanId(); skipBlanks(); boolean hasQuestionMark = peek() == '?'; if (hasQuestionMark) { next(); skipBlanks(); } if (peek() == '(') { para = scanPara(hasQuestionMark ? "@" + id + "?" : "@" + id); idToken = new Token(hasQuestionMark ? Symbol.CALL_IF_DEFINED : Symbol.CALL, id, beginRow); paraToken = new ParaToken(para, beginRow); return addIdParaToken(idToken, paraToken); } return fail(); default : return fail(); } } } boolean foundFollowingIf() { int p = forward; while (CharTable.isBlank(buf[p])) {p++;} if (buf[p++] == 'i') { if (buf[p++] == 'f') { while (CharTable.isBlank(buf[p])) {p++;} // 要求出现 '(' 才认定解析成功,为了支持这种场景: #else if you ... if (buf[p] == '(') { forward = p; return true; } } } return false; } /** * 调用者已确定以字母或下划线开头,故一定可以获取到 id值 */ String scanId() { int idStart = forward; while (CharTable.isLetterOrDigit(next())) { ; } return subBuf(idStart, forward - 1).toString(); } /** * 扫描指令参数,成功则返回,否则抛出词法分析异常 */ StringBuilder scanPara(String id) { char quotes = '"'; int localState = 0; int parenDepth = 1; // 指令后面参数的第一个 '(' 深度为 1 next(); int paraStart = forward; while (true) { switch (localState) { case 0: for (char c=peek(); true; c=next()) { if (c == ')') { parenDepth--; if (parenDepth == 0) { // parenDepth 不可能小于0,因为初始值为 1 next(); return subBuf(paraStart, forward - 2); } continue ; } if (c == '(') { parenDepth++; continue ; } if (c == '"' || c == '\'') { quotes = c; localState = 1; break ; } if (CharTable.isExprChar(c)) { continue ; } if (c == EOF) { throw new ParseException("#" + id + " parameter can not match the end char ')'", new Location(fileName, beginRow)); } throw new ParseException("#" + id + " parameter exists illegal char: '" + c + "'", new Location(fileName, beginRow)); } break ; case 1: for (char c=next(); true; c=next()) { if (c == quotes) { if (buf[forward - 1] != '\\') { // 前一个字符不是转义字符 next(); localState = 0; break ; } else { continue ; } } if (c == EOF) { throw new ParseException("#" + id + " parameter error, the string parameter not ending", new Location(fileName, beginRow)); } } break ; } } } /** * 单行注释,开始状态 100,关注换行与 EOF */ boolean scanSingleLineComment() { while (true) { switch (state) { case 100: if (peek() == '#' && next() == '#' && next() == '#') { state = 101; continue ; } return fail(); case 101: for (char c=next(); true; c=next()) { if (c == '\n') { if (deletePreviousTextTokenBlankTails()) { return prepareNextScan(1); } else { return prepareNextScan(0); } } if (c == EOF) { deletePreviousTextTokenBlankTails(); return prepareNextScan(0); } } default : return fail(); } } } /** * 多行注释,开始状态 200,关注结尾标记与 EOF */ boolean scanMultiLineComment() { while (true) { switch (state) { case 200: if (peek() == '#' && next() == '-' && next() == '-') { state = 201; continue ; } return fail(); case 201: for (char c=next(); true; c=next()) { if (c == '-' && buf[forward + 1] == '-' && buf[forward + 2] == '#') { forward = forward + 3; if (lookForwardLineFeedAndEof() && deletePreviousTextTokenBlankTails()) { return prepareNextScan(peek() != EOF ? 1 : 0); } else { return prepareNextScan(0); } } if (c == EOF) { throw new ParseException("The multiline comment start block \"#--\" can not match the end block: \"--#\"", new Location(fileName, beginRow)); } } default : return fail(); } } } /** * 非解析块,开始状态 300,关注结尾标记与 EOF */ boolean scanNoParse() { while (true) { switch (state) { case 300: if (peek() == '#' && next() == '[' && next() == '[') { state = 301; continue ; } return fail(); case 301: for (char c=next(); true; c=next()) { if (c == ']' && buf[forward + 1] == ']' && buf[forward + 2] == '#') { addTextToken(subBuf(lexemeBegin + 3, forward - 1)); // NoParse 块使用 TextToken return prepareNextScan(3); } if (c == EOF) { throw new ParseException("The \"no parse\" start block \"#[[\" can not match the end block: \"]]#\"", new Location(fileName, beginRow)); } } default : return fail(); } } } boolean scanText() { for (char c=peek(); true; c=next()) { if (c == '#' || c == EOF) { addTextToken(subBuf(lexemeBegin, forward - 1)); return prepareNextScan(0); } } } boolean fail() { if (state < 300) { forward = lexemeBegin; forwardRow = beginRow; } if (state < 100) { state = 100; } else if (state < 200) { state = 200; } else if (state < 300) { state = 300; } else { state = TEXT_STATE_DIAGRAM; } return false; } char next() { if (buf[forward] == '\n') { forwardRow++; } return buf[++forward]; } char peek() { return buf[forward]; } void skipBlanks() { while (CharTable.isBlank(buf[forward])) { next(); } } /** * scanPara 与 scanNoParse 存在 start > end 的情况 */ StringBuilder subBuf(int start, int end) { if (start > end) { return null; } StringBuilder ret = new StringBuilder(end - start + 1); for (int i=start; i<=end; i++) { ret.append(buf[i]); } return ret; } boolean prepareNextScan(int moveForward) { for (int i=0; i<moveForward; i++) { next(); } state = 0; lexemeBegin = forward; beginRow = forwardRow; return true; } void addTextToken(StringBuilder text) { if (text == null || text.length() == 0) { return ; } if (previousTextToken != null) { previousTextToken.append(text); } else { previousTextToken = new TextToken(text, beginRow); tokens.add(previousTextToken); } } /** * 带参指令处于独立行时删除前后空白字符,并且再删除一个后续的换行符 * 处于独立行是指:向前看无有用内容,在前面情况成立的基础之上 * 再向后看如果也无可用内容,前一个条件成立才开执行后续动作 * * 向前看时 forward 在移动,意味着正在删除空白字符(通过 lookForwardLineFeed()方法) * 向后看时也会在碰到空白 + '\n' 时删空白字符 (通过 deletePreviousTextTokenBlankTails()方法) */ boolean addIdParaToken(Token idToken, Token paraToken) { tokens.add(idToken); tokens.add(paraToken); skipFollowingComment(); // 保留指令所在行空白字符 // #define xxx() 模板函数名、#@xxx() 模板函数名,可以与指令同名,需要排除掉这三种 Symbol if (keepLineBlankDirectives.contains(idToken.value()) && idToken.symbol != Symbol.DEFINE && idToken.symbol != Symbol.CALL && idToken.symbol != Symbol.CALL_IF_DEFINED ) { prepareNextScan(0); } else { trimLineBlank(); } previousTextToken = null; return true; } // #set 这类指令,处在独立一行时,需要删除当前行的前后空白字符以及行尾字符 '\n' void trimLineBlank() { // if (lookForwardLineFeed() && (deletePreviousTextTokenBlankTails() || lexemeBegin == 0)) { if (lookForwardLineFeedAndEof() && deletePreviousTextTokenBlankTails()) { prepareNextScan(peek() != EOF ? 1 : 0); } else { prepareNextScan(0); } } // 无参指令无条件调用 trimLineBlank() boolean addNoParaToken(Token noParaToken) { tokens.add(noParaToken); skipFollowingComment(); if (CharTable.isBlank(peek())) { next(); // 无参指令之后紧随的一个空白字符仅为分隔符,不参与后续扫描 } trimLineBlank(); previousTextToken = null; return true; } // 向前看后续是否跟随的是空白 + 换行或者是空白 + EOF,是则表示当前指令后续没有其它有用内容 boolean lookForwardLineFeedAndEof() { int fp = forward; for (char c=buf[fp]; true; c=buf[++fp]) { if (CharTable.isBlank(c)) { continue ; } if (c == '\n' || c == EOF) { forward = fp; return true; } return false; } } /** * 1:当前指令前方仍然是指令 (previousTextToken 为 null),直接返回 true * 2:当前指令前方为 TextToken 时的处理逻辑与返回值完全依赖于 TextToken.deleteBlankTails() */ boolean deletePreviousTextTokenBlankTails() { // return previousTextToken != null ? previousTextToken.deleteBlankTails() : false; return previousTextToken == null || previousTextToken.deleteBlankTails(); } /** * 跳过指令后方跟随的注释,以便正确处理各类换行逻辑 */ void skipFollowingComment() { int fp = forward; for (char c=buf[fp]; true; c=buf[++fp]) { if (CharTable.isBlank(c)) { continue ; } // 勿使用 next() if (c == '#') { if (buf[fp + 1] == '#' && buf[fp + 2] == '#') { forward = fp; skipFollowingSingleLineComment(); } else if (buf[fp + 1] == '-' && buf[fp + 2] == '-') { forward = fp; skipFollowingMultiLineComment(); } } return ; } } void skipFollowingSingleLineComment() { forward = forward + 3; for (char c=peek(); true; c=next()) { if (c == '\n' || c == EOF) { break ; } } } void skipFollowingMultiLineComment() { forward = forward + 3; for (char c=peek(); true; c=next()) { if (c == '-' && buf[forward + 1] == '-' && buf[forward + 2] == '#') { forward = forward + 3; break ; } if (c == EOF) { throw new ParseException("The multiline comment start block \"#--\" can not match the end block: \"--#\"", new Location(fileName, beginRow)); } } } }
c2ea66a60522c23b257ce21a0725b2ed94648f40
28e8cfb58683170e4afc586ee2dedd12a478a3a7
/src/main/java/com/se2automate/util/VoiceUtil.java
3d56ebe2da757933533c5a9e64d235f3962cf327
[ "MIT" ]
permissive
gpprakash1989/GoogleVoiceTest
e1004e8cad2423cc2944e1eaf030b62f7ba5625f
ccc2f9dc8db1c21dc2f0a376e1f5fb3317a7f3a4
refs/heads/master
2021-10-09T20:23:21.175840
2019-01-03T07:11:23
2019-01-03T07:11:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,687
java
package com.se2automate.util; import in.co.gauravtiwari.voice.client.VoiceAutomationClient; import in.co.gauravtiwari.voice.clientresources.ClientOperationException; import in.co.gauravtiwari.voice.clientresources.Voice; import in.co.gauravtiwari.voice.design.Language; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URL; /** * created By Gaurav Tiwari */ public class VoiceUtil { static final Logger LOG = LoggerFactory.getLogger(VoiceUtil.class); public static void speak(String text, Language language){ try { Voice voice = new Voice(text, language); VoiceAutomationClient voiceAutomationClient = new VoiceAutomationClient(); voiceAutomationClient.load(voice); voiceAutomationClient.play(voice); LOG.info(voice.getFilename()); LOG.info(voice.getText()); LOG.info(voice.getVoiceName()); LOG.info(voice.getVoiceLanguage().toString()); }catch (ClientOperationException e){ e.printStackTrace(); }catch (Exception ex){ ex.printStackTrace(); } } public static void playInternetVoiceFile(String url){ try { URL voiceUrl = new URL(url); Voice voice = new Voice(voiceUrl); VoiceAutomationClient voiceAutomationClient = new VoiceAutomationClient(); voiceAutomationClient.load(voice); voiceAutomationClient.play(voice); LOG.info(voice.getFilename()); }catch (ClientOperationException e){ e.printStackTrace(); }catch (Exception ex){ ex.printStackTrace(); } } }
6216b9da3035fccf3f3a5ecff1a66449de3cac5d
04b345c9ef008b3b189d5a4ba3c6e766b18c5ec0
/Qualiti Delivery/br/com/qualiti/delivery/view/CreateEditProduto.java
33e451e1bd38bf58249d9cc56eed33f2697d8bc7
[]
no_license
oromar/java-projects
64ef6903ef0857fb4ab9281db9c181eb9b2795e7
4ce75b02056fa01f7e58c65373d32f5ea954001d
refs/heads/master
2021-01-18T12:35:14.536573
2016-02-23T18:26:31
2016-02-23T18:26:31
41,676,325
1
1
null
null
null
null
UTF-8
Java
false
false
7,629
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.com.qualiti.delivery.view; import br.com.qualiti.delivery.entidades.Produto; import br.com.qualiti.delivery.negocio.Fachada; import javax.swing.JOptionPane; /** * * @author OROMAR */ public class CreateEditProduto extends javax.swing.JDialog { private boolean editMode; private Produto produtoParaAtualizar; /** * Creates new form TelaCriarEditarProduto */ public CreateEditProduto(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); } public CreateEditProduto(java.awt.Frame parent, String titulo, Produto produto) { this(parent, true); produtoParaAtualizar = produto; editMode = true; setTitle(titulo); btnAddProduto.setText("Salvar"); edtDataValidadeProduto.setText(produtoParaAtualizar.getDateString()); edtNomeProduto.setText(produtoParaAtualizar.getNome()); edtPrecoProduto.setText(String.valueOf(produto.getPrecoUnitario())); lblNovoProduto.setText("Editar Produto"); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { lblNovoProduto = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); edtNomeProduto = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); edtPrecoProduto = new javax.swing.JTextField(); edtDataValidadeProduto = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); btnAddProduto = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Cadastrar Produto"); setResizable(false); lblNovoProduto.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N lblNovoProduto.setText("Novo Produto"); jLabel2.setText("Nome:"); jLabel3.setText("Preço Unitário:"); jLabel4.setText("Data de Validade:"); btnAddProduto.setText("Add"); btnAddProduto.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAddProdutoActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(edtPrecoProduto) .addComponent(edtNomeProduto) .addComponent(edtDataValidadeProduto) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lblNovoProduto) .addComponent(jLabel2) .addComponent(jLabel3) .addComponent(jLabel4)) .addGap(0, 161, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(btnAddProduto))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(lblNovoProduto) .addGap(18, 18, 18) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(edtNomeProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(edtPrecoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(edtDataValidadeProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnAddProduto) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void btnAddProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddProdutoActionPerformed try { if (editMode) { produtoParaAtualizar.setNome(edtNomeProduto.getText()); produtoParaAtualizar.setDateString(edtDataValidadeProduto.getText()); produtoParaAtualizar.setPrecoUnitario(Double.parseDouble(edtPrecoProduto.getText())); produtoParaAtualizar.validar(); Fachada.getInstancia().atualizar(produtoParaAtualizar); JOptionPane.showMessageDialog(this, "Registro atualizado com sucesso !", "Info", JOptionPane.INFORMATION_MESSAGE); dispose(); } else { Produto novoProduto = null; novoProduto = new Produto(); novoProduto.setNome(edtNomeProduto.getText()); novoProduto.setPrecoUnitario(Double.parseDouble(edtPrecoProduto.getText())); novoProduto.setDateString(edtDataValidadeProduto.getText()); novoProduto.validar(); Fachada.getInstancia().inserir(novoProduto); JOptionPane.showMessageDialog(this, "Registro inserido com sucesso !", "Info", JOptionPane.INFORMATION_MESSAGE); dispose(); } } catch (Exception ex) { JOptionPane.showMessageDialog(this, ex.getMessage(), "Erro", JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_btnAddProdutoActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnAddProduto; private javax.swing.JTextField edtDataValidadeProduto; private javax.swing.JTextField edtNomeProduto; private javax.swing.JTextField edtPrecoProduto; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel lblNovoProduto; // End of variables declaration//GEN-END:variables }
5d24fc52e88888700c00cf6f9024641bd823522b
73610143bf176c4a8e8abcd37756cc8b0a76facc
/Spring-MongoDB/src/main/java/com/raj/bean/Car.java
0785706c8eb4507e279a45ea1efd1fe140f2606d
[]
no_license
Raj-Tomar/Spring-MongoDB
1931ee918300e0ffb5c6466fe13a9f44effb18ff
d0cee3e992a29235d9d02e240c4507870e38e658
refs/heads/master
2021-01-02T09:39:38.852108
2017-08-03T20:06:30
2017-08-03T20:06:30
99,269,703
0
0
null
null
null
null
UTF-8
Java
false
false
925
java
package com.raj.bean; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; @Document(collection = "cars") public class Car { @Id private String id; private String brand; private String model; public Car(String brand, String model) { super(); this.brand = brand; this.model = model; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } @Override public String toString() { StringBuilder str = new StringBuilder(); str.append("Id:- " + getId() + ", Brand:- " + getBrand() + ", Model:- " + getModel()); return str.toString(); } }
f0bc4a917e2560a1dd8172804356c49fe873a72b
95012f1f676ac540ea01bb92673e67b667736eae
/app/src/main/java/com/example/ls/shoppingmall/home/activity/HealthInquriActivity.java
adcf42d80d7deb7df2063e5ee9c0e668d917ffc7
[]
no_license
luhenchang/MedicalAppSendToGitHub
ffbdd5095a969c5ddeca8264c65238690f597f58
66c98bf8ae4eb46dd48993dab90af46934408d91
refs/heads/master
2020-03-12T06:05:09.624283
2018-08-29T08:11:13
2018-08-29T08:11:13
130,477,785
0
0
null
null
null
null
UTF-8
Java
false
false
7,018
java
package com.example.ls.shoppingmall.home.activity; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.WindowManager; import android.webkit.JavascriptInterface; import android.webkit.JsResult; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ImageView; import android.widget.TextView; import com.example.ls.shoppingmall.R; import com.example.ls.shoppingmall.app.MyApplication; import com.example.ls.shoppingmall.app.config.NetConfig; import com.example.ls.shoppingmall.community.activity.MedicalInforActivity; //import com.example.ls.shoppingmall.user.activity.PayMoneyActivity; import com.example.ls.shoppingmall.utils.layoututils.LoadingDialog; import org.apache.commons.collections.map.HashedMap; import java.util.Map; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; public class HealthInquriActivity extends Activity { @Bind(R.id.back_to_agin) ImageView backToAgin; @Bind(R.id.title_top) TextView titleTop; @Bind(R.id.talk_case_conneting) TextView talkCaseConneting; @Bind(R.id.web_case) WebView webCase; private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { } }; private LoadingDialog dialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_health_inquri); ButterKnife.bind(this); getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); MyApplication.addActivity(this); dialog = new LoadingDialog(this, R.layout.login_load_layout,"加载中..."); dialog.setCancelable(false); dialog.setCanceledOnTouchOutside(false); initView(); } @OnClick({R.id.back_to_agin, R.id.title_top}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.back_to_agin: break; case R.id.title_top: break; } } private void initView() { dialog.show(); // String str = "file:///android_asset/doctor.html"; String str = NetConfig.MEDICAL_TALK; WebSettings websettings = webCase.getSettings(); websettings.setJavaScriptEnabled(true); websettings.setUseWideViewPort(true);//设置此属性,可任意比例缩放 websettings.setLoadWithOverviewMode(true); webCase.requestFocusFromTouch(); websettings.setJavaScriptCanOpenWindowsAutomatically(true); webCase.loadUrl(str); webCase.setWebViewClient(new HealthInquriActivity.MyWebViewClient()); webCase.setWebChromeClient(new HealthInquriActivity.MyWebChromeClient()); //清除缓存 webCase.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); webCase.addJavascriptInterface(new HealthInquriActivity.JavaScriptinterface(this), "openJava"); webCase.addJavascriptInterface(new HealthInquriActivity.JSInterface(), "Android"); } @Override protected void onResume() { super.onResume(); initView(); } @Override protected void onPause() { super.onPause(); if (dialog != null) { dialog.dismiss(); } } @Override protected void onStop() { super.onStop(); if (dialog != null) { dialog.dismiss(); } } public class MyWebChromeClient extends WebChromeClient { @Override public void onReceivedTitle(WebView view, String title) { //titleview.setText(title);// a textview } @Override public void onProgressChanged(WebView view, int newProgress) { super.onProgressChanged(view, newProgress); if (newProgress == 100) { dialog.dismiss(); } else { dialog.show(); } } @Override public boolean onJsConfirm(WebView view, String url, String message, JsResult result) { return super.onJsConfirm(view, url, message, result); } } public class MyWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { return super.shouldOverrideUrlLoading(view, url); } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); } @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { super.onReceivedError(view, errorCode, description, failingUrl); } } public class JavaScriptinterface { private Context mContext; /** * Instantiate the interface and set the context */ public JavaScriptinterface(Context c) { mContext = c; } /** * Show a toast from the web page */ @JavascriptInterface public void comeBack() { // TODO Auto-generated method stub Intent intent = new Intent(HealthInquriActivity.this, MedicalInforActivity.class); // Log.v("URI:::::::::", uri.toString()); intent.putExtra("Activity_Id", "id"); startActivity(intent); } } //这个是电话和微信选择切换 private class JSInterface { //刚进来判断是否已经收藏这个视乎是后天做的 /* @JavascriptInterface public void setVisibleConnected(int visible) { // window.Android.sendToAndroid(visible);//这里的visible是int类型 Message message=Message.obtain(); message.what = visible; mHandler.sendMessage(message); }*/ //sendToAndroidPay //返回的订单信息和钱 @JavascriptInterface public void sendToAndroidPay(String information, String money) { Map<String, Object> map = new HashedMap(); map.put("infor", information); map.put("money", money); Message message = Message.obtain(); message.obj = map; message.what = 110; mHandler.sendMessage(message); } } }
f76a94b61424b46ddba1caef39c33aa83ee4b728
a2e6b17e7d4f6eab733faeb48b4294fa74f121e6
/boot-example-advance/boot-example-guava-rate-limit/src/main/java/com/boot/example/cache/GuavaRateLimitTest2.java
de346680c3867da618971f399c21753bdeac3347
[]
no_license
a601942905git/boot-example
016449748f9a0586aae94156aee5aa01637752a8
f97533e9afb6b79b8e76769937fbeee6e1160aed
refs/heads/master
2023-06-21T18:22:56.049676
2023-05-24T10:52:20
2023-05-24T10:52:20
158,686,857
19
6
null
2023-06-14T22:47:32
2018-11-22T11:07:06
Java
UTF-8
Java
false
false
1,019
java
package com.boot.example.cache; import com.google.common.util.concurrent.RateLimiter; import java.time.Clock; import java.util.concurrent.TimeUnit; /** * com.boot.example.cache.GuavaRateLimitTest2 * * @author lipeng * @dateTime 2018/12/4 下午6:07 */ public class GuavaRateLimitTest2 { public static void main(String[] args) { RateLimiter rateLimiter = RateLimiter.create(1); /** * tryAcquire()根据给定的时间尝试获取令牌 * 此处的时间是指100ms内能否获取到令牌,并不是等待100ms * 根据如上配置,每1s才产生一个令牌,所以tryAcquire()返回false */ while (true) { Long time1 = Clock.systemDefaultZone().millis(); boolean acquireFlag = rateLimiter.tryAcquire(100, TimeUnit.MILLISECONDS); Long time2 = Clock.systemDefaultZone().millis(); System.out.println("【acquireFlag】" + acquireFlag + "【时间差】:" + (time2 - time1)); } } }
7f794860221b3dc669cea61d282b0698e40b401c
7cf9e6de264cf51bc2814297a3702897911b8476
/src/main/java/org/ota/tiger/App.java
9a0880d5232e677878faab6d6234b314da4251e6
[]
no_license
kyo-qin/tiger
31c1aa94beba8a42c30d3d0f1cc2318a7a437bb5
cab8dbc474c7ac4bcbf26e80811d4f96494f76b1
refs/heads/master
2020-03-25T04:01:47.004094
2018-12-21T01:18:42
2018-12-21T01:18:42
143,374,194
0
1
null
null
null
null
UTF-8
Java
false
false
176
java
package org.ota.tiger; /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } }
a9fea4ad68204d86951bedfd47767a85721121e0
c46d4daa8e9f3ae10698d28211a591cf65bbe61e
/rocketmq-spring-boot-autoconfigure/src/main/java/com/github/thierrysquirrel/core/factory/ConsumerFactory.java
6515f3a66da6a5ad6fa5a1a64ddd17f9fa6cb8f9
[ "Apache-2.0" ]
permissive
naturalation/rocketmq-spring-boot-starter
9a552faf095b410490694b1879dc93619a83c384
8e4fee522324d005d85e7fafd9be26bc1b756af4
refs/heads/master
2020-06-16T19:16:50.590375
2019-07-07T17:15:29
2019-07-07T17:15:29
195,676,209
0
0
Apache-2.0
2019-07-07T16:57:36
2019-07-07T16:57:36
null
UTF-8
Java
false
false
656
java
package com.github.thierrysquirrel.core.factory; import com.aliyun.openservices.ons.api.Consumer; import com.aliyun.openservices.ons.api.ONSFactory; import com.aliyun.openservices.ons.api.order.OrderConsumer; import java.util.Properties; /** * ClassName: ConsumerFactory * Description: * date: 2019/4/27 15:55 * * @author ThierrySquirrel * @since JDK 1.8 */ public class ConsumerFactory { public static Consumer createConsumer(Properties properties) { return ONSFactory.createConsumer(properties); } public static OrderConsumer createOrderConsumer(Properties properties) { return ONSFactory.createOrderedConsumer(properties); } }
5cf5bd9b1cca2a522a8d5bbe243f2b65f2051b0b
0d27fd64b86245f4cc7f3151d125635d8167759d
/app/src/test/java/com/mmali/assignment1/ExampleUnitTest.java
b738c7c452ac9d1235213c5efcce5861c97545f3
[]
no_license
mmehdiali5/AssignmentOne
3e91d4a326a95bb121dbf0d13342cff28bec28af
a9e5ff41143038ff45f25d917016c18ca50c450a
refs/heads/master
2023-03-29T06:37:12.161974
2021-04-03T23:05:10
2021-04-03T23:05:10
354,296,294
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
package com.mmali.assignment1; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
ca33d0645e0307416a9730475e9b7f2b75c553a0
2f8bcd14a2a2c7a3a1bb6a4e6dcc061447608680
/Bird.java
1041badedabf565cfaeed84a4ef94479d449e78a
[]
no_license
Sai-sindhu-ch/Polymorphism
cbefea1807087fba25b01522888045bcba579ea3
9757abc5b2df858b550aaa9f7a802e90fe39a754
refs/heads/master
2020-05-29T20:55:49.298494
2019-05-30T07:08:00
2019-05-30T07:08:00
189,363,567
0
0
null
null
null
null
UTF-8
Java
false
false
317
java
package polymorphism; interface Fly{ void goForward(); void goDown(); } class Bird { public static void main(String[] args) { Duck duck = new Duck(); duck.goForward(); duck.goDown(); Finch finch = new Finch(); finch.goForward(); finch.goDown(); } }
6b3adfc8db9b8a86ae4e146528784fb7e84f29e2
b67fcc05d7753cf6ba4a83f67f2036e2ec26a3e3
/src/main/java/com/crud/tasks/controller/TaskController.java
d78d5617859a8c8777dacda41606ecb492ad5bee
[]
no_license
apazdzio/projekt-aplikacji
fb5d0213e81cbb7d4ee30fadfaeab99aaae1b22e
a3f6f26f6ef7fbf9428ea7ecf7547e104d3874e1
refs/heads/master
2021-08-31T18:51:19.572137
2017-12-22T12:34:47
2017-12-22T12:34:47
106,740,248
0
0
null
null
null
null
UTF-8
Java
false
false
1,577
java
package com.crud.tasks.controller; import com.crud.tasks.domain.TaskDto; import com.crud.tasks.mapper.TaskMapper; import com.crud.tasks.service.DbService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; import static org.springframework.util.MimeTypeUtils.APPLICATION_JSON_VALUE; @CrossOrigin(origins = "*") @RestController @RequestMapping("/v1") public class TaskController { @Autowired private DbService service; @Autowired private TaskMapper taskMapper; @GetMapping(value = "/tasks") public List<TaskDto> getTasks(){ return taskMapper.mapToTaskDtoList(service.getAllTasks()); } @RequestMapping(method = RequestMethod.GET, value = "/tasks/{taskId}") public TaskDto getTask(@PathVariable Long taskId) throws TaskNotFoundException { return taskMapper.mapToTaskDto(service.getTask(taskId).orElseThrow(TaskNotFoundException::new)); } @RequestMapping(method = RequestMethod.DELETE, value = "/tasks/{taskId}") public void deleteTask(@PathVariable Long taskId){ service.deleteTask(taskId); } @PutMapping(value = "/tasks") public TaskDto updateTask(@RequestBody TaskDto taskDto){ return taskMapper.mapToTaskDto(service.saveTask(taskMapper.mapToTask(taskDto))); } @RequestMapping(method = RequestMethod.POST, value = "/tasks", consumes = APPLICATION_JSON_VALUE) public void createTask(@RequestBody TaskDto taskDto) { service.saveTask(taskMapper.mapToTask(taskDto)); } }
9750f1aba301fa95a91d700ee19846d2202b8364
7e3307994f7a8bcfeeda3e45ba025ab83f617090
/src/EstruturaAcoplacao.java
851bd5207925a14531a8daa4fd9c7a37c82e3cb3
[ "MIT" ]
permissive
HeitorAlves/AppCalcR.Gado
281670968af0544b3590bbe1872d3c8b72b152c6
df604e495f2567a4fb6dc593d3a56347f3dac3e3
refs/heads/master
2021-08-18T21:33:44.583412
2017-11-23T23:55:59
2017-11-23T23:55:59
108,762,780
0
0
null
null
null
null
UTF-8
Java
false
false
1,370
java
import java.text.DecimalFormat; public class EstruturaAcoplacao { Alimento alim; float porcAlim_pQ; float porcFinal; public EstruturaAcoplacao(Alimento alim,float porcentagem ){ this.alim = alim; this.porcAlim_pQ = porcentagem; this.porcFinal = 0; } public EstruturaAcoplacao(Alimento alim){ this.alim = alim; this.porcAlim_pQ = 0; this.porcFinal = 0; } public EstruturaAcoplacao(Alimento alim,float porcentagem,float porcFinal ){ this.alim = alim; this.porcAlim_pQ = porcentagem; this.porcFinal = porcFinal; } public Alimento getAlim() { return alim; } public void setAlim(Alimento alim) { this.alim = alim; } public float getPorcAlim_pQ() { return porcAlim_pQ; } public void setPorcAlim_pQ(float porcAlim_pQ) { this.porcAlim_pQ = porcAlim_pQ; } public float getPorcFinal() { return porcFinal; } public void setPorcFinal(float porcFinal) { this.porcFinal = porcFinal; } @Override public String toString(){ DecimalFormat df = new DecimalFormat("####0.00"); return ("(Nome :"+getAlim().getNome()+"/PorcQ_Alim :"+getPorcAlim_pQ()+"/PorcFinal :"+df.format(getPorcFinal())+")"); } }
4af9406bebd13923ce1832a19a5a2b0969d54954
1d94371896bc4d25f4e03440f140e6ee7e8c8e7d
/src/main/java/com/lvshen/demo/design/singleton/LazySingleton.java
3b949949dfc54fc43d76545197a36062c96eedd4
[]
no_license
lvshen9/demo
e567a0a128132ad4a4e483de4359bd5039cb3341
6614734fd4c027edc6dacd171ff4bf4c9704e72c
refs/heads/lvshen-dev
2023-06-21T20:44:58.669502
2022-12-20T09:10:23
2022-12-20T09:10:23
246,201,859
10
10
null
2023-06-15T16:21:13
2020-03-10T03:43:45
Java
UTF-8
Java
false
false
464
java
package com.lvshen.demo.design.singleton; /** * Description:懒汉式单列 * * @author yuange * @version 1.0 * @date: 2019/12/30 10:01 * @since JDK 1.8 */ public class LazySingleton { private static volatile LazySingleton instance = null; private LazySingleton(){} public static synchronized LazySingleton getInstance() { if (instance == null) { instance = new LazySingleton(); } return instance; } }
ea06149c16a00fb66a752b42a4971553a88e0ecf
091829d65b28e8c5b2a418a37d8a12fe9046acc2
/src/com/service/datastore/MessageService.java
8633c44014e1464821ef048fc7709af64e475fb0
[]
no_license
mahmoud201203661/Private
ccdb4cc4b16d7034b4dc875c17f72b147dcd26a0
b97a570a9a5f13087d9b419fe5f061bb2f07f1cf
refs/heads/master
2016-09-06T16:39:46.974120
2016-02-20T13:09:21
2016-02-20T13:09:21
37,098,154
0
0
null
null
null
null
UTF-8
Java
false
false
1,481
java
package com.service.datastore; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import com.controller.DatastorePreparedStatement; import com.entities.ConversationEntity; import com.entities.MessageEntity; import com.google.appengine.api.datastore.Entity; import com.models.Conversation; import com.models.Message; @Path("/") public class MessageService { public MessageService() { System.out.println("access MessageService Class"); } @POST @Path("/sendMessage") @Produces({MediaType.TEXT_PLAIN}) public String sendMessage(@FormParam("sender")String sender, @FormParam("ID") String conversationID, @FormParam("content")String content){ Message message = new Message(sender, conversationID, content); MessageEntity messageEntity = new MessageEntity(message); Entity entity = messageEntity.prepareEntity(); if(DatastorePreparedStatement.insertInto(entity)){ return "done"; } return null; } @POST @Path("/createConversation") @Produces({MediaType.TEXT_PLAIN}) public String createConversation(@FormParam("title")String title, @FormParam("users")String users){ Conversation conversation = new Conversation(title, users); ConversationEntity conversationEntity = new ConversationEntity(conversation); Entity entity = conversationEntity.prepareEntity(); if(DatastorePreparedStatement.insertInto(entity)){ return "done"; } return null; } }
b90dab62c997f2d43abc1af582bb36eb9384e407
7a7950d70224ff8fb2765a9798e056366eb9cfcd
/src/fundamentos/operadores/TipostringEquals.java
e1fa4494db32241e75003347cd74fa936c686c0a
[]
no_license
Jader-Arruda/CursoJava13Cod3r
29eb1bc22cd18fa26f40f54baf3f2572fbee8ad5
58275efc26e0e300e90a28d36c00dce6ad5e87fb
refs/heads/master
2022-04-27T07:22:29.372887
2020-05-02T19:11:30
2020-05-02T19:11:30
257,751,584
0
0
null
null
null
null
UTF-8
Java
false
false
425
java
package fundamentos.operadores; import java.util.Scanner; public class TipostringEquals { public static void main(String[] args) { System.out.println("2" == "2"); String s = new String("2"); System.out.println("2" == s); System.out.println("2".equals(s)); Scanner entrada = new Scanner(System.in); String s2 = entrada.next(); System.out.println("2".equals(s2.trim())); entrada.close(); } }
148aaca16c3f996b17af4cbef4aa01280a5509a0
67f0e9962a6a60aa6823ec58c9f7e67c917d4283
/gen/com/wangban/test_thinkandroid/R.java
c58dc3c23c0e09fe2c898cd28047c683202fc128
[]
no_license
yzbbanban/Test_thinkandroid
f894d201ae4414d0a3819992f07055a3163a9302
687cf3f602e2c86f2b67e701b6b4c0c16a79d773
refs/heads/master
2020-04-02T06:05:53.687966
2016-07-22T10:25:22
2016-07-22T10:25:22
63,939,420
0
0
null
null
null
null
UTF-8
Java
false
false
2,436
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.wangban.test_thinkandroid; public final class R { public static final class attr { } public static final class dimen { /** Default screen margins, per the Android Design guidelines. Customize dimensions originally defined in res/values/dimens.xml (such as screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. */ public static final int activity_horizontal_margin=0x7f040000; public static final int activity_vertical_margin=0x7f040001; } public static final class drawable { public static final int ic_launcher=0x7f020000; } public static final class id { public static final int action_settings=0x7f080000; } public static final class layout { public static final int activity_main=0x7f030000; } public static final class menu { public static final int main=0x7f070000; } public static final class string { public static final int action_settings=0x7f050001; public static final int app_name=0x7f050000; public static final int hello_world=0x7f050002; } public static final class style { /** Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. API 11 theme customizations can go here. Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. API 14 theme customizations can go here. */ public static final int AppBaseTheme=0x7f060000; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f060001; } }
2b16d8e57220dd6e7927d7be654b43321c573a47
b199f10ec3eb88faeda0b27289eb4aa1a421cd41
/src/main/java/com/javaegitimleri/petclinic/HalBrowserSecurityConfiguration.java
1a00259ead4ec511bffded338c83109ab946b7bd
[]
no_license
mekar4306/petclinic
d8aab72fe7dfe241e27d03587d8699d70b9171b5
8636af5b8674e2a7aee7896886cc484147660e8c
refs/heads/master
2022-09-22T21:06:45.236099
2020-05-27T06:14:23
2020-05-27T06:14:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
693
java
package com.javaegitimleri.petclinic; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @Configuration @Order(value=-1) public class HalBrowserSecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.antMatcher("/hal/**").authorizeRequests().anyRequest().permitAll(); http.csrf().disable(); http.headers().frameOptions().disable(); } }
[ "mkaradayi43@gmailcom" ]
mkaradayi43@gmailcom
162a810d80e383e575e706d786faf5413319cace
cac6bdf5e10f81b6e865f943fc779f484860e6fb
/src/com/pat/basic/Main1034.java
73f5ea375aa2e47748e75ce0e31e3ef7a0fd65f9
[]
no_license
CH1211/PAT
b5ccd856d50554378fd31c56ad798ad569ec30f0
3686c1edffbf766ded16f944f2441e73a3cd0149
refs/heads/master
2023-03-14T21:22:32.335586
2021-03-09T08:12:01
2021-03-09T08:12:01
340,668,057
0
0
null
null
null
null
UTF-8
Java
false
false
540
java
package com.pat.basic; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; /** * @author ch * @version 1.0 * @date 2020/12/25 * @description */ public class Main1034 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] str1 = br.readLine().split(" "); String[] numStr1 = str1[0].split("/"); String[] numStr2 = str1[1].split("/"); } }
35b9db61d37661592eae497ff06f20b53d46821e
f1f156c306863269c37aa84a7d63ba389ebe7c43
/CS 271 project1/sprint1/UserDatabase.java
6919cfa6572a7aca9fb06c1d2877ecbd83d842dc
[]
no_license
hnlarsen/CSHU271
fd906055216fe6e55885e648677aca48fb892278
ac389178cfb6bab26a497e63632020c48d51ec1a
refs/heads/master
2020-03-28T06:56:00.442890
2018-09-20T04:03:58
2018-09-20T04:03:58
147,870,583
1
0
null
null
null
null
UTF-8
Java
false
false
8,722
java
package sprint1; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.security.InvalidParameterException; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; /* * Database class for storing and retrieving the account credentials for * registered users. * Stores data in the following format: * <username>\t<password hash>\t<email>\t<SQ#.(answer)>\t<SQ#.(answer)>\t<[phone number]>\n * Note: Phone number format (###)###-#### * @authors Heather N. Larsen, Chris Miller * @version 1.3 2018/09/09:01:45 */ public class UserDatabase { private File database; // registered accounts database private BufferedReader reader; // database reader private BufferedWriter writer; private JPanel loginS, loginF, loginNF; private JLabel login1, login2, login3; private boolean loginSuccess = false; protected String tempMarker; // current account credentials /** * Creates:Opens the user database. * * @throws IOException issue locating file */ public UserDatabase() throws IOException { database = new File("USER-DATABASE"); if (!database.exists()) { database.createNewFile(); // create database if not in directory } database.setExecutable(false); database.setWritable(false); database.setReadable(false); } /*************************** USER.DATABASE ******************************/ /** * Registers the user's account credentials into the database. * * @param username account login username * @param password account login password * @throws IOException issue read/write to file * @throws IllegalArgumentException username is already registered */ public void registerUser(String username, String password, String email, String phone) throws IOException { if (userExists(username)) { throw new IllegalArgumentException("This username is already taken."); } database.setWritable(true); PrintWriter writer = new PrintWriter(new BufferedWriter((new FileWriter(database, true)))); writer.write(username + "\t" + password.hashCode() + "\t" + email + "\t" + phone + "\n"); writer.close(); database.setWritable(false); reader.close(); database.setReadable(false); } /***************************** REGISTER.USER *****************************/ /** * Logs the user into the account matching the login credentials. * * @param username account login username * @param password account login password * @throws IOException issue read from file * @throws IllegalArgumentException account does not exist * @throws InvalidParameterException password does not match username */ public void logIn(String username, String password) throws IOException { if (userExists(username)) { String[] credentials = tempMarker.split("\t"); int tempPassword = Integer.parseInt(credentials[1]); // current password if (tempPassword == password.hashCode()) { // TODO: login success! loginS = new JPanel(); loginSuccess = true; login1 = new JLabel("Login was successful. Welcome!"); loginS.add(login1); JFrame frame = new JFrame("LoginSucess"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); /* Add frame */ frame.getContentPane().add(loginS); frame.pack(); frame.setVisible(true); } else { // throw new InvalidParameterException("The username and password do not // match."); loginF = new JPanel(); login2 = new JLabel("The username and password do not match."); loginF.add(login2); JFrame frame = new JFrame("LoginFailed"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); /* Add frame */ frame.getContentPane().add(loginF); frame.pack(); frame.setVisible(true); } } else { // throw new IllegalArgumentException("This account does not exist."); loginNF = new JPanel(); login3 = new JLabel("This account does not exist."); loginNF.add(login3); JFrame frame = new JFrame("LoginFailed"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); /* Add frame */ frame.getContentPane().add(loginNF); frame.pack(); frame.setVisible(true); } reader.close(); database.setReadable(false); } /******************************* LOG.IN **********************************/ /** * Checks if the account exists in the database. * * @param username username to be searched for * @throws FileNotFoundException database missing from directory * @throws IOException issue read from file * @return true if username is in database */ public boolean userExists(String username) throws FileNotFoundException, IOException { database.setReadable(true); reader = new BufferedReader(new FileReader(database)); String[] credentials; // current individual credentials String tempUsername; // current username while ((tempMarker = reader.readLine()) != null) { credentials = tempMarker.split("\t"); tempUsername = credentials[0]; if (username.compareToIgnoreCase(tempUsername) == 0) { return true; } } return false; } /**************************** USER.EXISTS ******************************/ /** * Checks if an email exists in the database. * * @param email email to be searched for * @return true if email exists in database */ public boolean emailExists(String email) throws FileNotFoundException, IOException { database.setReadable(true); reader = new BufferedReader(new FileReader(database)); String[] credentials; // current individual credentials String tempEmail; // current email while ((tempMarker = reader.readLine()) != null) { credentials = tempMarker.split("\t"); tempEmail = credentials[2]; if (email.compareToIgnoreCase(tempEmail) == 0) { return true; } } return false; } /**************************** DELETE.USER ******************************/ /** * Deletes a specific user in the database. * * @param user user to be searched for and deleted * @return true if the user is deleted successfully */ // public boolean deleteUser(String user) throws FileNotFoundException, IOException { // database.setReadable(true); // //database.setWritable(true); // reader = new BufferedReader(new FileReader(database)); // // String[] credentials; // current individual credentials // String tempUser; // current email // // while ((tempMarker = reader.readLine()) != null) { // credentials = tempMarker.split("\t"); // tempUser = credentials[0]; // if (user.compareToIgnoreCase(tempUser) == 0) { // tempMarker.replaceAll(user, null); // return true; // } // } // // return false; // } public boolean deleteUser(String user, String pass, String email, String phone) throws FileNotFoundException, IOException { database.setReadable(true); database.setWritable(true); File tempFile = new File("USER-DATABASETEMP"); reader = new BufferedReader(new FileReader(database)); writer = new BufferedWriter(new FileWriter(tempFile)); String lineToRemove = "usertest!" + "\t" + "Password1!" + "\t" + "[email protected]"; String currentLine; while ((currentLine = reader.readLine()) != null) { String trimmedLine = currentLine.trim(); if (trimmedLine.equals(lineToRemove)) continue; writer.write(currentLine + System.getProperty("line.separator")); } File database = tempFile; return false; } public boolean deleteFile() throws IOException, FileNotFoundException { File databaseTemp = new File("USER-DATABASE"); reader = new BufferedReader(new FileReader(database)); writer = new BufferedWriter(new FileWriter(databaseTemp)); String current_line; while ((current_line = reader.readLine()) != null) { // System.out.println("Here."); current_line = current_line.replaceAll("\\s+", " "); writer.write(current_line); writer.newLine(); } reader.close(); writer.close(); File copyFile = new File("USER-DATABASE"); File originalFile = new File("USER-DATABASE"); originalFile.delete(); copyFile.renameTo(originalFile); return true; } public boolean getLoginState() { return loginSuccess; } }/******************************** * USER.DATABASE_CLASS ***************************/
885ac9a80624655a26053528c6e83eebbc2d5cef
cf33a7956437e5831e14134d9481890e84c3aef1
/Java基础精讲/第06节_Java核心_流程控制之循环结构/01_代码/代码/BreakAndContinue/src/cn/itcast/demo/ContinueDemo1.java
ff3320810e6374b6b55fa68a80386948e2e18072
[]
no_license
kurakikyrakiujarod/java_
262497482a32f7abf99b92c2bd09ebcb97039b22
46410c83c36e9ff93b5d7f6f1cad126da809c8cd
refs/heads/master
2020-07-16T19:49:49.178282
2019-09-10T16:21:59
2019-09-10T16:21:59
205,856,204
1
0
null
null
null
null
UTF-8
Java
false
false
739
java
package cn.itcast.demo; public class ContinueDemo1 { public static void main(String[] args) { //需求: 模拟逢7必过的小游戏. //1. 通过for循环获取到1~100之间所有的数据. for (int i = 1; i <= 100; i++) { //2. 判断当前数字是否是合法数据. //包含7或者是7的倍数, 这些数据都是不合法的. if (i % 10 == 7 || i / 10 % 10 == 7 || i % 7 == 0) { //3. 如果数据不合法, 直接跳过本次循环, 直接进行下次循环. System.out.println("..."); continue; } //4. 如果数据合法, 直接打印即可. System.out.println(i); } } }
3e1d3ffc1be0ba88302244300bc1919ce5adbf9d
52dfa1c40adddfebfeca1c0869d7602f926e4eee
/src/main/java/com/example/skkj/entity/Level.java
ec5e389762cddd6560ae0b85f5a5d15a49796c0f
[]
no_license
YongLWei03/SKKJCW
ef6b287328b4a02a7a153e745272a38b14a56c83
f1bb985ec5915947030ac54413ddae5ccd29cbb9
refs/heads/master
2021-09-15T23:53:53.223132
2018-06-13T06:48:07
2018-06-13T06:48:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,166
java
package com.example.skkj.entity; import java.io.Serializable; import java.util.List; public class Level implements Serializable { private String deviceType; private String deviceId; private String isRoot; private String reportPeriod; private String captureMode; private String sensorAddr; private String underTemp; private String overTemp; private String underSignal; private String overSignal; private String sensorNum; private String sequence; private String isAutoMode; private String zoneInNum; private String zoneInTatol; private String capturePeriod; private String southIP; private String southPort; private List<String> sensorName; private String nccId; public String getDeviceType() { return deviceType; } public void setDeviceType(String deviceType) { this.deviceType = deviceType; } public String getDeviceId() { return deviceId; } public void setDeviceId(String deviceId) { this.deviceId = deviceId; } public String getIsRoot() { return isRoot; } public void setIsRoot(String isRoot) { this.isRoot = isRoot; } public String getReportPeriod() { return reportPeriod; } public void setReportPeriod(String reportPeriod) { this.reportPeriod = reportPeriod; } public String getCaptureMode() { return captureMode; } public void setCaptureMode(String captureMode) { this.captureMode = captureMode; } public String getCapturePeriod() { return capturePeriod; } public void setCapturePeriod(String capturePeriod) { this.capturePeriod = capturePeriod; } public String getSensorAddr() { return sensorAddr; } public void setSensorAddr(String sensorAddr) { this.sensorAddr = sensorAddr; } public String getUnderTemp() { return underTemp; } public void setUnderTemp(String underTemp) { this.underTemp = underTemp; } public String getOverTemp() { return overTemp; } public void setOverTemp(String overTemp) { this.overTemp = overTemp; } public String getUnderSignal() { return underSignal; } public void setUnderSignal(String underSignal) { this.underSignal = underSignal; } public String getOverSignal() { return overSignal; } public void setOverSignal(String overSignal) { this.overSignal = overSignal; } public String getSensorNum() { return sensorNum; } public void setSensorNum(String sensorNum) { this.sensorNum = sensorNum; } public String getSequence() { return sequence; } public void setSequence(String sequence) { this.sequence = sequence; } public List<String> getSensorName() { return sensorName; } public void setSensorName(List<String> sensorName) { this.sensorName = sensorName; } public String getZoneInNum() { return zoneInNum; } public void setZoneInNum(String zoneInNum) { this.zoneInNum = zoneInNum; } public String getZoneInTatol() { return zoneInTatol; } public void setZoneInTatol(String zoneInTatol) { this.zoneInTatol = zoneInTatol; } public String getSouthIP() { return southIP; } public void setSouthIP(String southIP) { this.southIP = southIP; } public String getSouthPort() { return southPort; } public void setSouthPort(String southPort) { this.southPort = southPort; } public String getNccId() { return nccId; } public void setNccId(String nccId) { this.nccId = nccId; } @Override public String toString() { return "Level{" + "deviceType='" + deviceType + '\'' + ", deviceId='" + deviceId + '\'' + ", isRoot='" + isRoot + '\'' + ", reportPeriod='" + reportPeriod + '\'' + ", captureMode='" + captureMode + '\'' + ", sensorAddr='" + sensorAddr + '\'' + ", underTemp='" + underTemp + '\'' + ", overTemp='" + overTemp + '\'' + ", underSignal='" + underSignal + '\'' + ", overSignal='" + overSignal + '\'' + ", sensorNum='" + sensorNum + '\'' + ", sequence='" + sequence + '\'' + ", isAutoMode='" + isAutoMode + '\'' + ", zoneInNum='" + zoneInNum + '\'' + ", zoneInTatol='" + zoneInTatol + '\'' + ", capturePeriod='" + capturePeriod + '\'' + ", southIP='" + southIP + '\'' + ", southPort='" + southPort + '\'' + ", sensorName=" + sensorName + ", nccId='" + nccId + '\'' + '}'; } public String getIsAutoMode() { return isAutoMode; } public void setIsAutoMode(String isAutoMode) { this.isAutoMode = isAutoMode; } }
12f34cfcf208bf7f048bba8839a96d57cc5a46d3
6d57bc7937193585dd4f1596561cfd4f10376940
/movie-info-service/src/main/java/io/princedonkor/movieinfoservice/Controller/MovieResource.java
65e49296b76e057850e4e032f6cba3d5afc58876
[]
no_license
prince7475/SpringBootMircoservices
58d7fef1f26634dc438028bb06bdc7ea339a7c31
2728a2ba5a7624e53da08af8858d0044e29a0072
refs/heads/master
2020-05-02T10:05:45.277344
2019-03-28T01:00:05
2019-03-28T01:00:05
177,888,226
1
0
null
null
null
null
UTF-8
Java
false
false
519
java
package io.princedonkor.movieinfoservice.Controller; import io.princedonkor.movieinfoservice.Model.Movie; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/movies") public class MovieResource { @RequestMapping("/{movieId}") public Movie getMovieInfo(@PathVariable String movieId) { return new Movie(movieId,"Test name"); } }
[ "prince7475" ]
prince7475
a3bb75a5929131045ec791c2c4cc7ca0d76a37f7
0ff9e35469a8aefb7cb223a7f60175e040c6d172
/app/src/main/java/com/anonymous/latticeaid/ui/Chat/UserMessage.java
0590dbb40403549b38e78bfa0533ecfacee504ed
[]
no_license
jobann/Lattice-Aid
6f64c309b2305d5c02bd8f1f6c3db6a173b01dda
e1abf2bd3dc732643a30c977d28e3e60b1d08e7a
refs/heads/main
2023-03-28T07:59:02.751978
2021-03-29T17:00:23
2021-03-29T17:00:23
337,691,537
1
0
null
null
null
null
UTF-8
Java
false
false
1,395
java
package com.anonymous.latticeaid.ui.Chat; import android.util.Log; import org.json.JSONException; import org.json.JSONObject; import java.io.Serializable; import java.util.Date; public class UserMessage implements Serializable { String android_id; String message; Date date; double lat; double lng; int msgType; String jSONFileObject; public UserMessage(String jSONFileObject, int msgType) { this.jSONFileObject = jSONFileObject; this.msgType = msgType; } public UserMessage(String message, Date date, String android_id, int msgType) { this.message = message; this.date = date; this.android_id = android_id; this.msgType = msgType; } public UserMessage(String android_id, double lat, double lng, int msgType) { this.android_id = android_id; this.lat = lat; this.lng = lng; this.msgType = msgType; } public String getMessage() { return message; } public Date getDate() { return date; } public String getAndroid_id() { return android_id; } public double getLatitude() { return lat; } public double getLongitude() { return lng; } public int getMsgType() { return msgType; } public String getjSONFileObject() { return jSONFileObject; } }
6d77450f826e7f5fd6e21fe25556e9c04f7d68e8
fc6ce51dbd96c5246b9a5dcd17092dbfd29f38fe
/PlaytoxWebStore/src/com/store/gen/UsersEntity.java
f8d67a5e159e54a63e1b916ccb7fd4d8400c6b3c
[]
no_license
vldpyatkov/PlaytoxWebStore
09e22e575aa48e6b10a20cf834163b89011332cd
1c979a58721868febab329b44c210871cb14e4cb
refs/heads/master
2020-06-04T07:56:47.088713
2013-12-15T18:15:11
2013-12-15T18:15:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,486
java
package com.store.gen; import javax.persistence.*; import java.util.Set; /** * Created with IntelliJ IDEA. * User: makros * Date: 12/13/13 * Time: 11:14 PM * To change this template use File | Settings | File Templates. */ @javax.persistence.Table(name = "users") @Entity public class UsersEntity { private String login; @javax.persistence.Column(name = "login") @Basic public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } private int id; @javax.persistence.Column(name = "id") @Id @TableGenerator(table = "id_table", name = "AppUserIdTable", allocationSize = 1000, initialValue = 0, pkColumnName = "pk", valueColumnName = "value", pkColumnValue = "app_users") @GeneratedValue(strategy = GenerationType.TABLE, generator = "AppUserIdTable") public int getId() { return id; } public void setId(int id) { this.id = id; } private String password; @javax.persistence.Column(name = "password") @Basic public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } Set<RolesEntity> roles; @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinTable(name = "userinroles", catalog = "webstore", joinColumns = { @JoinColumn(name = "user_id", updatable = true, referencedColumnName = "id") }, inverseJoinColumns = { @JoinColumn(name = "role_id", updatable = true, referencedColumnName = "id") }) public Set<RolesEntity> getRoles() { return roles; } public void setRoles(Set<RolesEntity> roles) { this.roles = roles; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UsersEntity that = (UsersEntity) o; if (id != that.id) return false; if (login != null ? !login.equals(that.login) : that.login != null) return false; if (password != null ? !password.equals(that.password) : that.password != null) return false; return true; } @Override public int hashCode() { int result = login != null ? login.hashCode() : 0; result = 31 * result + id; result = 31 * result + (password != null ? password.hashCode() : 0); return result; } }
4f8a85b53536245af328664441f7dc16c92f3e96
10568ede568a80b6f927d8d387a2c5c35135cfc7
/src/main/java/com/x/hashmap/sorting/Employee.java
272ea0ee7ff26872e1c1605dc0d2a47a7206ac19
[]
no_license
akshayamangaraj/codepal
899d47ef36d63eab4df9bf9f4fdf5534409bcad2
d65143c78751f48289edd00282de276ebbe37a5b
refs/heads/master
2021-01-20T04:09:11.993766
2017-06-05T16:39:32
2017-06-05T16:39:32
89,647,759
0
0
null
null
null
null
UTF-8
Java
false
false
3,083
java
/** * */ package com.subrat.hashmap.sorting; import java.util.Comparator; /** * @author sparid2 * */ public class Employee implements Comparable<Employee>{ private String firstNmae; private String lastName; private int age; private Double salary; public Employee(String firstName, String lastName, int age,Double salary){ this.firstNmae = firstName; this.lastName = lastName; this.age = age; this.salary = salary; } public String getFirstNmae() { return firstNmae; } public void setFirstNmae(String firstNmae) { this.firstNmae = firstNmae; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public Double getSalary() { return salary; } public void setSalary(Double salary) { this.salary = salary; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + age; result = prime * result + ((firstNmae == null) ? 0 : firstNmae.hashCode()); result = prime * result + ((lastName == null) ? 0 : lastName.hashCode()); result = prime * result + ((salary == null) ? 0 : salary.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; Employee other = (Employee) obj; if (age != other.age) return false; if (firstNmae == null) { if (other.firstNmae != null) return false; } else if (!firstNmae.equals(other.firstNmae)) return false; if (lastName == null) { if (other.lastName != null) return false; } else if (!lastName.equals(other.lastName)) return false; if (salary == null) { if (other.salary != null) return false; } else if (!salary.equals(other.salary)) return false; return true; } @Override public String toString() { return "Employee [firstNmae=" + firstNmae + ", lastName=" + lastName + ", age=" + age + ", salary=" + salary + "]"; } @Override public int compareTo(Employee o) { // TODO Auto-generated method stub return this.age - o.age; } public static final Comparator<Employee> comparator = new Comparator<Employee>() { @Override public int compare(Employee o1, Employee o2) { // TODO Auto-generated method stub return (int) (o1.getSalary()-o2.getSalary()); } }; }
4371fcb7f8b01353f25938eba58dfbbddc9c0087
b40a98c36bb50656d691ec4d3b4bc81cbfc8d66e
/qwickie.test/testproject/src/main/java/org/qwickie/test/project/issue44/Issue22.java
9f5d43409a2b364974cb807e359d832fd3927fea
[]
no_license
try0/qwickie
5145bb6311f1ae769e7eb16fc371f173bbf06d25
a74d3ecd92669825495c7ebe1f4eadb0d67e4885
refs/heads/master
2022-12-28T14:23:56.622437
2020-01-16T16:29:52
2020-01-16T16:29:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
687
java
package org.qwickie.test.project.issue44; import java.util.Arrays; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.request.mapper.parameter.PageParameters; public class Issue22 extends WebPage { private static final long serialVersionUID = 1L; public Issue22(final PageParameters parameters) { add(new ListView<String>("lv", Arrays.asList("abc", "def")) { @Override protected void populateItem(final ListItem<String> item) { item.add(new Label("", item.getModelObject())); } }); } }
3db6085d6dba76933cf7ce3a48650a0f45d6ae45
f4955779f4e91cfd35f89770cdd3e3635d631a05
/Proj_zhz233/src/main/java/com/zhzteam/zhz233/mapper/wlh/PCAccountMapper.java
ce0acef3d0f2c3b49910905e88b356459146b8c7
[]
no_license
binbinTeam/Project-02
a237e75239205bb7494ad3eb1e67e15ce21b7df6
fa79e79911f5a8c86080dea7a9fb4c43a489d456
refs/heads/master
2020-03-17T09:40:21.536467
2018-06-02T14:47:18
2018-06-02T14:47:18
133,483,624
2
0
null
null
null
null
UTF-8
Java
false
false
1,240
java
package com.zhzteam.zhz233.mapper.wlh; import com.zhzteam.zhz233.model.AccountModel; import org.apache.ibatis.annotations.*; /** * @描述 * @参数 $params * @返回值 $return * @创建人 wenliheng * @创建时间 2018/5/24 */ @Mapper public interface PCAccountMapper { @Select("select * from tab_account") AccountModel selectAll(); @Update("update tab_account set account_no=#{account_no},certification=#{certification},available=#{available},frozen=#{frozen},credit_level=#{credit_level}," +"traders_password=#{traders_password},traders_alipay=#{traders_alipay},traders_wechat_pay=#{traders_wechat_pay},update_time=#{update_time}") int update(AccountModel pojo); @Delete("delete from tab_account where id=#{id}") public int delete(int id); @Insert("insert into tab_account(account_no,certification,available,frozen,credit_level,traders_password,traders_alipay,traders_wechat_pay,update_time,create_time) values" +"(#{account_no},#{certification},#{available},#{frozen},#{credit_level},#{traders_password},#{traders_alipay},#{traders_wechat_pay},#{update_time},#{create_time})") @Options(useGeneratedKeys = true,keyProperty = "id") int insert(AccountModel pojo); }
6b28c16641409844714a9140226e11f25bf78902
9b802b5993887db1dbef3ddd0be640d3e33a42cf
/src/main/java/com/mdy/dzs/game/fight/factory/choosetarget/impl/RowChooseTarget.java
53e946ab8d4859c2bbc4e191b579f6ae4ff4675f
[]
no_license
daxingyou/dzs_server
75175c72ee8aad1084f1beffb938ba2a504bf1de
c7dd3b39fbfbdb996eea0ba570ac2eecacc6d861
refs/heads/master
2022-11-25T15:26:07.976868
2020-07-31T07:01:09
2020-07-31T07:01:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
841
java
/** * */ package com.mdy.dzs.game.fight.factory.choosetarget.impl; import java.util.Arrays; import java.util.List; import com.mdy.dzs.game.fight.main.FightMain; import com.mdy.dzs.game.fight.main.Fighter; /** * 8 一排(一排最多3个) * @author fangtong E-mail: [email protected] * @version 创建时间:2014年9月28日 下午5:50:45 */ public class RowChooseTarget extends DefaultChooseTarget { @Override public List<Fighter> chooseTarget(FightMain main, Fighter fighter,int param) { preChoose(main, fighter,param); int pos = defaultPos(); List<Integer> posAry = null; if(pos > 3){ posAry = Arrays.asList(4,5,6); }else{ posAry = Arrays.asList(1,2,3); } for (Integer p : posAry) { if(!isTargetDead(p)){ res.add(target.get(p)); } } return res; } }
87109733bff3b0cb7122bda7625ebc6eccfa628e
435e8e93147a3cdb162207151819d2bdafbe66e2
/config-client/src/main/java/com/ralapchi/configclient/controller/ConfigController.java
b49712ac9859affae71dad1af57ea90dc4b4e0c5
[]
no_license
ralapchi/springcloud
c8415d5a4f32bd98ddf4b6f789cecf7de24cd649
72751837998a14cdd6a5db9dca854f3687508923
refs/heads/master
2020-03-20T13:22:03.359131
2018-09-27T09:09:20
2018-09-27T09:09:20
137,453,845
0
0
null
null
null
null
UTF-8
Java
false
false
512
java
package com.ralapchi.configclient.controller; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RefreshScope @RestController public class ConfigController { @Value("${server.port}") private String port; @RequestMapping(value = "/hi") public String hi() { return port; } }
d3eb8d0dab6f1f306e634bb90001834231522736
990984aa2a07fe6cb50a898f2a7c2df7a5441532
/src/co/jp/fujixerox/FXWebRTC/PeerViewActivity.java
f88d4fa262fcdeed343d458d6b7a123873d60174
[]
no_license
dandy613/Android-WebRTC-1
3576cd3bb96a4bb15681a57dcce64e9c6629a027
c1ebeb1bb21d1a834aaaf57ce882269d0477f5f3
refs/heads/master
2021-01-14T12:35:48.504163
2014-01-10T08:05:15
2014-01-10T08:05:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
20,689
java
package co.jp.fujixerox.FXWebRTC; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.*; import android.os.AsyncTask; import android.os.Bundle; import android.os.Looper; import android.support.v4.content.LocalBroadcastManager; import android.util.Log; import android.view.*; import android.content.DialogInterface; import android.widget.*; import java.util.HashMap; import java.util.Map; /** * Created with IntelliJ IDEA. * User: haiyang * Date: 10/28/13 * Time: 9:06 AM * To change this template use File | Settings | File Templates. */ public class PeerViewActivity extends Activity implements View.OnClickListener, PopupMenu.OnMenuItemClickListener{ public static final String TAG="PeerViewActivity"; private BroadcastReceiver mclientstatereceiver; private ProgressDialog progressDialog; private WebRTCClient webRTCClient; private boolean darkblue=true; private Peers currentContactPeer; private HashMap<Integer,View> currentShownPeers=new HashMap<Integer, View>(); public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.peerview); // Button button=(Button)findViewById(R.id.button_peerview_logoff); // button.setOnClickListener(this); ApplicationEx app=(ApplicationEx)getApplicationContext(); webRTCClient=app.getWebRTCClient(); if(webRTCClient==null) { Log.e(TAG,"cannot get webrtc client instance!"); } int id=webRTCClient.getUserID(); String username=webRTCClient.getUsername(); TextView textViewuseridusername=(TextView) findViewById(R.id.TextViewUserIDUserName); textViewuseridusername.setText("ID: "+id+"\nUsername: "+username); //create a local broadcast receiver mclientstatereceiver=new ClientStateReceiver(this); // The filter's action is BROADCAST_ACTION IntentFilter clientstatusIntentFilter = new IntentFilter( Constants.BROADCAST_ACTION); clientstatusIntentFilter.addCategory(Intent.CATEGORY_DEFAULT); LocalBroadcastManager.getInstance(this).registerReceiver(mclientstatereceiver, clientstatusIntentFilter); addPeerStartup(); // Log.d(TAG,"local broadcast receiver is registered"); } public void addPeerStartup() { if(webRTCClient.getPeers().isEmpty()) return; Log.d(TAG,"add peer at startup!"); HashMap<Integer,Peers> peersHashMap=webRTCClient.getPeers(); for(Map.Entry<Integer,Peers> entry: peersHashMap.entrySet()) { addPeer(entry.getKey()); } } public void onNetworkConnectionClosed() { AlertDialog.Builder builder=new AlertDialog.Builder(this); builder.setCancelable(false); builder.setTitle("Error"); builder.setIcon(android.R.drawable.ic_dialog_alert); builder.setMessage("Connection to server has been lost!"); builder.setInverseBackgroundForced(true); AlertDialog dialog; builder.setPositiveButton("OK",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); showLogoffProgressDialog(); new LogoutTask().execute(); } }); dialog=builder.create(); dialog.show(); } public void addPeer(int peer_id) { if(peer_id<0) return; Peers peer=webRTCClient.getPeers().get(peer_id); if(peer==null) { Log.e(TAG,"cannot find peer with id "+peer_id); return; } if(currentShownPeers.get(peer_id)!=null) { Log.e(TAG,"cannot add peer with id "+peer_id+" : already exits"); return; } Log.d(TAG,"going to add peer "+peer.getName()); TableLayout tableLayout=(TableLayout)findViewById(R.id.TableLayoutOnlinePeers); //add a TableRow view LayoutInflater layoutInflater= (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); // TableRow tr=new TableRow(this); View view=layoutInflater.inflate(R.layout.peertablerowview,tableLayout,false); //set background color if(darkblue) { view.setBackgroundResource(R.color.darker_blue); } else { view.setBackgroundResource(R.color.light_blue); } darkblue=!darkblue; TextView userid=(TextView)(view.findViewById(R.id.TableRowUserID)); userid.setText(Integer.toString(peer.getPeerId())); TextView username=(TextView)view.findViewById(R.id.TableRowUserName); username.setText(peer.getName()); ImageView platform=(ImageView)view.findViewById(R.id.TableRowPlatformPic); if(peer.getPlatform().equalsIgnoreCase("web")) platform.setImageResource(R.drawable.browser_icon); else if(peer.getPlatform().equalsIgnoreCase("android")) platform.setImageResource(R.drawable.android_icon); ImageView status=(ImageView)view.findViewById(R.id.TableRowStatusPic); if(peer.getStatus()== Peers.Status.STATUS_BUSY) status.setImageResource(R.drawable.msn_busy_onphone); else if(peer.getStatus()== Peers.Status.STATUS_IDLE) status.setImageResource(R.drawable.msn_online); ImageView udp=(ImageView)view.findViewById(R.id.TableRowUDPPic); if(peer.isUdp()) udp.setImageResource(R.drawable.corrent_icon); else udp.setImageResource(R.drawable.wrong_icon); view.setTag(peer_id); view.setClickable(true); view.setOnClickListener(this); tableLayout.addView(view); Log.d(TAG, "view class is of type: " + view.getClass().getName()); currentShownPeers.put(peer_id, view); } public void removePeer(int peer_id) { if(peer_id<0) return; if(currentShownPeers.get(peer_id)==null) { Log.e(TAG,"cannot remove peer "+peer_id); return; } //remove the TableRow view Log.d(TAG,"peer removed from thread "+android.os.Process.myTid()); Log.d(TAG,"going to remove peer "+peer_id); TableLayout tableLayout=(TableLayout)findViewById(R.id.TableLayoutOnlinePeers); View view=currentShownPeers.get(peer_id); view.setOnClickListener(null); tableLayout.removeView(view); currentShownPeers.remove(peer_id); } public void removeAllPeers() { if(currentShownPeers.isEmpty()) return; TableLayout tableLayout=(TableLayout)findViewById(R.id.TableLayoutOnlinePeers); for(Map.Entry<Integer,View> entry:currentShownPeers.entrySet()) { View view=entry.getValue(); view.setOnClickListener(null); tableLayout.removeView(view); } currentShownPeers.clear(); } public void updatePeer(int peer_id) { if(peer_id<0) return; if(currentShownPeers.get(peer_id)==null) { Log.e(TAG,"cannot update peer "+peer_id+" not found"); return; } Log.d(TAG,"going to update status for peer "+peer_id); View view=currentShownPeers.get(peer_id); Peers peer=webRTCClient.getPeers().get(peer_id); ImageView status=(ImageView)view.findViewById(R.id.TableRowStatusPic); if(peer.getStatus()== Peers.Status.STATUS_BUSY) status.setImageResource(R.drawable.msn_busy_onphone); else if(peer.getStatus()== Peers.Status.STATUS_IDLE) status.setImageResource(R.drawable.msn_online); } @Override public void onClick(View v) { switch(v.getId()) { case R.id.TableRowPeer: doActiononPeer(v); break; default: break; } } public void doActiononPeer(final View v) { Log.d(TAG,"view item is pressed"); currentContactPeer=webRTCClient.getPeers().get(v.getTag()); PopupMenu popupMenu=new PopupMenu(this,v); popupMenu.inflate(R.menu.peer_action_menu); popupMenu.setOnMenuItemClickListener(this); popupMenu.show(); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch(keyCode) { case KeyEvent.KEYCODE_BACK: showLogoffDialog(); return true; default: break; } return false; } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.peer_view_menu, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.peer_view_menu_logout: showLogoffDialog(); return true; default: break; } return super.onOptionsItemSelected(item); } public void switchtoMainActivity(boolean logoutSuccess) { // Intent intent=new Intent(this,FXWebRTCMainActivity.class); // startActivity(intent); removeAllPeers(); currentContactPeer=null; finish(); } public void showLogoffDialog() { AlertDialog.Builder builder=new AlertDialog.Builder(this); builder.setCancelable(false); builder.setTitle("Do you want to log off?"); builder.setInverseBackgroundForced(true); LogoffDialogListener listener=new LogoffDialogListener(); builder.setPositiveButton("YES", listener); builder.setNegativeButton("NO", listener); builder.setNeutralButton("CANCEL",listener); AlertDialog dialog=builder.create(); dialog.show(); } public void showLogoffProgressDialog() { progressDialog=new ProgressDialog(this); progressDialog.setMessage("Logging off..."); progressDialog.show(); } @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.PeerActionMenuCall: if(currentContactPeer.getStatus()== Peers.Status.STATUS_BUSY) { AlertDialog.Builder builder=new AlertDialog.Builder(this); builder.setCancelable(false); builder.setTitle("WARNING"); builder.setIcon(android.R.drawable.ic_dialog_alert); builder.setMessage("Client "+currentContactPeer.getName()+" is busy, try again later"); builder.setInverseBackgroundForced(true); builder.setPositiveButton("OK",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); AlertDialog dialog=builder.create(); dialog.show(); } break; case R.id.PeerActionMenuMSG: break; case R.id.PeerActionMenuUDP: if(currentContactPeer.getStatus()== Peers.Status.STATUS_BUSY) { AlertDialog.Builder builder=new AlertDialog.Builder(this); builder.setCancelable(false); builder.setTitle("WARNING"); builder.setIcon(android.R.drawable.ic_dialog_alert); builder.setMessage("Client "+currentContactPeer.getName()+" is busy, try again later"); builder.setInverseBackgroundForced(true); builder.setPositiveButton("OK",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); AlertDialog dialog=builder.create(); dialog.show(); } else if(currentContactPeer.getPlatform().equalsIgnoreCase("wweb")) { AlertDialog.Builder builder=new AlertDialog.Builder(this); builder.setCancelable(false); builder.setTitle("WARNING"); builder.setIcon(android.R.drawable.ic_dialog_alert); builder.setMessage("Client "+currentContactPeer.getName()+" is logged on from a browser, cannot do UDP measurement!"); builder.setInverseBackgroundForced(true); builder.setPositiveButton("YES",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); AlertDialog dialog=builder.create(); dialog.show(); } else { Intent intent=new Intent(this,UDPTestActivity.class); intent.putExtra("peer_id",currentContactPeer.getPeerId()); intent.putExtra("initiator",true); startActivity(intent); } break; default: break; } return false; } private class LogoffDialogListener implements DialogInterface.OnClickListener { @Override public void onClick(DialogInterface dialog, int which) { switch(which) { case DialogInterface.BUTTON_POSITIVE: dialog.dismiss(); showLogoffProgressDialog(); new LogoutTask().execute(webRTCClient); break; case DialogInterface.BUTTON_NEGATIVE: dialog.dismiss(); break; case DialogInterface.BUTTON_NEUTRAL: dialog.dismiss(); break; } } } public void onUserResponseforInvitation(int peerID, InvitationResponse response) { if(response.equals(InvitationResponse.INVITATION_RESPONSE_DECLINE)) { new InvitationDeclineTask().execute(webRTCClient); } else { Intent intent=new Intent(this,UDPTestActivity.class); intent.putExtra("peer_id",currentContactPeer.getPeerId()); intent.putExtra("initiator",false); startActivity(intent); } } public void onInvitationReceived(InvitationType type,int peerId) { currentContactPeer=webRTCClient.getPeers().get(peerId); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setCancelable(false); builder.setTitle("INVITATION"); builder.setIcon(android.R.drawable.ic_dialog_info); builder.setMessage("Client " + currentContactPeer.getName() + " sends you an invitation for " + (type.equals(InvitationType.INVITATION_UDP) ? "UDP Bandwidth Measurement" : "Video Call")); builder.setInverseBackgroundForced(true); final int local_peerID=peerId; builder.setPositiveButton("ACCEPT",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); onUserResponseforInvitation(local_peerID,InvitationResponse.INVITATION_RESPONSE_ACCEPT); } }); builder.setNegativeButton("DECLINE",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); onUserResponseforInvitation(local_peerID,InvitationResponse.INVITATION_RESPONSE_DECLINE); } }); AlertDialog dialog=builder.create(); dialog.show(); } private class ClientStateReceiver extends BroadcastReceiver { private Activity activity; private ClientStateReceiver(Activity activity) { this.activity=activity; } @Override public void onReceive(Context context, Intent intent) { int state=intent.getIntExtra(Constants.EXTENDED_DATA_STATUS,Constants.CLIENT_STATE_NULL); final int peer_id; switch(state) { case Constants.PEER_JOIN: peer_id=intent.getIntExtra(Constants.EXTENDED_DATA_ID,-1); runOnUiThread(new Runnable() { @Override public void run() { Log.d(TAG,"add peer through broadcast receiver!"); addPeer(peer_id); } }); break; case Constants.PEER_LEAVE: peer_id=intent.getIntExtra(Constants.EXTENDED_DATA_ID,-1); runOnUiThread(new Runnable() { @Override public void run() { removePeer(peer_id); } }); break; case Constants.PEER_UPDATE: peer_id=intent.getIntExtra(Constants.EXTENDED_DATA_ID,-1); runOnUiThread(new Runnable() { @Override public void run() { updatePeer(peer_id); } }); break; case Constants.CONNECTION_CLOSED: runOnUiThread(new Runnable() { @Override public void run() { onNetworkConnectionClosed(); } }); break; case Constants.VIDEO_INVITATION_RECEIVED: peer_id=intent.getIntExtra(Constants.EXTENDED_DATA_ID,-1); runOnUiThread(new Runnable() { @Override public void run() { onInvitationReceived(InvitationType.INVITATION_VIDEO, peer_id); } }); break; case Constants.UDP_INVITATION_RECEIVED: peer_id=intent.getIntExtra(Constants.EXTENDED_DATA_ID,-1); runOnUiThread(new Runnable() { @Override public void run() { onInvitationReceived(InvitationType.INVITATION_UDP, peer_id); } }); break; default: break; } } } private class LogoutTask extends AsyncTask<WebRTCClient,Integer,Boolean> { private WebRTCClient client; @Override protected Boolean doInBackground(WebRTCClient... params) { client=params[0]; return client.LogOut(); } protected void onPostExecute(Boolean result) { progressDialog.dismiss(); switchtoMainActivity(result); } } private class InvitationDeclineTask extends AsyncTask<WebRTCClient,Integer,Boolean> { private WebRTCClient client; @Override protected Boolean doInBackground(WebRTCClient... params) { client=params[0]; return client.declinePeer(currentContactPeer.getPeerId(),"USER"); } protected void onPostExecute(Boolean result) { currentContactPeer=null; } } private enum InvitationType{ INVITATION_VIDEO, INVITATION_UDP } private enum InvitationResponse{ INVITATION_RESPONSE_ACCEPT, INVITATION_RESPONSE_DECLINE } }
c97636a3f94f705b63cf5109265d3409a87c0edb
f6c3c7c50a219dbe892bf155c930f54cd28f8632
/Bhaskara/src/bhaskara/Bhaskara.java
685b0d4ccbd4bd2766a7a673a5dad5b57b9cdc81
[]
no_license
BrandonCarlos/Estruturas-de-dados
3c4a700fe02094d043505719567ea627cd59c04e
5bf11aac0d210edbf1e4221b2ed1d458a256dc5e
refs/heads/master
2021-03-13T19:42:55.600776
2020-03-12T00:08:05
2020-03-12T00:08:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
109
java
package bhaskara; public class Bhaskara { public static void main(String[] args) { } }
b909c38f229f060e4504867e54a6fd6c2d6a4241
de3e95d046a94b8cd987c327cfa48bd22dcb28cd
/src/main/java/schr0/chastmob/entity/ai/EntityAIChastCollectItem.java
12d55379a7893d66701fa83b660524f5f5f282bb
[]
no_license
Schr0/ChastMob
40841cb1edc35a94b1a674d5067e36c8ebd569c2
e6b52e5fd1c1ddf5b4f13b6a6c5ad362f5b29b2e
refs/heads/master
2021-01-13T11:45:11.591265
2018-12-31T17:39:16
2018-12-31T17:39:16
77,762,800
8
4
null
2018-12-31T17:39:17
2017-01-01T02:13:16
Java
UTF-8
Java
false
false
3,959
java
package schr0.chastmob.entity.ai; import java.util.List; import javax.annotation.Nullable; import net.minecraft.entity.item.EntityItem; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityHopper; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import schr0.chastmob.entity.EntityChast; import schr0.chastmob.inventory.InventoryChast; public class EntityAIChastCollectItem extends EntityAIChast { private static final double COLLECT_RANGE = 1.5D; private EntityItem targetEntityItem; public EntityAIChastCollectItem(EntityChast entityChast) { super(entityChast); this.targetEntityItem = null; } @Override public boolean shouldExecute() { this.targetEntityItem = this.getNearestEntityItem(); if (this.targetEntityItem != null) { return true; } return false; } @Override public boolean shouldContinueExecuting() { if (this.isTimeOut()) { return false; } return (this.targetEntityItem != null); } @Override public void resetTask() { super.resetTask(); this.targetEntityItem = null; } @Override public void updateTask() { super.updateTask(); this.getEntity().getLookHelper().setLookPositionWithEntity(this.targetEntityItem, this.getEntity().getHorizontalFaceSpeed(), this.getEntity().getVerticalFaceSpeed()); if (this.getEntity().getDistanceSq(this.targetEntityItem) < COLLECT_RANGE) { for (EntityItem aroundEntityItem : this.getAroundEntityItems()) { if (this.areEntityItemEqual(this.targetEntityItem, aroundEntityItem)) { if (!this.getEntity().isCoverOpen()) { this.getEntity().setCoverOpen(true); return; } TileEntityHopper.putDropInInventoryAllSlots((IInventory) null, this.getEntity().getInventoryMain(), aroundEntityItem); this.targetEntityItem = null; } } } else { this.getEntity().getNavigator().tryMoveToEntityLiving(this.targetEntityItem, this.getSpeed()); } } // TODO /* ======================================== MOD START =====================================*/ @Nullable private EntityItem getNearestEntityItem() { EntityItem nearestEntityItem = null; double rangeOrigin = 0; for (EntityItem aroundEntityItem : this.getAroundEntityItems()) { if (this.canCollectItem(aroundEntityItem)) { double range = this.getEntity().getDistanceSq(aroundEntityItem); if ((range < rangeOrigin) || (rangeOrigin == 0)) { rangeOrigin = range; nearestEntityItem = aroundEntityItem; } } } return nearestEntityItem; } private List<EntityItem> getAroundEntityItems() { BlockPos pos = this.getEntity().getCenterPosition(); return this.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos).grow(this.getRange(), this.getRange(), this.getRange())); } private boolean canCollectItem(EntityItem entityItem) { ItemStack stack = entityItem.getItem().copy(); ItemStack stackMainhand = this.getEntity().getHeldItemMainhand().copy(); ItemStack stackOffhand = this.getEntity().getHeldItemOffhand().copy(); stack.setCount(1); stackMainhand.setCount(1); stackOffhand.setCount(1); if (!stackMainhand.isEmpty() && !ItemStack.areItemStacksEqual(stack, stackMainhand)) { return false; } if (!stackOffhand.isEmpty() && ItemStack.areItemStacksEqual(stack, stackOffhand)) { return false; } if (this.getEntity().getEntitySenses().canSee(entityItem)) { if (entityItem.isEntityAlive() && !entityItem.cannotPickup()) { return InventoryChast.canStoreInventory(this.getEntity().getInventoryMain(), entityItem.getItem()); } } return false; } private boolean areEntityItemEqual(EntityItem entityItemA, EntityItem entityItemB) { if ((entityItemA != null) && (entityItemB != null)) { return ItemStack.areItemsEqual(entityItemA.getItem(), entityItemB.getItem()); } return false; } }
4541676dca126ba809da509028b4cfc0f9926fdf
416adf06aa6cbd44dc52f6563c9ff57fe5030bd2
/src/deling/cellcom/com/cn/adapter/FragSaleListAdapter.java
364fccc1b1981b2d5a64ce180a4f53852643d9f0
[]
no_license
wenpys/ouxuan
4ecc455154eb6b04e5353ee542abde8d4cec670a
343416e8d560d7b71e5cc4e9fdf31b068d05d6d2
refs/heads/master
2021-01-23T01:21:17.641729
2017-03-28T16:21:48
2017-03-28T16:21:48
85,901,262
0
0
null
null
null
null
UTF-8
Java
false
false
2,822
java
package deling.cellcom.com.cn.adapter; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import com.squareup.picasso.Picasso; import cn.jpush.a.a.ac; import android.app.Activity; import android.graphics.Color; import android.media.Rating; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RatingBar; import android.widget.TextView; import cellcom.com.cn.deling.R; import deling.cellcom.com.cn.activity.main.MainActivity; import deling.cellcom.com.cn.bean.AreaNotice; import deling.cellcom.com.cn.bean.SvRecord; import deling.cellcom.com.cn.db.BaseDataManager; public class FragSaleListAdapter extends BaseAdapter { private Activity activity; List<Map<String, String>> records = new ArrayList<Map<String, String>>(); public FragSaleListAdapter(Activity activity, List<Map<String, String>> records){ this.activity = activity; this.records = records; } @Override public int getCount() { return records.size(); } @Override public Map<String, String> getItem(int position) { return records.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View view, ViewGroup parent) { ViewHolder viewHolder=null; if(view==null){ view=LayoutInflater.from(activity).inflate(R.layout.frag_sale_list_item, null); viewHolder=new ViewHolder(); viewHolder.imIcon=(ImageView) view.findViewById(R.id.icon); viewHolder.tvTitle=(TextView) view.findViewById(R.id.title); viewHolder.imContent=(ImageView) view.findViewById(R.id.image); view.setTag(viewHolder); }else{ viewHolder=(ViewHolder) view.getTag(); } Map<String, String> record=records.get(position); bindView(viewHolder,record,position); return view; } private void bindView(final ViewHolder holder,final Map<String, String> record,final int position) { if(record!=null){ String title = record.get("title"); String icon = record.get("icon"); String image = record.get("image"); if(icon != null && !icon.equals("")){ Picasso.with(activity).load(icon).into(holder.imIcon); } if(title != null && !title.equals("")){ holder.tvTitle.setText(title); } if(image != null && !image.equals("")){ Picasso.with(activity).load(image).into(holder.imContent); } } } private class ViewHolder{ ImageView imIcon; TextView tvTitle; ImageView imContent; } }
[ "Administrator@DESKTOP-M36MM4D" ]
Administrator@DESKTOP-M36MM4D
fe82e4b82c6b9b759f5b5973cc1bb65f430703a8
9cde9ded07c9fbe61b23ba814ccb1c1f7dac3267
/restapi/src/main/java/eu/com/impress/model/EvalSdp.java
862d5acbafe65471c1b6c07b4f6e4c29116564d8
[]
no_license
ffborelli/impress-dev
f12128f156c8c19ee848544a39d389b608a6c0fc
c65c1ef01364deb4ccfa6a96e4d2b997d98db493
refs/heads/master
2020-12-12T16:17:38.000934
2016-12-19T21:50:10
2016-12-19T21:50:10
47,829,815
0
2
null
null
null
null
UTF-8
Java
false
false
8,515
java
package eu.com.impress.model; import java.io.Serializable; import javax.persistence.*; import java.sql.Timestamp; /** * The persistent class for the eval_sdp database table. * uid bigint NOT NULL, exp int NOT NULL, resource_type int references resource_type(id_resource_type), resource int NOT NULL references resource(id_resource), rep int NOT NULL, P1 timestamp, P2 timestamp, P3 timestamp, P4 timestamp, P5 timestamp, P6 timestamp */ @Entity @Table(name="eval_sdp") @NamedQuery(name="EvalSdp.findAll", query="SELECT e FROM EvalSdp e") public class EvalSdp implements Serializable { private static final long serialVersionUID = 1L; @Id @SequenceGenerator(name = "eval_sdp_func", sequenceName = "eval_sdp_id_seq", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "eval_sdp_func") @Column(name = "id", nullable = false) private Long uid; //private Long uid; private Integer exp; @Column(name = "resource_type") private Integer resourceType; private Integer resource; private Integer rep; private Timestamp p1; @Column(name = "p1_disk_read") private long p1DiskRead; @Column(name = "p1_disk_write") private long p1DiskWrite; @Column(name = "p1_mem_usage") private long p1MemUsage; @Column(name = "p1_mem_total") private long p1MemTotal; @Column(name = "p1_proc_usage") private double p1ProcUsage; private Timestamp p2; @Column(name = "p2_disk_read") private long p2DiskRead; @Column(name = "p2_disk_write") private long p2DiskWrite; @Column(name = "p2_mem_usage") private long p2MemUsage; @Column(name = "p2_mem_total") private long p2MemTotal; @Column(name = "p2_proc_usage") private double p2ProcUsage; private Timestamp p3; @Column(name = "p3_disk_read") private long p3DiskRead; @Column(name = "p3_disk_write") private long p3DiskWrite; @Column(name = "p3_mem_usage") private long p3MemUsage; @Column(name = "p3_mem_total") private long p3MemTotal; @Column(name = "p3_proc_usage") private double p3ProcUsage; private Timestamp p4; @Column(name = "p4_disk_read") private long p4DiskRead; @Column(name = "p4_disk_write") private long p4DiskWrite; @Column(name = "p4_mem_usage") private long p4MemUsage; @Column(name = "p4_mem_total") private long p4MemTotal; @Column(name = "p4_proc_usage") private double p4ProcUsage; private Timestamp p5; @Column(name = "p5_disk_read") private long p5DiskRead; @Column(name = "p5_disk_write") private long p5DiskWrite; @Column(name = "p5_mem_usage") private long p5MemUsage; @Column(name = "p5_mem_total") private long p5MemTotal; @Column(name = "p5_proc_usage") private double p5ProcUsage; private Timestamp p6; @Column(name = "p6_disk_read") private long p6DiskRead; @Column(name = "p6_disk_write") private long p6DiskWrite; @Column(name = "p6_mem_usage") private long p6MemUsage; @Column(name = "p6_mem_total") private long p6MemTotal; @Column(name = "p6_proc_usage") private double p6ProcUsage; public EvalSdp() { } public Long getUid() { return uid; } public void setUid(Long uid) { this.uid = uid; } public Integer getExp() { return exp; } public void setExp(Integer exp) { this.exp = exp; } public Integer getResourceType() { return resourceType; } public void setResourceType(Integer resourceType) { this.resourceType = resourceType; } public Integer getResource() { return resource; } public void setResource(Integer resource) { this.resource = resource; } public Integer getRep() { return rep; } public void setRep(Integer rep) { this.rep = rep; } public Timestamp getP1() { return p1; } public void setP1(Timestamp p1) { this.p1 = p1; } public long getP1DiskRead() { return p1DiskRead; } public void setP1DiskRead(long p1DiskRead) { this.p1DiskRead = p1DiskRead; } public long getP1DiskWrite() { return p1DiskWrite; } public void setP1DiskWrite(long p1DiskWrite) { this.p1DiskWrite = p1DiskWrite; } public long getP1MemUsage() { return p1MemUsage; } public void setP1MemUsage(long p1MemUsage) { this.p1MemUsage = p1MemUsage; } public long getP1MemTotal() { return p1MemTotal; } public void setP1MemTotal(long p1MemTotal) { this.p1MemTotal = p1MemTotal; } public double getP1ProcUsage() { return p1ProcUsage; } public void setP1ProcUsage(double p1ProcUsage) { this.p1ProcUsage = p1ProcUsage; } public Timestamp getP2() { return p2; } public void setP2(Timestamp p2) { this.p2 = p2; } public long getP2DiskRead() { return p2DiskRead; } public void setP2DiskRead(long p2DiskRead) { this.p2DiskRead = p2DiskRead; } public long getP2DiskWrite() { return p2DiskWrite; } public void setP2DiskWrite(long p2DiskWrite) { this.p2DiskWrite = p2DiskWrite; } public long getP2MemUsage() { return p2MemUsage; } public void setP2MemUsage(long p2MemUsage) { this.p2MemUsage = p2MemUsage; } public long getP2MemTotal() { return p2MemTotal; } public void setP2MemTotal(long p2MemTotal) { this.p2MemTotal = p2MemTotal; } public double getP2ProcUsage() { return p2ProcUsage; } public void setP2ProcUsage(double p2ProcUsage) { this.p2ProcUsage = p2ProcUsage; } public Timestamp getP3() { return p3; } public void setP3(Timestamp p3) { this.p3 = p3; } public long getP3DiskRead() { return p3DiskRead; } public void setP3DiskRead(long p3DiskRead) { this.p3DiskRead = p3DiskRead; } public long getP3DiskWrite() { return p3DiskWrite; } public void setP3DiskWrite(long p3DiskWrite) { this.p3DiskWrite = p3DiskWrite; } public long getP3MemUsage() { return p3MemUsage; } public void setP3MemUsage(long p3MemUsage) { this.p3MemUsage = p3MemUsage; } public long getP3MemTotal() { return p3MemTotal; } public void setP3MemTotal(long p3MemTotal) { this.p3MemTotal = p3MemTotal; } public double getP3ProcUsage() { return p3ProcUsage; } public void setP3ProcUsage(double p3ProcUsage) { this.p3ProcUsage = p3ProcUsage; } public Timestamp getP4() { return p4; } public void setP4(Timestamp p4) { this.p4 = p4; } public long getP4DiskRead() { return p4DiskRead; } public void setP4DiskRead(long p4DiskRead) { this.p4DiskRead = p4DiskRead; } public long getP4DiskWrite() { return p4DiskWrite; } public void setP4DiskWrite(long p4DiskWrite) { this.p4DiskWrite = p4DiskWrite; } public long getP4MemUsage() { return p4MemUsage; } public void setP4MemUsage(long p4MemUsage) { this.p4MemUsage = p4MemUsage; } public long getP4MemTotal() { return p4MemTotal; } public void setP4MemTotal(long p4MemTotal) { this.p4MemTotal = p4MemTotal; } public double getP4ProcUsage() { return p4ProcUsage; } public void setP4ProcUsage(double p4ProcUsage) { this.p4ProcUsage = p4ProcUsage; } public Timestamp getP5() { return p5; } public void setP5(Timestamp p5) { this.p5 = p5; } public long getP5DiskRead() { return p5DiskRead; } public void setP5DiskRead(long p5DiskRead) { this.p5DiskRead = p5DiskRead; } public long getP5DiskWrite() { return p5DiskWrite; } public void setP5DiskWrite(long p5DiskWrite) { this.p5DiskWrite = p5DiskWrite; } public long getP5MemUsage() { return p5MemUsage; } public void setP5MemUsage(long p5MemUsage) { this.p5MemUsage = p5MemUsage; } public long getP5MemTotal() { return p5MemTotal; } public void setP5MemTotal(long p5MemTotal) { this.p5MemTotal = p5MemTotal; } public double getP5ProcUsage() { return p5ProcUsage; } public void setP5ProcUsage(double p5ProcUsage) { this.p5ProcUsage = p5ProcUsage; } public Timestamp getP6() { return p6; } public void setP6(Timestamp p6) { this.p6 = p6; } public long getP6DiskRead() { return p6DiskRead; } public void setP6DiskRead(long p6DiskRead) { this.p6DiskRead = p6DiskRead; } public long getP6DiskWrite() { return p6DiskWrite; } public void setP6DiskWrite(long p6DiskWrite) { this.p6DiskWrite = p6DiskWrite; } public long getP6MemUsage() { return p6MemUsage; } public void setP6MemUsage(long p6MemUsage) { this.p6MemUsage = p6MemUsage; } public long getP6MemTotal() { return p6MemTotal; } public void setP6MemTotal(long p6MemTotal) { this.p6MemTotal = p6MemTotal; } public double getP6ProcUsage() { return p6ProcUsage; } public void setP6ProcUsage(double p6ProcUsage) { this.p6ProcUsage = p6ProcUsage; } }
7d7d18619cb9a1e7d16dd0b55d2393a035b98889
28baaf83bdb8405e73d1a02a0f72313fd2b60fe7
/src/com/example/pmudemo/view/ErrorViewHolder.java
695932eadcc337b218d9276081831e1b5ab90d2d
[]
no_license
lovelease/pmudemo
de9060c3276d4cca00015c1adf2c0270e6d04fe8
97f0c0de6fc0b15b6b60fe0ceb15c2e8ace6d477
refs/heads/master
2020-04-09T11:27:26.545926
2014-06-29T11:54:18
2014-06-29T11:54:18
20,800,832
0
1
null
null
null
null
UTF-8
Java
false
false
315
java
package com.example.pmudemo.view; import android.view.View; import android.widget.ImageView; /** * ErrorViewHolder class * Used when send message error * * @author weishijie * */ public class ErrorViewHolder { public ImageView error; public void removeError() { error.setVisibility(View.GONE); } }
2787e7a96febd8c8c82739eb1e7ee7c2e9eda15d
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/elastic--elasticsearch/610ce078fb3c84c47d6d32aff7d77ba850e28f9d/before/PreBuiltAnalyzers.java
352c6dee8c9af398d04a78c3eef5929f951f9041
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
12,875
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.indices.analysis; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.ar.ArabicAnalyzer; import org.apache.lucene.analysis.bg.BulgarianAnalyzer; import org.apache.lucene.analysis.br.BrazilianAnalyzer; import org.apache.lucene.analysis.ca.CatalanAnalyzer; import org.apache.lucene.analysis.cjk.CJKAnalyzer; import org.apache.lucene.analysis.ckb.SoraniAnalyzer; import org.apache.lucene.analysis.cn.ChineseAnalyzer; import org.apache.lucene.analysis.core.KeywordAnalyzer; import org.apache.lucene.analysis.core.SimpleAnalyzer; import org.apache.lucene.analysis.core.StopAnalyzer; import org.apache.lucene.analysis.core.WhitespaceAnalyzer; import org.apache.lucene.analysis.cz.CzechAnalyzer; import org.apache.lucene.analysis.da.DanishAnalyzer; import org.apache.lucene.analysis.de.GermanAnalyzer; import org.apache.lucene.analysis.el.GreekAnalyzer; import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.analysis.es.SpanishAnalyzer; import org.apache.lucene.analysis.eu.BasqueAnalyzer; import org.apache.lucene.analysis.fa.PersianAnalyzer; import org.apache.lucene.analysis.fi.FinnishAnalyzer; import org.apache.lucene.analysis.fr.FrenchAnalyzer; import org.apache.lucene.analysis.ga.IrishAnalyzer; import org.apache.lucene.analysis.gl.GalicianAnalyzer; import org.apache.lucene.analysis.hi.HindiAnalyzer; import org.apache.lucene.analysis.hu.HungarianAnalyzer; import org.apache.lucene.analysis.hy.ArmenianAnalyzer; import org.apache.lucene.analysis.id.IndonesianAnalyzer; import org.apache.lucene.analysis.it.ItalianAnalyzer; import org.apache.lucene.analysis.lv.LatvianAnalyzer; import org.apache.lucene.analysis.miscellaneous.PatternAnalyzer; import org.apache.lucene.analysis.nl.DutchAnalyzer; import org.apache.lucene.analysis.no.NorwegianAnalyzer; import org.apache.lucene.analysis.pt.PortugueseAnalyzer; import org.apache.lucene.analysis.ro.RomanianAnalyzer; import org.apache.lucene.analysis.ru.RussianAnalyzer; import org.apache.lucene.analysis.snowball.SnowballAnalyzer; import org.apache.lucene.analysis.standard.ClassicAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.analysis.sv.SwedishAnalyzer; import org.apache.lucene.analysis.th.ThaiAnalyzer; import org.apache.lucene.analysis.tr.TurkishAnalyzer; import org.apache.lucene.analysis.util.CharArraySet; import org.elasticsearch.Version; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.index.analysis.StandardHtmlStripAnalyzer; import org.elasticsearch.indices.analysis.PreBuiltCacheFactory.CachingStrategy; import java.util.Locale; /** * */ public enum PreBuiltAnalyzers { STANDARD(CachingStrategy.ELASTICSEARCH) { // we don't do stopwords anymore from 1.0Beta on @Override protected Analyzer create(Version version) { if (version.onOrAfter(Version.V_1_0_0_Beta1)) { return new StandardAnalyzer(version.luceneVersion, CharArraySet.EMPTY_SET); } return new StandardAnalyzer(version.luceneVersion); } }, DEFAULT(CachingStrategy.ELASTICSEARCH){ @Override protected Analyzer create(Version version) { // by calling get analyzer we are ensuring reuse of the same STANDARD analyzer for DEFAULT! // this call does not create a new instance return STANDARD.getAnalyzer(version); } }, KEYWORD(CachingStrategy.ONE) { @Override protected Analyzer create(Version version) { return new KeywordAnalyzer(); } }, STOP { @Override protected Analyzer create(Version version) { return new StopAnalyzer(version.luceneVersion); } }, WHITESPACE { @Override protected Analyzer create(Version version) { return new WhitespaceAnalyzer(version.luceneVersion); } }, SIMPLE { @Override protected Analyzer create(Version version) { return new SimpleAnalyzer(version.luceneVersion); } }, CLASSIC { @Override protected Analyzer create(Version version) { return new ClassicAnalyzer(version.luceneVersion); } }, SNOWBALL { @Override protected Analyzer create(Version version) { return new SnowballAnalyzer(version.luceneVersion, "English", StopAnalyzer.ENGLISH_STOP_WORDS_SET); } }, PATTERN(CachingStrategy.ELASTICSEARCH) { @Override protected Analyzer create(Version version) { if (version.onOrAfter(Version.V_1_0_0_RC1)) { return new PatternAnalyzer(version.luceneVersion, Regex.compile("\\W+" /*PatternAnalyzer.NON_WORD_PATTERN*/, null), true, CharArraySet.EMPTY_SET); } return new PatternAnalyzer(version.luceneVersion, Regex.compile("\\W+" /*PatternAnalyzer.NON_WORD_PATTERN*/, null), true, StopAnalyzer.ENGLISH_STOP_WORDS_SET); } }, STANDARD_HTML_STRIP(CachingStrategy.ELASTICSEARCH) { @Override protected Analyzer create(Version version) { if (version.onOrAfter(Version.V_1_0_0_RC1)) { return new StandardHtmlStripAnalyzer(version.luceneVersion, CharArraySet.EMPTY_SET); } return new StandardHtmlStripAnalyzer(version.luceneVersion); } }, ARABIC { @Override protected Analyzer create(Version version) { return new ArabicAnalyzer(version.luceneVersion); } }, ARMENIAN { @Override protected Analyzer create(Version version) { return new ArmenianAnalyzer(version.luceneVersion); } }, BASQUE { @Override protected Analyzer create(Version version) { return new BasqueAnalyzer(version.luceneVersion); } }, BRAZILIAN { @Override protected Analyzer create(Version version) { return new BrazilianAnalyzer(version.luceneVersion); } }, BULGARIAN { @Override protected Analyzer create(Version version) { return new BulgarianAnalyzer(version.luceneVersion); } }, CATALAN { @Override protected Analyzer create(Version version) { return new CatalanAnalyzer(version.luceneVersion); } }, CHINESE(CachingStrategy.ONE) { @Override protected Analyzer create(Version version) { return new ChineseAnalyzer(); } }, CJK { @Override protected Analyzer create(Version version) { return new CJKAnalyzer(version.luceneVersion); } }, CZECH { @Override protected Analyzer create(Version version) { return new CzechAnalyzer(version.luceneVersion); } }, DUTCH { @Override protected Analyzer create(Version version) { return new DutchAnalyzer(version.luceneVersion); } }, DANISH { @Override protected Analyzer create(Version version) { return new DanishAnalyzer(version.luceneVersion); } }, ENGLISH { @Override protected Analyzer create(Version version) { return new EnglishAnalyzer(version.luceneVersion); } }, FINNISH { @Override protected Analyzer create(Version version) { return new FinnishAnalyzer(version.luceneVersion); } }, FRENCH { @Override protected Analyzer create(Version version) { return new FrenchAnalyzer(version.luceneVersion); } }, GALICIAN { @Override protected Analyzer create(Version version) { return new GalicianAnalyzer(version.luceneVersion); } }, GERMAN { @Override protected Analyzer create(Version version) { return new GermanAnalyzer(version.luceneVersion); } }, GREEK { @Override protected Analyzer create(Version version) { return new GreekAnalyzer(version.luceneVersion); } }, HINDI { @Override protected Analyzer create(Version version) { return new HindiAnalyzer(version.luceneVersion); } }, HUNGARIAN { @Override protected Analyzer create(Version version) { return new HungarianAnalyzer(version.luceneVersion); } }, INDONESIAN { @Override protected Analyzer create(Version version) { return new IndonesianAnalyzer(version.luceneVersion); } }, IRISH { @Override protected Analyzer create(Version version) { return new IrishAnalyzer(version.luceneVersion); } }, ITALIAN { @Override protected Analyzer create(Version version) { return new ItalianAnalyzer(version.luceneVersion); } }, LATVIAN { @Override protected Analyzer create(Version version) { return new LatvianAnalyzer(version.luceneVersion); } }, NORWEGIAN { @Override protected Analyzer create(Version version) { return new NorwegianAnalyzer(version.luceneVersion); } }, PERSIAN { @Override protected Analyzer create(Version version) { return new PersianAnalyzer(version.luceneVersion); } }, PORTUGUESE { @Override protected Analyzer create(Version version) { return new PortugueseAnalyzer(version.luceneVersion); } }, ROMANIAN { @Override protected Analyzer create(Version version) { return new RomanianAnalyzer(version.luceneVersion); } }, RUSSIAN { @Override protected Analyzer create(Version version) { return new RussianAnalyzer(version.luceneVersion); } }, SORANI { @Override protected Analyzer create(Version version) { return new SoraniAnalyzer(version.luceneVersion); } }, SPANISH { @Override protected Analyzer create(Version version) { return new SpanishAnalyzer(version.luceneVersion); } }, SWEDISH { @Override protected Analyzer create(Version version) { return new SwedishAnalyzer(version.luceneVersion); } }, TURKISH { @Override protected Analyzer create(Version version) { return new TurkishAnalyzer(version.luceneVersion); } }, THAI { @Override protected Analyzer create(Version version) { return new ThaiAnalyzer(version.luceneVersion); } }; abstract protected Analyzer create(Version version); protected final PreBuiltCacheFactory.PreBuiltCache<Analyzer> cache; PreBuiltAnalyzers() { this(PreBuiltCacheFactory.CachingStrategy.LUCENE); } PreBuiltAnalyzers(PreBuiltCacheFactory.CachingStrategy cachingStrategy) { cache = PreBuiltCacheFactory.getCache(cachingStrategy); } PreBuiltCacheFactory.PreBuiltCache<Analyzer> getCache() { return cache; } public synchronized Analyzer getAnalyzer(Version version) { Analyzer analyzer = cache.get(version); if (analyzer == null) { analyzer = this.create(version); cache.put(version, analyzer); } return analyzer; } /** * Get a pre built Analyzer by its name or fallback to the default one * @param name Analyzer name * @param defaultAnalyzer default Analyzer if name not found */ public static PreBuiltAnalyzers getOrDefault(String name, PreBuiltAnalyzers defaultAnalyzer) { try { return valueOf(name.toUpperCase(Locale.ROOT)); } catch (IllegalArgumentException e) { return defaultAnalyzer; } } }
add1fd240b52188904bf25f80c64aaa5ba4dec0c
77d404587a019c5e0aad91ce399d4c42736b90ac
/IdeaProjects/Demo001/src/com/example/day17作业/b/Colous.java
4ddef9ee1e0563ab7868c6eafa068e0303a50655
[]
no_license
yan13960/Ideaproject
dc895e10817a3ca87c649a45572edab545a9141a
68180e916a8694a92a813c1adec99e9362aa76d0
refs/heads/master
2023-08-22T23:59:39.919458
2021-10-25T17:02:01
2021-10-25T17:02:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
169
java
package com.example.day17作业.b; /** * */ public class Colous implements PaperColor { @Override public String getColor() { return "彩色"; } }
2100308e0fff0ace5e7ba260ba19988ab2b4796b
91268ae3404b2122ad37e884f54c8793df257d02
/src/test/java/com/lambdaworks/redis/commands/transactional/SetTxCommandTest.java
50f9849276d584d3d0c6e393b997193bc9148cd0
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
tanming1003/lettuce-core
bee42eb150ab5c5e94a7152b10d47c26d8ffb169
5d1f1fcd04f6de97fb419c1ccf133831ac4c6047
refs/heads/master
2021-07-10T19:50:04.536719
2017-10-12T21:40:25
2017-10-13T07:49:30
106,836,063
1
0
null
2017-10-13T14:40:25
2017-10-13T14:40:25
null
UTF-8
Java
false
false
1,013
java
/* * Copyright 2011-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.lambdaworks.redis.commands.transactional; import com.lambdaworks.redis.api.sync.RedisCommands; import com.lambdaworks.redis.commands.SetCommandTest; /** * @author Mark Paluch */ public class SetTxCommandTest extends SetCommandTest { @Override protected RedisCommands<String, String> connect() { return TxSyncInvocationHandler.sync(client.connect()); } }
62118d08229da066dd6d9872190f678c19307732
b629d07cc4d70c7c45b1cef1f13be30fea438a62
/HotelManagement/src/hotelmanagement/SMnew.java
fb6043a03a6f836eee9ef26074e485aa285fcb7d
[]
no_license
asifaman/HotelManagement
9626753a9957e068df04e2a995a7bbd54d64c3ab
475486785c02fab7d360c17de41af28bb6bb1f31
refs/heads/master
2020-04-27T07:35:34.371055
2015-02-18T04:56:06
2015-02-18T04:56:06
30,930,718
0
0
null
null
null
null
UTF-8
Java
false
false
16,473
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package hotelmanagement; import Utility.Utility; import Utility.Utility2; import javax.swing.JOptionPane; /** * * @author SABER */ public class SMnew extends javax.swing.JDialog { private boolean isNew; Object[][] data; /** * Creates new form SMnew */ public SMnew(java.awt.Frame parent, boolean modal,boolean isN) { super(parent, modal); initComponents(); isNew = isN; this.setLocation(Utility.getWindowPosition(this.getSize(), this.getToolkit())); if (isNew == true) { String sql = "SELECT count(id) FROM manager.sm where id='" + SM.selecteditem3 + "'"; int count = Utility2.countQuery(rootPane, sql); System.out.println(count); data = new Object[count][5]; String sq = "select id,name,desig,salary,paid from manager.sm where id='" + SM.selecteditem3 + "' "; data = Utility2.getMultiRowQueryObjects(sq, rootPane, count); date1.setText(data[0][0].toString()); date2.setText(data[0][1].toString()); date3.setText(data[0][2].toString()); date4.setText(data[0][3].toString()); date5.setText(data[0][4].toString()); } } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel2 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); date1 = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); date2 = new javax.swing.JTextField(); date3 = new javax.swing.JTextField(); date4 = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); date5 = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); DATE = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel2.setBackground(new java.awt.Color(0, 0, 0)); jLabel3.setFont(new java.awt.Font("Lucida Handwriting", 1, 36)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("HOTEL THE PACIFIC ISLAND"); jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setText("ID"); date1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { date1ActionPerformed(evt); } }); jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel5.setForeground(new java.awt.Color(255, 255, 255)); jLabel5.setText("NAME"); date2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { date2ActionPerformed(evt); } }); date3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { date3ActionPerformed(evt); } }); date4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { date4ActionPerformed(evt); } }); jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel6.setForeground(new java.awt.Color(255, 255, 255)); jLabel6.setText("DESIG"); jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel7.setForeground(new java.awt.Color(255, 255, 255)); jLabel7.setText("SALARY"); date5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { date5ActionPerformed(evt); } }); jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel8.setForeground(new java.awt.Color(255, 255, 255)); jLabel8.setText("PAID"); jButton1.setText("SAVE"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("CLOSE"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); DATE.setText("jLabel9"); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap(152, Short.MAX_VALUE) .addComponent(jLabel3) .addGap(145, 145, 145)) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(269, 269, 269) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jButton2) .addGap(18, 18, 18) .addComponent(jButton1)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6) .addComponent(jLabel7) .addComponent(jLabel8) .addComponent(jLabel5) .addComponent(jLabel4)) .addGap(25, 25, 25) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(date1, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(date2, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(date4, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(date3, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(date5, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(26, 26, 26) .addComponent(DATE, javax.swing.GroupLayout.PREFERRED_SIZE, 234, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(33, 33, 33) .addComponent(jLabel3) .addGap(58, 58, 58) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(date1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(date2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(date3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(date4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(date5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8)) .addGap(42, 42, 42) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE) .addComponent(DATE) .addGap(25, 25, 25)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void date1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_date1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_date1ActionPerformed private void date2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_date2ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_date2ActionPerformed private void date3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_date3ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_date3ActionPerformed private void date4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_date4ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_date4ActionPerformed private void date5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_date5ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_date5ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: if (date1.getText().isEmpty() || date2.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane, "Error: Empty field", "Error", JOptionPane.WARNING_MESSAGE); return; } String sql; // boolean isNew; if (isNew == false) { sql = "INSERT INTO manager.sm VALUES('" + date1.getText() + "','" + date2.getText() + "','" + date3.getText() + "','" + date4.getText() + "','" + date5.getText()+ "')"; Utility2.insertUpdateQuery(sql, rootPane, 1); } else { sql = "update manager.sm set id='" + date1.getText() + "',name='" + date2.getText() + "',desig='" + date3.getText() + "',salary='" + date4.getText() + "',paid='" + date5.getText()+ "'" + "where id ='" + SM.selecteditem3 + "'"; Utility2.insertUpdateQuery(sql, rootPane, 2); } setVisible(false); dispose(); // TODO add your handling code here: }//GEN-LAST:event_jButton1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: this.setVisible(true); dispose(); }//GEN-LAST:event_jButton2ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* * Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay with the * default look and feel. For details see * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(SMnew.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(SMnew.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(SMnew.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(SMnew.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* * Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { SMnew dialog = new SMnew(new javax.swing.JFrame(), true,true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel DATE; private javax.swing.JTextField date1; private javax.swing.JTextField date2; private javax.swing.JTextField date3; private javax.swing.JTextField date4; private javax.swing.JTextField date5; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JPanel jPanel2; // End of variables declaration//GEN-END:variables }
1307aac615fd8cd22d424e062fd2ab852afe47d4
6fded89b8dfa1f439616ce9eaaacb21976b09563
/src/cz/autoclient/GUI/summoner_spells/InputSummonerSpell.java
f706507bf4d4762db5437c9d25140b1bd27dc633
[]
no_license
BenjaminBNielsen/auto-client
7ddfce7646a7fd53d01a90937a292c3671a41b00
75aa2b9a1fc85d5cf91c67fb19adc2874e3dfae5
refs/heads/master
2021-01-12T19:31:13.832279
2015-05-24T00:51:32
2015-05-24T00:51:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,536
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package cz.autoclient.GUI.summoner_spells; import cz.autoclient.event.EventCallback; import cz.autoclient.settings.Input; import cz.autoclient.settings.SettingsInputVerifier; import cz.autoclient.settings.ValueChanged; import javax.swing.JComponent; /** * * @author Jakub */ public class InputSummonerSpell implements Input { private final ButtonSummonerSpellMaster field; private final ValueChanged onchange; private SettingsInputVerifier<Object> verifier; //Indicate whether events have been bound to input private boolean bound = false; public InputSummonerSpell(ButtonSummonerSpellMaster input, ValueChanged onchange, SettingsInputVerifier<Object> subverifier) { field = input; this.onchange = onchange; verifier = subverifier; } /** * Binds the events to the field using InputVerifier */ @Override public void bind() { bound = true; //Internal verifier final SettingsInputVerifier<Object> verif = this.verifier; field.addEventListener("change", new EventCallback() { @Override public void event(Object... parameters) { if(parameters[0] instanceof String || parameters[0]==null) { //SummonerSpell value = (SummonerSpell)parameters[0]; onchange.changed(parameters[0]); } } }); } @Override public JComponent getField() { return field; } @Override public Object getValue() { if(verifier==null) return field.getSpell(); else if(validate()) return verifier.value(field); else return null; } @Override public void setValue(Object value) { if(value instanceof String) { field.setSpell((String)value); } else field.setSpell(null); } @Override public boolean validate() { return verifier!=null?verifier.verify(field):true; } @Override public SettingsInputVerifier<Object> getVerifier() { return verifier; } /** * Change the internal verifier. */ @Override public void setVerifier(SettingsInputVerifier<Object> ver) { verifier = ver; if(bound) { //Re-bind the event listener bind(); } } @Override public void unbind() { bound = false; field.setInputVerifier(null); } }
6f5aaeb078defba2cfbdc7622012f7e6080aa9c6
d0fd9424b3f11c1555e8c19bbc465b5432d9c16e
/app/src/main/java/com/zebra/printstationcard/templates/SelectedTemplateJobActivity.java
4da17e1c4ea22953d067898044ca9469db1fcc80
[]
no_license
DanielAltino/Projeto-Impressora-Zebra
8c05dcf0368f21755f403de4099b739e8709b905
c2a8fc7fef8ec35a5380fac7cf4bb27b36894794
refs/heads/master
2020-07-13T20:46:11.874311
2019-09-02T17:40:19
2019-09-02T17:40:19
205,151,408
0
0
null
null
null
null
UTF-8
Java
false
false
16,460
java
/*********************************************** * CONFIDENTIAL AND PROPRIETARY * * The source code and other information contained herein is the confidential and exclusive property of * ZIH Corp. and is subject to the terms and conditions in your end user license agreement. * This source code, and any other information contained herein, shall not be copied, reproduced, published, * displayed or distributed, in whole or in part, in any medium, by any means, for any purpose except as * expressly permitted under such license agreement. * * Copyright ZIH Corp. 2018 * * ALL RIGHTS RESERVED ***********************************************/ package com.zebra.printstationcard.templates; import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.zebra.printstationcard.MainApplication; import com.zebra.printstationcard.PollJobStatusTask; import com.zebra.printstationcard.R; import com.zebra.printstationcard.util.DialogHelper; import com.zebra.printstationcard.util.SelectedPrinterManager; import com.zebra.printstationcard.util.UIHelper; import com.zebra.sdk.common.card.containers.JobStatusInfo; import com.zebra.sdk.common.card.template.ZebraCardTemplate; import com.zebra.zebraui.ZebraButton; import com.zebra.zebraui.ZebraEditText; import com.zebra.zebraui.ZebraSpinnerView; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.TimeoutException; public class SelectedTemplateJobActivity extends AppCompatActivity implements GetTemplateVariablesTask.OnGetTemplateVariablesListener, SendTemplateJobTask.OnSendTemplateJobListener, PollJobStatusTask.OnJobStatusPollListener { public static final String KEY_SELECTED_TEMPLATE_NAME = "KEY_SELECTED_TEMPLATE_NAME"; private ZebraCardTemplate zebraCardTemplate; private boolean isApplicationBusy = false; private GetTemplateVariablesTask getTemplateVariablesTask; private SendTemplateJobTask sendTemplateJobTask; private PollJobStatusTask pollJobStatusTask; private String templateName; private Map<String, ZebraEditText> variablesData = new HashMap<>(); private LinearLayout templateVariableList; private ZebraSpinnerView quantitySpinner; private ZebraButton printButton; private LinearLayout progressOverlay; private TextView progressMessage; //RECEIVE DATA String userID = ""; String userName = ""; String userSobrenome = ""; String userRegistro = ""; String userCPF = ""; String userRG = ""; String userState = ""; String userCargo = ""; String userTipoSang = ""; String userNascimento = ""; String userGenero = ""; String userPorteArma = ""; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_selected_template); zebraCardTemplate = ((MainApplication) getApplication()).getZebraCardTemplate(); templateName = getIntent().getStringExtra(KEY_SELECTED_TEMPLATE_NAME); TextView selectedTemplateName = (TextView) findViewById(R.id.selectedTemplateName); templateVariableList = (LinearLayout) findViewById(R.id.templateVariableList); quantitySpinner = (ZebraSpinnerView) findViewById(R.id.quantitySpinner); printButton = (ZebraButton) findViewById(R.id.printButton); ZebraButton cancelButton = (ZebraButton) findViewById(R.id.cancelButton); progressOverlay = (LinearLayout) findViewById(R.id.progressOverlay); progressMessage = (TextView) findViewById(R.id.progressMessage); selectedTemplateName.setText(templateName); getTemplateVariablesTask = new GetTemplateVariablesTask(zebraCardTemplate, SelectedPrinterManager.getSelectedPrinter(), templateName); getTemplateVariablesTask.setOnGetTemplateVariablesListener(this); getTemplateVariablesTask.execute(); //RECEIVE DATA Bundle extras = getIntent().getExtras(); userID = extras.getString("userID"); userName = extras.getString("userName"); userSobrenome = extras.getString("userSobrenome"); userRegistro = extras.getString("userRegistro"); userCPF = extras.getString("userCPF"); userRG = extras.getString("userRG"); userState = extras.getString("userState"); userCargo = extras.getString("userCargo"); userTipoSang = extras.getString("userTipoSang"); userNascimento = extras.getString("userNascimento"); userGenero = extras.getString("userGenero"); userPorteArma = extras.getString("userPorteArma"); //Toast.makeText(SelectedTemplateJobActivity.this, "Opened the template", Toast.LENGTH_SHORT).show(); //TRYING TO PUT VARIABLES /* String geralInfos = ""; Map<String, String> varsData = new HashMap<>(); for (String variable : variablesData.keySet()) { while(variablesData.get(variable).getText().equals("")){ variablesData.get(variable).setText("AAAAAAAA"); } varsData.put(variable, variablesData.get(variable).getText()); //Toast.makeText(SelectedTemplateJobActivity.this, "The INFO IS: " + variablesData.get(variable).getText(), Toast.LENGTH_SHORT).show(); geralInfos = geralInfos + "VAR:" + variable + " VALUES " + variablesData.get(variable).getText() + " <> "; } */ printButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!isApplicationBusy) { isApplicationBusy = true; printButton.setEnabled(false); UIHelper.hideSoftKeyboard(SelectedTemplateJobActivity.this); String geralInfos = ""; Map<String, String> varsData = new HashMap<>(); for (String variable : variablesData.keySet()) { varsData.put(variable, variablesData.get(variable).getText()); //Toast.makeText(SelectedTemplateJobActivity.this, "The INFO IS: " + variablesData.get(variable).getText(), Toast.LENGTH_SHORT).show(); //geralInfos = geralInfos + "VAR:" + variable + " VALUES " + variablesData.get(variable).getText() + " <> "; } //Toast.makeText(SelectedTemplateJobActivity.this, "ALL: " + geralInfos, Toast.LENGTH_LONG).show(); int quantity = Integer.parseInt(quantitySpinner.getSelectedItem().toString()); if (sendTemplateJobTask != null) { sendTemplateJobTask.cancel(true); } sendTemplateJobTask = new SendTemplateJobTask(zebraCardTemplate, SelectedPrinterManager.getSelectedPrinter(), templateName, varsData, quantity); sendTemplateJobTask.setOnSendTemplateJobListener(SelectedTemplateJobActivity.this); sendTemplateJobTask.execute(); } } }); cancelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); } void testToast(){ Toast.makeText(this, "I am delayed toast", Toast.LENGTH_LONG).show(); } @Override protected void onDestroy() { super.onDestroy(); if (getTemplateVariablesTask != null) { getTemplateVariablesTask.cancel(true); } if (sendTemplateJobTask != null) { sendTemplateJobTask.cancel(true); } if (pollJobStatusTask != null) { pollJobStatusTask.cancel(true); } } @Override public void onBackPressed() { if (!isApplicationBusy) { super.onBackPressed(); } } @Override public void onGetTemplateVariablesStarted(){ isApplicationBusy = true; //showProgressOverlay(getString(R.string.retrieving_template_variables)); showProgressOverlay("Trying to edit variables values"); Toast.makeText(this, "Before the toast", Toast.LENGTH_SHORT).show(); Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { testToast(); setVariablesValue(); } }, 1800); //5 seconds setVariablesValue(); } private void setVariablesValue(){ if (!isApplicationBusy) { String geralInfos = ""; int count = 0; Map<String, String> varsData = new HashMap<>(); for (String variable : variablesData.keySet()) { switch (variable){ case "Nome": variablesData.get(variable).setText(userName); break; case "Sobrenome": variablesData.get(variable).setText(userSobrenome); break; case "Registro": variablesData.get(variable).setText(userRegistro); break; case "CPF": variablesData.get(variable).setText(userCPF); break; case "RG": variablesData.get(variable).setText(userRG); break; case "Estado": variablesData.get(variable).setText(userState); break; case "Cargo": variablesData.get(variable).setText(userCargo); break; case "TipoSang": variablesData.get(variable).setText(userTipoSang); break; case "Nascimento": variablesData.get(variable).setText(userNascimento); break; case "Genero": variablesData.get(variable).setText(userGenero); break; case "PorteArma": variablesData.get(variable).setText(userPorteArma); break; case "NomeCompleto": variablesData.get(variable).setText(userName+" "+userSobrenome); break; } //variablesData.get(variable).setText("AAAAAAAA: " + count++); varsData.put(variable, variablesData.get(variable).getText()); //Toast.makeText(SelectedTemplateJobActivity.this, "The INFO IS: " + variablesData.get(variable).getText(), Toast.LENGTH_SHORT).show(); geralInfos = geralInfos + "VAR:" + variable + " VALUES " + variablesData.get(variable).getText() + " <> "; } Toast.makeText(SelectedTemplateJobActivity.this, "ALL: " + geralInfos, Toast.LENGTH_LONG).show(); } } @Override public void onGetTemplateVariablesFinished(Exception exception, List<String> templateVariables) { isApplicationBusy = false; hideProgressOverlay(); if (exception != null) { printButton.setEnabled(false); DialogHelper.showErrorDialog(this, getString(R.string.unable_to_retrieve_template_variables_message, exception.getMessage())); } else if (templateVariables == null) { DialogHelper.showErrorDialog(this, getString(R.string.no_template_variables_found)); } else { for (String variableName : templateVariables) { ZebraEditText zebraEditText = createTemplateVariableView(variableName); templateVariableList.addView(zebraEditText); variablesData.put(variableName, zebraEditText); } } } @Override public void onSendTemplateJobStarted() { showProgressOverlay(getString(R.string.sending_template_job_to_printer)); } @Override public void onSendTemplateJobFinished(Exception exception, int jobId, final String templateName, final Map<String, String> variablesData, final int quantity) { if (exception == null) { if (pollJobStatusTask != null) { pollJobStatusTask.cancel(true); } pollJobStatusTask = new PollJobStatusTask(this, SelectedPrinterManager.getSelectedPrinter(), jobId, templateName, variablesData, quantity); pollJobStatusTask.setOnJobStatusPollListener(this); pollJobStatusTask.execute(); } else { isApplicationBusy = false; printButton.setEnabled(true); hideProgressOverlay(); showRetryTemplateJobDialog(exception.getMessage(), templateName, variablesData, quantity); } } @Override public void onJobStatusPollStarted() { showProgressOverlay(getString(R.string.printing_template)); } @Override public void onJobStatusUserInputRequired(int jobId, String alarmInfoDescription, final PollJobStatusTask.OnUserInputListener onUserInputListener) { DialogHelper.showAlarmEncounteredDialog(this, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (onUserInputListener != null) { onUserInputListener.onPositiveButtonClicked(); } } }, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (onUserInputListener != null) { onUserInputListener.onNegativeButtonClicked(); } } }, jobId, alarmInfoDescription); } @Override public void onJobStatusPollFinished(Exception exception, final String templateName, final Map<String, String> variablesData, final int quantity, JobStatusInfo jobStatusInfo, String doneMessage) { isApplicationBusy = false; printButton.setEnabled(true); hideProgressOverlay(); if (exception == null) { if (jobStatusInfo != null && jobStatusInfo.errorInfo.value > 0) { showRetryTemplateJobDialog(doneMessage, templateName, variablesData, quantity); } else { UIHelper.showSnackbar(this, doneMessage); } } else { showRetryTemplateJobDialog(exception.getMessage(), templateName, variablesData, quantity); } } private void showRetryTemplateJobDialog(String message, final String templateName, final Map<String, String> variablesData, final int quantity) { DialogHelper.createPrintingErrorDialog(this, message, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (sendTemplateJobTask != null) { sendTemplateJobTask.cancel(true); } sendTemplateJobTask = new SendTemplateJobTask(zebraCardTemplate, SelectedPrinterManager.getSelectedPrinter(), templateName, variablesData, quantity); sendTemplateJobTask.setOnSendTemplateJobListener(SelectedTemplateJobActivity.this); sendTemplateJobTask.execute(); dialog.dismiss(); } }).show(); } private ZebraEditText createTemplateVariableView(String headerText) { ZebraEditText zebraEditText = (ZebraEditText) LayoutInflater.from(this).inflate(R.layout.item_template_variable, templateVariableList, false); zebraEditText.setHeaderText(headerText); return zebraEditText; } private void showProgressOverlay(String message) { progressMessage.setText(message); progressOverlay.setVisibility(View.VISIBLE); } private void hideProgressOverlay() { progressMessage.setText(null); progressOverlay.setVisibility(View.GONE); } }
46a9e246854ba2c2ac92515fc6ea946775ae1aba
fe34a576993ca77fbc8b1c5c09e7123a4f2ed2d4
/app/src/androidTest/java/com/fragments/justus/mystories/ApplicationTest.java
71c313d70cea91fc13dc72948750bb3387bf1365
[]
no_license
kyaloj-zz/my-stories
f960b46d579a4c2dd732ae890e4934af71eda5e4
f7f4c4a2a4a7499d99a11a37a096c5da73bba0e6
refs/heads/master
2021-05-28T14:41:45.429228
2015-04-23T11:08:47
2015-04-23T11:08:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package com.fragments.justus.mystories; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
301b02c49ce46545cfdcd24d6e00f6b6381ca4c4
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_b78ce9a0608a08b1ad56367fd09a11753ee79237/ChannelImpl/2_b78ce9a0608a08b1ad56367fd09a11753ee79237_ChannelImpl_t.java
c2f13f8a2a0ca45e9826b4ce0fbad73220e93fe8
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
69,596
java
/* * Copyright 2007-2008 Sun Microsystems, Inc. * * This file is part of Project Darkstar Server. * * Project Darkstar Server is free software: you can redistribute it * and/or modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation and * distributed hereunder to you. * * Project Darkstar Server 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, see <http://www.gnu.org/licenses/>. */ package com.sun.sgs.impl.service.channel; import com.sun.sgs.app.Channel; import com.sun.sgs.app.ChannelListener; import com.sun.sgs.app.ClientSession; import com.sun.sgs.app.Delivery; import com.sun.sgs.app.ManagedObject; import com.sun.sgs.app.ManagedObjectRemoval; import com.sun.sgs.app.ManagedReference; import com.sun.sgs.app.MessageRejectedException; import com.sun.sgs.app.NameNotBoundException; import com.sun.sgs.app.ObjectNotFoundException; import com.sun.sgs.app.ResourceUnavailableException; import com.sun.sgs.app.Task; import com.sun.sgs.app.TransactionException; import com.sun.sgs.impl.service.session.ClientSessionImpl; import com.sun.sgs.impl.service.session.ClientSessionWrapper; import com.sun.sgs.impl.service.session.NodeAssignment; import com.sun.sgs.impl.sharedutil.HexDumper; import com.sun.sgs.impl.sharedutil.LoggerWrapper; import com.sun.sgs.impl.util.AbstractKernelRunnable; import com.sun.sgs.impl.util.BoundNamesUtil; import com.sun.sgs.impl.util.IoRunnable; import com.sun.sgs.impl.util.ManagedQueue; import com.sun.sgs.impl.util.ManagedSerializable; import com.sun.sgs.protocol.simple.SimpleSgsProtocol; import com.sun.sgs.service.DataService; import com.sun.sgs.service.Node; import com.sun.sgs.service.TaskService; import com.sun.sgs.service.Transaction; import com.sun.sgs.service.WatchdogService; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import java.util.Random; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; /** * Channel implementation for use within a single transaction. */ abstract class ChannelImpl implements ManagedObject, Serializable { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; /** The logger for this class. */ protected static final LoggerWrapper logger = new LoggerWrapper( Logger.getLogger(ChannelImpl.class.getName())); /** The package name. */ private static final String PKG_NAME = "com.sun.sgs.impl.service.channel."; /** The channel name component prefix. */ private static final String NAME_COMPONENT = "name."; /** The channel set component prefix. */ private static final String SET_COMPONENT = "set."; /** The member session component prefix. */ private static final String SESSION_COMPONENT = "session."; /** The work queue component prefix. */ private static final String QUEUE_COMPONENT = "eventq."; /** The random number generator for choosing a new coordinator. */ private static final Random random = new Random(); /** The channel name. */ protected final String name; /** The ID from a managed reference to this instance. */ protected final byte[] channelId; /** The wrapped channel instance. */ private final ManagedReference<ChannelWrapper> wrappedChannelRef; /** The reference to this channel's listener. */ private final ManagedReference<ChannelListener> listenerRef; /** The delivery requirement for messages sent on this channel. */ protected final Delivery delivery; /** The ChannelServers that have locally connected sessions * that are members of this channel, keyed by node ID. */ private final Set<Long> servers = new HashSet<Long>(); /** * The node ID of the coordinator for this channel. At first, it * is the node that the channel was created on. If the * coordinator node fails, then the coordinator becomes one of the * member's nodes or the node performing recovery if there are no * members. */ private long coordNodeId; /** The transaction. */ private transient Transaction txn; /** The data service. */ private transient DataService dataService; /** Flag that is 'true' if this channel is closed. */ private boolean isClosed = false; /** * The maximum number of message bytes that can be queued for delivery on * this channel. */ private final int writeBufferCapacity; /** * Constructs an instance of this class with the specified * {@code name}, {@code listener}, {@code delivery} requirement, * and write buffer capacity. * * @param name a channel name * @param listener a channel listener * @param delivery a delivery requirement * @param writeBufferCapacity the capacity of the write buffer, in bytes */ protected ChannelImpl(String name, ChannelListener listener, Delivery delivery, int writeBufferCapacity) { if (name == null) { throw new NullPointerException("null name"); } this.name = name; this.dataService = ChannelServiceImpl.getDataService(); if (listener != null) { if (!(listener instanceof Serializable)) { throw new IllegalArgumentException("non-serializable listener"); } else if (!(listener instanceof ManagedObject)) { listener = new ManagedSerializableChannelListener(listener); } this.listenerRef = dataService.createReference(listener); } else { this.listenerRef = null; } this.delivery = delivery; this.writeBufferCapacity = writeBufferCapacity; this.txn = ChannelServiceImpl.getTransaction(); ManagedReference<ChannelImpl> ref = dataService.createReference(this); this.wrappedChannelRef = dataService.createReference(new ChannelWrapper(ref)); this.channelId = ref.getId().toByteArray(); this.coordNodeId = getLocalNodeId(); if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "Created ChannelImpl:{0}", HexDumper.toHexString(channelId)); } dataService.setServiceBinding(getChannelKey(), this); dataService.setServiceBinding(getEventQueueKey(), new EventQueue(this)); } /* -- Factory methods -- */ /** * Constructs a new {@code Channel} with the given {@code name}, {@code * listener}, {@code delivery} requirement and write-buffer capacity. */ static Channel newInstance(String name, ChannelListener listener, Delivery delivery, int writeBufferCapacity) { // TBD: create other channel types depending on delivery. return new OrderedUnreliableChannelImpl( name, listener, delivery, writeBufferCapacity).getWrappedChannel(); } /** * Returns a channel with the given {@code name}. */ static Channel getInstance(String name) { try { return ((ChannelImpl) ChannelServiceImpl.getDataService(). getServiceBinding(getChannelKey(name))).getWrappedChannel(); } catch (ObjectNotFoundException e) { // TBD: This shouldn't happen, so log at SEVERE? throw new NameNotBoundException("channel not found!", e); } } /* -- Implement Channel -- */ /** Implements {@link Channel#getName}. */ String getName() { checkContext(); if (logger.isLoggable(Level.FINEST)) { logger.log(Level.FINEST, "getName returns {0}", name); } return name; } /** Implements {@link Channel#getDeliveryRequirement}. */ Delivery getDeliveryRequirement() { checkContext(); if (logger.isLoggable(Level.FINEST)) { logger.log(Level.FINEST, "getDeliveryRequirement returns {0}", delivery); } return delivery; } /** Implements {@link Channel#hasSessions}. */ boolean hasSessions() { checkClosed(); String prefix = getSessionPrefix(); String name = dataService.nextServiceBoundName(prefix); return name != null && name.startsWith(prefix); } /** Implements {@link Channel#getSessions}. */ Iterator<ClientSession> getSessions() { checkClosed(); return new ClientSessionIterator(dataService, getSessionPrefix()); } /** Implements {@link Channel#join(ClientSession)}. */ void join(final ClientSession session) { try { checkClosed(); if (session == null) { throw new NullPointerException("null session"); } /* * Enqueue join request with underlying (unwrapped) client * session object. */ addEvent(new JoinEvent(unwrapSession(session))); logger.log(Level.FINEST, "join session:{0} returns", session); } catch (RuntimeException e) { logger.logThrow(Level.FINEST, e, "join throws"); throw e; } } /** Implements {@link Channel#join(Set)}. * * Enqueues a join event to this channel's event queue and notifies * this channel's coordinator to service the event. */ void join(final Set<ClientSession> sessions) { try { checkClosed(); if (sessions == null) { throw new NullPointerException("null sessions"); } /* * Enqueue join requests, each with underlying (unwrapped) * client session object. * * TBD: (optimization) add a single event instead of one for * each session. */ for (ClientSession session : sessions) { addEvent(new JoinEvent(unwrapSession(session))); } logger.log(Level.FINEST, "join sessions:{0} returns", sessions); } catch (RuntimeException e) { logger.logThrow(Level.FINEST, e, "join throws"); throw e; } } /** * Returns the underlying {@code ClientSession} for the specified * {@code session}. Note: The client session service wraps each client * session object that it hands out to the application. The channel * service implementation relies on the assumption that a client * session's {@code ManagedObject} ID is the client session's ID (used * for identifiying the client session, e.g. for sending messages to * the client session). This method is invoked by the {@code join} and * {@code leave} methods in order to access the underlying {@code * ClientSession} so that the correct client session ID can be obtained. */ private ClientSession unwrapSession(ClientSession session) { assert session instanceof ClientSessionWrapper; return ((ClientSessionWrapper) session).getClientSession(); } /** * Adds the specified channel {@code event} to this channel's event queue * and notifies the coordinator that there is an event to service. As * an optimization, if the local node is the coordinator for this channel * and the event queue is empty, then service the event immediately * without adding it to the event queue. */ private void addEvent(ChannelEvent event) { EventQueue eventQueue = getEventQueue(coordNodeId, channelId); if (isCoordinator() && eventQueue.isEmpty()) { event.serviceEvent(eventQueue); } else if (eventQueue.offer(event)) { notifyServiceEventQueue(eventQueue); } else { throw new ResourceUnavailableException( "not enough resources to add channel event"); } } /** * If the coordinator is the local node, services events locally; * otherwise, schedules a task to send a request to this channel's * coordinator to service the event queue. * * @param eventQueue this channel's event queue */ private void notifyServiceEventQueue(EventQueue eventQueue) { if (isCoordinator()) { eventQueue.serviceEvent(); } else { final ChannelServer coordinator = getChannelServer(coordNodeId); if (coordinator == null) { /* * If the ChannelServer for the coordinator's node has been * removed, then the coordinator's node has failed and will * be reassigned during recovery. When recovery for the * failed node completes, the newly chosen coordinator will * restart the processing of channel events. */ return; } final long coord = coordNodeId; final ChannelServiceImpl channelService = ChannelServiceImpl.getChannelService(); channelService.getTaskService().scheduleNonDurableTask( new AbstractKernelRunnable() { public void run() { channelService.runIoTask( new IoRunnable() { public void run() throws IOException { coordinator.serviceEventQueue(channelId); }}, coord); } }, false); } } /** Implements {@link Channel#leave(ClientSession)}. * * Enqueues a leave event to this channel's event queue and notifies * this channel's coordinator to service the event. */ void leave(final ClientSession session) { try { checkClosed(); if (session == null) { throw new NullPointerException("null client session"); } /* * Enqueue leave request with underlying (unwrapped) client * session object. */ addEvent(new LeaveEvent(unwrapSession(session))); logger.log(Level.FINEST, "leave session:{0} returns", session); } catch (RuntimeException e) { logger.logThrow(Level.FINEST, e, "leave throws"); throw e; } } /** Implements {@link Channel#leave(Set)}. * * Enqueues leave event(s) to this channel's event queue and notifies * this channel's coordinator to service the event(s). */ void leave(final Set<ClientSession> sessions) { try { checkClosed(); if (sessions == null) { throw new NullPointerException("null sessions"); } /* * Enqueue leave requests, each with underlying (unwrapped) * client session object. * * TBD: (optimization) add a single event instead of one for * each session. */ for (ClientSession session : sessions) { addEvent(new LeaveEvent(unwrapSession(session))); } logger.log(Level.FINEST, "leave sessions:{0} returns", sessions); } catch (RuntimeException e) { logger.logThrow(Level.FINEST, e, "leave throws"); throw e; } } /** Implements {@link Channel#leaveAll}. * * Enqueues a leaveAll event to this channel's event queue and notifies * this channel's coordinator to service the event. */ void leaveAll() { try { checkClosed(); /* * Enqueue leaveAll request. */ addEvent(new LeaveAllEvent()); logger.log(Level.FINEST, "leaveAll returns"); } catch (RuntimeException e) { logger.logThrow(Level.FINEST, e, "leave throws"); throw e; } } /** Implements {@link Channel#send}. * * Enqueues a send event to this channel's event queue and notifies * this channel's coordinator to service the event. */ void send(ClientSession sender, ByteBuffer message) { try { checkClosed(); if (message == null) { throw new NullPointerException("null message"); } message = message.asReadOnlyBuffer(); if (message.remaining() > SimpleSgsProtocol.MAX_PAYLOAD_LENGTH) { throw new IllegalArgumentException( "message too long: " + message.remaining() + " > " + SimpleSgsProtocol.MAX_PAYLOAD_LENGTH); } /* * Enqueue send request. */ byte[] msgBytes = new byte[message.remaining()]; message.get(msgBytes); byte[] senderIdBytes = sender != null ? getSessionIdBytes(unwrapSession(sender)) : null; addEvent(new SendEvent(senderIdBytes, msgBytes)); if (logger.isLoggable(Level.FINEST)) { logger.log(Level.FINEST, "send channel:{0} message:{1} returns", this, HexDumper.format(msgBytes, 0x50)); } } catch (RuntimeException e) { if (logger.isLoggable(Level.FINEST)) { logger.logThrow( Level.FINEST, e, "send channel:{0} message:{1} throws", this, HexDumper.format(message, 0x50)); } throw e; } } /** * If this channel has a null {@code ChannelListener}, forwards the * specified {@code message} to the channel by invoking this channel's * {@code send} method with the specified {@code sender} and {@code * message}; otherwise, invokes the {@code ChannelListener}'s {@code * receivedMessage} method with this channel, the specified {@code sender}, * and {@code message}. */ private void receivedMessage(ClientSession sender, ByteBuffer message) { assert sender instanceof ClientSessionWrapper; if (listenerRef == null) { send(sender, message); } else { // TBD: exception handling? listenerRef.get().receivedMessage( getWrappedChannel(), sender, message.asReadOnlyBuffer()); } } /** * Enqueues a close event to this channel's event queue and notifies * this channel's coordinator to service the event. This method * is invoked by this channel's {@code ChannelWrapper} when the * application removes the wrapper object. */ void close() { checkContext(); if (!isClosed) { /* * Enqueue close event. */ addEvent(new CloseEvent()); isClosed = true; } } /* -- Implement Object -- */ /** {@inheritDoc} */ @Override public boolean equals(Object obj) { // TBD: Because this is a managed object, does an "==" check // suffice here? return (this == obj) || (obj != null && obj.getClass() == this.getClass() && Arrays.equals(((ChannelImpl) obj).channelId, channelId)); } /** {@inheritDoc} */ @Override public int hashCode() { return Arrays.hashCode(channelId); } /** {@inheritDoc} */ @Override public String toString() { return getClass().getName() + "[" + HexDumper.toHexString(channelId) + "]"; } /* -- Serialization methods -- */ private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); txn = ChannelServiceImpl.getTransaction(); dataService = ChannelServiceImpl.getDataService(); } /* -- Binding prefix/key methods -- */ /** * Return a key for accessing the channel with the specified * {@code name}. The key has the following form: * * com.sun.sgs.impl.service.channel.name.<channelName> */ private static String getChannelKey(String name) { return PKG_NAME + NAME_COMPONENT + name; } /** * Returns a key for accessing this channel. The key has the * following form: * * com.sun.sgs.impl.service.channel.name.<channelName> */ private String getChannelKey() { return getChannelKey(name); } /** * Returns the prefix for accessing all client sessions on this * channel. The prefix has the following form: * * com.sun.sgs.impl.service.channel. * session.<channelId>. */ private static String getSessionPrefix(byte[] channelId) { return PKG_NAME + SESSION_COMPONENT + HexDumper.toHexString(channelId) + "."; } /** * Returns the prefix for accessing all client sessions on this * channel. The prefix has the following form: * * com.sun.sgs.impl.service.channel. * session.<channelId>. */ private String getSessionPrefix() { return getSessionPrefix(channelId); } /** * Returns the prefix for accessing all the client sessions on * this channel that are connected to the node with the specified * {@code nodeId}. The prefix has the following form: * * com.sun.sgs.impl.service.channel. * session.<channelId>.<nodeId>. */ private static String getSessionNodePrefix(byte[] channelId, long nodeId) { return getSessionPrefix(channelId) + nodeId + "."; } /** * Returns a key for accessing the specified {@code session} as a * member of this channel. The key has the following form: * * com.sun.sgs.impl.service.channel. * session.<channelId>.<nodeId>.<sessionId> */ private String getSessionKey(ClientSession session) { return getSessionKey(getNodeId(session), getSessionIdBytes(session)); } /** * Returns a key for accessing the member session with the * specified {@code sessionIdBytes} and is connected to the node * with the specified {@code nodeId}. The key has the following * form: * * com.sun.sgs.impl.service.channel. * session.<channelId>.<nodeId>.<sessionId> */ private String getSessionKey(long nodeId, byte[] sessionIdBytes) { return getSessionNodePrefix(channelId, nodeId) + HexDumper.toHexString(sessionIdBytes); } /** * Returns a prefix for accessing the event queues for channels * coordinated on the given {@code nodeId}. The prefix has the * following form: * * com.sun.sgs.impl.service.channel. * eventq.<nodeId>. */ private static String getEventQueuePrefix(long nodeId) { return PKG_NAME + QUEUE_COMPONENT + nodeId + "."; } /** * Returns a key for accessing the work queue for this channel's * coordinator. The key has the following form: * * com.sun.sgs.impl.service.channel. * eventq.<coordNodeId>.<channelId> */ private String getEventQueueKey() { return getEventQueueKey(coordNodeId, channelId); } /** * Returns a key for accessing the work queue for the channel with * the specified {@code channelId} and coordinator {@code * nodeId}. The key has the following form: * * com.sun.sgs.impl.service.channel. * eventq.<nodeId>.<channelId> */ private static String getEventQueueKey(long nodeId, byte[] channelId) { return getEventQueuePrefix(nodeId) + HexDumper.toHexString(channelId); } /* -- Other methods -- */ /** * Returns the ID for the specified {@code session}. */ private static byte[] getSessionIdBytes(ClientSession session) { return ChannelServiceImpl.getDataService(). createReference(session).getId().toByteArray(); } /** * Returns the node ID for the specified {@code session}. */ private static long getNodeId(ClientSession session) { if (session instanceof NodeAssignment) { return ((NodeAssignment) session).getNodeId(); } else { throw new IllegalArgumentException( "session does not implement NodeAssignment: " + session.getClass()); } } /** * Returns the wrapped channel for this instance. */ protected ChannelWrapper getWrappedChannel() { return wrappedChannelRef.get(); } /** * Checks that this channel's transaction is currently active, * throwing TransactionNotActiveException if it isn't. */ private void checkContext() { ChannelServiceImpl.checkTransaction(txn); } /** * Checks the context, and then checks that this channel is not * closed, throwing an IllegalStateException if the channel is * closed. */ private void checkClosed() { checkContext(); if (isClosed) { throw new IllegalStateException("channel is closed"); } } /** * Returns {@code true} if this node is the coordinator for this * channel, otherwise returns {@code false}. */ private boolean isCoordinator() { return coordNodeId == getLocalNodeId(); } /** * If the specified {@code session} is not already a member of * this channel, adds the session to this channel and * returns {@code true}; otherwise if the specified {@code * session} is already a member of this channel, returns {@code * false}. * * @return {@code true} if the session was added to the channel, * and {@code false} if the session is already a member */ private boolean addSession(ClientSession session) { /* * If client session is already a channel member, return false * immediately. */ if (hasSession(session)) { return false; } /* * If client session is first session on a new node for this * channel, then add server's node ID to server list. */ long nodeId = getNodeId(session); if (!hasServerNode(nodeId)) { dataService.markForUpdate(this); servers.add(nodeId); } /* * Add session binding. */ String sessionKey = getSessionKey(session); dataService.setServiceBinding( sessionKey, new ClientSessionInfo(dataService, session)); return true; } /** * Removes the specified member {@code session} from this channel, * and returns {@code true} if the session was a member of this * channel when this method was invoked and {@code false} otherwise. */ private boolean removeSession(ClientSession session) { return removeSession(getNodeId(session), getSessionIdBytes(session)); } /** * Removes the binding with the given {@code sessionKey} (and the * associated object) and throws {@code NameNotBoundException} if the * key is not bound. */ private void removeSessionBinding(String sessionKey) { ClientSessionInfo sessionInfo = (ClientSessionInfo) dataService.getServiceBinding(sessionKey); dataService.removeServiceBinding(sessionKey); dataService.removeObject(sessionInfo); } /** * Removes from this channel the member session with the specified * {@code sessionIdBytes} that is connected to the node with the * specified {@code nodeId}, notifies the session's server that the * session left the channel, and returns {@code true} if the * session was a member of this channel when this method was * invoked. If the session is not a member of this channel, then no * action is taken and {@code false} is returned. */ private boolean removeSession( final long nodeId, final byte[] sessionIdBytes) { // Remove session binding. String sessionKey = getSessionKey(nodeId, sessionIdBytes); try { removeSessionBinding(sessionKey); } catch (NameNotBoundException e) { return false; } /* * If the specified session is the last one on its node to be * removed from this channel, then remove the session's node * from the server map. */ if (!hasSessionsOnNode(nodeId)) { dataService.markForUpdate(this); servers.remove(nodeId); } final ChannelServer server = getChannelServer(nodeId); /* * If there is no channel server for the session's node, * then the session's node has failed and the session is * now disconnected. There is no need to send a 'leave' * notification (to update the channel membership cache) to * the failed server. */ if (server != null) { ChannelServiceImpl.getChannelService().addChannelTask( new BigInteger(1, channelId), new IoRunnable() { public void run() throws IOException { server.leave(channelId, sessionIdBytes); }}, nodeId); } return true; } /** * Reassigns the channel coordinator as follows: * * 1) Reassigns the channel's coordinator from the node specified by * the {@code failedCoordNodeId} to another server node (if there are * channel members), or the local node (if there are no channel * members) and rebinds the event queue to the new coordinator's key. * * 2) Marks the event queue to indicate that a refresh request for this * channel must be sent this channel's channel servers to notify each * server to reread this channel's membership list (for the given * channel server's local node) before servicing any more events. * * 3} Finally, sends out a 'serviceEventQueue' request to the new * coordinator to restart this channel's event processing. */ private void reassignCoordinator(long failedCoordNodeId) { dataService.markForUpdate(this); if (coordNodeId != failedCoordNodeId) { logger.log( Level.SEVERE, "attempt to reassign coordinator:{0} for channel:{1} " + "that is not the failed node:{2}", coordNodeId, failedCoordNodeId, this); return; } servers.remove(failedCoordNodeId); EventQueue eventQueue = getEventQueue(coordNodeId, channelId); if (eventQueue == null) { logger.log( Level.SEVERE, "event queue for channel:{0} and coordinator:{1} " + "prematurely removed", this, coordNodeId); return; } /* * Remove previous coordinator's event queue binding, assign a new * coordinator, and set new coordinator's event queue binding. */ dataService.removeServiceBinding(getEventQueueKey()); coordNodeId = chooseCoordinatorNode(); if (logger.isLoggable(Level.FINE)) { logger.log( Level.FINE, "channel:{0} reassigning coordinator from:{1} to:{2}", HexDumper.toHexString(channelId), failedCoordNodeId, coordNodeId); } dataService.setServiceBinding(getEventQueueKey(), eventQueue); /* * Mark the event queue to indicate that a refresh must be sent to * all channel servers for this channel before servicing any events * in the queue, and then send a 'serviceEventQueue' notification * to the new coordinator. */ eventQueue.setSendRefresh(); notifyServiceEventQueue(eventQueue); } /** * Chooses a node to be the new coordinator for this channel, and * returns the ID for the chosen node. If there is one or more * channel server(s) for this channel that are currently alive, this * method chooses one of those server nodes at random to be the new * coordinator. If there are no live channel servers for this channel, * then the local node is chosen to be the coordinator. * * This method should be called within a transaction. */ private long chooseCoordinatorNode() { if (!servers.isEmpty()) { int numServers = servers.size(); Long[] serverIds = servers.toArray(new Long[numServers]); int startIndex = random.nextInt(numServers); WatchdogService watchdogService = ChannelServiceImpl.getWatchdogService(); for (int i = 0; i < numServers; i++) { int tryIndex = (startIndex + i) % numServers; long candidateId = serverIds[tryIndex]; Node coordCandidate = watchdogService.getNode(candidateId); if (coordCandidate != null && coordCandidate.isAlive()) { return candidateId; } } } return getLocalNodeId(); } /** * Removes the client session with the specified {@code sessionIdBytes} * from the channel with the specified {@code channelRefId}. This * method is invoked when a session is disconnected from this node * (with the specified {@code nodeId}) gracefully or otherwise, or if * this node is recovering for a failed node whose sessions all became * disconnected. The {@code nodeId} specifies the node that the * session was previously connected to, which is not necessarily * the local node's ID. * * This method should be called within a transaction. */ static void removeSessionFromChannel( long nodeId, byte[] sessionIdBytes, BigInteger channelRefId) { ChannelImpl channel = (ChannelImpl) getObjectForId(channelRefId); if (channel != null) { channel.removeSession(nodeId, sessionIdBytes); } else { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "channel already removed:{0}", HexDumper.toHexString(channelRefId.toByteArray())); } } } /** * Returns the local node's ID. */ private static long getLocalNodeId() { return ChannelServiceImpl.getLocalNodeId(); } /** * Returns {@code true} if the node with the associated {@code nodeId} * is alive, otherwise returns {@code false}. * * This method must be called from outside a transaction or an * {@code IllegalStateException} will be thrown. */ private static boolean isAlive(long nodeId) { return ChannelServiceImpl.getChannelService().isAlive(nodeId); } /** * Returns the channel server for the specified {@code nodeId}. */ private static ChannelServer getChannelServer(long nodeId) { return ChannelServiceImpl.getChannelService().getChannelServer(nodeId); } /** * Returns the managed object with the specified {@code refId}, or {@code * null} if there is no object with the specified {@code refId}. * * @param refId the object's identifier as obtained by * {@link ManagedReference#getId ManagedReference.getId} * * @throws TransactionException if the operation failed because of a * problem with the current transaction */ private static Object getObjectForId(BigInteger refId) { DataService dataService = ChannelServiceImpl.getDataService(); try { return dataService.createReferenceForId(refId).get(); } catch (ObjectNotFoundException e) { return null; } } /** * Returns a list containing the node IDs of the channel servers for * this channel. */ private List<Long> getChannelServerNodeIds() { return new ArrayList<Long>(servers); } /** * Removes all sessions from this channel and clears the list of * channel servers for this channel. This method should be called * when all sessions leave the channel. */ private void removeAllSessions() { for (String sessionKey : BoundNamesUtil.getServiceBoundNamesIterable( dataService, getSessionPrefix())) { ClientSessionInfo sessionInfo = (ClientSessionInfo) dataService.getServiceBinding(sessionKey); removeSession(sessionInfo.nodeId, sessionInfo.sessionIdBytes); } dataService.markForUpdate(this); servers.clear(); } /** * Removes all sessions from this channel, removes the channel * object and its binding, the channel listener wrapper (if we * created a wrapper for it), and the event queue and associated * binding from the data store. This method should be called when * the channel is closed. */ private void removeChannel() { removeAllSessions(); dataService.removeServiceBinding(getChannelKey()); dataService.removeObject(this); if (listenerRef != null) { ChannelListener maybeWrappedListener = listenerRef.get(); if (maybeWrappedListener instanceof ManagedSerializable) { dataService.removeObject(maybeWrappedListener); } } EventQueue eventQueue = getEventQueue(coordNodeId, channelId); dataService.removeServiceBinding(getEventQueueKey()); dataService.removeObject(eventQueue); } /** * Returns {@code true} if the specified client {@code session} is * a member of this channel. */ private boolean hasSession(ClientSession session) { return getClientSessionInfo(session) != null; } /** * Returns {@code true} if this channel has any members connected * to the node with the specified {@code nodeId}. */ private boolean hasSessionsOnNode(long nodeId) { String keyPrefix = getSessionNodePrefix(channelId, nodeId); return dataService.nextServiceBoundName(keyPrefix). startsWith(keyPrefix); } /** * Returns {@code true} if the specified client {@code session} * would be the first session to join this channel on a new node, * otherwise returns {@code false}. */ private boolean hasServerNode(long nodeId) { return servers.contains(nodeId); } /** * Returns the {@code ClientSessionInfo} object for the specified * client {@code session}. */ private ClientSessionInfo getClientSessionInfo(ClientSession session) { String sessionKey = getSessionKey(session); ClientSessionInfo info = null; try { info = (ClientSessionInfo) dataService.getServiceBinding( sessionKey); } catch (NameNotBoundException e) { } catch (ObjectNotFoundException e) { logger.logThrow( Level.SEVERE, e, "ClientSessionInfo binding:{0} exists, but object removed", sessionKey); } return info; } /* -- Other classes -- */ /** * An iterator for {@code ClientSessions} of a given channel. */ private static class ClientSessionIterator implements Iterator<ClientSession> { /** The data service. */ protected final DataService dataService; /** The underlying iterator for service bound names. */ protected final Iterator<String> iterator; /** The client session to be returned by {@code next}. */ private ClientSession nextSession = null; /** * Constructs an instance of this class with the specified * {@code dataService} and {@code keyPrefix}. */ ClientSessionIterator(DataService dataService, String keyPrefix) { this.dataService = dataService; this.iterator = BoundNamesUtil.getServiceBoundNamesIterator( dataService, keyPrefix); } /** {@inheritDoc} */ public boolean hasNext() { if (!iterator.hasNext()) { return false; } if (nextSession != null) { return true; } String key = iterator.next(); ChannelImpl.ClientSessionInfo info = (ChannelImpl.ClientSessionInfo) dataService.getServiceBinding(key); ClientSession session = info.getClientSession(); if (session == null) { return hasNext(); } else { nextSession = session; return true; } } /** {@inheritDoc} */ public ClientSession next() { try { if (nextSession == null && !hasNext()) { throw new NoSuchElementException(); } return nextSession; } finally { nextSession = null; } } /** {@inheritDoc} */ public void remove() { throw new UnsupportedOperationException("remove is not supported"); } } /** * A wrapper for a {@code ChannelListener} that is serializable, * but not managed. */ private static class ManagedSerializableChannelListener extends ManagedSerializable<ChannelListener> implements ChannelListener { private static final long serialVersionUID = 1L; /** Constructs an instance with the specified {@code listener}. */ ManagedSerializableChannelListener(ChannelListener listener) { super(listener); } /** {@inheritDoc} */ public void receivedMessage( Channel channel, ClientSession sender, ByteBuffer message) { assert sender instanceof ClientSessionWrapper; get().receivedMessage(channel, sender, message); } } /** * A {@code ManagedObject} wrapper for a {@code ClientSession}'s * ID. An instance of this class also provides a means of * obtaining the corresponding client session if the client * session still exists. * * Note: this class is package accessible to allow test access. */ static class ClientSessionInfo implements ManagedObject, Serializable { private static final long serialVersionUID = 1L; final long nodeId; final byte[] sessionIdBytes; private final ManagedReference<ClientSession> sessionRef; /** * Constructs an instance of this class with the specified * {@code sessionIdBytes}. */ ClientSessionInfo(DataService dataService, ClientSession session) { if (session == null) { throw new NullPointerException("null session"); } assert session instanceof ClientSessionImpl; nodeId = getNodeId(session); sessionRef = dataService.createReference(session); sessionIdBytes = sessionRef.getId().toByteArray(); } /** * Returns the {@code ClientSession} or {@code null} if the * session has been removed. */ ClientSession getClientSession() { try { return ((ClientSessionImpl) sessionRef.get()). getWrappedClientSession(); } catch (ObjectNotFoundException e) { return null; } } /** {@inheritDoc} */ @Override public String toString() { return getClass().getName() + "[" + HexDumper.toHexString(sessionIdBytes) + "]"; } } /** * The channel's event queue. */ private static class EventQueue implements ManagedObjectRemoval, Serializable { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; /** The managed reference to the queue's channel. */ private final ManagedReference<ChannelImpl> channelRef; /** The managed reference to the managed queue. */ private final ManagedReference<ManagedQueue<ChannelEvent>> queueRef; /** The sequence number for events on this channel. */ private long seq = 0; /** If {@code true}, a refresh should be sent to all channel's * servers before servicing the next event. */ private boolean sendRefresh = false; /** * The number of bytes of the write buffer that are currently * available. */ private int writeBufferAvailable; /** * Constructs an event queue for the specified {@code channel}. */ EventQueue(ChannelImpl channel) { channelRef = channel.dataService.createReference(channel); queueRef = channel.dataService.createReference( new ManagedQueue<ChannelEvent>()); writeBufferAvailable = channel.getWriteBufferCapacity(); } /** * Attempts to enqueue the specified {@code event}, and returns * {@code true} if successful, and {@code false} otherwise. * * @param event the event * @return {@code true} if successful, and {@code false} otherwise * @throws MessageRejectedException if the cost of the event * exceeds the available buffer space in the queue */ boolean offer(ChannelEvent event) { int cost = event.getCost(); if (cost > writeBufferAvailable) { throw new MessageRejectedException( "Not enough queue space: " + writeBufferAvailable + " bytes available, " + cost + " requested"); } boolean success = getQueue().offer(event); if (success && (cost > 0)) { ChannelServiceImpl.getDataService().markForUpdate(this); writeBufferAvailable -= cost; if (logger.isLoggable(Level.FINEST)) { logger.log(Level.FINEST, "{0} reserved {1,number,#} leaving {2,number,#}", this, cost, writeBufferAvailable); } } return success; } /** * Returns the channel for this queue. */ ChannelImpl getChannel() { return channelRef.get(); } /** * Returns the channel ID for this queue. */ BigInteger getChannelRefId() { return channelRef.getId(); } /** * Returns the managed queue object. */ ManagedQueue<ChannelEvent> getQueue() { return queueRef.get(); } /** * Returns {@code true} if the event queue is empty. */ boolean isEmpty() { return getQueue().isEmpty(); } /** * Throws a retryable exception if the event queue is not in a * state to process the next event (e.g., it hasn't received * an expected acknowledgment that all channel servers have * received a specified 'send' request). */ void checkState() { // FIXME: This needs to be implemented in order to support // reliable messages in the face of channel coordinator crash. } /** * Marks this queue to indicate that a 'refresh' notification needs * to be sent to the associated channel's servers before servicing * any more events. This action is taken when the associated * channel's coordinator is reassigned during the previous channel * coordinator's recovery. */ void setSendRefresh() { ChannelServiceImpl.getDataService().markForUpdate(this); sendRefresh = true; } /** * Processes (at least) the first event in the queue. */ void serviceEvent() { checkState(); ChannelImpl channel = getChannel(); if (!channel.isCoordinator()) { // TBD: should a serviceEventQueue request be forwarded to // the true channel coordinator? logger.log( Level.WARNING, "Attempt at node:{0} channel:{1} to service events; " + "instead of current coordinator:{2}", getLocalNodeId(), HexDumper.toHexString(channel.channelId), channel.coordNodeId); return; } ChannelServiceImpl channelService = ChannelServiceImpl.getChannelService(); DataService dataService = ChannelServiceImpl.getDataService(); /* * If a new coordinator has taken over (i.e., 'sendRefresh' is * true), then all pending events should to be serviced, since * a 'serviceEventQueue' request may have been missed when the * former channel coordinator failed and was in the process of * being reassigned. So, assign the 'serviceAllEvents' flag * to indicate whether or not all pending events should be * processed below. */ boolean serviceAllEvents = sendRefresh; if (sendRefresh) { BigInteger channelRefId = getChannelRefId(); final byte[] channelIdBytes = channel.channelId; final String channelName = channel.name; if (logger.isLoggable(Level.FINEST)) { logger.log(Level.FINEST, "sending refresh, channel:{0}", HexDumper.toHexString(channelIdBytes)); } for (final long nodeId : channel.getChannelServerNodeIds()) { channelService.addChannelTask( channelRefId, new IoRunnable() { public void run() throws IOException { ChannelServer server = getChannelServer(nodeId); if (server != null) { server.refresh(channelName, channelIdBytes); } }}, nodeId); } dataService.markForUpdate(this); sendRefresh = false; } /* * Process channel events. If the 'serviceAllEvents' flag is * true, then service all pending events. */ int eventsToService = channelService.eventsPerTxn; ManagedQueue<ChannelEvent> eventQueue = getQueue(); do { ChannelEvent event = eventQueue.poll(); if (event == null) { return; } logger.log(Level.FINEST, "processing event:{0}", event); int cost = event.getCost(); if (cost > 0) { dataService.markForUpdate(this); writeBufferAvailable += cost; if (logger.isLoggable(Level.FINEST)) { logger.log(Level.FINEST, "{0} cleared reservation of " + "{1,number,#} bytes, leaving {2,number,#}", this, cost, writeBufferAvailable); } } event.serviceEvent(this); } while (serviceAllEvents || --eventsToService > 0); } /* -- Implement ManagedObjectRemoval -- */ /** {@inheritDoc} */ public void removingObject() { try { DataService dataService = ChannelServiceImpl.getDataService(); dataService.removeObject(queueRef.get()); } catch (ObjectNotFoundException e) { // already removed. } } } /** * Represents an event on a channel. */ private abstract static class ChannelEvent implements ManagedObject, Serializable { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; /** * Services this event, taken from the head of the given {@code * eventQueue}. */ abstract void serviceEvent(EventQueue eventQueue); /** * Returns the cost of this event, which the {@code EventQueue} * may use to reject events when the total cost is too large. * The default implementation returns a cost of zero. * * @return the cost of this event */ int getCost() { return 0; } } /** * A channel join event. */ private static class JoinEvent extends ChannelEvent { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; private final byte[] sessionId; /** * Constructs a join event with the specified {@code session}. */ JoinEvent(ClientSession session) { sessionId = getSessionIdBytes(session); } /** {@inheritDoc} */ public void serviceEvent(EventQueue eventQueue) { ClientSession session = (ClientSession) getObjectForId( new BigInteger(1, sessionId)); if (session == null) { logger.log( Level.FINE, "unable to obtain client session for ID:{0}", this); return; } final ChannelImpl channel = eventQueue.getChannel(); if (!channel.addSession(session)) { return; } long nodeId = getNodeId(session); final ChannelServer server = getChannelServer(nodeId); if (server == null) { /* * If there is no channel server for the session's node, * then the session's node has failed and the session is * now disconnected. There is no need to send a 'join' * notification (to update the channel membership cache) to * the failed server. */ return; } final String channelName = channel.name; final byte[] channelIdBytes = channel.channelId; ChannelServiceImpl.getChannelService().addChannelTask( eventQueue.getChannelRefId(), new IoRunnable() { public void run() throws IOException { server.join(channelName, channelIdBytes, sessionId); }}, nodeId); } /** {@inheritDoc} */ @Override public String toString() { return getClass().getName() + ": " + HexDumper.toHexString(sessionId); } } /** * A channel leave event. */ private static class LeaveEvent extends ChannelEvent { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; private final byte[] sessionId; /** * Constructs a leave event with the specified {@code session}. */ LeaveEvent(ClientSession session) { sessionId = getSessionIdBytes(session); } /** {@inheritDoc} */ public void serviceEvent(EventQueue eventQueue) { ClientSession session = (ClientSession) getObjectForId( new BigInteger(1, sessionId)); if (session == null) { logger.log( Level.FINE, "unable to obtain client session for ID:{0}", this); return; } final ChannelImpl channel = eventQueue.getChannel(); if (!channel.removeSession(session)) { return; } } /** {@inheritDoc} */ @Override public String toString() { return getClass().getName() + ": " + HexDumper.toHexString(sessionId); } } /** * A channel leaveAll event. */ private static class LeaveAllEvent extends ChannelEvent { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; /** * Constructs a leaveAll event. */ LeaveAllEvent() { } /** {@inheritDoc} */ public void serviceEvent(EventQueue eventQueue) { ChannelImpl channel = eventQueue.getChannel(); channel.removeAllSessions(); ChannelServiceImpl channelService = ChannelServiceImpl.getChannelService(); final byte[] channelIdBytes = channel.channelId; for (final long nodeId : channel.getChannelServerNodeIds()) { channelService.addChannelTask( eventQueue.getChannelRefId(), new IoRunnable() { public void run() throws IOException { ChannelServer server = getChannelServer(nodeId); if (server != null) { server.leaveAll(channelIdBytes); } }}, nodeId); } } /** {@inheritDoc} */ @Override public String toString() { return getClass().getName(); } } /** * A channel send event. */ private static class SendEvent extends ChannelEvent { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; private final byte[] message; /** The sender's session ID, or null. */ private final byte[] senderId; /** * Constructs a send event with the given {@code senderId} and * {@code message}. * * @param senderId a sender's session ID, or {@code null} * @param message a message */ SendEvent(byte[] senderId, byte[] message) { this.senderId = senderId; this.message = message; } /** {@inheritDoc} * * TBD: (optimization) this should handle sending * multiple messages to a given channel. Here, we * could peek at the next event in the queue, and if * it is a send, that event could be batched with this * send event. This could be repeated for multiple * send events appearing in the queue. */ public void serviceEvent(EventQueue eventQueue) { /* * Verfiy that the sending session (if any) is a member of this * channel. */ ChannelImpl channel = eventQueue.getChannel(); if (senderId != null) { ClientSession sender = (ClientSession) getObjectForId(new BigInteger(1, senderId)); if (sender == null || !channel.hasSession(sender)) { return; } } /* * Enqueue a channel task to forward the message to the * channel's servers for delivery. */ ChannelServiceImpl channelService = ChannelServiceImpl.getChannelService(); final byte[] channelIdBytes = channel.channelId; for (final long nodeId : channel.getChannelServerNodeIds()) { channelService.addChannelTask( eventQueue.getChannelRefId(), new IoRunnable() { public void run() throws IOException { ChannelServer server = getChannelServer(nodeId); if (server != null) { server.send(channelIdBytes, message); } }}, nodeId); } // TBD: need to add a task to update queue that all // channel servers have been notified of // the 'send'. } /** Use the message length as the cost for sending messages. */ @Override int getCost() { return message.length; } /** {@inheritDoc} */ @Override public String toString() { return getClass().getName(); } } /** * Returns the write buffer capacity for this channel. * * @return the write buffer capacity */ int getWriteBufferCapacity() { return writeBufferCapacity; } /** * A channel close event. */ private static class CloseEvent extends ChannelEvent { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; /** * Constructs a close event. */ CloseEvent() { } /** {@inheritDoc} */ public void serviceEvent(EventQueue eventQueue) { ChannelImpl channel = eventQueue.getChannel(); final BigInteger channelRefId = eventQueue.getChannelRefId(); channel.removeChannel(); final ChannelServiceImpl channelService = ChannelServiceImpl.getChannelService(); final byte[] channelIdBytes = channel.channelId; for (final long nodeId : channel.getChannelServerNodeIds()) { channelService.addChannelTask( channelRefId, new IoRunnable() { public void run() throws IOException { ChannelServer server = getChannelServer(nodeId); if (server != null) { server.close(channelIdBytes); } }}, nodeId); } channelService.addChannelTask( channelRefId, new AbstractKernelRunnable() { public void run() { channelService.closedChannel(channelRefId); }}); } /** {@inheritDoc} */ @Override public String toString() { return getClass().getName(); } } /** * Returns the event queue for the channel that has the specified * {@code channelId} and coordinator {@code nodeId}. */ private static EventQueue getEventQueue(long nodeId, byte[] channelId) { String eventQueueKey = getEventQueueKey(nodeId, channelId); DataService dataService = ChannelServiceImpl.getDataService(); try { return (EventQueue) dataService.getServiceBinding(eventQueueKey); } catch (NameNotBoundException e) { logger.logThrow( Level.WARNING, e, "Event queue binding:{0} does not exist", eventQueueKey); return null; } catch (ObjectNotFoundException e) { logger.logThrow( Level.SEVERE, e, "Event queue binding:{0} exists, but object is removed", eventQueueKey); throw e; } } /* -- Static method invoked by ChannelServiceImpl -- */ /** * Handles a channel {@code message} that the specified {@code session} * is sending on the channel with the specified {@code channelRefId}. * * @param channelRefId the channel ID, as a {@code BigInteger} * @param session the client session sending the channel message * @param message the channel message */ static void handleChannelMessage( BigInteger channelRefId, ClientSession session, ByteBuffer message) { assert session instanceof ClientSessionWrapper; ChannelImpl channel = (ChannelImpl) getObjectForId(channelRefId); if (channel != null) { channel.receivedMessage(session, message); } else { // Ignore message received for unknown channel. if (logger.isLoggable(Level.FINE)) { logger.log( Level.FINE, "Dropping message:{0}: from:{1} for unknown channel: {2}", HexDumper.format(message), session, HexDumper.toHexString(channelRefId.toByteArray())); } } } /** * Services the event queue for the channel with the specified {@code * channelId}. */ static void serviceEventQueue(byte[] channelId) { EventQueue eventQueue = getEventQueue(getLocalNodeId(), channelId); if (eventQueue != null) { eventQueue.serviceEvent(); } } /** * Returns the next service bound name after the given {@code key} that * starts with the given {@code prefix}, or {@code null} if there is none. */ private static String nextServiceBoundNameWithPrefix( DataService dataService, String key, String prefix) { String name = dataService.nextServiceBoundName(key); return (name != null && name.startsWith(prefix)) ? name : null; } /** * A persistent task to reassign channel coordinators on a failed node * to another node. In a single task, only one failed coordinator is * reassigned. A task for one coordinator schedules a task for the * next reassignment, if there are coordinators on the failed node left * to be reassigned. */ static class ReassignCoordinatorsTask implements Task, Serializable { /** The serialVersionUID for this class. */ private final static long serialVersionUID = 1L; /** The node ID of the failed node. */ private final long nodeId; /** * Constructs an instance of this class with the specified * {@code nodeId} of the failed node. */ ReassignCoordinatorsTask(long nodeId) { this.nodeId = nodeId; } /** * Reassigns the next coordinator for the {@code nodeId} to another * node with member sessions (or the local node if there are no * member sessions), schedules a task to remove failed sessions for * the channel, and then reschedules this task to reassign the next * coordinator. If there are no more coordinators for the * specified {@code nodeId}, then no action is taken. */ public void run() { WatchdogService watchdogService = ChannelServiceImpl.getWatchdogService(); DataService dataService = ChannelServiceImpl.getDataService(); TaskService taskService = ChannelServiceImpl.getTaskService(); String prefix = getEventQueuePrefix(nodeId); String key = nextServiceBoundNameWithPrefix( dataService, prefix, prefix); if (key == null) { return; } EventQueue eventQueue = (EventQueue) dataService.getServiceBinding(key); BigInteger channelRefId = eventQueue.getChannelRefId(); ChannelImpl channel = (ChannelImpl) getObjectForId(channelRefId); if (channel != null) { channel.reassignCoordinator(nodeId); byte[] channelId = channel.channelId; // Schedule a task to remove failed sessions for channel. taskService.scheduleTask( new RemoveFailedSessionsFromChannelTask( channelId, nodeId, channelRefId)); /* * If other channel servers have failed, remove their * sessions too. This covers the case where a channel * coordinator (informed of a node failure) fails before it * has a chance to schedule a task to remove member * sessions for another failed node (cascading failure * during recovery). */ for (long serverNodeId : channel.servers) { if (serverNodeId != nodeId) { Node serverNode = watchdogService.getNode(serverNodeId); if (serverNode == null || !serverNode.isAlive()) { taskService.scheduleTask( new RemoveFailedSessionsFromChannelTask( channelId, serverNodeId, channelRefId)); } } } } else { // channel removed, so just remove the service binding. dataService.removeServiceBinding(key); } // Schedule a task to reassign the next channel coordinator. taskService.scheduleTask(this); } } /** * A persistent task to remove sessions, connected to a failed node, * from locally coordinated channels. This task handles a single * locally-coordinated channel, and then schedules another task to * handle the next one. */ static class RemoveFailedSessionsFromLocalChannelsTask implements Task, Serializable { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; private String localNodePrefix; private String eventQueueKey; private final long failedNodeId; /** * Constructs an instance with the specified {@code localNodeId} * and {@code failedNodeId}. */ RemoveFailedSessionsFromLocalChannelsTask( long localNodeId, long failedNodeId) { this.localNodePrefix = getEventQueuePrefix(localNodeId); this.eventQueueKey = this.localNodePrefix; this.failedNodeId = failedNodeId; } /** * Finds the next locally-coordinated channel and schedules a * task to remove the failed sessions from that channel, and * reschedules this task to handle the next locally-coordinated * channel. If there are no more locally-coordinated channels, * then this task takes no action. */ public void run() { DataService dataService = ChannelServiceImpl.getDataService(); TaskService taskService = ChannelServiceImpl.getTaskService(); eventQueueKey = nextServiceBoundNameWithPrefix( dataService, eventQueueKey, localNodePrefix); if (eventQueueKey != null) { BigInteger channelRefId = getLastComponentAsBigInteger(eventQueueKey); taskService.scheduleTask( new RemoveFailedSessionsFromChannelTask( channelRefId.toByteArray(), failedNodeId, channelRefId)); // Schedule a task to remove failed sessions from next // locally coordinated channel. taskService.scheduleTask(this); } } } /** * A persistent task to remove all failed sessions (specified by the * {@code sessionPrefix} on a given node for a channel. In a single * task, only one failed session is removed from the channel. A task * for one session schedules a task for the next session to be removed * if there are sessions left to be removed. */ private static class RemoveFailedSessionsFromChannelTask implements Task, Serializable { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; private final String sessionPrefix; private String sessionKey; private final BigInteger channelRefId; private final long failedNodeId; /** Constructs an instance. */ RemoveFailedSessionsFromChannelTask( byte[] channelId, long failedNodeId, BigInteger channelRefId) { this.sessionPrefix = getSessionNodePrefix(channelId, failedNodeId); this.sessionKey = sessionPrefix; this.channelRefId = channelRefId; this.failedNodeId = failedNodeId; } /** {@inheritDoc} */ public void run() { DataService dataService = ChannelServiceImpl.getDataService(); sessionKey = nextServiceBoundNameWithPrefix( dataService, sessionKey, sessionPrefix); if (sessionKey != null) { ChannelImpl channel = (ChannelImpl) getObjectForId(channelRefId); if (channel != null) { BigInteger sessionRefId = getLastComponentAsBigInteger(sessionKey); channel.removeSession( failedNodeId, sessionRefId.toByteArray()); } else { // This shouldn't happen, but remove the binding anyway. channel.removeSessionBinding(sessionKey); } ChannelServiceImpl.getTaskService().scheduleTask(this); } } } /** * Returns the prefix for accessing channel sets for all sessions * connected to the node with the specified {@code nodeId}. The * prefix has the following form: * * com.sun.sgs.impl.service.channel. * set.<nodeId>. * * This method is only included to locate obsolete channel sets to be * removed. */ private static String getChannelSetPrefix(long nodeId) { return PKG_NAME + SET_COMPONENT + nodeId + "."; } /** * Obsolete {@code ChannelSet} representation. The serialized form is * here just so that obsolete channel sets can be removed by * {@code ChannelServiceImpl} upon recovery. */ private static class ChannelSet extends ClientSessionInfo { private final static long serialVersionUID = 1L; /** The set of channel IDs that the client session is a member of. */ private final Set<BigInteger> set = new HashSet<BigInteger>(); /** * Constructs an instance. This constructor is only present for * testing purposes. */ public ChannelSet(DataService dataService, ClientSession session) { super(dataService, session); } } /** * A task to remove any obsolete channel sets left over from previous * ChannelServiceImpl version. */ static class RemoveObsoleteChannelSetsTask implements Task, Serializable { /** The serialVersionUID for this class. */ private static final long serialVersionUID = 1L; private final long failedNodeId; /** * Constructs an instance. * @param failedNodeId the ID of the failed node */ RemoveObsoleteChannelSetsTask(long failedNodeId) { this.failedNodeId = failedNodeId; } /** {@inheritDoc} */ public void run() { DataService dataService = ChannelServiceImpl.getDataService(); String prefix = getChannelSetPrefix(failedNodeId); String key = nextServiceBoundNameWithPrefix(dataService, prefix, prefix); if (key != null) { try { ManagedObject channelSet = dataService.getServiceBinding(key); dataService.removeObject(channelSet); } catch (ObjectNotFoundException e) { logger.logThrow( Level.WARNING, e, "Cleaning up obsolete channel set:{0} throws", key); } dataService.removeServiceBinding(key); ChannelServiceImpl.getTaskService().scheduleTask(this); } } } /** * Returns a set containing session identifiers (as obtained by * {@link ManagedReference#getId ManagedReference.getId}) for all * sessions that are a member of the channel with the specified * {@code channelRefId} and are last known to have been connected * to node {@code nodeId}. */ static Set<BigInteger> getSessionRefIdsForNode( DataService dataService, BigInteger channelRefId, long nodeId) { Set<BigInteger> members = new HashSet<BigInteger>(); ChannelImpl channel = (ChannelImpl) getObjectForId(channelRefId); if (channel != null) { for (String sessionKey : BoundNamesUtil.getServiceBoundNamesIterable( dataService, channel.getSessionNodePrefix(channel.channelId, nodeId))) { BigInteger sessionRefId = getLastComponentAsBigInteger(sessionKey); members.add(sessionRefId); } } return members; } /** * Returns the last component of the given {@code key} as a BigInteger. */ private static BigInteger getLastComponentAsBigInteger(String key) { int index = key.lastIndexOf('.'); return new BigInteger(key.substring(index + 1), 16); } }
fb0a4f0bd4e5d4a38a783358c36f30563ad1e681
1c6b1b1a752dc28d3b6527f737d7b9b98b7fc779
/src/main/java/org/onnx4j/onnx/prototypes/OnnxProto3.java
d78e58efe64f5100c0128b1e3e7ff29229e35431
[ "Apache-2.0" ]
permissive
moxuyou/onnx4j
897762bb01c28de2b6d5a48675ae91a8639ef602
30985d80c3f1405f817be5927041f87732c2b874
refs/heads/master
2020-11-23T18:36:56.785721
2019-12-13T05:05:24
2019-12-13T05:05:24
227,770,868
1
0
null
2019-12-13T06:22:14
2019-12-13T06:22:13
null
UTF-8
Java
false
true
872,468
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: onnx.proto3 package org.onnx4j.onnx.prototypes; public final class OnnxProto3 { private OnnxProto3() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } /** * <pre> * Versioning * ONNX versioning is specified in docs/IR.md and elaborated on in docs/Versioning.md * To be compatible with both proto2 and proto3, we will use a version number * that is not defined by the default value but an explicit enum number. * </pre> * * Protobuf enum {@code onnx.Version} */ public enum Version implements com.google.protobuf.ProtocolMessageEnum { /** * <pre> * proto3 requires the first enum value to be zero. * We add this just to appease the compiler. * </pre> * * <code>_START_VERSION = 0;</code> */ _START_VERSION(0), /** * <pre> * The version field is always serialized and we will use it to store the * version that the graph is generated from. This helps us set up version * control. * For the IR, we are using simple numbers starting with with 0x00000001, * which was the version we published on Oct 10, 2017. * </pre> * * <code>IR_VERSION_2017_10_10 = 1;</code> */ IR_VERSION_2017_10_10(1), /** * <pre> * IR_VERSION 2 published on Oct 30, 2017 * - Added type discriminator to AttributeProto to support proto3 users * </pre> * * <code>IR_VERSION_2017_10_30 = 2;</code> */ IR_VERSION_2017_10_30(2), /** * <pre> * IR VERSION 3 published on Nov 3, 2017 * - For operator versioning: * - Added new message OperatorSetIdProto * - Added opset_import in ModelProto * - For vendor extensions, added domain in NodeProto * </pre> * * <code>IR_VERSION_2017_11_3 = 3;</code> */ IR_VERSION_2017_11_3(3), /** * <pre> * IR VERSION 4 published on Jan 22, 2019 * - Relax constraint that initializers should be a subset of graph inputs * - Add type BFLOAT16 * </pre> * * <code>IR_VERSION_2019_1_22 = 4;</code> */ IR_VERSION_2019_1_22(4), /** * <pre> * IR VERSION 5 published on March 18, 2019 * - Add message TensorAnnotation. * - Add quantization annotation in GraphProto to map tensor with its scale and zero point quantization parameters. * </pre> * * <code>IR_VERSION = 5;</code> */ IR_VERSION(5), UNRECOGNIZED(-1), ; /** * <pre> * proto3 requires the first enum value to be zero. * We add this just to appease the compiler. * </pre> * * <code>_START_VERSION = 0;</code> */ public static final int _START_VERSION_VALUE = 0; /** * <pre> * The version field is always serialized and we will use it to store the * version that the graph is generated from. This helps us set up version * control. * For the IR, we are using simple numbers starting with with 0x00000001, * which was the version we published on Oct 10, 2017. * </pre> * * <code>IR_VERSION_2017_10_10 = 1;</code> */ public static final int IR_VERSION_2017_10_10_VALUE = 1; /** * <pre> * IR_VERSION 2 published on Oct 30, 2017 * - Added type discriminator to AttributeProto to support proto3 users * </pre> * * <code>IR_VERSION_2017_10_30 = 2;</code> */ public static final int IR_VERSION_2017_10_30_VALUE = 2; /** * <pre> * IR VERSION 3 published on Nov 3, 2017 * - For operator versioning: * - Added new message OperatorSetIdProto * - Added opset_import in ModelProto * - For vendor extensions, added domain in NodeProto * </pre> * * <code>IR_VERSION_2017_11_3 = 3;</code> */ public static final int IR_VERSION_2017_11_3_VALUE = 3; /** * <pre> * IR VERSION 4 published on Jan 22, 2019 * - Relax constraint that initializers should be a subset of graph inputs * - Add type BFLOAT16 * </pre> * * <code>IR_VERSION_2019_1_22 = 4;</code> */ public static final int IR_VERSION_2019_1_22_VALUE = 4; /** * <pre> * IR VERSION 5 published on March 18, 2019 * - Add message TensorAnnotation. * - Add quantization annotation in GraphProto to map tensor with its scale and zero point quantization parameters. * </pre> * * <code>IR_VERSION = 5;</code> */ public static final int IR_VERSION_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; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static Version valueOf(int value) { return forNumber(value); } public static Version forNumber(int value) { switch (value) { case 0: return _START_VERSION; case 1: return IR_VERSION_2017_10_10; case 2: return IR_VERSION_2017_10_30; case 3: return IR_VERSION_2017_11_3; case 4: return IR_VERSION_2019_1_22; case 5: return IR_VERSION; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<Version> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< Version> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Version>() { public Version findValueByNumber(int number) { return Version.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 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 org.onnx4j.onnx.prototypes.OnnxProto3.getDescriptor().getEnumTypes().get(0); } private static final Version[] VALUES = values(); public static Version 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 Version(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:onnx.Version) } public interface AttributeProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.AttributeProto) com.google.protobuf.MessageOrBuilder { /** * <pre> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ java.lang.String getName(); /** * <pre> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ com.google.protobuf.ByteString getNameBytes(); /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ java.lang.String getRefAttrName(); /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ com.google.protobuf.ByteString getRefAttrNameBytes(); /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ java.lang.String getDocString(); /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ com.google.protobuf.ByteString getDocStringBytes(); /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ int getTypeValue(); /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType getType(); /** * <pre> * Exactly ONE of the following fields must be present for this version of the IR * </pre> * * <code>float f = 2;</code> */ float getF(); /** * <pre> * int * </pre> * * <code>int64 i = 3;</code> */ long getI(); /** * <pre> * UTF-8 string * </pre> * * <code>bytes s = 4;</code> */ com.google.protobuf.ByteString getS(); /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ boolean hasT(); /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getT(); /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getTOrBuilder(); /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ boolean hasG(); /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getG(); /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGOrBuilder(); /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ java.util.List<java.lang.Float> getFloatsList(); /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ int getFloatsCount(); /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ float getFloats(int index); /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ java.util.List<java.lang.Long> getIntsList(); /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ int getIntsCount(); /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ long getInts(int index); /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ java.util.List<com.google.protobuf.ByteString> getStringsList(); /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ int getStringsCount(); /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ com.google.protobuf.ByteString getStrings(int index); /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> getTensorsList(); /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getTensors(int index); /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ int getTensorsCount(); /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getTensorsOrBuilderList(); /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getTensorsOrBuilder( int index); /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto> getGraphsList(); /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getGraphs(int index); /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ int getGraphsCount(); /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> getGraphsOrBuilderList(); /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGraphsOrBuilder( int index); } /** * <pre> * Attributes * A named attribute containing either singular float, integer, string, graph, * and tensor values, or repeated float, integer, string, graph, and tensor values. * An AttributeProto MUST contain the name field, and *only one* of the * following content fields, effectively enforcing a C/C++ union equivalent. * </pre> * * Protobuf type {@code onnx.AttributeProto} */ public static final class AttributeProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.AttributeProto) AttributeProtoOrBuilder { private static final long serialVersionUID = 0L; // Use AttributeProto.newBuilder() to construct. private AttributeProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AttributeProto() { name_ = ""; refAttrName_ = ""; docString_ = ""; type_ = 0; s_ = com.google.protobuf.ByteString.EMPTY; floats_ = emptyFloatList(); ints_ = emptyLongList(); strings_ = java.util.Collections.emptyList(); tensors_ = java.util.Collections.emptyList(); graphs_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AttributeProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AttributeProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 21: { f_ = input.readFloat(); break; } case 24: { i_ = input.readInt64(); break; } case 34: { s_ = input.readBytes(); break; } case 42: { org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder subBuilder = null; if (t_ != null) { subBuilder = t_.toBuilder(); } t_ = input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(t_); t_ = subBuilder.buildPartial(); } break; } case 50: { org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder subBuilder = null; if (g_ != null) { subBuilder = g_.toBuilder(); } g_ = input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(g_); g_ = subBuilder.buildPartial(); } break; } case 61: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { floats_ = newFloatList(); mutable_bitField0_ |= 0x00000001; } floats_.addFloat(input.readFloat()); break; } case 58: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { floats_ = newFloatList(); mutable_bitField0_ |= 0x00000001; } while (input.getBytesUntilLimit() > 0) { floats_.addFloat(input.readFloat()); } input.popLimit(limit); break; } case 64: { if (!((mutable_bitField0_ & 0x00000002) != 0)) { ints_ = newLongList(); mutable_bitField0_ |= 0x00000002; } ints_.addLong(input.readInt64()); break; } case 66: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { ints_ = newLongList(); mutable_bitField0_ |= 0x00000002; } while (input.getBytesUntilLimit() > 0) { ints_.addLong(input.readInt64()); } input.popLimit(limit); break; } case 74: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { strings_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); mutable_bitField0_ |= 0x00000004; } strings_.add(input.readBytes()); break; } case 82: { if (!((mutable_bitField0_ & 0x00000008) != 0)) { tensors_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto>(); mutable_bitField0_ |= 0x00000008; } tensors_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.parser(), extensionRegistry)); break; } case 90: { if (!((mutable_bitField0_ & 0x00000010) != 0)) { graphs_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto>(); mutable_bitField0_ |= 0x00000010; } graphs_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.parser(), extensionRegistry)); break; } case 106: { java.lang.String s = input.readStringRequireUtf8(); docString_ = s; break; } case 160: { int rawValue = input.readEnum(); type_ = rawValue; break; } case 170: { java.lang.String s = input.readStringRequireUtf8(); refAttrName_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { floats_.makeImmutable(); // C } if (((mutable_bitField0_ & 0x00000002) != 0)) { ints_.makeImmutable(); // C } if (((mutable_bitField0_ & 0x00000004) != 0)) { strings_ = java.util.Collections.unmodifiableList(strings_); // C } if (((mutable_bitField0_ & 0x00000008) != 0)) { tensors_ = java.util.Collections.unmodifiableList(tensors_); } if (((mutable_bitField0_ & 0x00000010) != 0)) { graphs_ = java.util.Collections.unmodifiableList(graphs_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_AttributeProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_AttributeProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder.class); } /** * <pre> * Note: this enum is structurally identical to the OpSchema::AttrType * enum defined in schema.h. If you rev one, you likely need to rev the other. * </pre> * * Protobuf enum {@code onnx.AttributeProto.AttributeType} */ public enum AttributeType implements com.google.protobuf.ProtocolMessageEnum { /** * <code>UNDEFINED = 0;</code> */ UNDEFINED(0), /** * <code>FLOAT = 1;</code> */ FLOAT(1), /** * <code>INT = 2;</code> */ INT(2), /** * <code>STRING = 3;</code> */ STRING(3), /** * <code>TENSOR = 4;</code> */ TENSOR(4), /** * <code>GRAPH = 5;</code> */ GRAPH(5), /** * <code>FLOATS = 6;</code> */ FLOATS(6), /** * <code>INTS = 7;</code> */ INTS(7), /** * <code>STRINGS = 8;</code> */ STRINGS(8), /** * <code>TENSORS = 9;</code> */ TENSORS(9), /** * <code>GRAPHS = 10;</code> */ GRAPHS(10), UNRECOGNIZED(-1), ; /** * <code>UNDEFINED = 0;</code> */ public static final int UNDEFINED_VALUE = 0; /** * <code>FLOAT = 1;</code> */ public static final int FLOAT_VALUE = 1; /** * <code>INT = 2;</code> */ public static final int INT_VALUE = 2; /** * <code>STRING = 3;</code> */ public static final int STRING_VALUE = 3; /** * <code>TENSOR = 4;</code> */ public static final int TENSOR_VALUE = 4; /** * <code>GRAPH = 5;</code> */ public static final int GRAPH_VALUE = 5; /** * <code>FLOATS = 6;</code> */ public static final int FLOATS_VALUE = 6; /** * <code>INTS = 7;</code> */ public static final int INTS_VALUE = 7; /** * <code>STRINGS = 8;</code> */ public static final int STRINGS_VALUE = 8; /** * <code>TENSORS = 9;</code> */ public static final int TENSORS_VALUE = 9; /** * <code>GRAPHS = 10;</code> */ public static final int GRAPHS_VALUE = 10; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static AttributeType valueOf(int value) { return forNumber(value); } public static AttributeType forNumber(int value) { switch (value) { case 0: return UNDEFINED; case 1: return FLOAT; case 2: return INT; case 3: return STRING; case 4: return TENSOR; case 5: return GRAPH; case 6: return FLOATS; case 7: return INTS; case 8: return STRINGS; case 9: return TENSORS; case 10: return GRAPHS; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<AttributeType> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< AttributeType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<AttributeType>() { public AttributeType findValueByNumber(int number) { return AttributeType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 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 org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.getDescriptor().getEnumTypes().get(0); } private static final AttributeType[] VALUES = values(); public static AttributeType 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 AttributeType(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:onnx.AttributeProto.AttributeType) } public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** * <pre> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <pre> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int REF_ATTR_NAME_FIELD_NUMBER = 21; private volatile java.lang.Object refAttrName_; /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ public java.lang.String getRefAttrName() { java.lang.Object ref = refAttrName_; 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(); refAttrName_ = s; return s; } } /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ public com.google.protobuf.ByteString getRefAttrNameBytes() { java.lang.Object ref = refAttrName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); refAttrName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DOC_STRING_FIELD_NUMBER = 13; private volatile java.lang.Object docString_; /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; 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(); docString_ = s; return s; } } /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int TYPE_FIELD_NUMBER = 20; private int type_; /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ public int getTypeValue() { return type_; } /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType getType() { @SuppressWarnings("deprecation") org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType result = org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType.valueOf(type_); return result == null ? org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType.UNRECOGNIZED : result; } public static final int F_FIELD_NUMBER = 2; private float f_; /** * <pre> * Exactly ONE of the following fields must be present for this version of the IR * </pre> * * <code>float f = 2;</code> */ public float getF() { return f_; } public static final int I_FIELD_NUMBER = 3; private long i_; /** * <pre> * int * </pre> * * <code>int64 i = 3;</code> */ public long getI() { return i_; } public static final int S_FIELD_NUMBER = 4; private com.google.protobuf.ByteString s_; /** * <pre> * UTF-8 string * </pre> * * <code>bytes s = 4;</code> */ public com.google.protobuf.ByteString getS() { return s_; } public static final int T_FIELD_NUMBER = 5; private org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto t_; /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public boolean hasT() { return t_ != null; } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getT() { return t_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance() : t_; } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getTOrBuilder() { return getT(); } public static final int G_FIELD_NUMBER = 6; private org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto g_; /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public boolean hasG() { return g_ != null; } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getG() { return g_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance() : g_; } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGOrBuilder() { return getG(); } public static final int FLOATS_FIELD_NUMBER = 7; private com.google.protobuf.Internal.FloatList floats_; /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public java.util.List<java.lang.Float> getFloatsList() { return floats_; } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public int getFloatsCount() { return floats_.size(); } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public float getFloats(int index) { return floats_.getFloat(index); } private int floatsMemoizedSerializedSize = -1; public static final int INTS_FIELD_NUMBER = 8; private com.google.protobuf.Internal.LongList ints_; /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public java.util.List<java.lang.Long> getIntsList() { return ints_; } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public int getIntsCount() { return ints_.size(); } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public long getInts(int index) { return ints_.getLong(index); } private int intsMemoizedSerializedSize = -1; public static final int STRINGS_FIELD_NUMBER = 9; private java.util.List<com.google.protobuf.ByteString> strings_; /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public java.util.List<com.google.protobuf.ByteString> getStringsList() { return strings_; } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public int getStringsCount() { return strings_.size(); } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public com.google.protobuf.ByteString getStrings(int index) { return strings_.get(index); } public static final int TENSORS_FIELD_NUMBER = 10; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> tensors_; /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> getTensorsList() { return tensors_; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getTensorsOrBuilderList() { return tensors_; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public int getTensorsCount() { return tensors_.size(); } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getTensors(int index) { return tensors_.get(index); } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getTensorsOrBuilder( int index) { return tensors_.get(index); } public static final int GRAPHS_FIELD_NUMBER = 11; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto> graphs_; /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto> getGraphsList() { return graphs_; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> getGraphsOrBuilderList() { return graphs_; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public int getGraphsCount() { return graphs_.size(); } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getGraphs(int index) { return graphs_.get(index); } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGraphsOrBuilder( int index) { return graphs_.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 { getSerializedSize(); if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (f_ != 0F) { output.writeFloat(2, f_); } if (i_ != 0L) { output.writeInt64(3, i_); } if (!s_.isEmpty()) { output.writeBytes(4, s_); } if (t_ != null) { output.writeMessage(5, getT()); } if (g_ != null) { output.writeMessage(6, getG()); } if (getFloatsList().size() > 0) { output.writeUInt32NoTag(58); output.writeUInt32NoTag(floatsMemoizedSerializedSize); } for (int i = 0; i < floats_.size(); i++) { output.writeFloatNoTag(floats_.getFloat(i)); } if (getIntsList().size() > 0) { output.writeUInt32NoTag(66); output.writeUInt32NoTag(intsMemoizedSerializedSize); } for (int i = 0; i < ints_.size(); i++) { output.writeInt64NoTag(ints_.getLong(i)); } for (int i = 0; i < strings_.size(); i++) { output.writeBytes(9, strings_.get(i)); } for (int i = 0; i < tensors_.size(); i++) { output.writeMessage(10, tensors_.get(i)); } for (int i = 0; i < graphs_.size(); i++) { output.writeMessage(11, graphs_.get(i)); } if (!getDocStringBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 13, docString_); } if (type_ != org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType.UNDEFINED.getNumber()) { output.writeEnum(20, type_); } if (!getRefAttrNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 21, refAttrName_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (f_ != 0F) { size += com.google.protobuf.CodedOutputStream .computeFloatSize(2, f_); } if (i_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, i_); } if (!s_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(4, s_); } if (t_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getT()); } if (g_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, getG()); } { int dataSize = 0; dataSize = 4 * getFloatsList().size(); size += dataSize; if (!getFloatsList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(dataSize); } floatsMemoizedSerializedSize = dataSize; } { int dataSize = 0; for (int i = 0; i < ints_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeInt64SizeNoTag(ints_.getLong(i)); } size += dataSize; if (!getIntsList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(dataSize); } intsMemoizedSerializedSize = dataSize; } { int dataSize = 0; for (int i = 0; i < strings_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(strings_.get(i)); } size += dataSize; size += 1 * getStringsList().size(); } for (int i = 0; i < tensors_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(10, tensors_.get(i)); } for (int i = 0; i < graphs_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(11, graphs_.get(i)); } if (!getDocStringBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, docString_); } if (type_ != org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType.UNDEFINED.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(20, type_); } if (!getRefAttrNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, refAttrName_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto) obj; if (!getName() .equals(other.getName())) return false; if (!getRefAttrName() .equals(other.getRefAttrName())) return false; if (!getDocString() .equals(other.getDocString())) return false; if (type_ != other.type_) return false; if (java.lang.Float.floatToIntBits(getF()) != java.lang.Float.floatToIntBits( other.getF())) return false; if (getI() != other.getI()) return false; if (!getS() .equals(other.getS())) return false; if (hasT() != other.hasT()) return false; if (hasT()) { if (!getT() .equals(other.getT())) return false; } if (hasG() != other.hasG()) return false; if (hasG()) { if (!getG() .equals(other.getG())) return false; } if (!getFloatsList() .equals(other.getFloatsList())) return false; if (!getIntsList() .equals(other.getIntsList())) return false; if (!getStringsList() .equals(other.getStringsList())) return false; if (!getTensorsList() .equals(other.getTensorsList())) return false; if (!getGraphsList() .equals(other.getGraphsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + REF_ATTR_NAME_FIELD_NUMBER; hash = (53 * hash) + getRefAttrName().hashCode(); hash = (37 * hash) + DOC_STRING_FIELD_NUMBER; hash = (53 * hash) + getDocString().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; hash = (37 * hash) + F_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits( getF()); hash = (37 * hash) + I_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getI()); hash = (37 * hash) + S_FIELD_NUMBER; hash = (53 * hash) + getS().hashCode(); if (hasT()) { hash = (37 * hash) + T_FIELD_NUMBER; hash = (53 * hash) + getT().hashCode(); } if (hasG()) { hash = (37 * hash) + G_FIELD_NUMBER; hash = (53 * hash) + getG().hashCode(); } if (getFloatsCount() > 0) { hash = (37 * hash) + FLOATS_FIELD_NUMBER; hash = (53 * hash) + getFloatsList().hashCode(); } if (getIntsCount() > 0) { hash = (37 * hash) + INTS_FIELD_NUMBER; hash = (53 * hash) + getIntsList().hashCode(); } if (getStringsCount() > 0) { hash = (37 * hash) + STRINGS_FIELD_NUMBER; hash = (53 * hash) + getStringsList().hashCode(); } if (getTensorsCount() > 0) { hash = (37 * hash) + TENSORS_FIELD_NUMBER; hash = (53 * hash) + getTensorsList().hashCode(); } if (getGraphsCount() > 0) { hash = (37 * hash) + GRAPHS_FIELD_NUMBER; hash = (53 * hash) + getGraphsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto 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> * Attributes * A named attribute containing either singular float, integer, string, graph, * and tensor values, or repeated float, integer, string, graph, and tensor values. * An AttributeProto MUST contain the name field, and *only one* of the * following content fields, effectively enforcing a C/C++ union equivalent. * </pre> * * Protobuf type {@code onnx.AttributeProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.AttributeProto) org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_AttributeProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_AttributeProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder.class); } // Construct using onnx.OnnxProto3.AttributeProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTensorsFieldBuilder(); getGraphsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); name_ = ""; refAttrName_ = ""; docString_ = ""; type_ = 0; f_ = 0F; i_ = 0L; s_ = com.google.protobuf.ByteString.EMPTY; if (tBuilder_ == null) { t_ = null; } else { t_ = null; tBuilder_ = null; } if (gBuilder_ == null) { g_ = null; } else { g_ = null; gBuilder_ = null; } floats_ = emptyFloatList(); bitField0_ = (bitField0_ & ~0x00000001); ints_ = emptyLongList(); bitField0_ = (bitField0_ & ~0x00000002); strings_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); if (tensorsBuilder_ == null) { tensors_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); } else { tensorsBuilder_.clear(); } if (graphsBuilder_ == null) { graphs_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); } else { graphsBuilder_.clear(); } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_AttributeProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto(this); int from_bitField0_ = bitField0_; result.name_ = name_; result.refAttrName_ = refAttrName_; result.docString_ = docString_; result.type_ = type_; result.f_ = f_; result.i_ = i_; result.s_ = s_; if (tBuilder_ == null) { result.t_ = t_; } else { result.t_ = tBuilder_.build(); } if (gBuilder_ == null) { result.g_ = g_; } else { result.g_ = gBuilder_.build(); } if (((bitField0_ & 0x00000001) != 0)) { floats_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000001); } result.floats_ = floats_; if (((bitField0_ & 0x00000002) != 0)) { ints_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000002); } result.ints_ = ints_; if (((bitField0_ & 0x00000004) != 0)) { strings_ = java.util.Collections.unmodifiableList(strings_); bitField0_ = (bitField0_ & ~0x00000004); } result.strings_ = strings_; if (tensorsBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0)) { tensors_ = java.util.Collections.unmodifiableList(tensors_); bitField0_ = (bitField0_ & ~0x00000008); } result.tensors_ = tensors_; } else { result.tensors_ = tensorsBuilder_.build(); } if (graphsBuilder_ == null) { if (((bitField0_ & 0x00000010) != 0)) { graphs_ = java.util.Collections.unmodifiableList(graphs_); bitField0_ = (bitField0_ & ~0x00000010); } result.graphs_ = graphs_; } else { result.graphs_ = graphsBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getRefAttrName().isEmpty()) { refAttrName_ = other.refAttrName_; onChanged(); } if (!other.getDocString().isEmpty()) { docString_ = other.docString_; onChanged(); } if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } if (other.getF() != 0F) { setF(other.getF()); } if (other.getI() != 0L) { setI(other.getI()); } if (other.getS() != com.google.protobuf.ByteString.EMPTY) { setS(other.getS()); } if (other.hasT()) { mergeT(other.getT()); } if (other.hasG()) { mergeG(other.getG()); } if (!other.floats_.isEmpty()) { if (floats_.isEmpty()) { floats_ = other.floats_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureFloatsIsMutable(); floats_.addAll(other.floats_); } onChanged(); } if (!other.ints_.isEmpty()) { if (ints_.isEmpty()) { ints_ = other.ints_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureIntsIsMutable(); ints_.addAll(other.ints_); } onChanged(); } if (!other.strings_.isEmpty()) { if (strings_.isEmpty()) { strings_ = other.strings_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureStringsIsMutable(); strings_.addAll(other.strings_); } onChanged(); } if (tensorsBuilder_ == null) { if (!other.tensors_.isEmpty()) { if (tensors_.isEmpty()) { tensors_ = other.tensors_; bitField0_ = (bitField0_ & ~0x00000008); } else { ensureTensorsIsMutable(); tensors_.addAll(other.tensors_); } onChanged(); } } else { if (!other.tensors_.isEmpty()) { if (tensorsBuilder_.isEmpty()) { tensorsBuilder_.dispose(); tensorsBuilder_ = null; tensors_ = other.tensors_; bitField0_ = (bitField0_ & ~0x00000008); tensorsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTensorsFieldBuilder() : null; } else { tensorsBuilder_.addAllMessages(other.tensors_); } } } if (graphsBuilder_ == null) { if (!other.graphs_.isEmpty()) { if (graphs_.isEmpty()) { graphs_ = other.graphs_; bitField0_ = (bitField0_ & ~0x00000010); } else { ensureGraphsIsMutable(); graphs_.addAll(other.graphs_); } onChanged(); } } else { if (!other.graphs_.isEmpty()) { if (graphsBuilder_.isEmpty()) { graphsBuilder_.dispose(); graphsBuilder_ = null; graphs_ = other.graphs_; bitField0_ = (bitField0_ & ~0x00000010); graphsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getGraphsFieldBuilder() : null; } else { graphsBuilder_.addAllMessages(other.graphs_); } } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private java.lang.Object name_ = ""; /** * <pre> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ 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> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * <pre> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * <pre> * The name field MUST be present for this version of the IR. * </pre> * * <code>string name = 1;</code> */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private java.lang.Object refAttrName_ = ""; /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ public java.lang.String getRefAttrName() { java.lang.Object ref = refAttrName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); refAttrName_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ public com.google.protobuf.ByteString getRefAttrNameBytes() { java.lang.Object ref = refAttrName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); refAttrName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ public Builder setRefAttrName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } refAttrName_ = value; onChanged(); return this; } /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ public Builder clearRefAttrName() { refAttrName_ = getDefaultInstance().getRefAttrName(); onChanged(); return this; } /** * <pre> * if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function. * In this case, this AttributeProto does not contain data, and it's a reference of attribute * in parent scope. * NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. * </pre> * * <code>string ref_attr_name = 21;</code> */ public Builder setRefAttrNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); refAttrName_ = value; onChanged(); return this; } private java.lang.Object docString_ = ""; /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); docString_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ public Builder setDocString( java.lang.String value) { if (value == null) { throw new NullPointerException(); } docString_ = value; onChanged(); return this; } /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ public Builder clearDocString() { docString_ = getDefaultInstance().getDocString(); onChanged(); return this; } /** * <pre> * A human-readable documentation for this attribute. Markdown is allowed. * </pre> * * <code>string doc_string = 13;</code> */ public Builder setDocStringBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); docString_ = value; onChanged(); return this; } private int type_ = 0; /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ public int getTypeValue() { return type_; } /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ public Builder setTypeValue(int value) { type_ = value; onChanged(); return this; } /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType getType() { @SuppressWarnings("deprecation") org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType result = org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType.valueOf(type_); return result == null ? org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType.UNRECOGNIZED : result; } /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ public Builder setType(org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.AttributeType value) { if (value == null) { throw new NullPointerException(); } type_ = value.getNumber(); onChanged(); return this; } /** * <pre> * The type field MUST be present for this version of the IR. * For 0.0.1 versions of the IR, this field was not defined, and * implementations needed to use has_field hueristics to determine * which value field was in use. For IR_VERSION 0.0.2 or later, this * field MUST be set and match the f|i|s|t|... field in use. This * change was made to accomodate proto3 implementations. * </pre> * * <code>.onnx.AttributeProto.AttributeType type = 20;</code> */ public Builder clearType() { type_ = 0; onChanged(); return this; } private float f_ ; /** * <pre> * Exactly ONE of the following fields must be present for this version of the IR * </pre> * * <code>float f = 2;</code> */ public float getF() { return f_; } /** * <pre> * Exactly ONE of the following fields must be present for this version of the IR * </pre> * * <code>float f = 2;</code> */ public Builder setF(float value) { f_ = value; onChanged(); return this; } /** * <pre> * Exactly ONE of the following fields must be present for this version of the IR * </pre> * * <code>float f = 2;</code> */ public Builder clearF() { f_ = 0F; onChanged(); return this; } private long i_ ; /** * <pre> * int * </pre> * * <code>int64 i = 3;</code> */ public long getI() { return i_; } /** * <pre> * int * </pre> * * <code>int64 i = 3;</code> */ public Builder setI(long value) { i_ = value; onChanged(); return this; } /** * <pre> * int * </pre> * * <code>int64 i = 3;</code> */ public Builder clearI() { i_ = 0L; onChanged(); return this; } private com.google.protobuf.ByteString s_ = com.google.protobuf.ByteString.EMPTY; /** * <pre> * UTF-8 string * </pre> * * <code>bytes s = 4;</code> */ public com.google.protobuf.ByteString getS() { return s_; } /** * <pre> * UTF-8 string * </pre> * * <code>bytes s = 4;</code> */ public Builder setS(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } s_ = value; onChanged(); return this; } /** * <pre> * UTF-8 string * </pre> * * <code>bytes s = 4;</code> */ public Builder clearS() { s_ = getDefaultInstance().getS(); onChanged(); return this; } private org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto t_; private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> tBuilder_; /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public boolean hasT() { return tBuilder_ != null || t_ != null; } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getT() { if (tBuilder_ == null) { return t_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance() : t_; } else { return tBuilder_.getMessage(); } } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public Builder setT(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto value) { if (tBuilder_ == null) { if (value == null) { throw new NullPointerException(); } t_ = value; onChanged(); } else { tBuilder_.setMessage(value); } return this; } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public Builder setT( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder builderForValue) { if (tBuilder_ == null) { t_ = builderForValue.build(); onChanged(); } else { tBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public Builder mergeT(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto value) { if (tBuilder_ == null) { if (t_ != null) { t_ = org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.newBuilder(t_).mergeFrom(value).buildPartial(); } else { t_ = value; } onChanged(); } else { tBuilder_.mergeFrom(value); } return this; } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public Builder clearT() { if (tBuilder_ == null) { t_ = null; onChanged(); } else { t_ = null; tBuilder_ = null; } return this; } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder getTBuilder() { onChanged(); return getTFieldBuilder().getBuilder(); } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getTOrBuilder() { if (tBuilder_ != null) { return tBuilder_.getMessageOrBuilder(); } else { return t_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance() : t_; } } /** * <pre> * tensor value * </pre> * * <code>.onnx.TensorProto t = 5;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getTFieldBuilder() { if (tBuilder_ == null) { tBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder>( getT(), getParentForChildren(), isClean()); t_ = null; } return tBuilder_; } private org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto g_; private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> gBuilder_; /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public boolean hasG() { return gBuilder_ != null || g_ != null; } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getG() { if (gBuilder_ == null) { return g_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance() : g_; } else { return gBuilder_.getMessage(); } } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public Builder setG(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto value) { if (gBuilder_ == null) { if (value == null) { throw new NullPointerException(); } g_ = value; onChanged(); } else { gBuilder_.setMessage(value); } return this; } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public Builder setG( org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder builderForValue) { if (gBuilder_ == null) { g_ = builderForValue.build(); onChanged(); } else { gBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public Builder mergeG(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto value) { if (gBuilder_ == null) { if (g_ != null) { g_ = org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.newBuilder(g_).mergeFrom(value).buildPartial(); } else { g_ = value; } onChanged(); } else { gBuilder_.mergeFrom(value); } return this; } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public Builder clearG() { if (gBuilder_ == null) { g_ = null; onChanged(); } else { g_ = null; gBuilder_ = null; } return this; } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder getGBuilder() { onChanged(); return getGFieldBuilder().getBuilder(); } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGOrBuilder() { if (gBuilder_ != null) { return gBuilder_.getMessageOrBuilder(); } else { return g_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance() : g_; } } /** * <pre> * graph * </pre> * * <code>.onnx.GraphProto g = 6;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> getGFieldBuilder() { if (gBuilder_ == null) { gBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder>( getG(), getParentForChildren(), isClean()); g_ = null; } return gBuilder_; } private com.google.protobuf.Internal.FloatList floats_ = emptyFloatList(); private void ensureFloatsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { floats_ = mutableCopy(floats_); bitField0_ |= 0x00000001; } } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public java.util.List<java.lang.Float> getFloatsList() { return ((bitField0_ & 0x00000001) != 0) ? java.util.Collections.unmodifiableList(floats_) : floats_; } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public int getFloatsCount() { return floats_.size(); } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public float getFloats(int index) { return floats_.getFloat(index); } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public Builder setFloats( int index, float value) { ensureFloatsIsMutable(); floats_.setFloat(index, value); onChanged(); return this; } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public Builder addFloats(float value) { ensureFloatsIsMutable(); floats_.addFloat(value); onChanged(); return this; } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public Builder addAllFloats( java.lang.Iterable<? extends java.lang.Float> values) { ensureFloatsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, floats_); onChanged(); return this; } /** * <pre> * list of floats * </pre> * * <code>repeated float floats = 7;</code> */ public Builder clearFloats() { floats_ = emptyFloatList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } private com.google.protobuf.Internal.LongList ints_ = emptyLongList(); private void ensureIntsIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { ints_ = mutableCopy(ints_); bitField0_ |= 0x00000002; } } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public java.util.List<java.lang.Long> getIntsList() { return ((bitField0_ & 0x00000002) != 0) ? java.util.Collections.unmodifiableList(ints_) : ints_; } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public int getIntsCount() { return ints_.size(); } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public long getInts(int index) { return ints_.getLong(index); } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public Builder setInts( int index, long value) { ensureIntsIsMutable(); ints_.setLong(index, value); onChanged(); return this; } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public Builder addInts(long value) { ensureIntsIsMutable(); ints_.addLong(value); onChanged(); return this; } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public Builder addAllInts( java.lang.Iterable<? extends java.lang.Long> values) { ensureIntsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, ints_); onChanged(); return this; } /** * <pre> * list of ints * </pre> * * <code>repeated int64 ints = 8;</code> */ public Builder clearInts() { ints_ = emptyLongList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } private java.util.List<com.google.protobuf.ByteString> strings_ = java.util.Collections.emptyList(); private void ensureStringsIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { strings_ = new java.util.ArrayList<com.google.protobuf.ByteString>(strings_); bitField0_ |= 0x00000004; } } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public java.util.List<com.google.protobuf.ByteString> getStringsList() { return ((bitField0_ & 0x00000004) != 0) ? java.util.Collections.unmodifiableList(strings_) : strings_; } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public int getStringsCount() { return strings_.size(); } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public com.google.protobuf.ByteString getStrings(int index) { return strings_.get(index); } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public Builder setStrings( int index, com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureStringsIsMutable(); strings_.set(index, value); onChanged(); return this; } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public Builder addStrings(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureStringsIsMutable(); strings_.add(value); onChanged(); return this; } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public Builder addAllStrings( java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { ensureStringsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, strings_); onChanged(); return this; } /** * <pre> * list of UTF-8 strings * </pre> * * <code>repeated bytes strings = 9;</code> */ public Builder clearStrings() { strings_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> tensors_ = java.util.Collections.emptyList(); private void ensureTensorsIsMutable() { if (!((bitField0_ & 0x00000008) != 0)) { tensors_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto>(tensors_); bitField0_ |= 0x00000008; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> tensorsBuilder_; /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> getTensorsList() { if (tensorsBuilder_ == null) { return java.util.Collections.unmodifiableList(tensors_); } else { return tensorsBuilder_.getMessageList(); } } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public int getTensorsCount() { if (tensorsBuilder_ == null) { return tensors_.size(); } else { return tensorsBuilder_.getCount(); } } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getTensors(int index) { if (tensorsBuilder_ == null) { return tensors_.get(index); } else { return tensorsBuilder_.getMessage(index); } } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder setTensors( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto value) { if (tensorsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTensorsIsMutable(); tensors_.set(index, value); onChanged(); } else { tensorsBuilder_.setMessage(index, value); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder setTensors( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder builderForValue) { if (tensorsBuilder_ == null) { ensureTensorsIsMutable(); tensors_.set(index, builderForValue.build()); onChanged(); } else { tensorsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder addTensors(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto value) { if (tensorsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTensorsIsMutable(); tensors_.add(value); onChanged(); } else { tensorsBuilder_.addMessage(value); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder addTensors( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto value) { if (tensorsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTensorsIsMutable(); tensors_.add(index, value); onChanged(); } else { tensorsBuilder_.addMessage(index, value); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder addTensors( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder builderForValue) { if (tensorsBuilder_ == null) { ensureTensorsIsMutable(); tensors_.add(builderForValue.build()); onChanged(); } else { tensorsBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder addTensors( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder builderForValue) { if (tensorsBuilder_ == null) { ensureTensorsIsMutable(); tensors_.add(index, builderForValue.build()); onChanged(); } else { tensorsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder addAllTensors( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> values) { if (tensorsBuilder_ == null) { ensureTensorsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, tensors_); onChanged(); } else { tensorsBuilder_.addAllMessages(values); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder clearTensors() { if (tensorsBuilder_ == null) { tensors_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { tensorsBuilder_.clear(); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public Builder removeTensors(int index) { if (tensorsBuilder_ == null) { ensureTensorsIsMutable(); tensors_.remove(index); onChanged(); } else { tensorsBuilder_.remove(index); } return this; } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder getTensorsBuilder( int index) { return getTensorsFieldBuilder().getBuilder(index); } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getTensorsOrBuilder( int index) { if (tensorsBuilder_ == null) { return tensors_.get(index); } else { return tensorsBuilder_.getMessageOrBuilder(index); } } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getTensorsOrBuilderList() { if (tensorsBuilder_ != null) { return tensorsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(tensors_); } } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder addTensorsBuilder() { return getTensorsFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance()); } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder addTensorsBuilder( int index) { return getTensorsFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance()); } /** * <pre> * list of tensors * </pre> * * <code>repeated .onnx.TensorProto tensors = 10;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder> getTensorsBuilderList() { return getTensorsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getTensorsFieldBuilder() { if (tensorsBuilder_ == null) { tensorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder>( tensors_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); tensors_ = null; } return tensorsBuilder_; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto> graphs_ = java.util.Collections.emptyList(); private void ensureGraphsIsMutable() { if (!((bitField0_ & 0x00000010) != 0)) { graphs_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto>(graphs_); bitField0_ |= 0x00000010; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> graphsBuilder_; /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto> getGraphsList() { if (graphsBuilder_ == null) { return java.util.Collections.unmodifiableList(graphs_); } else { return graphsBuilder_.getMessageList(); } } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public int getGraphsCount() { if (graphsBuilder_ == null) { return graphs_.size(); } else { return graphsBuilder_.getCount(); } } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getGraphs(int index) { if (graphsBuilder_ == null) { return graphs_.get(index); } else { return graphsBuilder_.getMessage(index); } } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder setGraphs( int index, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto value) { if (graphsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureGraphsIsMutable(); graphs_.set(index, value); onChanged(); } else { graphsBuilder_.setMessage(index, value); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder setGraphs( int index, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder builderForValue) { if (graphsBuilder_ == null) { ensureGraphsIsMutable(); graphs_.set(index, builderForValue.build()); onChanged(); } else { graphsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder addGraphs(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto value) { if (graphsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureGraphsIsMutable(); graphs_.add(value); onChanged(); } else { graphsBuilder_.addMessage(value); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder addGraphs( int index, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto value) { if (graphsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureGraphsIsMutable(); graphs_.add(index, value); onChanged(); } else { graphsBuilder_.addMessage(index, value); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder addGraphs( org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder builderForValue) { if (graphsBuilder_ == null) { ensureGraphsIsMutable(); graphs_.add(builderForValue.build()); onChanged(); } else { graphsBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder addGraphs( int index, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder builderForValue) { if (graphsBuilder_ == null) { ensureGraphsIsMutable(); graphs_.add(index, builderForValue.build()); onChanged(); } else { graphsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder addAllGraphs( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto> values) { if (graphsBuilder_ == null) { ensureGraphsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, graphs_); onChanged(); } else { graphsBuilder_.addAllMessages(values); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder clearGraphs() { if (graphsBuilder_ == null) { graphs_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { graphsBuilder_.clear(); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public Builder removeGraphs(int index) { if (graphsBuilder_ == null) { ensureGraphsIsMutable(); graphs_.remove(index); onChanged(); } else { graphsBuilder_.remove(index); } return this; } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder getGraphsBuilder( int index) { return getGraphsFieldBuilder().getBuilder(index); } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGraphsOrBuilder( int index) { if (graphsBuilder_ == null) { return graphs_.get(index); } else { return graphsBuilder_.getMessageOrBuilder(index); } } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> getGraphsOrBuilderList() { if (graphsBuilder_ != null) { return graphsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(graphs_); } } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder addGraphsBuilder() { return getGraphsFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance()); } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder addGraphsBuilder( int index) { return getGraphsFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance()); } /** * <pre> * list of graph * </pre> * * <code>repeated .onnx.GraphProto graphs = 11;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder> getGraphsBuilderList() { return getGraphsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> getGraphsFieldBuilder() { if (graphsBuilder_ == null) { graphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder>( graphs_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); graphs_ = null; } return graphsBuilder_; } @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:onnx.AttributeProto) } // @@protoc_insertion_point(class_scope:onnx.AttributeProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AttributeProto> PARSER = new com.google.protobuf.AbstractParser<AttributeProto>() { @java.lang.Override public AttributeProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AttributeProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AttributeProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AttributeProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface ValueInfoProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.ValueInfoProto) com.google.protobuf.MessageOrBuilder { /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ java.lang.String getName(); /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ com.google.protobuf.ByteString getNameBytes(); /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ boolean hasType(); /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto getType(); /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TypeProtoOrBuilder getTypeOrBuilder(); /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ java.lang.String getDocString(); /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ com.google.protobuf.ByteString getDocStringBytes(); } /** * <pre> * Defines information on value, including the name, the type, and * the shape of the value. * </pre> * * Protobuf type {@code onnx.ValueInfoProto} */ public static final class ValueInfoProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.ValueInfoProto) ValueInfoProtoOrBuilder { private static final long serialVersionUID = 0L; // Use ValueInfoProto.newBuilder() to construct. private ValueInfoProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ValueInfoProto() { name_ = ""; docString_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new ValueInfoProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private ValueInfoProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 18: { org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Builder subBuilder = null; if (type_ != null) { subBuilder = type_.toBuilder(); } type_ = input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(type_); type_ = subBuilder.buildPartial(); } break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); docString_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ValueInfoProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ValueInfoProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int TYPE_FIELD_NUMBER = 2; private org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto type_; /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public boolean hasType() { return type_ != null; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto getType() { return type_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.getDefaultInstance() : type_; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProtoOrBuilder getTypeOrBuilder() { return getType(); } public static final int DOC_STRING_FIELD_NUMBER = 3; private volatile java.lang.Object docString_; /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; 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(); docString_ = s; return s; } } /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = 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 (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (type_ != null) { output.writeMessage(2, getType()); } if (!getDocStringBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, docString_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (type_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getType()); } if (!getDocStringBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, docString_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto) obj; if (!getName() .equals(other.getName())) return false; if (hasType() != other.hasType()) return false; if (hasType()) { if (!getType() .equals(other.getType())) return false; } if (!getDocString() .equals(other.getDocString())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasType()) { hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + getType().hashCode(); } hash = (37 * hash) + DOC_STRING_FIELD_NUMBER; hash = (53 * hash) + getDocString().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto 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> * Defines information on value, including the name, the type, and * the shape of the value. * </pre> * * Protobuf type {@code onnx.ValueInfoProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.ValueInfoProto) org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ValueInfoProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ValueInfoProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder.class); } // Construct using onnx.OnnxProto3.ValueInfoProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); name_ = ""; if (typeBuilder_ == null) { type_ = null; } else { type_ = null; typeBuilder_ = null; } docString_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ValueInfoProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto(this); result.name_ = name_; if (typeBuilder_ == null) { result.type_ = type_; } else { result.type_ = typeBuilder_.build(); } result.docString_ = docString_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasType()) { mergeType(other.getType()); } if (!other.getDocString().isEmpty()) { docString_ = other.docString_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object name_ = ""; /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ 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> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>string name = 1;</code> */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto type_; private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProtoOrBuilder> typeBuilder_; /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public boolean hasType() { return typeBuilder_ != null || type_ != null; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto getType() { if (typeBuilder_ == null) { return type_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.getDefaultInstance() : type_; } else { return typeBuilder_.getMessage(); } } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public Builder setType(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto value) { if (typeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } type_ = value; onChanged(); } else { typeBuilder_.setMessage(value); } return this; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public Builder setType( org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Builder builderForValue) { if (typeBuilder_ == null) { type_ = builderForValue.build(); onChanged(); } else { typeBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public Builder mergeType(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto value) { if (typeBuilder_ == null) { if (type_ != null) { type_ = org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.newBuilder(type_).mergeFrom(value).buildPartial(); } else { type_ = value; } onChanged(); } else { typeBuilder_.mergeFrom(value); } return this; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public Builder clearType() { if (typeBuilder_ == null) { type_ = null; onChanged(); } else { type_ = null; typeBuilder_ = null; } return this; } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Builder getTypeBuilder() { onChanged(); return getTypeFieldBuilder().getBuilder(); } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProtoOrBuilder getTypeOrBuilder() { if (typeBuilder_ != null) { return typeBuilder_.getMessageOrBuilder(); } else { return type_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.getDefaultInstance() : type_; } } /** * <pre> * This field MUST be present in this version of the IR. * </pre> * * <code>.onnx.TypeProto type = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProtoOrBuilder> getTypeFieldBuilder() { if (typeBuilder_ == null) { typeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProtoOrBuilder>( getType(), getParentForChildren(), isClean()); type_ = null; } return typeBuilder_; } private java.lang.Object docString_ = ""; /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); docString_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ public Builder setDocString( java.lang.String value) { if (value == null) { throw new NullPointerException(); } docString_ = value; onChanged(); return this; } /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ public Builder clearDocString() { docString_ = getDefaultInstance().getDocString(); onChanged(); return this; } /** * <pre> * A human-readable documentation for this value. Markdown is allowed. * </pre> * * <code>string doc_string = 3;</code> */ public Builder setDocStringBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); docString_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:onnx.ValueInfoProto) } // @@protoc_insertion_point(class_scope:onnx.ValueInfoProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ValueInfoProto> PARSER = new com.google.protobuf.AbstractParser<ValueInfoProto>() { @java.lang.Override public ValueInfoProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ValueInfoProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<ValueInfoProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ValueInfoProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface NodeProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.NodeProto) com.google.protobuf.MessageOrBuilder { /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ java.util.List<java.lang.String> getInputList(); /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ int getInputCount(); /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ java.lang.String getInput(int index); /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ com.google.protobuf.ByteString getInputBytes(int index); /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ java.util.List<java.lang.String> getOutputList(); /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ int getOutputCount(); /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ java.lang.String getOutput(int index); /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ com.google.protobuf.ByteString getOutputBytes(int index); /** * <pre> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ java.lang.String getName(); /** * <pre> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ com.google.protobuf.ByteString getNameBytes(); /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ java.lang.String getOpType(); /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ com.google.protobuf.ByteString getOpTypeBytes(); /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ java.lang.String getDomain(); /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ com.google.protobuf.ByteString getDomainBytes(); /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto> getAttributeList(); /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto getAttribute(int index); /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ int getAttributeCount(); /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder> getAttributeOrBuilderList(); /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder getAttributeOrBuilder( int index); /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ java.lang.String getDocString(); /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ com.google.protobuf.ByteString getDocStringBytes(); } /** * <pre> * Nodes * Computation graphs are made up of a DAG of nodes, which represent what is * commonly called a "layer" or "pipeline stage" in machine learning frameworks. * For example, it can be a node of type "Conv" that takes in an image, a filter * tensor and a bias tensor, and produces the convolved output. * </pre> * * Protobuf type {@code onnx.NodeProto} */ public static final class NodeProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.NodeProto) NodeProtoOrBuilder { private static final long serialVersionUID = 0L; // Use NodeProto.newBuilder() to construct. private NodeProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private NodeProto() { input_ = com.google.protobuf.LazyStringArrayList.EMPTY; output_ = com.google.protobuf.LazyStringArrayList.EMPTY; name_ = ""; opType_ = ""; domain_ = ""; attribute_ = java.util.Collections.emptyList(); docString_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new NodeProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private NodeProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000001) != 0)) { input_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000001; } input_.add(s); break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000002) != 0)) { output_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000002; } output_.add(s); break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 34: { java.lang.String s = input.readStringRequireUtf8(); opType_ = s; break; } case 42: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { attribute_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto>(); mutable_bitField0_ |= 0x00000004; } attribute_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.parser(), extensionRegistry)); break; } case 50: { java.lang.String s = input.readStringRequireUtf8(); docString_ = s; break; } case 58: { java.lang.String s = input.readStringRequireUtf8(); domain_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { input_ = input_.getUnmodifiableView(); } if (((mutable_bitField0_ & 0x00000002) != 0)) { output_ = output_.getUnmodifiableView(); } if (((mutable_bitField0_ & 0x00000004) != 0)) { attribute_ = java.util.Collections.unmodifiableList(attribute_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_NodeProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_NodeProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder.class); } public static final int INPUT_FIELD_NUMBER = 1; private com.google.protobuf.LazyStringList input_; /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public com.google.protobuf.ProtocolStringList getInputList() { return input_; } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public int getInputCount() { return input_.size(); } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public java.lang.String getInput(int index) { return input_.get(index); } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public com.google.protobuf.ByteString getInputBytes(int index) { return input_.getByteString(index); } public static final int OUTPUT_FIELD_NUMBER = 2; private com.google.protobuf.LazyStringList output_; /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public com.google.protobuf.ProtocolStringList getOutputList() { return output_; } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public int getOutputCount() { return output_.size(); } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public java.lang.String getOutput(int index) { return output_.get(index); } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public com.google.protobuf.ByteString getOutputBytes(int index) { return output_.getByteString(index); } public static final int NAME_FIELD_NUMBER = 3; private volatile java.lang.Object name_; /** * <pre> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <pre> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int OP_TYPE_FIELD_NUMBER = 4; private volatile java.lang.Object opType_; /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ public java.lang.String getOpType() { java.lang.Object ref = opType_; 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(); opType_ = s; return s; } } /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ public com.google.protobuf.ByteString getOpTypeBytes() { java.lang.Object ref = opType_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); opType_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DOMAIN_FIELD_NUMBER = 7; private volatile java.lang.Object domain_; /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ public java.lang.String getDomain() { java.lang.Object ref = domain_; 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(); domain_ = s; return s; } } /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ public com.google.protobuf.ByteString getDomainBytes() { java.lang.Object ref = domain_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); domain_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int ATTRIBUTE_FIELD_NUMBER = 5; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto> attribute_; /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto> getAttributeList() { return attribute_; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder> getAttributeOrBuilderList() { return attribute_; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public int getAttributeCount() { return attribute_.size(); } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto getAttribute(int index) { return attribute_.get(index); } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder getAttributeOrBuilder( int index) { return attribute_.get(index); } public static final int DOC_STRING_FIELD_NUMBER = 6; private volatile java.lang.Object docString_; /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; 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(); docString_ = s; return s; } } /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = 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 { for (int i = 0; i < input_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, input_.getRaw(i)); } for (int i = 0; i < output_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, output_.getRaw(i)); } if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); } if (!getOpTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, opType_); } for (int i = 0; i < attribute_.size(); i++) { output.writeMessage(5, attribute_.get(i)); } if (!getDocStringBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, docString_); } if (!getDomainBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, domain_); } unknownFields.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 < input_.size(); i++) { dataSize += computeStringSizeNoTag(input_.getRaw(i)); } size += dataSize; size += 1 * getInputList().size(); } { int dataSize = 0; for (int i = 0; i < output_.size(); i++) { dataSize += computeStringSizeNoTag(output_.getRaw(i)); } size += dataSize; size += 1 * getOutputList().size(); } if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); } if (!getOpTypeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, opType_); } for (int i = 0; i < attribute_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, attribute_.get(i)); } if (!getDocStringBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, docString_); } if (!getDomainBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, domain_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto) obj; if (!getInputList() .equals(other.getInputList())) return false; if (!getOutputList() .equals(other.getOutputList())) return false; if (!getName() .equals(other.getName())) return false; if (!getOpType() .equals(other.getOpType())) return false; if (!getDomain() .equals(other.getDomain())) return false; if (!getAttributeList() .equals(other.getAttributeList())) return false; if (!getDocString() .equals(other.getDocString())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getInputCount() > 0) { hash = (37 * hash) + INPUT_FIELD_NUMBER; hash = (53 * hash) + getInputList().hashCode(); } if (getOutputCount() > 0) { hash = (37 * hash) + OUTPUT_FIELD_NUMBER; hash = (53 * hash) + getOutputList().hashCode(); } hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + OP_TYPE_FIELD_NUMBER; hash = (53 * hash) + getOpType().hashCode(); hash = (37 * hash) + DOMAIN_FIELD_NUMBER; hash = (53 * hash) + getDomain().hashCode(); if (getAttributeCount() > 0) { hash = (37 * hash) + ATTRIBUTE_FIELD_NUMBER; hash = (53 * hash) + getAttributeList().hashCode(); } hash = (37 * hash) + DOC_STRING_FIELD_NUMBER; hash = (53 * hash) + getDocString().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto 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> * Nodes * Computation graphs are made up of a DAG of nodes, which represent what is * commonly called a "layer" or "pipeline stage" in machine learning frameworks. * For example, it can be a node of type "Conv" that takes in an image, a filter * tensor and a bias tensor, and produces the convolved output. * </pre> * * Protobuf type {@code onnx.NodeProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.NodeProto) org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_NodeProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_NodeProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder.class); } // Construct using onnx.OnnxProto3.NodeProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getAttributeFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); input_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); output_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); name_ = ""; opType_ = ""; domain_ = ""; if (attributeBuilder_ == null) { attribute_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { attributeBuilder_.clear(); } docString_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_NodeProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto(this); int from_bitField0_ = bitField0_; if (((bitField0_ & 0x00000001) != 0)) { input_ = input_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); } result.input_ = input_; if (((bitField0_ & 0x00000002) != 0)) { output_ = output_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000002); } result.output_ = output_; result.name_ = name_; result.opType_ = opType_; result.domain_ = domain_; if (attributeBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { attribute_ = java.util.Collections.unmodifiableList(attribute_); bitField0_ = (bitField0_ & ~0x00000004); } result.attribute_ = attribute_; } else { result.attribute_ = attributeBuilder_.build(); } result.docString_ = docString_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.getDefaultInstance()) return this; if (!other.input_.isEmpty()) { if (input_.isEmpty()) { input_ = other.input_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureInputIsMutable(); input_.addAll(other.input_); } onChanged(); } if (!other.output_.isEmpty()) { if (output_.isEmpty()) { output_ = other.output_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureOutputIsMutable(); output_.addAll(other.output_); } onChanged(); } if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getOpType().isEmpty()) { opType_ = other.opType_; onChanged(); } if (!other.getDomain().isEmpty()) { domain_ = other.domain_; onChanged(); } if (attributeBuilder_ == null) { if (!other.attribute_.isEmpty()) { if (attribute_.isEmpty()) { attribute_ = other.attribute_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureAttributeIsMutable(); attribute_.addAll(other.attribute_); } onChanged(); } } else { if (!other.attribute_.isEmpty()) { if (attributeBuilder_.isEmpty()) { attributeBuilder_.dispose(); attributeBuilder_ = null; attribute_ = other.attribute_; bitField0_ = (bitField0_ & ~0x00000004); attributeBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getAttributeFieldBuilder() : null; } else { attributeBuilder_.addAllMessages(other.attribute_); } } } if (!other.getDocString().isEmpty()) { docString_ = other.docString_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private com.google.protobuf.LazyStringList input_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureInputIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { input_ = new com.google.protobuf.LazyStringArrayList(input_); bitField0_ |= 0x00000001; } } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public com.google.protobuf.ProtocolStringList getInputList() { return input_.getUnmodifiableView(); } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public int getInputCount() { return input_.size(); } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public java.lang.String getInput(int index) { return input_.get(index); } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public com.google.protobuf.ByteString getInputBytes(int index) { return input_.getByteString(index); } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public Builder setInput( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureInputIsMutable(); input_.set(index, value); onChanged(); return this; } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public Builder addInput( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureInputIsMutable(); input_.add(value); onChanged(); return this; } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public Builder addAllInput( java.lang.Iterable<java.lang.String> values) { ensureInputIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, input_); onChanged(); return this; } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public Builder clearInput() { input_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * <pre> * namespace Value * </pre> * * <code>repeated string input = 1;</code> */ public Builder addInputBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureInputIsMutable(); input_.add(value); onChanged(); return this; } private com.google.protobuf.LazyStringList output_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureOutputIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { output_ = new com.google.protobuf.LazyStringArrayList(output_); bitField0_ |= 0x00000002; } } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public com.google.protobuf.ProtocolStringList getOutputList() { return output_.getUnmodifiableView(); } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public int getOutputCount() { return output_.size(); } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public java.lang.String getOutput(int index) { return output_.get(index); } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public com.google.protobuf.ByteString getOutputBytes(int index) { return output_.getByteString(index); } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public Builder setOutput( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureOutputIsMutable(); output_.set(index, value); onChanged(); return this; } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public Builder addOutput( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureOutputIsMutable(); output_.add(value); onChanged(); return this; } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public Builder addAllOutput( java.lang.Iterable<java.lang.String> values) { ensureOutputIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, output_); onChanged(); return this; } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public Builder clearOutput() { output_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * <pre> * namespace Value * </pre> * * <code>repeated string output = 2;</code> */ public Builder addOutputBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureOutputIsMutable(); output_.add(value); onChanged(); return this; } private java.lang.Object name_ = ""; /** * <pre> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ 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> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * <pre> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * <pre> * An optional identifier for this node in a graph. * This field MAY be absent in ths version of the IR. * </pre> * * <code>string name = 3;</code> */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private java.lang.Object opType_ = ""; /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ public java.lang.String getOpType() { java.lang.Object ref = opType_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); opType_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ public com.google.protobuf.ByteString getOpTypeBytes() { java.lang.Object ref = opType_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); opType_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ public Builder setOpType( java.lang.String value) { if (value == null) { throw new NullPointerException(); } opType_ = value; onChanged(); return this; } /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ public Builder clearOpType() { opType_ = getDefaultInstance().getOpType(); onChanged(); return this; } /** * <pre> * The symbolic identifier of the Operator to execute. * </pre> * * <code>string op_type = 4;</code> */ public Builder setOpTypeBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); opType_ = value; onChanged(); return this; } private java.lang.Object domain_ = ""; /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ public java.lang.String getDomain() { java.lang.Object ref = domain_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); domain_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ public com.google.protobuf.ByteString getDomainBytes() { java.lang.Object ref = domain_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); domain_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ public Builder setDomain( java.lang.String value) { if (value == null) { throw new NullPointerException(); } domain_ = value; onChanged(); return this; } /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ public Builder clearDomain() { domain_ = getDefaultInstance().getDomain(); onChanged(); return this; } /** * <pre> * The domain of the OperatorSet that specifies the operator named by op_type. * </pre> * * <code>string domain = 7;</code> */ public Builder setDomainBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); domain_ = value; onChanged(); return this; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto> attribute_ = java.util.Collections.emptyList(); private void ensureAttributeIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { attribute_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto>(attribute_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder> attributeBuilder_; /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto> getAttributeList() { if (attributeBuilder_ == null) { return java.util.Collections.unmodifiableList(attribute_); } else { return attributeBuilder_.getMessageList(); } } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public int getAttributeCount() { if (attributeBuilder_ == null) { return attribute_.size(); } else { return attributeBuilder_.getCount(); } } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto getAttribute(int index) { if (attributeBuilder_ == null) { return attribute_.get(index); } else { return attributeBuilder_.getMessage(index); } } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder setAttribute( int index, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto value) { if (attributeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAttributeIsMutable(); attribute_.set(index, value); onChanged(); } else { attributeBuilder_.setMessage(index, value); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder setAttribute( int index, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder builderForValue) { if (attributeBuilder_ == null) { ensureAttributeIsMutable(); attribute_.set(index, builderForValue.build()); onChanged(); } else { attributeBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder addAttribute(org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto value) { if (attributeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAttributeIsMutable(); attribute_.add(value); onChanged(); } else { attributeBuilder_.addMessage(value); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder addAttribute( int index, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto value) { if (attributeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAttributeIsMutable(); attribute_.add(index, value); onChanged(); } else { attributeBuilder_.addMessage(index, value); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder addAttribute( org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder builderForValue) { if (attributeBuilder_ == null) { ensureAttributeIsMutable(); attribute_.add(builderForValue.build()); onChanged(); } else { attributeBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder addAttribute( int index, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder builderForValue) { if (attributeBuilder_ == null) { ensureAttributeIsMutable(); attribute_.add(index, builderForValue.build()); onChanged(); } else { attributeBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder addAllAttribute( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto> values) { if (attributeBuilder_ == null) { ensureAttributeIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, attribute_); onChanged(); } else { attributeBuilder_.addAllMessages(values); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder clearAttribute() { if (attributeBuilder_ == null) { attribute_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { attributeBuilder_.clear(); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public Builder removeAttribute(int index) { if (attributeBuilder_ == null) { ensureAttributeIsMutable(); attribute_.remove(index); onChanged(); } else { attributeBuilder_.remove(index); } return this; } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder getAttributeBuilder( int index) { return getAttributeFieldBuilder().getBuilder(index); } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder getAttributeOrBuilder( int index) { if (attributeBuilder_ == null) { return attribute_.get(index); } else { return attributeBuilder_.getMessageOrBuilder(index); } } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder> getAttributeOrBuilderList() { if (attributeBuilder_ != null) { return attributeBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(attribute_); } } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder addAttributeBuilder() { return getAttributeFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.getDefaultInstance()); } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder addAttributeBuilder( int index) { return getAttributeFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.getDefaultInstance()); } /** * <pre> * Additional named attributes. * </pre> * * <code>repeated .onnx.AttributeProto attribute = 5;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder> getAttributeBuilderList() { return getAttributeFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder> getAttributeFieldBuilder() { if (attributeBuilder_ == null) { attributeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.AttributeProtoOrBuilder>( attribute_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); attribute_ = null; } return attributeBuilder_; } private java.lang.Object docString_ = ""; /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); docString_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public Builder setDocString( java.lang.String value) { if (value == null) { throw new NullPointerException(); } docString_ = value; onChanged(); return this; } /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public Builder clearDocString() { docString_ = getDefaultInstance().getDocString(); onChanged(); return this; } /** * <pre> * A human-readable documentation for this node. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public Builder setDocStringBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); docString_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:onnx.NodeProto) } // @@protoc_insertion_point(class_scope:onnx.NodeProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<NodeProto> PARSER = new com.google.protobuf.AbstractParser<NodeProto>() { @java.lang.Override public NodeProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new NodeProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<NodeProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<NodeProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface ModelProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.ModelProto) com.google.protobuf.MessageOrBuilder { /** * <pre> * The version of the IR this model targets. See Version enum above. * This field MUST be present. * </pre> * * <code>int64 ir_version = 1;</code> */ long getIrVersion(); /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto> getOpsetImportList(); /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto getOpsetImport(int index); /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ int getOpsetImportCount(); /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder> getOpsetImportOrBuilderList(); /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder getOpsetImportOrBuilder( int index); /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ java.lang.String getProducerName(); /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ com.google.protobuf.ByteString getProducerNameBytes(); /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ java.lang.String getProducerVersion(); /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ com.google.protobuf.ByteString getProducerVersionBytes(); /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ java.lang.String getDomain(); /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ com.google.protobuf.ByteString getDomainBytes(); /** * <pre> * The version of the graph encoded. See Version enum below. * </pre> * * <code>int64 model_version = 5;</code> */ long getModelVersion(); /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ java.lang.String getDocString(); /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ com.google.protobuf.ByteString getDocStringBytes(); /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ boolean hasGraph(); /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getGraph(); /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGraphOrBuilder(); /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getMetadataPropsList(); /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getMetadataProps(int index); /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ int getMetadataPropsCount(); /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getMetadataPropsOrBuilderList(); /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getMetadataPropsOrBuilder( int index); } /** * <pre> * Models * ModelProto is a top-level file/container format for bundling a ML model and * associating its computation graph with metadata. * The semantics of the model are described by the associated GraphProto. * </pre> * * Protobuf type {@code onnx.ModelProto} */ public static final class ModelProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.ModelProto) ModelProtoOrBuilder { private static final long serialVersionUID = 0L; // Use ModelProto.newBuilder() to construct. private ModelProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ModelProto() { opsetImport_ = java.util.Collections.emptyList(); producerName_ = ""; producerVersion_ = ""; domain_ = ""; docString_ = ""; metadataProps_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new ModelProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private ModelProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { irVersion_ = input.readInt64(); break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); producerName_ = s; break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); producerVersion_ = s; break; } case 34: { java.lang.String s = input.readStringRequireUtf8(); domain_ = s; break; } case 40: { modelVersion_ = input.readInt64(); break; } case 50: { java.lang.String s = input.readStringRequireUtf8(); docString_ = s; break; } case 58: { org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder subBuilder = null; if (graph_ != null) { subBuilder = graph_.toBuilder(); } graph_ = input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(graph_); graph_ = subBuilder.buildPartial(); } break; } case 66: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { opsetImport_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto>(); mutable_bitField0_ |= 0x00000001; } opsetImport_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.parser(), extensionRegistry)); break; } case 114: { if (!((mutable_bitField0_ & 0x00000002) != 0)) { metadataProps_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto>(); mutable_bitField0_ |= 0x00000002; } metadataProps_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.parser(), extensionRegistry)); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { opsetImport_ = java.util.Collections.unmodifiableList(opsetImport_); } if (((mutable_bitField0_ & 0x00000002) != 0)) { metadataProps_ = java.util.Collections.unmodifiableList(metadataProps_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ModelProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ModelProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto.Builder.class); } public static final int IR_VERSION_FIELD_NUMBER = 1; private long irVersion_; /** * <pre> * The version of the IR this model targets. See Version enum above. * This field MUST be present. * </pre> * * <code>int64 ir_version = 1;</code> */ public long getIrVersion() { return irVersion_; } public static final int OPSET_IMPORT_FIELD_NUMBER = 8; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto> opsetImport_; /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto> getOpsetImportList() { return opsetImport_; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder> getOpsetImportOrBuilderList() { return opsetImport_; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public int getOpsetImportCount() { return opsetImport_.size(); } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto getOpsetImport(int index) { return opsetImport_.get(index); } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder getOpsetImportOrBuilder( int index) { return opsetImport_.get(index); } public static final int PRODUCER_NAME_FIELD_NUMBER = 2; private volatile java.lang.Object producerName_; /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ public java.lang.String getProducerName() { java.lang.Object ref = producerName_; 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(); producerName_ = s; return s; } } /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ public com.google.protobuf.ByteString getProducerNameBytes() { java.lang.Object ref = producerName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); producerName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PRODUCER_VERSION_FIELD_NUMBER = 3; private volatile java.lang.Object producerVersion_; /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ public java.lang.String getProducerVersion() { java.lang.Object ref = producerVersion_; 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(); producerVersion_ = s; return s; } } /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ public com.google.protobuf.ByteString getProducerVersionBytes() { java.lang.Object ref = producerVersion_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); producerVersion_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DOMAIN_FIELD_NUMBER = 4; private volatile java.lang.Object domain_; /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ public java.lang.String getDomain() { java.lang.Object ref = domain_; 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(); domain_ = s; return s; } } /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ public com.google.protobuf.ByteString getDomainBytes() { java.lang.Object ref = domain_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); domain_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int MODEL_VERSION_FIELD_NUMBER = 5; private long modelVersion_; /** * <pre> * The version of the graph encoded. See Version enum below. * </pre> * * <code>int64 model_version = 5;</code> */ public long getModelVersion() { return modelVersion_; } public static final int DOC_STRING_FIELD_NUMBER = 6; private volatile java.lang.Object docString_; /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; 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(); docString_ = s; return s; } } /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int GRAPH_FIELD_NUMBER = 7; private org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto graph_; /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public boolean hasGraph() { return graph_ != null; } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getGraph() { return graph_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance() : graph_; } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGraphOrBuilder() { return getGraph(); } public static final int METADATA_PROPS_FIELD_NUMBER = 14; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> metadataProps_; /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getMetadataPropsList() { return metadataProps_; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getMetadataPropsOrBuilderList() { return metadataProps_; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public int getMetadataPropsCount() { return metadataProps_.size(); } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getMetadataProps(int index) { return metadataProps_.get(index); } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getMetadataPropsOrBuilder( int index) { return metadataProps_.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 { if (irVersion_ != 0L) { output.writeInt64(1, irVersion_); } if (!getProducerNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, producerName_); } if (!getProducerVersionBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, producerVersion_); } if (!getDomainBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, domain_); } if (modelVersion_ != 0L) { output.writeInt64(5, modelVersion_); } if (!getDocStringBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, docString_); } if (graph_ != null) { output.writeMessage(7, getGraph()); } for (int i = 0; i < opsetImport_.size(); i++) { output.writeMessage(8, opsetImport_.get(i)); } for (int i = 0; i < metadataProps_.size(); i++) { output.writeMessage(14, metadataProps_.get(i)); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (irVersion_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, irVersion_); } if (!getProducerNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, producerName_); } if (!getProducerVersionBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, producerVersion_); } if (!getDomainBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, domain_); } if (modelVersion_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(5, modelVersion_); } if (!getDocStringBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, docString_); } if (graph_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, getGraph()); } for (int i = 0; i < opsetImport_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(8, opsetImport_.get(i)); } for (int i = 0; i < metadataProps_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(14, metadataProps_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto) obj; if (getIrVersion() != other.getIrVersion()) return false; if (!getOpsetImportList() .equals(other.getOpsetImportList())) return false; if (!getProducerName() .equals(other.getProducerName())) return false; if (!getProducerVersion() .equals(other.getProducerVersion())) return false; if (!getDomain() .equals(other.getDomain())) return false; if (getModelVersion() != other.getModelVersion()) return false; if (!getDocString() .equals(other.getDocString())) return false; if (hasGraph() != other.hasGraph()) return false; if (hasGraph()) { if (!getGraph() .equals(other.getGraph())) return false; } if (!getMetadataPropsList() .equals(other.getMetadataPropsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + IR_VERSION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getIrVersion()); if (getOpsetImportCount() > 0) { hash = (37 * hash) + OPSET_IMPORT_FIELD_NUMBER; hash = (53 * hash) + getOpsetImportList().hashCode(); } hash = (37 * hash) + PRODUCER_NAME_FIELD_NUMBER; hash = (53 * hash) + getProducerName().hashCode(); hash = (37 * hash) + PRODUCER_VERSION_FIELD_NUMBER; hash = (53 * hash) + getProducerVersion().hashCode(); hash = (37 * hash) + DOMAIN_FIELD_NUMBER; hash = (53 * hash) + getDomain().hashCode(); hash = (37 * hash) + MODEL_VERSION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getModelVersion()); hash = (37 * hash) + DOC_STRING_FIELD_NUMBER; hash = (53 * hash) + getDocString().hashCode(); if (hasGraph()) { hash = (37 * hash) + GRAPH_FIELD_NUMBER; hash = (53 * hash) + getGraph().hashCode(); } if (getMetadataPropsCount() > 0) { hash = (37 * hash) + METADATA_PROPS_FIELD_NUMBER; hash = (53 * hash) + getMetadataPropsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto 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> * Models * ModelProto is a top-level file/container format for bundling a ML model and * associating its computation graph with metadata. * The semantics of the model are described by the associated GraphProto. * </pre> * * Protobuf type {@code onnx.ModelProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.ModelProto) org.onnx4j.onnx.prototypes.OnnxProto3.ModelProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ModelProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ModelProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto.Builder.class); } // Construct using onnx.OnnxProto3.ModelProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getOpsetImportFieldBuilder(); getMetadataPropsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); irVersion_ = 0L; if (opsetImportBuilder_ == null) { opsetImport_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { opsetImportBuilder_.clear(); } producerName_ = ""; producerVersion_ = ""; domain_ = ""; modelVersion_ = 0L; docString_ = ""; if (graphBuilder_ == null) { graph_ = null; } else { graph_ = null; graphBuilder_ = null; } if (metadataPropsBuilder_ == null) { metadataProps_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); } else { metadataPropsBuilder_.clear(); } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_ModelProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto(this); int from_bitField0_ = bitField0_; result.irVersion_ = irVersion_; if (opsetImportBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { opsetImport_ = java.util.Collections.unmodifiableList(opsetImport_); bitField0_ = (bitField0_ & ~0x00000001); } result.opsetImport_ = opsetImport_; } else { result.opsetImport_ = opsetImportBuilder_.build(); } result.producerName_ = producerName_; result.producerVersion_ = producerVersion_; result.domain_ = domain_; result.modelVersion_ = modelVersion_; result.docString_ = docString_; if (graphBuilder_ == null) { result.graph_ = graph_; } else { result.graph_ = graphBuilder_.build(); } if (metadataPropsBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { metadataProps_ = java.util.Collections.unmodifiableList(metadataProps_); bitField0_ = (bitField0_ & ~0x00000002); } result.metadataProps_ = metadataProps_; } else { result.metadataProps_ = metadataPropsBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto.getDefaultInstance()) return this; if (other.getIrVersion() != 0L) { setIrVersion(other.getIrVersion()); } if (opsetImportBuilder_ == null) { if (!other.opsetImport_.isEmpty()) { if (opsetImport_.isEmpty()) { opsetImport_ = other.opsetImport_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureOpsetImportIsMutable(); opsetImport_.addAll(other.opsetImport_); } onChanged(); } } else { if (!other.opsetImport_.isEmpty()) { if (opsetImportBuilder_.isEmpty()) { opsetImportBuilder_.dispose(); opsetImportBuilder_ = null; opsetImport_ = other.opsetImport_; bitField0_ = (bitField0_ & ~0x00000001); opsetImportBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getOpsetImportFieldBuilder() : null; } else { opsetImportBuilder_.addAllMessages(other.opsetImport_); } } } if (!other.getProducerName().isEmpty()) { producerName_ = other.producerName_; onChanged(); } if (!other.getProducerVersion().isEmpty()) { producerVersion_ = other.producerVersion_; onChanged(); } if (!other.getDomain().isEmpty()) { domain_ = other.domain_; onChanged(); } if (other.getModelVersion() != 0L) { setModelVersion(other.getModelVersion()); } if (!other.getDocString().isEmpty()) { docString_ = other.docString_; onChanged(); } if (other.hasGraph()) { mergeGraph(other.getGraph()); } if (metadataPropsBuilder_ == null) { if (!other.metadataProps_.isEmpty()) { if (metadataProps_.isEmpty()) { metadataProps_ = other.metadataProps_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureMetadataPropsIsMutable(); metadataProps_.addAll(other.metadataProps_); } onChanged(); } } else { if (!other.metadataProps_.isEmpty()) { if (metadataPropsBuilder_.isEmpty()) { metadataPropsBuilder_.dispose(); metadataPropsBuilder_ = null; metadataProps_ = other.metadataProps_; bitField0_ = (bitField0_ & ~0x00000002); metadataPropsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getMetadataPropsFieldBuilder() : null; } else { metadataPropsBuilder_.addAllMessages(other.metadataProps_); } } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private long irVersion_ ; /** * <pre> * The version of the IR this model targets. See Version enum above. * This field MUST be present. * </pre> * * <code>int64 ir_version = 1;</code> */ public long getIrVersion() { return irVersion_; } /** * <pre> * The version of the IR this model targets. See Version enum above. * This field MUST be present. * </pre> * * <code>int64 ir_version = 1;</code> */ public Builder setIrVersion(long value) { irVersion_ = value; onChanged(); return this; } /** * <pre> * The version of the IR this model targets. See Version enum above. * This field MUST be present. * </pre> * * <code>int64 ir_version = 1;</code> */ public Builder clearIrVersion() { irVersion_ = 0L; onChanged(); return this; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto> opsetImport_ = java.util.Collections.emptyList(); private void ensureOpsetImportIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { opsetImport_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto>(opsetImport_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder> opsetImportBuilder_; /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto> getOpsetImportList() { if (opsetImportBuilder_ == null) { return java.util.Collections.unmodifiableList(opsetImport_); } else { return opsetImportBuilder_.getMessageList(); } } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public int getOpsetImportCount() { if (opsetImportBuilder_ == null) { return opsetImport_.size(); } else { return opsetImportBuilder_.getCount(); } } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto getOpsetImport(int index) { if (opsetImportBuilder_ == null) { return opsetImport_.get(index); } else { return opsetImportBuilder_.getMessage(index); } } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder setOpsetImport( int index, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto value) { if (opsetImportBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureOpsetImportIsMutable(); opsetImport_.set(index, value); onChanged(); } else { opsetImportBuilder_.setMessage(index, value); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder setOpsetImport( int index, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder builderForValue) { if (opsetImportBuilder_ == null) { ensureOpsetImportIsMutable(); opsetImport_.set(index, builderForValue.build()); onChanged(); } else { opsetImportBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder addOpsetImport(org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto value) { if (opsetImportBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureOpsetImportIsMutable(); opsetImport_.add(value); onChanged(); } else { opsetImportBuilder_.addMessage(value); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder addOpsetImport( int index, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto value) { if (opsetImportBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureOpsetImportIsMutable(); opsetImport_.add(index, value); onChanged(); } else { opsetImportBuilder_.addMessage(index, value); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder addOpsetImport( org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder builderForValue) { if (opsetImportBuilder_ == null) { ensureOpsetImportIsMutable(); opsetImport_.add(builderForValue.build()); onChanged(); } else { opsetImportBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder addOpsetImport( int index, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder builderForValue) { if (opsetImportBuilder_ == null) { ensureOpsetImportIsMutable(); opsetImport_.add(index, builderForValue.build()); onChanged(); } else { opsetImportBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder addAllOpsetImport( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto> values) { if (opsetImportBuilder_ == null) { ensureOpsetImportIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, opsetImport_); onChanged(); } else { opsetImportBuilder_.addAllMessages(values); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder clearOpsetImport() { if (opsetImportBuilder_ == null) { opsetImport_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { opsetImportBuilder_.clear(); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public Builder removeOpsetImport(int index) { if (opsetImportBuilder_ == null) { ensureOpsetImportIsMutable(); opsetImport_.remove(index); onChanged(); } else { opsetImportBuilder_.remove(index); } return this; } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder getOpsetImportBuilder( int index) { return getOpsetImportFieldBuilder().getBuilder(index); } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder getOpsetImportOrBuilder( int index) { if (opsetImportBuilder_ == null) { return opsetImport_.get(index); } else { return opsetImportBuilder_.getMessageOrBuilder(index); } } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder> getOpsetImportOrBuilderList() { if (opsetImportBuilder_ != null) { return opsetImportBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(opsetImport_); } } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder addOpsetImportBuilder() { return getOpsetImportFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.getDefaultInstance()); } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder addOpsetImportBuilder( int index) { return getOpsetImportFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.getDefaultInstance()); } /** * <pre> * The OperatorSets this model relies on. * All ModelProtos MUST have at least one entry that * specifies which version of the ONNX OperatorSet is * being imported. * All nodes in the ModelProto's graph will bind against the operator * with the same-domain/same-op_type operator with the HIGHEST version * in the referenced operator sets. * </pre> * * <code>repeated .onnx.OperatorSetIdProto opset_import = 8;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder> getOpsetImportBuilderList() { return getOpsetImportFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder> getOpsetImportFieldBuilder() { if (opsetImportBuilder_ == null) { opsetImportBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder>( opsetImport_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); opsetImport_ = null; } return opsetImportBuilder_; } private java.lang.Object producerName_ = ""; /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ public java.lang.String getProducerName() { java.lang.Object ref = producerName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); producerName_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ public com.google.protobuf.ByteString getProducerNameBytes() { java.lang.Object ref = producerName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); producerName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ public Builder setProducerName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } producerName_ = value; onChanged(); return this; } /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ public Builder clearProducerName() { producerName_ = getDefaultInstance().getProducerName(); onChanged(); return this; } /** * <pre> * The name of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_name = 2;</code> */ public Builder setProducerNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); producerName_ = value; onChanged(); return this; } private java.lang.Object producerVersion_ = ""; /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ public java.lang.String getProducerVersion() { java.lang.Object ref = producerVersion_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); producerVersion_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ public com.google.protobuf.ByteString getProducerVersionBytes() { java.lang.Object ref = producerVersion_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); producerVersion_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ public Builder setProducerVersion( java.lang.String value) { if (value == null) { throw new NullPointerException(); } producerVersion_ = value; onChanged(); return this; } /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ public Builder clearProducerVersion() { producerVersion_ = getDefaultInstance().getProducerVersion(); onChanged(); return this; } /** * <pre> * The version of the framework or tool used to generate this model. * This field SHOULD be present to indicate which implementation/tool/framework * emitted the model. * </pre> * * <code>string producer_version = 3;</code> */ public Builder setProducerVersionBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); producerVersion_ = value; onChanged(); return this; } private java.lang.Object domain_ = ""; /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ public java.lang.String getDomain() { java.lang.Object ref = domain_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); domain_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ public com.google.protobuf.ByteString getDomainBytes() { java.lang.Object ref = domain_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); domain_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ public Builder setDomain( java.lang.String value) { if (value == null) { throw new NullPointerException(); } domain_ = value; onChanged(); return this; } /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ public Builder clearDomain() { domain_ = getDefaultInstance().getDomain(); onChanged(); return this; } /** * <pre> * Domain name of the model. * We use reverse domain names as name space indicators. For example: * `com.facebook.fair` or `com.microsoft.cognitiveservices` * Together with `model_version` and GraphProto.name, this forms the unique identity of * the graph. * </pre> * * <code>string domain = 4;</code> */ public Builder setDomainBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); domain_ = value; onChanged(); return this; } private long modelVersion_ ; /** * <pre> * The version of the graph encoded. See Version enum below. * </pre> * * <code>int64 model_version = 5;</code> */ public long getModelVersion() { return modelVersion_; } /** * <pre> * The version of the graph encoded. See Version enum below. * </pre> * * <code>int64 model_version = 5;</code> */ public Builder setModelVersion(long value) { modelVersion_ = value; onChanged(); return this; } /** * <pre> * The version of the graph encoded. See Version enum below. * </pre> * * <code>int64 model_version = 5;</code> */ public Builder clearModelVersion() { modelVersion_ = 0L; onChanged(); return this; } private java.lang.Object docString_ = ""; /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); docString_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public Builder setDocString( java.lang.String value) { if (value == null) { throw new NullPointerException(); } docString_ = value; onChanged(); return this; } /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public Builder clearDocString() { docString_ = getDefaultInstance().getDocString(); onChanged(); return this; } /** * <pre> * A human-readable documentation for this model. Markdown is allowed. * </pre> * * <code>string doc_string = 6;</code> */ public Builder setDocStringBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); docString_ = value; onChanged(); return this; } private org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto graph_; private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> graphBuilder_; /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public boolean hasGraph() { return graphBuilder_ != null || graph_ != null; } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getGraph() { if (graphBuilder_ == null) { return graph_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance() : graph_; } else { return graphBuilder_.getMessage(); } } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public Builder setGraph(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto value) { if (graphBuilder_ == null) { if (value == null) { throw new NullPointerException(); } graph_ = value; onChanged(); } else { graphBuilder_.setMessage(value); } return this; } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public Builder setGraph( org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder builderForValue) { if (graphBuilder_ == null) { graph_ = builderForValue.build(); onChanged(); } else { graphBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public Builder mergeGraph(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto value) { if (graphBuilder_ == null) { if (graph_ != null) { graph_ = org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.newBuilder(graph_).mergeFrom(value).buildPartial(); } else { graph_ = value; } onChanged(); } else { graphBuilder_.mergeFrom(value); } return this; } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public Builder clearGraph() { if (graphBuilder_ == null) { graph_ = null; onChanged(); } else { graph_ = null; graphBuilder_ = null; } return this; } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder getGraphBuilder() { onChanged(); return getGraphFieldBuilder().getBuilder(); } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder getGraphOrBuilder() { if (graphBuilder_ != null) { return graphBuilder_.getMessageOrBuilder(); } else { return graph_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance() : graph_; } } /** * <pre> * The parameterized graph that is evaluated to execute the model. * </pre> * * <code>.onnx.GraphProto graph = 7;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder> getGraphFieldBuilder() { if (graphBuilder_ == null) { graphBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder>( getGraph(), getParentForChildren(), isClean()); graph_ = null; } return graphBuilder_; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> metadataProps_ = java.util.Collections.emptyList(); private void ensureMetadataPropsIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { metadataProps_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto>(metadataProps_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> metadataPropsBuilder_; /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getMetadataPropsList() { if (metadataPropsBuilder_ == null) { return java.util.Collections.unmodifiableList(metadataProps_); } else { return metadataPropsBuilder_.getMessageList(); } } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public int getMetadataPropsCount() { if (metadataPropsBuilder_ == null) { return metadataProps_.size(); } else { return metadataPropsBuilder_.getCount(); } } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getMetadataProps(int index) { if (metadataPropsBuilder_ == null) { return metadataProps_.get(index); } else { return metadataPropsBuilder_.getMessage(index); } } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder setMetadataProps( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (metadataPropsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureMetadataPropsIsMutable(); metadataProps_.set(index, value); onChanged(); } else { metadataPropsBuilder_.setMessage(index, value); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder setMetadataProps( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (metadataPropsBuilder_ == null) { ensureMetadataPropsIsMutable(); metadataProps_.set(index, builderForValue.build()); onChanged(); } else { metadataPropsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder addMetadataProps(org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (metadataPropsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureMetadataPropsIsMutable(); metadataProps_.add(value); onChanged(); } else { metadataPropsBuilder_.addMessage(value); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder addMetadataProps( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (metadataPropsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureMetadataPropsIsMutable(); metadataProps_.add(index, value); onChanged(); } else { metadataPropsBuilder_.addMessage(index, value); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder addMetadataProps( org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (metadataPropsBuilder_ == null) { ensureMetadataPropsIsMutable(); metadataProps_.add(builderForValue.build()); onChanged(); } else { metadataPropsBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder addMetadataProps( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (metadataPropsBuilder_ == null) { ensureMetadataPropsIsMutable(); metadataProps_.add(index, builderForValue.build()); onChanged(); } else { metadataPropsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder addAllMetadataProps( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> values) { if (metadataPropsBuilder_ == null) { ensureMetadataPropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, metadataProps_); onChanged(); } else { metadataPropsBuilder_.addAllMessages(values); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder clearMetadataProps() { if (metadataPropsBuilder_ == null) { metadataProps_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { metadataPropsBuilder_.clear(); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public Builder removeMetadataProps(int index) { if (metadataPropsBuilder_ == null) { ensureMetadataPropsIsMutable(); metadataProps_.remove(index); onChanged(); } else { metadataPropsBuilder_.remove(index); } return this; } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder getMetadataPropsBuilder( int index) { return getMetadataPropsFieldBuilder().getBuilder(index); } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getMetadataPropsOrBuilder( int index) { if (metadataPropsBuilder_ == null) { return metadataProps_.get(index); } else { return metadataPropsBuilder_.getMessageOrBuilder(index); } } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getMetadataPropsOrBuilderList() { if (metadataPropsBuilder_ != null) { return metadataPropsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(metadataProps_); } } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder addMetadataPropsBuilder() { return getMetadataPropsFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.getDefaultInstance()); } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder addMetadataPropsBuilder( int index) { return getMetadataPropsFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.getDefaultInstance()); } /** * <pre> * Named metadata values; keys should be distinct. * </pre> * * <code>repeated .onnx.StringStringEntryProto metadata_props = 14;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder> getMetadataPropsBuilderList() { return getMetadataPropsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getMetadataPropsFieldBuilder() { if (metadataPropsBuilder_ == null) { metadataPropsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder>( metadataProps_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); metadataProps_ = null; } return metadataPropsBuilder_; } @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:onnx.ModelProto) } // @@protoc_insertion_point(class_scope:onnx.ModelProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ModelProto> PARSER = new com.google.protobuf.AbstractParser<ModelProto>() { @java.lang.Override public ModelProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ModelProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<ModelProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ModelProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.ModelProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface StringStringEntryProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.StringStringEntryProto) com.google.protobuf.MessageOrBuilder { /** * <code>string key = 1;</code> */ java.lang.String getKey(); /** * <code>string key = 1;</code> */ com.google.protobuf.ByteString getKeyBytes(); /** * <code>string value = 2;</code> */ java.lang.String getValue(); /** * <code>string value = 2;</code> */ com.google.protobuf.ByteString getValueBytes(); } /** * <pre> * StringStringEntryProto follows the pattern for cross-proto-version maps. * See https://developers.google.com/protocol-buffers/docs/proto3#maps * </pre> * * Protobuf type {@code onnx.StringStringEntryProto} */ public static final class StringStringEntryProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.StringStringEntryProto) StringStringEntryProtoOrBuilder { private static final long serialVersionUID = 0L; // Use StringStringEntryProto.newBuilder() to construct. private StringStringEntryProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private StringStringEntryProto() { key_ = ""; value_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new StringStringEntryProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private StringStringEntryProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); key_ = s; break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); value_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_StringStringEntryProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_StringStringEntryProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder.class); } public static final int KEY_FIELD_NUMBER = 1; private volatile java.lang.Object key_; /** * <code>string key = 1;</code> */ public java.lang.String getKey() { java.lang.Object ref = key_; 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(); key_ = s; return s; } } /** * <code>string key = 1;</code> */ public com.google.protobuf.ByteString getKeyBytes() { java.lang.Object ref = key_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); key_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int VALUE_FIELD_NUMBER = 2; private volatile java.lang.Object value_; /** * <code>string value = 2;</code> */ public java.lang.String getValue() { java.lang.Object ref = value_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); value_ = s; return s; } } /** * <code>string value = 2;</code> */ public com.google.protobuf.ByteString getValueBytes() { java.lang.Object ref = value_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); value_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private 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 (!getKeyBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); } if (!getValueBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getKeyBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); } if (!getValueBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto) obj; if (!getKey() .equals(other.getKey())) return false; if (!getValue() .equals(other.getValue())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto 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> * StringStringEntryProto follows the pattern for cross-proto-version maps. * See https://developers.google.com/protocol-buffers/docs/proto3#maps * </pre> * * Protobuf type {@code onnx.StringStringEntryProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.StringStringEntryProto) org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_StringStringEntryProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_StringStringEntryProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder.class); } // Construct using onnx.OnnxProto3.StringStringEntryProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); key_ = ""; value_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_StringStringEntryProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto(this); result.key_ = key_; result.value_ = value_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.getDefaultInstance()) return this; if (!other.getKey().isEmpty()) { key_ = other.key_; onChanged(); } if (!other.getValue().isEmpty()) { value_ = other.value_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object key_ = ""; /** * <code>string key = 1;</code> */ public java.lang.String getKey() { java.lang.Object ref = key_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); key_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string key = 1;</code> */ public com.google.protobuf.ByteString getKeyBytes() { java.lang.Object ref = key_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); key_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string key = 1;</code> */ public Builder setKey( java.lang.String value) { if (value == null) { throw new NullPointerException(); } key_ = value; onChanged(); return this; } /** * <code>string key = 1;</code> */ public Builder clearKey() { key_ = getDefaultInstance().getKey(); onChanged(); return this; } /** * <code>string key = 1;</code> */ public Builder setKeyBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); key_ = value; onChanged(); return this; } private java.lang.Object value_ = ""; /** * <code>string value = 2;</code> */ public java.lang.String getValue() { java.lang.Object ref = value_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); value_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string value = 2;</code> */ public com.google.protobuf.ByteString getValueBytes() { java.lang.Object ref = value_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); value_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string value = 2;</code> */ public Builder setValue( java.lang.String value) { if (value == null) { throw new NullPointerException(); } value_ = value; onChanged(); return this; } /** * <code>string value = 2;</code> */ public Builder clearValue() { value_ = getDefaultInstance().getValue(); onChanged(); return this; } /** * <code>string value = 2;</code> */ public Builder setValueBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); value_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:onnx.StringStringEntryProto) } // @@protoc_insertion_point(class_scope:onnx.StringStringEntryProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<StringStringEntryProto> PARSER = new com.google.protobuf.AbstractParser<StringStringEntryProto>() { @java.lang.Override public StringStringEntryProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new StringStringEntryProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<StringStringEntryProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<StringStringEntryProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface TensorAnnotationOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.TensorAnnotation) com.google.protobuf.MessageOrBuilder { /** * <code>string tensor_name = 1;</code> */ java.lang.String getTensorName(); /** * <code>string tensor_name = 1;</code> */ com.google.protobuf.ByteString getTensorNameBytes(); /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getQuantParameterTensorNamesList(); /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getQuantParameterTensorNames(int index); /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ int getQuantParameterTensorNamesCount(); /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getQuantParameterTensorNamesOrBuilderList(); /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getQuantParameterTensorNamesOrBuilder( int index); } /** * Protobuf type {@code onnx.TensorAnnotation} */ public static final class TensorAnnotation extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.TensorAnnotation) TensorAnnotationOrBuilder { private static final long serialVersionUID = 0L; // Use TensorAnnotation.newBuilder() to construct. private TensorAnnotation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private TensorAnnotation() { tensorName_ = ""; quantParameterTensorNames_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new TensorAnnotation(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private TensorAnnotation( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); tensorName_ = s; break; } case 18: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { quantParameterTensorNames_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto>(); mutable_bitField0_ |= 0x00000001; } quantParameterTensorNames_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.parser(), extensionRegistry)); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { quantParameterTensorNames_ = java.util.Collections.unmodifiableList(quantParameterTensorNames_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorAnnotation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorAnnotation_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder.class); } public static final int TENSOR_NAME_FIELD_NUMBER = 1; private volatile java.lang.Object tensorName_; /** * <code>string tensor_name = 1;</code> */ public java.lang.String getTensorName() { java.lang.Object ref = tensorName_; 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(); tensorName_ = s; return s; } } /** * <code>string tensor_name = 1;</code> */ public com.google.protobuf.ByteString getTensorNameBytes() { java.lang.Object ref = tensorName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); tensorName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int QUANT_PARAMETER_TENSOR_NAMES_FIELD_NUMBER = 2; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> quantParameterTensorNames_; /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getQuantParameterTensorNamesList() { return quantParameterTensorNames_; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getQuantParameterTensorNamesOrBuilderList() { return quantParameterTensorNames_; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public int getQuantParameterTensorNamesCount() { return quantParameterTensorNames_.size(); } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getQuantParameterTensorNames(int index) { return quantParameterTensorNames_.get(index); } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getQuantParameterTensorNamesOrBuilder( int index) { return quantParameterTensorNames_.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 { if (!getTensorNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tensorName_); } for (int i = 0; i < quantParameterTensorNames_.size(); i++) { output.writeMessage(2, quantParameterTensorNames_.get(i)); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getTensorNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tensorName_); } for (int i = 0; i < quantParameterTensorNames_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, quantParameterTensorNames_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation other = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation) obj; if (!getTensorName() .equals(other.getTensorName())) return false; if (!getQuantParameterTensorNamesList() .equals(other.getQuantParameterTensorNamesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TENSOR_NAME_FIELD_NUMBER; hash = (53 * hash) + getTensorName().hashCode(); if (getQuantParameterTensorNamesCount() > 0) { hash = (37 * hash) + QUANT_PARAMETER_TENSOR_NAMES_FIELD_NUMBER; hash = (53 * hash) + getQuantParameterTensorNamesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation 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(org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation 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 onnx.TensorAnnotation} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.TensorAnnotation) org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorAnnotation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorAnnotation_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder.class); } // Construct using onnx.OnnxProto3.TensorAnnotation.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getQuantParameterTensorNamesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); tensorName_ = ""; if (quantParameterTensorNamesBuilder_ == null) { quantParameterTensorNames_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { quantParameterTensorNamesBuilder_.clear(); } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorAnnotation_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation build() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation result = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation(this); int from_bitField0_ = bitField0_; result.tensorName_ = tensorName_; if (quantParameterTensorNamesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { quantParameterTensorNames_ = java.util.Collections.unmodifiableList(quantParameterTensorNames_); bitField0_ = (bitField0_ & ~0x00000001); } result.quantParameterTensorNames_ = quantParameterTensorNames_; } else { result.quantParameterTensorNames_ = quantParameterTensorNamesBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.getDefaultInstance()) return this; if (!other.getTensorName().isEmpty()) { tensorName_ = other.tensorName_; onChanged(); } if (quantParameterTensorNamesBuilder_ == null) { if (!other.quantParameterTensorNames_.isEmpty()) { if (quantParameterTensorNames_.isEmpty()) { quantParameterTensorNames_ = other.quantParameterTensorNames_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureQuantParameterTensorNamesIsMutable(); quantParameterTensorNames_.addAll(other.quantParameterTensorNames_); } onChanged(); } } else { if (!other.quantParameterTensorNames_.isEmpty()) { if (quantParameterTensorNamesBuilder_.isEmpty()) { quantParameterTensorNamesBuilder_.dispose(); quantParameterTensorNamesBuilder_ = null; quantParameterTensorNames_ = other.quantParameterTensorNames_; bitField0_ = (bitField0_ & ~0x00000001); quantParameterTensorNamesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getQuantParameterTensorNamesFieldBuilder() : null; } else { quantParameterTensorNamesBuilder_.addAllMessages(other.quantParameterTensorNames_); } } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private java.lang.Object tensorName_ = ""; /** * <code>string tensor_name = 1;</code> */ public java.lang.String getTensorName() { java.lang.Object ref = tensorName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); tensorName_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string tensor_name = 1;</code> */ public com.google.protobuf.ByteString getTensorNameBytes() { java.lang.Object ref = tensorName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); tensorName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string tensor_name = 1;</code> */ public Builder setTensorName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } tensorName_ = value; onChanged(); return this; } /** * <code>string tensor_name = 1;</code> */ public Builder clearTensorName() { tensorName_ = getDefaultInstance().getTensorName(); onChanged(); return this; } /** * <code>string tensor_name = 1;</code> */ public Builder setTensorNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); tensorName_ = value; onChanged(); return this; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> quantParameterTensorNames_ = java.util.Collections.emptyList(); private void ensureQuantParameterTensorNamesIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { quantParameterTensorNames_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto>(quantParameterTensorNames_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> quantParameterTensorNamesBuilder_; /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getQuantParameterTensorNamesList() { if (quantParameterTensorNamesBuilder_ == null) { return java.util.Collections.unmodifiableList(quantParameterTensorNames_); } else { return quantParameterTensorNamesBuilder_.getMessageList(); } } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public int getQuantParameterTensorNamesCount() { if (quantParameterTensorNamesBuilder_ == null) { return quantParameterTensorNames_.size(); } else { return quantParameterTensorNamesBuilder_.getCount(); } } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getQuantParameterTensorNames(int index) { if (quantParameterTensorNamesBuilder_ == null) { return quantParameterTensorNames_.get(index); } else { return quantParameterTensorNamesBuilder_.getMessage(index); } } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder setQuantParameterTensorNames( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (quantParameterTensorNamesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureQuantParameterTensorNamesIsMutable(); quantParameterTensorNames_.set(index, value); onChanged(); } else { quantParameterTensorNamesBuilder_.setMessage(index, value); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder setQuantParameterTensorNames( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (quantParameterTensorNamesBuilder_ == null) { ensureQuantParameterTensorNamesIsMutable(); quantParameterTensorNames_.set(index, builderForValue.build()); onChanged(); } else { quantParameterTensorNamesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder addQuantParameterTensorNames(org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (quantParameterTensorNamesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureQuantParameterTensorNamesIsMutable(); quantParameterTensorNames_.add(value); onChanged(); } else { quantParameterTensorNamesBuilder_.addMessage(value); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder addQuantParameterTensorNames( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (quantParameterTensorNamesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureQuantParameterTensorNamesIsMutable(); quantParameterTensorNames_.add(index, value); onChanged(); } else { quantParameterTensorNamesBuilder_.addMessage(index, value); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder addQuantParameterTensorNames( org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (quantParameterTensorNamesBuilder_ == null) { ensureQuantParameterTensorNamesIsMutable(); quantParameterTensorNames_.add(builderForValue.build()); onChanged(); } else { quantParameterTensorNamesBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder addQuantParameterTensorNames( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (quantParameterTensorNamesBuilder_ == null) { ensureQuantParameterTensorNamesIsMutable(); quantParameterTensorNames_.add(index, builderForValue.build()); onChanged(); } else { quantParameterTensorNamesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder addAllQuantParameterTensorNames( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> values) { if (quantParameterTensorNamesBuilder_ == null) { ensureQuantParameterTensorNamesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, quantParameterTensorNames_); onChanged(); } else { quantParameterTensorNamesBuilder_.addAllMessages(values); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder clearQuantParameterTensorNames() { if (quantParameterTensorNamesBuilder_ == null) { quantParameterTensorNames_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { quantParameterTensorNamesBuilder_.clear(); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public Builder removeQuantParameterTensorNames(int index) { if (quantParameterTensorNamesBuilder_ == null) { ensureQuantParameterTensorNamesIsMutable(); quantParameterTensorNames_.remove(index); onChanged(); } else { quantParameterTensorNamesBuilder_.remove(index); } return this; } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder getQuantParameterTensorNamesBuilder( int index) { return getQuantParameterTensorNamesFieldBuilder().getBuilder(index); } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getQuantParameterTensorNamesOrBuilder( int index) { if (quantParameterTensorNamesBuilder_ == null) { return quantParameterTensorNames_.get(index); } else { return quantParameterTensorNamesBuilder_.getMessageOrBuilder(index); } } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getQuantParameterTensorNamesOrBuilderList() { if (quantParameterTensorNamesBuilder_ != null) { return quantParameterTensorNamesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(quantParameterTensorNames_); } } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder addQuantParameterTensorNamesBuilder() { return getQuantParameterTensorNamesFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.getDefaultInstance()); } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder addQuantParameterTensorNamesBuilder( int index) { return getQuantParameterTensorNamesFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.getDefaultInstance()); } /** * <pre> * &lt;key, value&gt; pairs to annotate tensor specified by &lt;tensor_name&gt; above. * The keys used in the mapping below must be pre-defined in ONNX spec. * For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as * quantization parameter keys. * </pre> * * <code>repeated .onnx.StringStringEntryProto quant_parameter_tensor_names = 2;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder> getQuantParameterTensorNamesBuilderList() { return getQuantParameterTensorNamesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getQuantParameterTensorNamesFieldBuilder() { if (quantParameterTensorNamesBuilder_ == null) { quantParameterTensorNamesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder>( quantParameterTensorNames_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); quantParameterTensorNames_ = null; } return quantParameterTensorNamesBuilder_; } @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:onnx.TensorAnnotation) } // @@protoc_insertion_point(class_scope:onnx.TensorAnnotation) private static final org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<TensorAnnotation> PARSER = new com.google.protobuf.AbstractParser<TensorAnnotation>() { @java.lang.Override public TensorAnnotation parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new TensorAnnotation(input, extensionRegistry); } }; public static com.google.protobuf.Parser<TensorAnnotation> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<TensorAnnotation> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface GraphProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.GraphProto) com.google.protobuf.MessageOrBuilder { /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto> getNodeList(); /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto getNode(int index); /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ int getNodeCount(); /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder> getNodeOrBuilderList(); /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder getNodeOrBuilder( int index); /** * <pre> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ java.lang.String getName(); /** * <pre> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ com.google.protobuf.ByteString getNameBytes(); /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> getInitializerList(); /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getInitializer(int index); /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ int getInitializerCount(); /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getInitializerOrBuilderList(); /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getInitializerOrBuilder( int index); /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ java.lang.String getDocString(); /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ com.google.protobuf.ByteString getDocStringBytes(); /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getInputList(); /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getInput(int index); /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ int getInputCount(); /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getInputOrBuilderList(); /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getInputOrBuilder( int index); /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getOutputList(); /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getOutput(int index); /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ int getOutputCount(); /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getOutputOrBuilderList(); /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getOutputOrBuilder( int index); /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getValueInfoList(); /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getValueInfo(int index); /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ int getValueInfoCount(); /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getValueInfoOrBuilderList(); /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getValueInfoOrBuilder( int index); /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation> getQuantizationAnnotationList(); /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation getQuantizationAnnotation(int index); /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ int getQuantizationAnnotationCount(); /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder> getQuantizationAnnotationOrBuilderList(); /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder getQuantizationAnnotationOrBuilder( int index); } /** * <pre> * Graphs * A graph defines the computational logic of a model and is comprised of a parameterized * list of nodes that form a directed acyclic graph based on their inputs and outputs. * This is the equivalent of the "network" or "graph" in many deep learning * frameworks. * </pre> * * Protobuf type {@code onnx.GraphProto} */ public static final class GraphProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.GraphProto) GraphProtoOrBuilder { private static final long serialVersionUID = 0L; // Use GraphProto.newBuilder() to construct. private GraphProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private GraphProto() { node_ = java.util.Collections.emptyList(); name_ = ""; initializer_ = java.util.Collections.emptyList(); docString_ = ""; input_ = java.util.Collections.emptyList(); output_ = java.util.Collections.emptyList(); valueInfo_ = java.util.Collections.emptyList(); quantizationAnnotation_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new GraphProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private GraphProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { node_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto>(); mutable_bitField0_ |= 0x00000001; } node_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.parser(), extensionRegistry)); break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 42: { if (!((mutable_bitField0_ & 0x00000002) != 0)) { initializer_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto>(); mutable_bitField0_ |= 0x00000002; } initializer_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.parser(), extensionRegistry)); break; } case 82: { java.lang.String s = input.readStringRequireUtf8(); docString_ = s; break; } case 90: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { input_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto>(); mutable_bitField0_ |= 0x00000004; } input_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.parser(), extensionRegistry)); break; } case 98: { if (!((mutable_bitField0_ & 0x00000008) != 0)) { output_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto>(); mutable_bitField0_ |= 0x00000008; } output_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.parser(), extensionRegistry)); break; } case 106: { if (!((mutable_bitField0_ & 0x00000010) != 0)) { valueInfo_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto>(); mutable_bitField0_ |= 0x00000010; } valueInfo_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.parser(), extensionRegistry)); break; } case 114: { if (!((mutable_bitField0_ & 0x00000020) != 0)) { quantizationAnnotation_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation>(); mutable_bitField0_ |= 0x00000020; } quantizationAnnotation_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.parser(), extensionRegistry)); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { node_ = java.util.Collections.unmodifiableList(node_); } if (((mutable_bitField0_ & 0x00000002) != 0)) { initializer_ = java.util.Collections.unmodifiableList(initializer_); } if (((mutable_bitField0_ & 0x00000004) != 0)) { input_ = java.util.Collections.unmodifiableList(input_); } if (((mutable_bitField0_ & 0x00000008) != 0)) { output_ = java.util.Collections.unmodifiableList(output_); } if (((mutable_bitField0_ & 0x00000010) != 0)) { valueInfo_ = java.util.Collections.unmodifiableList(valueInfo_); } if (((mutable_bitField0_ & 0x00000020) != 0)) { quantizationAnnotation_ = java.util.Collections.unmodifiableList(quantizationAnnotation_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_GraphProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_GraphProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder.class); } public static final int NODE_FIELD_NUMBER = 1; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto> node_; /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto> getNodeList() { return node_; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder> getNodeOrBuilderList() { return node_; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public int getNodeCount() { return node_.size(); } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto getNode(int index) { return node_.get(index); } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder getNodeOrBuilder( int index) { return node_.get(index); } public static final int NAME_FIELD_NUMBER = 2; private volatile java.lang.Object name_; /** * <pre> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <pre> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int INITIALIZER_FIELD_NUMBER = 5; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> initializer_; /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> getInitializerList() { return initializer_; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getInitializerOrBuilderList() { return initializer_; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public int getInitializerCount() { return initializer_.size(); } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getInitializer(int index) { return initializer_.get(index); } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getInitializerOrBuilder( int index) { return initializer_.get(index); } public static final int DOC_STRING_FIELD_NUMBER = 10; private volatile java.lang.Object docString_; /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; 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(); docString_ = s; return s; } } /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int INPUT_FIELD_NUMBER = 11; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> input_; /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getInputList() { return input_; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getInputOrBuilderList() { return input_; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public int getInputCount() { return input_.size(); } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getInput(int index) { return input_.get(index); } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getInputOrBuilder( int index) { return input_.get(index); } public static final int OUTPUT_FIELD_NUMBER = 12; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> output_; /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getOutputList() { return output_; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getOutputOrBuilderList() { return output_; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public int getOutputCount() { return output_.size(); } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getOutput(int index) { return output_.get(index); } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getOutputOrBuilder( int index) { return output_.get(index); } public static final int VALUE_INFO_FIELD_NUMBER = 13; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> valueInfo_; /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getValueInfoList() { return valueInfo_; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getValueInfoOrBuilderList() { return valueInfo_; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public int getValueInfoCount() { return valueInfo_.size(); } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getValueInfo(int index) { return valueInfo_.get(index); } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getValueInfoOrBuilder( int index) { return valueInfo_.get(index); } public static final int QUANTIZATION_ANNOTATION_FIELD_NUMBER = 14; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation> quantizationAnnotation_; /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation> getQuantizationAnnotationList() { return quantizationAnnotation_; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder> getQuantizationAnnotationOrBuilderList() { return quantizationAnnotation_; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public int getQuantizationAnnotationCount() { return quantizationAnnotation_.size(); } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation getQuantizationAnnotation(int index) { return quantizationAnnotation_.get(index); } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder getQuantizationAnnotationOrBuilder( int index) { return quantizationAnnotation_.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 < node_.size(); i++) { output.writeMessage(1, node_.get(i)); } if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); } for (int i = 0; i < initializer_.size(); i++) { output.writeMessage(5, initializer_.get(i)); } if (!getDocStringBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 10, docString_); } for (int i = 0; i < input_.size(); i++) { output.writeMessage(11, input_.get(i)); } for (int i = 0; i < output_.size(); i++) { output.writeMessage(12, output_.get(i)); } for (int i = 0; i < valueInfo_.size(); i++) { output.writeMessage(13, valueInfo_.get(i)); } for (int i = 0; i < quantizationAnnotation_.size(); i++) { output.writeMessage(14, quantizationAnnotation_.get(i)); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < node_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, node_.get(i)); } if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); } for (int i = 0; i < initializer_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, initializer_.get(i)); } if (!getDocStringBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, docString_); } for (int i = 0; i < input_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(11, input_.get(i)); } for (int i = 0; i < output_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(12, output_.get(i)); } for (int i = 0; i < valueInfo_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(13, valueInfo_.get(i)); } for (int i = 0; i < quantizationAnnotation_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(14, quantizationAnnotation_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto) obj; if (!getNodeList() .equals(other.getNodeList())) return false; if (!getName() .equals(other.getName())) return false; if (!getInitializerList() .equals(other.getInitializerList())) return false; if (!getDocString() .equals(other.getDocString())) return false; if (!getInputList() .equals(other.getInputList())) return false; if (!getOutputList() .equals(other.getOutputList())) return false; if (!getValueInfoList() .equals(other.getValueInfoList())) return false; if (!getQuantizationAnnotationList() .equals(other.getQuantizationAnnotationList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getNodeCount() > 0) { hash = (37 * hash) + NODE_FIELD_NUMBER; hash = (53 * hash) + getNodeList().hashCode(); } hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (getInitializerCount() > 0) { hash = (37 * hash) + INITIALIZER_FIELD_NUMBER; hash = (53 * hash) + getInitializerList().hashCode(); } hash = (37 * hash) + DOC_STRING_FIELD_NUMBER; hash = (53 * hash) + getDocString().hashCode(); if (getInputCount() > 0) { hash = (37 * hash) + INPUT_FIELD_NUMBER; hash = (53 * hash) + getInputList().hashCode(); } if (getOutputCount() > 0) { hash = (37 * hash) + OUTPUT_FIELD_NUMBER; hash = (53 * hash) + getOutputList().hashCode(); } if (getValueInfoCount() > 0) { hash = (37 * hash) + VALUE_INFO_FIELD_NUMBER; hash = (53 * hash) + getValueInfoList().hashCode(); } if (getQuantizationAnnotationCount() > 0) { hash = (37 * hash) + QUANTIZATION_ANNOTATION_FIELD_NUMBER; hash = (53 * hash) + getQuantizationAnnotationList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto 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> * Graphs * A graph defines the computational logic of a model and is comprised of a parameterized * list of nodes that form a directed acyclic graph based on their inputs and outputs. * This is the equivalent of the "network" or "graph" in many deep learning * frameworks. * </pre> * * Protobuf type {@code onnx.GraphProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.GraphProto) org.onnx4j.onnx.prototypes.OnnxProto3.GraphProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_GraphProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_GraphProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.Builder.class); } // Construct using onnx.OnnxProto3.GraphProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getNodeFieldBuilder(); getInitializerFieldBuilder(); getInputFieldBuilder(); getOutputFieldBuilder(); getValueInfoFieldBuilder(); getQuantizationAnnotationFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); if (nodeBuilder_ == null) { node_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { nodeBuilder_.clear(); } name_ = ""; if (initializerBuilder_ == null) { initializer_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); } else { initializerBuilder_.clear(); } docString_ = ""; if (inputBuilder_ == null) { input_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { inputBuilder_.clear(); } if (outputBuilder_ == null) { output_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); } else { outputBuilder_.clear(); } if (valueInfoBuilder_ == null) { valueInfo_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); } else { valueInfoBuilder_.clear(); } if (quantizationAnnotationBuilder_ == null) { quantizationAnnotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); } else { quantizationAnnotationBuilder_.clear(); } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_GraphProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto(this); int from_bitField0_ = bitField0_; if (nodeBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { node_ = java.util.Collections.unmodifiableList(node_); bitField0_ = (bitField0_ & ~0x00000001); } result.node_ = node_; } else { result.node_ = nodeBuilder_.build(); } result.name_ = name_; if (initializerBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { initializer_ = java.util.Collections.unmodifiableList(initializer_); bitField0_ = (bitField0_ & ~0x00000002); } result.initializer_ = initializer_; } else { result.initializer_ = initializerBuilder_.build(); } result.docString_ = docString_; if (inputBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { input_ = java.util.Collections.unmodifiableList(input_); bitField0_ = (bitField0_ & ~0x00000004); } result.input_ = input_; } else { result.input_ = inputBuilder_.build(); } if (outputBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0)) { output_ = java.util.Collections.unmodifiableList(output_); bitField0_ = (bitField0_ & ~0x00000008); } result.output_ = output_; } else { result.output_ = outputBuilder_.build(); } if (valueInfoBuilder_ == null) { if (((bitField0_ & 0x00000010) != 0)) { valueInfo_ = java.util.Collections.unmodifiableList(valueInfo_); bitField0_ = (bitField0_ & ~0x00000010); } result.valueInfo_ = valueInfo_; } else { result.valueInfo_ = valueInfoBuilder_.build(); } if (quantizationAnnotationBuilder_ == null) { if (((bitField0_ & 0x00000020) != 0)) { quantizationAnnotation_ = java.util.Collections.unmodifiableList(quantizationAnnotation_); bitField0_ = (bitField0_ & ~0x00000020); } result.quantizationAnnotation_ = quantizationAnnotation_; } else { result.quantizationAnnotation_ = quantizationAnnotationBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto.getDefaultInstance()) return this; if (nodeBuilder_ == null) { if (!other.node_.isEmpty()) { if (node_.isEmpty()) { node_ = other.node_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureNodeIsMutable(); node_.addAll(other.node_); } onChanged(); } } else { if (!other.node_.isEmpty()) { if (nodeBuilder_.isEmpty()) { nodeBuilder_.dispose(); nodeBuilder_ = null; node_ = other.node_; bitField0_ = (bitField0_ & ~0x00000001); nodeBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getNodeFieldBuilder() : null; } else { nodeBuilder_.addAllMessages(other.node_); } } } if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (initializerBuilder_ == null) { if (!other.initializer_.isEmpty()) { if (initializer_.isEmpty()) { initializer_ = other.initializer_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureInitializerIsMutable(); initializer_.addAll(other.initializer_); } onChanged(); } } else { if (!other.initializer_.isEmpty()) { if (initializerBuilder_.isEmpty()) { initializerBuilder_.dispose(); initializerBuilder_ = null; initializer_ = other.initializer_; bitField0_ = (bitField0_ & ~0x00000002); initializerBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getInitializerFieldBuilder() : null; } else { initializerBuilder_.addAllMessages(other.initializer_); } } } if (!other.getDocString().isEmpty()) { docString_ = other.docString_; onChanged(); } if (inputBuilder_ == null) { if (!other.input_.isEmpty()) { if (input_.isEmpty()) { input_ = other.input_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureInputIsMutable(); input_.addAll(other.input_); } onChanged(); } } else { if (!other.input_.isEmpty()) { if (inputBuilder_.isEmpty()) { inputBuilder_.dispose(); inputBuilder_ = null; input_ = other.input_; bitField0_ = (bitField0_ & ~0x00000004); inputBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getInputFieldBuilder() : null; } else { inputBuilder_.addAllMessages(other.input_); } } } if (outputBuilder_ == null) { if (!other.output_.isEmpty()) { if (output_.isEmpty()) { output_ = other.output_; bitField0_ = (bitField0_ & ~0x00000008); } else { ensureOutputIsMutable(); output_.addAll(other.output_); } onChanged(); } } else { if (!other.output_.isEmpty()) { if (outputBuilder_.isEmpty()) { outputBuilder_.dispose(); outputBuilder_ = null; output_ = other.output_; bitField0_ = (bitField0_ & ~0x00000008); outputBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getOutputFieldBuilder() : null; } else { outputBuilder_.addAllMessages(other.output_); } } } if (valueInfoBuilder_ == null) { if (!other.valueInfo_.isEmpty()) { if (valueInfo_.isEmpty()) { valueInfo_ = other.valueInfo_; bitField0_ = (bitField0_ & ~0x00000010); } else { ensureValueInfoIsMutable(); valueInfo_.addAll(other.valueInfo_); } onChanged(); } } else { if (!other.valueInfo_.isEmpty()) { if (valueInfoBuilder_.isEmpty()) { valueInfoBuilder_.dispose(); valueInfoBuilder_ = null; valueInfo_ = other.valueInfo_; bitField0_ = (bitField0_ & ~0x00000010); valueInfoBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getValueInfoFieldBuilder() : null; } else { valueInfoBuilder_.addAllMessages(other.valueInfo_); } } } if (quantizationAnnotationBuilder_ == null) { if (!other.quantizationAnnotation_.isEmpty()) { if (quantizationAnnotation_.isEmpty()) { quantizationAnnotation_ = other.quantizationAnnotation_; bitField0_ = (bitField0_ & ~0x00000020); } else { ensureQuantizationAnnotationIsMutable(); quantizationAnnotation_.addAll(other.quantizationAnnotation_); } onChanged(); } } else { if (!other.quantizationAnnotation_.isEmpty()) { if (quantizationAnnotationBuilder_.isEmpty()) { quantizationAnnotationBuilder_.dispose(); quantizationAnnotationBuilder_ = null; quantizationAnnotation_ = other.quantizationAnnotation_; bitField0_ = (bitField0_ & ~0x00000020); quantizationAnnotationBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getQuantizationAnnotationFieldBuilder() : null; } else { quantizationAnnotationBuilder_.addAllMessages(other.quantizationAnnotation_); } } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto> node_ = java.util.Collections.emptyList(); private void ensureNodeIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { node_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto>(node_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder> nodeBuilder_; /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto> getNodeList() { if (nodeBuilder_ == null) { return java.util.Collections.unmodifiableList(node_); } else { return nodeBuilder_.getMessageList(); } } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public int getNodeCount() { if (nodeBuilder_ == null) { return node_.size(); } else { return nodeBuilder_.getCount(); } } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto getNode(int index) { if (nodeBuilder_ == null) { return node_.get(index); } else { return nodeBuilder_.getMessage(index); } } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder setNode( int index, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto value) { if (nodeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureNodeIsMutable(); node_.set(index, value); onChanged(); } else { nodeBuilder_.setMessage(index, value); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder setNode( int index, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder builderForValue) { if (nodeBuilder_ == null) { ensureNodeIsMutable(); node_.set(index, builderForValue.build()); onChanged(); } else { nodeBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder addNode(org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto value) { if (nodeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureNodeIsMutable(); node_.add(value); onChanged(); } else { nodeBuilder_.addMessage(value); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder addNode( int index, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto value) { if (nodeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureNodeIsMutable(); node_.add(index, value); onChanged(); } else { nodeBuilder_.addMessage(index, value); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder addNode( org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder builderForValue) { if (nodeBuilder_ == null) { ensureNodeIsMutable(); node_.add(builderForValue.build()); onChanged(); } else { nodeBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder addNode( int index, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder builderForValue) { if (nodeBuilder_ == null) { ensureNodeIsMutable(); node_.add(index, builderForValue.build()); onChanged(); } else { nodeBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder addAllNode( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto> values) { if (nodeBuilder_ == null) { ensureNodeIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, node_); onChanged(); } else { nodeBuilder_.addAllMessages(values); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder clearNode() { if (nodeBuilder_ == null) { node_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { nodeBuilder_.clear(); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public Builder removeNode(int index) { if (nodeBuilder_ == null) { ensureNodeIsMutable(); node_.remove(index); onChanged(); } else { nodeBuilder_.remove(index); } return this; } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder getNodeBuilder( int index) { return getNodeFieldBuilder().getBuilder(index); } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder getNodeOrBuilder( int index) { if (nodeBuilder_ == null) { return node_.get(index); } else { return nodeBuilder_.getMessageOrBuilder(index); } } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder> getNodeOrBuilderList() { if (nodeBuilder_ != null) { return nodeBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(node_); } } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder addNodeBuilder() { return getNodeFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.getDefaultInstance()); } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder addNodeBuilder( int index) { return getNodeFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.getDefaultInstance()); } /** * <pre> * The nodes in the graph, sorted topologically. * </pre> * * <code>repeated .onnx.NodeProto node = 1;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder> getNodeBuilderList() { return getNodeFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder> getNodeFieldBuilder() { if (nodeBuilder_ == null) { nodeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.NodeProtoOrBuilder>( node_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); node_ = null; } return nodeBuilder_; } private java.lang.Object name_ = ""; /** * <pre> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ 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> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * <pre> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * <pre> * The name of the graph. * </pre> * * <code>string name = 2;</code> */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> initializer_ = java.util.Collections.emptyList(); private void ensureInitializerIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { initializer_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto>(initializer_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> initializerBuilder_; /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> getInitializerList() { if (initializerBuilder_ == null) { return java.util.Collections.unmodifiableList(initializer_); } else { return initializerBuilder_.getMessageList(); } } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public int getInitializerCount() { if (initializerBuilder_ == null) { return initializer_.size(); } else { return initializerBuilder_.getCount(); } } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getInitializer(int index) { if (initializerBuilder_ == null) { return initializer_.get(index); } else { return initializerBuilder_.getMessage(index); } } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder setInitializer( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto value) { if (initializerBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureInitializerIsMutable(); initializer_.set(index, value); onChanged(); } else { initializerBuilder_.setMessage(index, value); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder setInitializer( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder builderForValue) { if (initializerBuilder_ == null) { ensureInitializerIsMutable(); initializer_.set(index, builderForValue.build()); onChanged(); } else { initializerBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder addInitializer(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto value) { if (initializerBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureInitializerIsMutable(); initializer_.add(value); onChanged(); } else { initializerBuilder_.addMessage(value); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder addInitializer( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto value) { if (initializerBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureInitializerIsMutable(); initializer_.add(index, value); onChanged(); } else { initializerBuilder_.addMessage(index, value); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder addInitializer( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder builderForValue) { if (initializerBuilder_ == null) { ensureInitializerIsMutable(); initializer_.add(builderForValue.build()); onChanged(); } else { initializerBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder addInitializer( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder builderForValue) { if (initializerBuilder_ == null) { ensureInitializerIsMutable(); initializer_.add(index, builderForValue.build()); onChanged(); } else { initializerBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder addAllInitializer( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto> values) { if (initializerBuilder_ == null) { ensureInitializerIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, initializer_); onChanged(); } else { initializerBuilder_.addAllMessages(values); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder clearInitializer() { if (initializerBuilder_ == null) { initializer_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { initializerBuilder_.clear(); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public Builder removeInitializer(int index) { if (initializerBuilder_ == null) { ensureInitializerIsMutable(); initializer_.remove(index); onChanged(); } else { initializerBuilder_.remove(index); } return this; } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder getInitializerBuilder( int index) { return getInitializerFieldBuilder().getBuilder(index); } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder getInitializerOrBuilder( int index) { if (initializerBuilder_ == null) { return initializer_.get(index); } else { return initializerBuilder_.getMessageOrBuilder(index); } } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getInitializerOrBuilderList() { if (initializerBuilder_ != null) { return initializerBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(initializer_); } } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder addInitializerBuilder() { return getInitializerFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance()); } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder addInitializerBuilder( int index) { return getInitializerFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance()); } /** * <pre> * A list of named tensor values, used to specify constant inputs of the graph. * Each TensorProto entry must have a distinct name (within the list) that * MAY also appear in the input list. * </pre> * * <code>repeated .onnx.TensorProto initializer = 5;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder> getInitializerBuilderList() { return getInitializerFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder> getInitializerFieldBuilder() { if (initializerBuilder_ == null) { initializerBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder>( initializer_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); initializer_ = null; } return initializerBuilder_; } private java.lang.Object docString_ = ""; /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); docString_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ public Builder setDocString( java.lang.String value) { if (value == null) { throw new NullPointerException(); } docString_ = value; onChanged(); return this; } /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ public Builder clearDocString() { docString_ = getDefaultInstance().getDocString(); onChanged(); return this; } /** * <pre> * A human-readable documentation for this graph. Markdown is allowed. * </pre> * * <code>string doc_string = 10;</code> */ public Builder setDocStringBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); docString_ = value; onChanged(); return this; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> input_ = java.util.Collections.emptyList(); private void ensureInputIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { input_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto>(input_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> inputBuilder_; /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getInputList() { if (inputBuilder_ == null) { return java.util.Collections.unmodifiableList(input_); } else { return inputBuilder_.getMessageList(); } } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public int getInputCount() { if (inputBuilder_ == null) { return input_.size(); } else { return inputBuilder_.getCount(); } } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getInput(int index) { if (inputBuilder_ == null) { return input_.get(index); } else { return inputBuilder_.getMessage(index); } } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder setInput( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (inputBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureInputIsMutable(); input_.set(index, value); onChanged(); } else { inputBuilder_.setMessage(index, value); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder setInput( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (inputBuilder_ == null) { ensureInputIsMutable(); input_.set(index, builderForValue.build()); onChanged(); } else { inputBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder addInput(org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (inputBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureInputIsMutable(); input_.add(value); onChanged(); } else { inputBuilder_.addMessage(value); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder addInput( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (inputBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureInputIsMutable(); input_.add(index, value); onChanged(); } else { inputBuilder_.addMessage(index, value); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder addInput( org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (inputBuilder_ == null) { ensureInputIsMutable(); input_.add(builderForValue.build()); onChanged(); } else { inputBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder addInput( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (inputBuilder_ == null) { ensureInputIsMutable(); input_.add(index, builderForValue.build()); onChanged(); } else { inputBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder addAllInput( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> values) { if (inputBuilder_ == null) { ensureInputIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, input_); onChanged(); } else { inputBuilder_.addAllMessages(values); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder clearInput() { if (inputBuilder_ == null) { input_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { inputBuilder_.clear(); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public Builder removeInput(int index) { if (inputBuilder_ == null) { ensureInputIsMutable(); input_.remove(index); onChanged(); } else { inputBuilder_.remove(index); } return this; } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder getInputBuilder( int index) { return getInputFieldBuilder().getBuilder(index); } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getInputOrBuilder( int index) { if (inputBuilder_ == null) { return input_.get(index); } else { return inputBuilder_.getMessageOrBuilder(index); } } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getInputOrBuilderList() { if (inputBuilder_ != null) { return inputBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(input_); } } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder addInputBuilder() { return getInputFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.getDefaultInstance()); } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder addInputBuilder( int index) { return getInputFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.getDefaultInstance()); } /** * <pre> * The inputs and outputs of the graph. * </pre> * * <code>repeated .onnx.ValueInfoProto input = 11;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder> getInputBuilderList() { return getInputFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getInputFieldBuilder() { if (inputBuilder_ == null) { inputBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder>( input_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); input_ = null; } return inputBuilder_; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> output_ = java.util.Collections.emptyList(); private void ensureOutputIsMutable() { if (!((bitField0_ & 0x00000008) != 0)) { output_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto>(output_); bitField0_ |= 0x00000008; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> outputBuilder_; /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getOutputList() { if (outputBuilder_ == null) { return java.util.Collections.unmodifiableList(output_); } else { return outputBuilder_.getMessageList(); } } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public int getOutputCount() { if (outputBuilder_ == null) { return output_.size(); } else { return outputBuilder_.getCount(); } } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getOutput(int index) { if (outputBuilder_ == null) { return output_.get(index); } else { return outputBuilder_.getMessage(index); } } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder setOutput( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (outputBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureOutputIsMutable(); output_.set(index, value); onChanged(); } else { outputBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder setOutput( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (outputBuilder_ == null) { ensureOutputIsMutable(); output_.set(index, builderForValue.build()); onChanged(); } else { outputBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder addOutput(org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (outputBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureOutputIsMutable(); output_.add(value); onChanged(); } else { outputBuilder_.addMessage(value); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder addOutput( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (outputBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureOutputIsMutable(); output_.add(index, value); onChanged(); } else { outputBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder addOutput( org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (outputBuilder_ == null) { ensureOutputIsMutable(); output_.add(builderForValue.build()); onChanged(); } else { outputBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder addOutput( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (outputBuilder_ == null) { ensureOutputIsMutable(); output_.add(index, builderForValue.build()); onChanged(); } else { outputBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder addAllOutput( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> values) { if (outputBuilder_ == null) { ensureOutputIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, output_); onChanged(); } else { outputBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder clearOutput() { if (outputBuilder_ == null) { output_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { outputBuilder_.clear(); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public Builder removeOutput(int index) { if (outputBuilder_ == null) { ensureOutputIsMutable(); output_.remove(index); onChanged(); } else { outputBuilder_.remove(index); } return this; } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder getOutputBuilder( int index) { return getOutputFieldBuilder().getBuilder(index); } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getOutputOrBuilder( int index) { if (outputBuilder_ == null) { return output_.get(index); } else { return outputBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getOutputOrBuilderList() { if (outputBuilder_ != null) { return outputBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(output_); } } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder addOutputBuilder() { return getOutputFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.getDefaultInstance()); } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder addOutputBuilder( int index) { return getOutputFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.getDefaultInstance()); } /** * <code>repeated .onnx.ValueInfoProto output = 12;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder> getOutputBuilderList() { return getOutputFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getOutputFieldBuilder() { if (outputBuilder_ == null) { outputBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder>( output_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); output_ = null; } return outputBuilder_; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> valueInfo_ = java.util.Collections.emptyList(); private void ensureValueInfoIsMutable() { if (!((bitField0_ & 0x00000010) != 0)) { valueInfo_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto>(valueInfo_); bitField0_ |= 0x00000010; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> valueInfoBuilder_; /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> getValueInfoList() { if (valueInfoBuilder_ == null) { return java.util.Collections.unmodifiableList(valueInfo_); } else { return valueInfoBuilder_.getMessageList(); } } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public int getValueInfoCount() { if (valueInfoBuilder_ == null) { return valueInfo_.size(); } else { return valueInfoBuilder_.getCount(); } } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto getValueInfo(int index) { if (valueInfoBuilder_ == null) { return valueInfo_.get(index); } else { return valueInfoBuilder_.getMessage(index); } } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder setValueInfo( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (valueInfoBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureValueInfoIsMutable(); valueInfo_.set(index, value); onChanged(); } else { valueInfoBuilder_.setMessage(index, value); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder setValueInfo( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (valueInfoBuilder_ == null) { ensureValueInfoIsMutable(); valueInfo_.set(index, builderForValue.build()); onChanged(); } else { valueInfoBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder addValueInfo(org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (valueInfoBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureValueInfoIsMutable(); valueInfo_.add(value); onChanged(); } else { valueInfoBuilder_.addMessage(value); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder addValueInfo( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto value) { if (valueInfoBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureValueInfoIsMutable(); valueInfo_.add(index, value); onChanged(); } else { valueInfoBuilder_.addMessage(index, value); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder addValueInfo( org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (valueInfoBuilder_ == null) { ensureValueInfoIsMutable(); valueInfo_.add(builderForValue.build()); onChanged(); } else { valueInfoBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder addValueInfo( int index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder builderForValue) { if (valueInfoBuilder_ == null) { ensureValueInfoIsMutable(); valueInfo_.add(index, builderForValue.build()); onChanged(); } else { valueInfoBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder addAllValueInfo( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto> values) { if (valueInfoBuilder_ == null) { ensureValueInfoIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, valueInfo_); onChanged(); } else { valueInfoBuilder_.addAllMessages(values); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder clearValueInfo() { if (valueInfoBuilder_ == null) { valueInfo_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { valueInfoBuilder_.clear(); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public Builder removeValueInfo(int index) { if (valueInfoBuilder_ == null) { ensureValueInfoIsMutable(); valueInfo_.remove(index); onChanged(); } else { valueInfoBuilder_.remove(index); } return this; } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder getValueInfoBuilder( int index) { return getValueInfoFieldBuilder().getBuilder(index); } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder getValueInfoOrBuilder( int index) { if (valueInfoBuilder_ == null) { return valueInfo_.get(index); } else { return valueInfoBuilder_.getMessageOrBuilder(index); } } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getValueInfoOrBuilderList() { if (valueInfoBuilder_ != null) { return valueInfoBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(valueInfo_); } } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder addValueInfoBuilder() { return getValueInfoFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.getDefaultInstance()); } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder addValueInfoBuilder( int index) { return getValueInfoFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.getDefaultInstance()); } /** * <pre> * Information for the values in the graph. The ValueInfoProto.name's * must be distinct. It is optional for a value to appear in value_info list. * </pre> * * <code>repeated .onnx.ValueInfoProto value_info = 13;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder> getValueInfoBuilderList() { return getValueInfoFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder> getValueInfoFieldBuilder() { if (valueInfoBuilder_ == null) { valueInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.ValueInfoProtoOrBuilder>( valueInfo_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); valueInfo_ = null; } return valueInfoBuilder_; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation> quantizationAnnotation_ = java.util.Collections.emptyList(); private void ensureQuantizationAnnotationIsMutable() { if (!((bitField0_ & 0x00000020) != 0)) { quantizationAnnotation_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation>(quantizationAnnotation_); bitField0_ |= 0x00000020; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder> quantizationAnnotationBuilder_; /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation> getQuantizationAnnotationList() { if (quantizationAnnotationBuilder_ == null) { return java.util.Collections.unmodifiableList(quantizationAnnotation_); } else { return quantizationAnnotationBuilder_.getMessageList(); } } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public int getQuantizationAnnotationCount() { if (quantizationAnnotationBuilder_ == null) { return quantizationAnnotation_.size(); } else { return quantizationAnnotationBuilder_.getCount(); } } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation getQuantizationAnnotation(int index) { if (quantizationAnnotationBuilder_ == null) { return quantizationAnnotation_.get(index); } else { return quantizationAnnotationBuilder_.getMessage(index); } } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder setQuantizationAnnotation( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation value) { if (quantizationAnnotationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureQuantizationAnnotationIsMutable(); quantizationAnnotation_.set(index, value); onChanged(); } else { quantizationAnnotationBuilder_.setMessage(index, value); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder setQuantizationAnnotation( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder builderForValue) { if (quantizationAnnotationBuilder_ == null) { ensureQuantizationAnnotationIsMutable(); quantizationAnnotation_.set(index, builderForValue.build()); onChanged(); } else { quantizationAnnotationBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder addQuantizationAnnotation(org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation value) { if (quantizationAnnotationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureQuantizationAnnotationIsMutable(); quantizationAnnotation_.add(value); onChanged(); } else { quantizationAnnotationBuilder_.addMessage(value); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder addQuantizationAnnotation( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation value) { if (quantizationAnnotationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureQuantizationAnnotationIsMutable(); quantizationAnnotation_.add(index, value); onChanged(); } else { quantizationAnnotationBuilder_.addMessage(index, value); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder addQuantizationAnnotation( org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder builderForValue) { if (quantizationAnnotationBuilder_ == null) { ensureQuantizationAnnotationIsMutable(); quantizationAnnotation_.add(builderForValue.build()); onChanged(); } else { quantizationAnnotationBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder addQuantizationAnnotation( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder builderForValue) { if (quantizationAnnotationBuilder_ == null) { ensureQuantizationAnnotationIsMutable(); quantizationAnnotation_.add(index, builderForValue.build()); onChanged(); } else { quantizationAnnotationBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder addAllQuantizationAnnotation( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation> values) { if (quantizationAnnotationBuilder_ == null) { ensureQuantizationAnnotationIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, quantizationAnnotation_); onChanged(); } else { quantizationAnnotationBuilder_.addAllMessages(values); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder clearQuantizationAnnotation() { if (quantizationAnnotationBuilder_ == null) { quantizationAnnotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { quantizationAnnotationBuilder_.clear(); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public Builder removeQuantizationAnnotation(int index) { if (quantizationAnnotationBuilder_ == null) { ensureQuantizationAnnotationIsMutable(); quantizationAnnotation_.remove(index); onChanged(); } else { quantizationAnnotationBuilder_.remove(index); } return this; } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder getQuantizationAnnotationBuilder( int index) { return getQuantizationAnnotationFieldBuilder().getBuilder(index); } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder getQuantizationAnnotationOrBuilder( int index) { if (quantizationAnnotationBuilder_ == null) { return quantizationAnnotation_.get(index); } else { return quantizationAnnotationBuilder_.getMessageOrBuilder(index); } } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder> getQuantizationAnnotationOrBuilderList() { if (quantizationAnnotationBuilder_ != null) { return quantizationAnnotationBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(quantizationAnnotation_); } } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder addQuantizationAnnotationBuilder() { return getQuantizationAnnotationFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.getDefaultInstance()); } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder addQuantizationAnnotationBuilder( int index) { return getQuantizationAnnotationFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.getDefaultInstance()); } /** * <pre> * This field carries information to indicate the mapping among a tensor and its * quantization parameter tensors. For example: * For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated, * which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. * </pre> * * <code>repeated .onnx.TensorAnnotation quantization_annotation = 14;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder> getQuantizationAnnotationBuilderList() { return getQuantizationAnnotationFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder> getQuantizationAnnotationFieldBuilder() { if (quantizationAnnotationBuilder_ == null) { quantizationAnnotationBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotation.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorAnnotationOrBuilder>( quantizationAnnotation_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); quantizationAnnotation_ = null; } return quantizationAnnotationBuilder_; } @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:onnx.GraphProto) } // @@protoc_insertion_point(class_scope:onnx.GraphProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<GraphProto> PARSER = new com.google.protobuf.AbstractParser<GraphProto>() { @java.lang.Override public GraphProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new GraphProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<GraphProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<GraphProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.GraphProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface TensorProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.TensorProto) com.google.protobuf.MessageOrBuilder { /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ java.util.List<java.lang.Long> getDimsList(); /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ int getDimsCount(); /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ long getDims(int index); /** * <pre> * The data type of the tensor. * This field MUST have a valid TensorProto.DataType value * </pre> * * <code>int32 data_type = 2;</code> */ int getDataType(); /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ boolean hasSegment(); /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment getSegment(); /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.SegmentOrBuilder getSegmentOrBuilder(); /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ java.util.List<java.lang.Float> getFloatDataList(); /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ int getFloatDataCount(); /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ float getFloatData(int index); /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ java.util.List<java.lang.Integer> getInt32DataList(); /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ int getInt32DataCount(); /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ int getInt32Data(int index); /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ java.util.List<com.google.protobuf.ByteString> getStringDataList(); /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ int getStringDataCount(); /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ com.google.protobuf.ByteString getStringData(int index); /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ java.util.List<java.lang.Long> getInt64DataList(); /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ int getInt64DataCount(); /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ long getInt64Data(int index); /** * <pre> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ java.lang.String getName(); /** * <pre> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ com.google.protobuf.ByteString getNameBytes(); /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ java.lang.String getDocString(); /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ com.google.protobuf.ByteString getDocStringBytes(); /** * <pre> * Serializations can either use one of the fields above, or use this * raw bytes field. The only exception is the string case, where one is * required to store the content in the repeated bytes string_data field. * When this raw_data field is used to store tensor value, elements MUST * be stored in as fixed-width, little-endian order. * Floating-point data types MUST be stored in IEEE 754 format. * Complex64 elements must be written as two consecutive FLOAT values, real component first. * Complex128 elements must be written as two consecutive DOUBLE values, real component first. * Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false). * Note: the advantage of specific field rather than the raw_data field is * that in some cases (e.g. int data), protobuf does a better packing via * variable length storage, and may lead to smaller binary footprint. * When this field is present, the data_type field MUST NOT be STRING or UNDEFINED * </pre> * * <code>bytes raw_data = 9;</code> */ com.google.protobuf.ByteString getRawData(); /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getExternalDataList(); /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getExternalData(int index); /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ int getExternalDataCount(); /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getExternalDataOrBuilderList(); /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getExternalDataOrBuilder( int index); /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ int getDataLocationValue(); /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation getDataLocation(); /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ java.util.List<java.lang.Double> getDoubleDataList(); /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ int getDoubleDataCount(); /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ double getDoubleData(int index); /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ java.util.List<java.lang.Long> getUint64DataList(); /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ int getUint64DataCount(); /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ long getUint64Data(int index); } /** * <pre> * Tensors * A serialized tensor value. * </pre> * * Protobuf type {@code onnx.TensorProto} */ public static final class TensorProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.TensorProto) TensorProtoOrBuilder { private static final long serialVersionUID = 0L; // Use TensorProto.newBuilder() to construct. private TensorProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private TensorProto() { dims_ = emptyLongList(); floatData_ = emptyFloatList(); int32Data_ = emptyIntList(); stringData_ = java.util.Collections.emptyList(); int64Data_ = emptyLongList(); name_ = ""; docString_ = ""; rawData_ = com.google.protobuf.ByteString.EMPTY; externalData_ = java.util.Collections.emptyList(); dataLocation_ = 0; doubleData_ = emptyDoubleList(); uint64Data_ = emptyLongList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new TensorProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private TensorProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { dims_ = newLongList(); mutable_bitField0_ |= 0x00000001; } dims_.addLong(input.readInt64()); break; } case 10: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { dims_ = newLongList(); mutable_bitField0_ |= 0x00000001; } while (input.getBytesUntilLimit() > 0) { dims_.addLong(input.readInt64()); } input.popLimit(limit); break; } case 16: { dataType_ = input.readInt32(); break; } case 26: { org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.Builder subBuilder = null; if (segment_ != null) { subBuilder = segment_.toBuilder(); } segment_ = input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(segment_); segment_ = subBuilder.buildPartial(); } break; } case 37: { if (!((mutable_bitField0_ & 0x00000002) != 0)) { floatData_ = newFloatList(); mutable_bitField0_ |= 0x00000002; } floatData_.addFloat(input.readFloat()); break; } case 34: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { floatData_ = newFloatList(); mutable_bitField0_ |= 0x00000002; } while (input.getBytesUntilLimit() > 0) { floatData_.addFloat(input.readFloat()); } input.popLimit(limit); break; } case 40: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { int32Data_ = newIntList(); mutable_bitField0_ |= 0x00000004; } int32Data_.addInt(input.readInt32()); break; } case 42: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) { int32Data_ = newIntList(); mutable_bitField0_ |= 0x00000004; } while (input.getBytesUntilLimit() > 0) { int32Data_.addInt(input.readInt32()); } input.popLimit(limit); break; } case 50: { if (!((mutable_bitField0_ & 0x00000008) != 0)) { stringData_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); mutable_bitField0_ |= 0x00000008; } stringData_.add(input.readBytes()); break; } case 56: { if (!((mutable_bitField0_ & 0x00000010) != 0)) { int64Data_ = newLongList(); mutable_bitField0_ |= 0x00000010; } int64Data_.addLong(input.readInt64()); break; } case 58: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000010) != 0) && input.getBytesUntilLimit() > 0) { int64Data_ = newLongList(); mutable_bitField0_ |= 0x00000010; } while (input.getBytesUntilLimit() > 0) { int64Data_.addLong(input.readInt64()); } input.popLimit(limit); break; } case 66: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 74: { rawData_ = input.readBytes(); break; } case 81: { if (!((mutable_bitField0_ & 0x00000040) != 0)) { doubleData_ = newDoubleList(); mutable_bitField0_ |= 0x00000040; } doubleData_.addDouble(input.readDouble()); break; } case 82: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000040) != 0) && input.getBytesUntilLimit() > 0) { doubleData_ = newDoubleList(); mutable_bitField0_ |= 0x00000040; } while (input.getBytesUntilLimit() > 0) { doubleData_.addDouble(input.readDouble()); } input.popLimit(limit); break; } case 88: { if (!((mutable_bitField0_ & 0x00000080) != 0)) { uint64Data_ = newLongList(); mutable_bitField0_ |= 0x00000080; } uint64Data_.addLong(input.readUInt64()); break; } case 90: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); if (!((mutable_bitField0_ & 0x00000080) != 0) && input.getBytesUntilLimit() > 0) { uint64Data_ = newLongList(); mutable_bitField0_ |= 0x00000080; } while (input.getBytesUntilLimit() > 0) { uint64Data_.addLong(input.readUInt64()); } input.popLimit(limit); break; } case 98: { java.lang.String s = input.readStringRequireUtf8(); docString_ = s; break; } case 106: { if (!((mutable_bitField0_ & 0x00000020) != 0)) { externalData_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto>(); mutable_bitField0_ |= 0x00000020; } externalData_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.parser(), extensionRegistry)); break; } case 112: { int rawValue = input.readEnum(); dataLocation_ = rawValue; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { dims_.makeImmutable(); // C } if (((mutable_bitField0_ & 0x00000002) != 0)) { floatData_.makeImmutable(); // C } if (((mutable_bitField0_ & 0x00000004) != 0)) { int32Data_.makeImmutable(); // C } if (((mutable_bitField0_ & 0x00000008) != 0)) { stringData_ = java.util.Collections.unmodifiableList(stringData_); // C } if (((mutable_bitField0_ & 0x00000010) != 0)) { int64Data_.makeImmutable(); // C } if (((mutable_bitField0_ & 0x00000040) != 0)) { doubleData_.makeImmutable(); // C } if (((mutable_bitField0_ & 0x00000080) != 0)) { uint64Data_.makeImmutable(); // C } if (((mutable_bitField0_ & 0x00000020) != 0)) { externalData_ = java.util.Collections.unmodifiableList(externalData_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder.class); } /** * Protobuf enum {@code onnx.TensorProto.DataType} */ public enum DataType implements com.google.protobuf.ProtocolMessageEnum { /** * <code>UNDEFINED = 0;</code> */ UNDEFINED(0), /** * <pre> * Basic types. * </pre> * * <code>FLOAT = 1;</code> */ FLOAT(1), /** * <pre> * uint8_t * </pre> * * <code>UINT8 = 2;</code> */ UINT8(2), /** * <pre> * int8_t * </pre> * * <code>INT8 = 3;</code> */ INT8(3), /** * <pre> * uint16_t * </pre> * * <code>UINT16 = 4;</code> */ UINT16(4), /** * <pre> * int16_t * </pre> * * <code>INT16 = 5;</code> */ INT16(5), /** * <pre> * int32_t * </pre> * * <code>INT32 = 6;</code> */ INT32(6), /** * <pre> * int64_t * </pre> * * <code>INT64 = 7;</code> */ INT64(7), /** * <pre> * string * </pre> * * <code>STRING = 8;</code> */ STRING(8), /** * <pre> * bool * </pre> * * <code>BOOL = 9;</code> */ BOOL(9), /** * <pre> * IEEE754 half-precision floating-point format (16 bits wide). * This format has 1 sign bit, 5 exponent bits, and 10 mantissa bits. * </pre> * * <code>FLOAT16 = 10;</code> */ FLOAT16(10), /** * <code>DOUBLE = 11;</code> */ DOUBLE(11), /** * <code>UINT32 = 12;</code> */ UINT32(12), /** * <code>UINT64 = 13;</code> */ UINT64(13), /** * <pre> * complex with float32 real and imaginary components * </pre> * * <code>COMPLEX64 = 14;</code> */ COMPLEX64(14), /** * <pre> * complex with float64 real and imaginary components * </pre> * * <code>COMPLEX128 = 15;</code> */ COMPLEX128(15), /** * <pre> * Non-IEEE floating-point format based on IEEE754 single-precision * floating-point number truncated to 16 bits. * This format has 1 sign bit, 8 exponent bits, and 7 mantissa bits. * </pre> * * <code>BFLOAT16 = 16;</code> */ BFLOAT16(16), UNRECOGNIZED(-1), ; /** * <code>UNDEFINED = 0;</code> */ public static final int UNDEFINED_VALUE = 0; /** * <pre> * Basic types. * </pre> * * <code>FLOAT = 1;</code> */ public static final int FLOAT_VALUE = 1; /** * <pre> * uint8_t * </pre> * * <code>UINT8 = 2;</code> */ public static final int UINT8_VALUE = 2; /** * <pre> * int8_t * </pre> * * <code>INT8 = 3;</code> */ public static final int INT8_VALUE = 3; /** * <pre> * uint16_t * </pre> * * <code>UINT16 = 4;</code> */ public static final int UINT16_VALUE = 4; /** * <pre> * int16_t * </pre> * * <code>INT16 = 5;</code> */ public static final int INT16_VALUE = 5; /** * <pre> * int32_t * </pre> * * <code>INT32 = 6;</code> */ public static final int INT32_VALUE = 6; /** * <pre> * int64_t * </pre> * * <code>INT64 = 7;</code> */ public static final int INT64_VALUE = 7; /** * <pre> * string * </pre> * * <code>STRING = 8;</code> */ public static final int STRING_VALUE = 8; /** * <pre> * bool * </pre> * * <code>BOOL = 9;</code> */ public static final int BOOL_VALUE = 9; /** * <pre> * IEEE754 half-precision floating-point format (16 bits wide). * This format has 1 sign bit, 5 exponent bits, and 10 mantissa bits. * </pre> * * <code>FLOAT16 = 10;</code> */ public static final int FLOAT16_VALUE = 10; /** * <code>DOUBLE = 11;</code> */ public static final int DOUBLE_VALUE = 11; /** * <code>UINT32 = 12;</code> */ public static final int UINT32_VALUE = 12; /** * <code>UINT64 = 13;</code> */ public static final int UINT64_VALUE = 13; /** * <pre> * complex with float32 real and imaginary components * </pre> * * <code>COMPLEX64 = 14;</code> */ public static final int COMPLEX64_VALUE = 14; /** * <pre> * complex with float64 real and imaginary components * </pre> * * <code>COMPLEX128 = 15;</code> */ public static final int COMPLEX128_VALUE = 15; /** * <pre> * Non-IEEE floating-point format based on IEEE754 single-precision * floating-point number truncated to 16 bits. * This format has 1 sign bit, 8 exponent bits, and 7 mantissa bits. * </pre> * * <code>BFLOAT16 = 16;</code> */ public static final int BFLOAT16_VALUE = 16; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static DataType valueOf(int value) { return forNumber(value); } public static DataType forNumber(int value) { switch (value) { case 0: return UNDEFINED; case 1: return FLOAT; case 2: return UINT8; case 3: return INT8; case 4: return UINT16; case 5: return INT16; case 6: return INT32; case 7: return INT64; case 8: return STRING; case 9: return BOOL; case 10: return FLOAT16; case 11: return DOUBLE; case 12: return UINT32; case 13: return UINT64; case 14: return COMPLEX64; case 15: return COMPLEX128; case 16: return BFLOAT16; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<DataType> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< DataType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<DataType>() { public DataType findValueByNumber(int number) { return DataType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDescriptor().getEnumTypes().get(0); } private static final DataType[] VALUES = values(); public static DataType 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 DataType(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:onnx.TensorProto.DataType) } /** * <pre> * Location of the data for this tensor. MUST be one of: * - DEFAULT - data stored inside the protobuf message. Data is stored in raw_data (if set) otherwise in type-specified field. * - EXTERNAL - data stored in an external location as described by external_data field. * </pre> * * Protobuf enum {@code onnx.TensorProto.DataLocation} */ public enum DataLocation implements com.google.protobuf.ProtocolMessageEnum { /** * <code>DEFAULT = 0;</code> */ DEFAULT(0), /** * <code>EXTERNAL = 1;</code> */ EXTERNAL(1), UNRECOGNIZED(-1), ; /** * <code>DEFAULT = 0;</code> */ public static final int DEFAULT_VALUE = 0; /** * <code>EXTERNAL = 1;</code> */ public static final int EXTERNAL_VALUE = 1; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static DataLocation valueOf(int value) { return forNumber(value); } public static DataLocation forNumber(int value) { switch (value) { case 0: return DEFAULT; case 1: return EXTERNAL; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<DataLocation> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< DataLocation> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<DataLocation>() { public DataLocation findValueByNumber(int number) { return DataLocation.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDescriptor().getEnumTypes().get(1); } private static final DataLocation[] VALUES = values(); public static DataLocation 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 DataLocation(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:onnx.TensorProto.DataLocation) } public interface SegmentOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.TensorProto.Segment) com.google.protobuf.MessageOrBuilder { /** * <code>int64 begin = 1;</code> */ long getBegin(); /** * <code>int64 end = 2;</code> */ long getEnd(); } /** * <pre> * For very large tensors, we may want to store them in chunks, in which * case the following fields will specify the segment that is stored in * the current TensorProto. * </pre> * * Protobuf type {@code onnx.TensorProto.Segment} */ public static final class Segment extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.TensorProto.Segment) SegmentOrBuilder { private static final long serialVersionUID = 0L; // Use Segment.newBuilder() to construct. private Segment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Segment() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Segment(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Segment( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { begin_ = input.readInt64(); break; } case 16: { end_ = input.readInt64(); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_Segment_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_Segment_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.Builder.class); } public static final int BEGIN_FIELD_NUMBER = 1; private long begin_; /** * <code>int64 begin = 1;</code> */ public long getBegin() { return begin_; } public static final int END_FIELD_NUMBER = 2; private long end_; /** * <code>int64 end = 2;</code> */ public long getEnd() { return end_; } 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 (begin_ != 0L) { output.writeInt64(1, begin_); } if (end_ != 0L) { output.writeInt64(2, end_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (begin_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, begin_); } if (end_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(2, end_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment other = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment) obj; if (getBegin() != other.getBegin()) return false; if (getEnd() != other.getEnd()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + BEGIN_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getBegin()); hash = (37 * hash) + END_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getEnd()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment 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(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment 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> * For very large tensors, we may want to store them in chunks, in which * case the following fields will specify the segment that is stored in * the current TensorProto. * </pre> * * Protobuf type {@code onnx.TensorProto.Segment} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.TensorProto.Segment) org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.SegmentOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_Segment_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_Segment_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.Builder.class); } // Construct using onnx.OnnxProto3.TensorProto.Segment.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); begin_ = 0L; end_ = 0L; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_Segment_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment build() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment result = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment(this); result.begin_ = begin_; result.end_ = end_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.getDefaultInstance()) return this; if (other.getBegin() != 0L) { setBegin(other.getBegin()); } if (other.getEnd() != 0L) { setEnd(other.getEnd()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private long begin_ ; /** * <code>int64 begin = 1;</code> */ public long getBegin() { return begin_; } /** * <code>int64 begin = 1;</code> */ public Builder setBegin(long value) { begin_ = value; onChanged(); return this; } /** * <code>int64 begin = 1;</code> */ public Builder clearBegin() { begin_ = 0L; onChanged(); return this; } private long end_ ; /** * <code>int64 end = 2;</code> */ public long getEnd() { return end_; } /** * <code>int64 end = 2;</code> */ public Builder setEnd(long value) { end_ = value; onChanged(); return this; } /** * <code>int64 end = 2;</code> */ public Builder clearEnd() { end_ = 0L; 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:onnx.TensorProto.Segment) } // @@protoc_insertion_point(class_scope:onnx.TensorProto.Segment) private static final org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Segment> PARSER = new com.google.protobuf.AbstractParser<Segment>() { @java.lang.Override public Segment parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Segment(input, extensionRegistry); } }; public static com.google.protobuf.Parser<Segment> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Segment> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public static final int DIMS_FIELD_NUMBER = 1; private com.google.protobuf.Internal.LongList dims_; /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public java.util.List<java.lang.Long> getDimsList() { return dims_; } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public int getDimsCount() { return dims_.size(); } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public long getDims(int index) { return dims_.getLong(index); } private int dimsMemoizedSerializedSize = -1; public static final int DATA_TYPE_FIELD_NUMBER = 2; private int dataType_; /** * <pre> * The data type of the tensor. * This field MUST have a valid TensorProto.DataType value * </pre> * * <code>int32 data_type = 2;</code> */ public int getDataType() { return dataType_; } public static final int SEGMENT_FIELD_NUMBER = 3; private org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment segment_; /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public boolean hasSegment() { return segment_ != null; } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment getSegment() { return segment_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.getDefaultInstance() : segment_; } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.SegmentOrBuilder getSegmentOrBuilder() { return getSegment(); } public static final int FLOAT_DATA_FIELD_NUMBER = 4; private com.google.protobuf.Internal.FloatList floatData_; /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public java.util.List<java.lang.Float> getFloatDataList() { return floatData_; } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public int getFloatDataCount() { return floatData_.size(); } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public float getFloatData(int index) { return floatData_.getFloat(index); } private int floatDataMemoizedSerializedSize = -1; public static final int INT32_DATA_FIELD_NUMBER = 5; private com.google.protobuf.Internal.IntList int32Data_; /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public java.util.List<java.lang.Integer> getInt32DataList() { return int32Data_; } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public int getInt32DataCount() { return int32Data_.size(); } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public int getInt32Data(int index) { return int32Data_.getInt(index); } private int int32DataMemoizedSerializedSize = -1; public static final int STRING_DATA_FIELD_NUMBER = 6; private java.util.List<com.google.protobuf.ByteString> stringData_; /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public java.util.List<com.google.protobuf.ByteString> getStringDataList() { return stringData_; } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public int getStringDataCount() { return stringData_.size(); } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public com.google.protobuf.ByteString getStringData(int index) { return stringData_.get(index); } public static final int INT64_DATA_FIELD_NUMBER = 7; private com.google.protobuf.Internal.LongList int64Data_; /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public java.util.List<java.lang.Long> getInt64DataList() { return int64Data_; } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public int getInt64DataCount() { return int64Data_.size(); } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public long getInt64Data(int index) { return int64Data_.getLong(index); } private int int64DataMemoizedSerializedSize = -1; public static final int NAME_FIELD_NUMBER = 8; private volatile java.lang.Object name_; /** * <pre> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <pre> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DOC_STRING_FIELD_NUMBER = 12; private volatile java.lang.Object docString_; /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; 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(); docString_ = s; return s; } } /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int RAW_DATA_FIELD_NUMBER = 9; private com.google.protobuf.ByteString rawData_; /** * <pre> * Serializations can either use one of the fields above, or use this * raw bytes field. The only exception is the string case, where one is * required to store the content in the repeated bytes string_data field. * When this raw_data field is used to store tensor value, elements MUST * be stored in as fixed-width, little-endian order. * Floating-point data types MUST be stored in IEEE 754 format. * Complex64 elements must be written as two consecutive FLOAT values, real component first. * Complex128 elements must be written as two consecutive DOUBLE values, real component first. * Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false). * Note: the advantage of specific field rather than the raw_data field is * that in some cases (e.g. int data), protobuf does a better packing via * variable length storage, and may lead to smaller binary footprint. * When this field is present, the data_type field MUST NOT be STRING or UNDEFINED * </pre> * * <code>bytes raw_data = 9;</code> */ public com.google.protobuf.ByteString getRawData() { return rawData_; } public static final int EXTERNAL_DATA_FIELD_NUMBER = 13; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> externalData_; /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getExternalDataList() { return externalData_; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getExternalDataOrBuilderList() { return externalData_; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public int getExternalDataCount() { return externalData_.size(); } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getExternalData(int index) { return externalData_.get(index); } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getExternalDataOrBuilder( int index) { return externalData_.get(index); } public static final int DATA_LOCATION_FIELD_NUMBER = 14; private int dataLocation_; /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ public int getDataLocationValue() { return dataLocation_; } /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation getDataLocation() { @SuppressWarnings("deprecation") org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation result = org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation.valueOf(dataLocation_); return result == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation.UNRECOGNIZED : result; } public static final int DOUBLE_DATA_FIELD_NUMBER = 10; private com.google.protobuf.Internal.DoubleList doubleData_; /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public java.util.List<java.lang.Double> getDoubleDataList() { return doubleData_; } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public int getDoubleDataCount() { return doubleData_.size(); } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public double getDoubleData(int index) { return doubleData_.getDouble(index); } private int doubleDataMemoizedSerializedSize = -1; public static final int UINT64_DATA_FIELD_NUMBER = 11; private com.google.protobuf.Internal.LongList uint64Data_; /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public java.util.List<java.lang.Long> getUint64DataList() { return uint64Data_; } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public int getUint64DataCount() { return uint64Data_.size(); } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public long getUint64Data(int index) { return uint64Data_.getLong(index); } private int uint64DataMemoizedSerializedSize = -1; 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 { getSerializedSize(); if (getDimsList().size() > 0) { output.writeUInt32NoTag(10); output.writeUInt32NoTag(dimsMemoizedSerializedSize); } for (int i = 0; i < dims_.size(); i++) { output.writeInt64NoTag(dims_.getLong(i)); } if (dataType_ != 0) { output.writeInt32(2, dataType_); } if (segment_ != null) { output.writeMessage(3, getSegment()); } if (getFloatDataList().size() > 0) { output.writeUInt32NoTag(34); output.writeUInt32NoTag(floatDataMemoizedSerializedSize); } for (int i = 0; i < floatData_.size(); i++) { output.writeFloatNoTag(floatData_.getFloat(i)); } if (getInt32DataList().size() > 0) { output.writeUInt32NoTag(42); output.writeUInt32NoTag(int32DataMemoizedSerializedSize); } for (int i = 0; i < int32Data_.size(); i++) { output.writeInt32NoTag(int32Data_.getInt(i)); } for (int i = 0; i < stringData_.size(); i++) { output.writeBytes(6, stringData_.get(i)); } if (getInt64DataList().size() > 0) { output.writeUInt32NoTag(58); output.writeUInt32NoTag(int64DataMemoizedSerializedSize); } for (int i = 0; i < int64Data_.size(); i++) { output.writeInt64NoTag(int64Data_.getLong(i)); } if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 8, name_); } if (!rawData_.isEmpty()) { output.writeBytes(9, rawData_); } if (getDoubleDataList().size() > 0) { output.writeUInt32NoTag(82); output.writeUInt32NoTag(doubleDataMemoizedSerializedSize); } for (int i = 0; i < doubleData_.size(); i++) { output.writeDoubleNoTag(doubleData_.getDouble(i)); } if (getUint64DataList().size() > 0) { output.writeUInt32NoTag(90); output.writeUInt32NoTag(uint64DataMemoizedSerializedSize); } for (int i = 0; i < uint64Data_.size(); i++) { output.writeUInt64NoTag(uint64Data_.getLong(i)); } if (!getDocStringBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 12, docString_); } for (int i = 0; i < externalData_.size(); i++) { output.writeMessage(13, externalData_.get(i)); } if (dataLocation_ != org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation.DEFAULT.getNumber()) { output.writeEnum(14, dataLocation_); } unknownFields.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 < dims_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeInt64SizeNoTag(dims_.getLong(i)); } size += dataSize; if (!getDimsList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(dataSize); } dimsMemoizedSerializedSize = dataSize; } if (dataType_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, dataType_); } if (segment_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getSegment()); } { int dataSize = 0; dataSize = 4 * getFloatDataList().size(); size += dataSize; if (!getFloatDataList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(dataSize); } floatDataMemoizedSerializedSize = dataSize; } { int dataSize = 0; for (int i = 0; i < int32Data_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(int32Data_.getInt(i)); } size += dataSize; if (!getInt32DataList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(dataSize); } int32DataMemoizedSerializedSize = dataSize; } { int dataSize = 0; for (int i = 0; i < stringData_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(stringData_.get(i)); } size += dataSize; size += 1 * getStringDataList().size(); } { int dataSize = 0; for (int i = 0; i < int64Data_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeInt64SizeNoTag(int64Data_.getLong(i)); } size += dataSize; if (!getInt64DataList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(dataSize); } int64DataMemoizedSerializedSize = dataSize; } if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, name_); } if (!rawData_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(9, rawData_); } { int dataSize = 0; dataSize = 8 * getDoubleDataList().size(); size += dataSize; if (!getDoubleDataList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(dataSize); } doubleDataMemoizedSerializedSize = dataSize; } { int dataSize = 0; for (int i = 0; i < uint64Data_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeUInt64SizeNoTag(uint64Data_.getLong(i)); } size += dataSize; if (!getUint64DataList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeInt32SizeNoTag(dataSize); } uint64DataMemoizedSerializedSize = dataSize; } if (!getDocStringBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, docString_); } for (int i = 0; i < externalData_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(13, externalData_.get(i)); } if (dataLocation_ != org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation.DEFAULT.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(14, dataLocation_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto) obj; if (!getDimsList() .equals(other.getDimsList())) return false; if (getDataType() != other.getDataType()) return false; if (hasSegment() != other.hasSegment()) return false; if (hasSegment()) { if (!getSegment() .equals(other.getSegment())) return false; } if (!getFloatDataList() .equals(other.getFloatDataList())) return false; if (!getInt32DataList() .equals(other.getInt32DataList())) return false; if (!getStringDataList() .equals(other.getStringDataList())) return false; if (!getInt64DataList() .equals(other.getInt64DataList())) return false; if (!getName() .equals(other.getName())) return false; if (!getDocString() .equals(other.getDocString())) return false; if (!getRawData() .equals(other.getRawData())) return false; if (!getExternalDataList() .equals(other.getExternalDataList())) return false; if (dataLocation_ != other.dataLocation_) return false; if (!getDoubleDataList() .equals(other.getDoubleDataList())) return false; if (!getUint64DataList() .equals(other.getUint64DataList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getDimsCount() > 0) { hash = (37 * hash) + DIMS_FIELD_NUMBER; hash = (53 * hash) + getDimsList().hashCode(); } hash = (37 * hash) + DATA_TYPE_FIELD_NUMBER; hash = (53 * hash) + getDataType(); if (hasSegment()) { hash = (37 * hash) + SEGMENT_FIELD_NUMBER; hash = (53 * hash) + getSegment().hashCode(); } if (getFloatDataCount() > 0) { hash = (37 * hash) + FLOAT_DATA_FIELD_NUMBER; hash = (53 * hash) + getFloatDataList().hashCode(); } if (getInt32DataCount() > 0) { hash = (37 * hash) + INT32_DATA_FIELD_NUMBER; hash = (53 * hash) + getInt32DataList().hashCode(); } if (getStringDataCount() > 0) { hash = (37 * hash) + STRING_DATA_FIELD_NUMBER; hash = (53 * hash) + getStringDataList().hashCode(); } if (getInt64DataCount() > 0) { hash = (37 * hash) + INT64_DATA_FIELD_NUMBER; hash = (53 * hash) + getInt64DataList().hashCode(); } hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + DOC_STRING_FIELD_NUMBER; hash = (53 * hash) + getDocString().hashCode(); hash = (37 * hash) + RAW_DATA_FIELD_NUMBER; hash = (53 * hash) + getRawData().hashCode(); if (getExternalDataCount() > 0) { hash = (37 * hash) + EXTERNAL_DATA_FIELD_NUMBER; hash = (53 * hash) + getExternalDataList().hashCode(); } hash = (37 * hash) + DATA_LOCATION_FIELD_NUMBER; hash = (53 * hash) + dataLocation_; if (getDoubleDataCount() > 0) { hash = (37 * hash) + DOUBLE_DATA_FIELD_NUMBER; hash = (53 * hash) + getDoubleDataList().hashCode(); } if (getUint64DataCount() > 0) { hash = (37 * hash) + UINT64_DATA_FIELD_NUMBER; hash = (53 * hash) + getUint64DataList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto 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> * Tensors * A serialized tensor value. * </pre> * * Protobuf type {@code onnx.TensorProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.TensorProto) org.onnx4j.onnx.prototypes.OnnxProto3.TensorProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Builder.class); } // Construct using onnx.OnnxProto3.TensorProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getExternalDataFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); dims_ = emptyLongList(); bitField0_ = (bitField0_ & ~0x00000001); dataType_ = 0; if (segmentBuilder_ == null) { segment_ = null; } else { segment_ = null; segmentBuilder_ = null; } floatData_ = emptyFloatList(); bitField0_ = (bitField0_ & ~0x00000002); int32Data_ = emptyIntList(); bitField0_ = (bitField0_ & ~0x00000004); stringData_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); int64Data_ = emptyLongList(); bitField0_ = (bitField0_ & ~0x00000010); name_ = ""; docString_ = ""; rawData_ = com.google.protobuf.ByteString.EMPTY; if (externalDataBuilder_ == null) { externalData_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); } else { externalDataBuilder_.clear(); } dataLocation_ = 0; doubleData_ = emptyDoubleList(); bitField0_ = (bitField0_ & ~0x00000040); uint64Data_ = emptyLongList(); bitField0_ = (bitField0_ & ~0x00000080); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto(this); int from_bitField0_ = bitField0_; if (((bitField0_ & 0x00000001) != 0)) { dims_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000001); } result.dims_ = dims_; result.dataType_ = dataType_; if (segmentBuilder_ == null) { result.segment_ = segment_; } else { result.segment_ = segmentBuilder_.build(); } if (((bitField0_ & 0x00000002) != 0)) { floatData_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000002); } result.floatData_ = floatData_; if (((bitField0_ & 0x00000004) != 0)) { int32Data_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000004); } result.int32Data_ = int32Data_; if (((bitField0_ & 0x00000008) != 0)) { stringData_ = java.util.Collections.unmodifiableList(stringData_); bitField0_ = (bitField0_ & ~0x00000008); } result.stringData_ = stringData_; if (((bitField0_ & 0x00000010) != 0)) { int64Data_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000010); } result.int64Data_ = int64Data_; result.name_ = name_; result.docString_ = docString_; result.rawData_ = rawData_; if (externalDataBuilder_ == null) { if (((bitField0_ & 0x00000020) != 0)) { externalData_ = java.util.Collections.unmodifiableList(externalData_); bitField0_ = (bitField0_ & ~0x00000020); } result.externalData_ = externalData_; } else { result.externalData_ = externalDataBuilder_.build(); } result.dataLocation_ = dataLocation_; if (((bitField0_ & 0x00000040) != 0)) { doubleData_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000040); } result.doubleData_ = doubleData_; if (((bitField0_ & 0x00000080) != 0)) { uint64Data_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000080); } result.uint64Data_ = uint64Data_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.getDefaultInstance()) return this; if (!other.dims_.isEmpty()) { if (dims_.isEmpty()) { dims_ = other.dims_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDimsIsMutable(); dims_.addAll(other.dims_); } onChanged(); } if (other.getDataType() != 0) { setDataType(other.getDataType()); } if (other.hasSegment()) { mergeSegment(other.getSegment()); } if (!other.floatData_.isEmpty()) { if (floatData_.isEmpty()) { floatData_ = other.floatData_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureFloatDataIsMutable(); floatData_.addAll(other.floatData_); } onChanged(); } if (!other.int32Data_.isEmpty()) { if (int32Data_.isEmpty()) { int32Data_ = other.int32Data_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureInt32DataIsMutable(); int32Data_.addAll(other.int32Data_); } onChanged(); } if (!other.stringData_.isEmpty()) { if (stringData_.isEmpty()) { stringData_ = other.stringData_; bitField0_ = (bitField0_ & ~0x00000008); } else { ensureStringDataIsMutable(); stringData_.addAll(other.stringData_); } onChanged(); } if (!other.int64Data_.isEmpty()) { if (int64Data_.isEmpty()) { int64Data_ = other.int64Data_; bitField0_ = (bitField0_ & ~0x00000010); } else { ensureInt64DataIsMutable(); int64Data_.addAll(other.int64Data_); } onChanged(); } if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getDocString().isEmpty()) { docString_ = other.docString_; onChanged(); } if (other.getRawData() != com.google.protobuf.ByteString.EMPTY) { setRawData(other.getRawData()); } if (externalDataBuilder_ == null) { if (!other.externalData_.isEmpty()) { if (externalData_.isEmpty()) { externalData_ = other.externalData_; bitField0_ = (bitField0_ & ~0x00000020); } else { ensureExternalDataIsMutable(); externalData_.addAll(other.externalData_); } onChanged(); } } else { if (!other.externalData_.isEmpty()) { if (externalDataBuilder_.isEmpty()) { externalDataBuilder_.dispose(); externalDataBuilder_ = null; externalData_ = other.externalData_; bitField0_ = (bitField0_ & ~0x00000020); externalDataBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getExternalDataFieldBuilder() : null; } else { externalDataBuilder_.addAllMessages(other.externalData_); } } } if (other.dataLocation_ != 0) { setDataLocationValue(other.getDataLocationValue()); } if (!other.doubleData_.isEmpty()) { if (doubleData_.isEmpty()) { doubleData_ = other.doubleData_; bitField0_ = (bitField0_ & ~0x00000040); } else { ensureDoubleDataIsMutable(); doubleData_.addAll(other.doubleData_); } onChanged(); } if (!other.uint64Data_.isEmpty()) { if (uint64Data_.isEmpty()) { uint64Data_ = other.uint64Data_; bitField0_ = (bitField0_ & ~0x00000080); } else { ensureUint64DataIsMutable(); uint64Data_.addAll(other.uint64Data_); } onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private com.google.protobuf.Internal.LongList dims_ = emptyLongList(); private void ensureDimsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { dims_ = mutableCopy(dims_); bitField0_ |= 0x00000001; } } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public java.util.List<java.lang.Long> getDimsList() { return ((bitField0_ & 0x00000001) != 0) ? java.util.Collections.unmodifiableList(dims_) : dims_; } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public int getDimsCount() { return dims_.size(); } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public long getDims(int index) { return dims_.getLong(index); } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public Builder setDims( int index, long value) { ensureDimsIsMutable(); dims_.setLong(index, value); onChanged(); return this; } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public Builder addDims(long value) { ensureDimsIsMutable(); dims_.addLong(value); onChanged(); return this; } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public Builder addAllDims( java.lang.Iterable<? extends java.lang.Long> values) { ensureDimsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, dims_); onChanged(); return this; } /** * <pre> * The shape of the tensor. * </pre> * * <code>repeated int64 dims = 1;</code> */ public Builder clearDims() { dims_ = emptyLongList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } private int dataType_ ; /** * <pre> * The data type of the tensor. * This field MUST have a valid TensorProto.DataType value * </pre> * * <code>int32 data_type = 2;</code> */ public int getDataType() { return dataType_; } /** * <pre> * The data type of the tensor. * This field MUST have a valid TensorProto.DataType value * </pre> * * <code>int32 data_type = 2;</code> */ public Builder setDataType(int value) { dataType_ = value; onChanged(); return this; } /** * <pre> * The data type of the tensor. * This field MUST have a valid TensorProto.DataType value * </pre> * * <code>int32 data_type = 2;</code> */ public Builder clearDataType() { dataType_ = 0; onChanged(); return this; } private org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment segment_; private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.SegmentOrBuilder> segmentBuilder_; /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public boolean hasSegment() { return segmentBuilder_ != null || segment_ != null; } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment getSegment() { if (segmentBuilder_ == null) { return segment_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.getDefaultInstance() : segment_; } else { return segmentBuilder_.getMessage(); } } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public Builder setSegment(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment value) { if (segmentBuilder_ == null) { if (value == null) { throw new NullPointerException(); } segment_ = value; onChanged(); } else { segmentBuilder_.setMessage(value); } return this; } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public Builder setSegment( org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.Builder builderForValue) { if (segmentBuilder_ == null) { segment_ = builderForValue.build(); onChanged(); } else { segmentBuilder_.setMessage(builderForValue.build()); } return this; } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public Builder mergeSegment(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment value) { if (segmentBuilder_ == null) { if (segment_ != null) { segment_ = org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.newBuilder(segment_).mergeFrom(value).buildPartial(); } else { segment_ = value; } onChanged(); } else { segmentBuilder_.mergeFrom(value); } return this; } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public Builder clearSegment() { if (segmentBuilder_ == null) { segment_ = null; onChanged(); } else { segment_ = null; segmentBuilder_ = null; } return this; } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.Builder getSegmentBuilder() { onChanged(); return getSegmentFieldBuilder().getBuilder(); } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.SegmentOrBuilder getSegmentOrBuilder() { if (segmentBuilder_ != null) { return segmentBuilder_.getMessageOrBuilder(); } else { return segment_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.getDefaultInstance() : segment_; } } /** * <code>.onnx.TensorProto.Segment segment = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.SegmentOrBuilder> getSegmentFieldBuilder() { if (segmentBuilder_ == null) { segmentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.Segment.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.SegmentOrBuilder>( getSegment(), getParentForChildren(), isClean()); segment_ = null; } return segmentBuilder_; } private com.google.protobuf.Internal.FloatList floatData_ = emptyFloatList(); private void ensureFloatDataIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { floatData_ = mutableCopy(floatData_); bitField0_ |= 0x00000002; } } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public java.util.List<java.lang.Float> getFloatDataList() { return ((bitField0_ & 0x00000002) != 0) ? java.util.Collections.unmodifiableList(floatData_) : floatData_; } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public int getFloatDataCount() { return floatData_.size(); } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public float getFloatData(int index) { return floatData_.getFloat(index); } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public Builder setFloatData( int index, float value) { ensureFloatDataIsMutable(); floatData_.setFloat(index, value); onChanged(); return this; } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public Builder addFloatData(float value) { ensureFloatDataIsMutable(); floatData_.addFloat(value); onChanged(); return this; } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public Builder addAllFloatData( java.lang.Iterable<? extends java.lang.Float> values) { ensureFloatDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, floatData_); onChanged(); return this; } /** * <pre> * For float and complex64 values * Complex64 tensors are encoded as a single array of floats, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be FLOAT or COMPLEX64. * </pre> * * <code>repeated float float_data = 4 [packed = true];</code> */ public Builder clearFloatData() { floatData_ = emptyFloatList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } private com.google.protobuf.Internal.IntList int32Data_ = emptyIntList(); private void ensureInt32DataIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { int32Data_ = mutableCopy(int32Data_); bitField0_ |= 0x00000004; } } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public java.util.List<java.lang.Integer> getInt32DataList() { return ((bitField0_ & 0x00000004) != 0) ? java.util.Collections.unmodifiableList(int32Data_) : int32Data_; } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public int getInt32DataCount() { return int32Data_.size(); } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public int getInt32Data(int index) { return int32Data_.getInt(index); } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public Builder setInt32Data( int index, int value) { ensureInt32DataIsMutable(); int32Data_.setInt(index, value); onChanged(); return this; } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public Builder addInt32Data(int value) { ensureInt32DataIsMutable(); int32Data_.addInt(value); onChanged(); return this; } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public Builder addAllInt32Data( java.lang.Iterable<? extends java.lang.Integer> values) { ensureInt32DataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, int32Data_); onChanged(); return this; } /** * <pre> * For int32, uint8, int8, uint16, int16, bool, and float16 values * float16 values must be bit-wise converted to an uint16_t prior * to writing to the buffer. * When this field is present, the data_type field MUST be * INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 * </pre> * * <code>repeated int32 int32_data = 5 [packed = true];</code> */ public Builder clearInt32Data() { int32Data_ = emptyIntList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } private java.util.List<com.google.protobuf.ByteString> stringData_ = java.util.Collections.emptyList(); private void ensureStringDataIsMutable() { if (!((bitField0_ & 0x00000008) != 0)) { stringData_ = new java.util.ArrayList<com.google.protobuf.ByteString>(stringData_); bitField0_ |= 0x00000008; } } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public java.util.List<com.google.protobuf.ByteString> getStringDataList() { return ((bitField0_ & 0x00000008) != 0) ? java.util.Collections.unmodifiableList(stringData_) : stringData_; } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public int getStringDataCount() { return stringData_.size(); } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public com.google.protobuf.ByteString getStringData(int index) { return stringData_.get(index); } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public Builder setStringData( int index, com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureStringDataIsMutable(); stringData_.set(index, value); onChanged(); return this; } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public Builder addStringData(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureStringDataIsMutable(); stringData_.add(value); onChanged(); return this; } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public Builder addAllStringData( java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { ensureStringDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, stringData_); onChanged(); return this; } /** * <pre> * For strings. * Each element of string_data is a UTF-8 encoded Unicode * string. No trailing null, no leading BOM. The protobuf "string" * scalar type is not used to match ML community conventions. * When this field is present, the data_type field MUST be STRING * </pre> * * <code>repeated bytes string_data = 6;</code> */ public Builder clearStringData() { stringData_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } private com.google.protobuf.Internal.LongList int64Data_ = emptyLongList(); private void ensureInt64DataIsMutable() { if (!((bitField0_ & 0x00000010) != 0)) { int64Data_ = mutableCopy(int64Data_); bitField0_ |= 0x00000010; } } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public java.util.List<java.lang.Long> getInt64DataList() { return ((bitField0_ & 0x00000010) != 0) ? java.util.Collections.unmodifiableList(int64Data_) : int64Data_; } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public int getInt64DataCount() { return int64Data_.size(); } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public long getInt64Data(int index) { return int64Data_.getLong(index); } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public Builder setInt64Data( int index, long value) { ensureInt64DataIsMutable(); int64Data_.setLong(index, value); onChanged(); return this; } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public Builder addInt64Data(long value) { ensureInt64DataIsMutable(); int64Data_.addLong(value); onChanged(); return this; } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public Builder addAllInt64Data( java.lang.Iterable<? extends java.lang.Long> values) { ensureInt64DataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, int64Data_); onChanged(); return this; } /** * <pre> * For int64. * When this field is present, the data_type field MUST be INT64 * </pre> * * <code>repeated int64 int64_data = 7 [packed = true];</code> */ public Builder clearInt64Data() { int64Data_ = emptyLongList(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } private java.lang.Object name_ = ""; /** * <pre> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ 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> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * <pre> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * <pre> * Optionally, a name for the tensor. * </pre> * * <code>string name = 8;</code> */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private java.lang.Object docString_ = ""; /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ public java.lang.String getDocString() { java.lang.Object ref = docString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); docString_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ public com.google.protobuf.ByteString getDocStringBytes() { java.lang.Object ref = docString_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); docString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ public Builder setDocString( java.lang.String value) { if (value == null) { throw new NullPointerException(); } docString_ = value; onChanged(); return this; } /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ public Builder clearDocString() { docString_ = getDefaultInstance().getDocString(); onChanged(); return this; } /** * <pre> * A human-readable documentation for this tensor. Markdown is allowed. * </pre> * * <code>string doc_string = 12;</code> */ public Builder setDocStringBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); docString_ = value; onChanged(); return this; } private com.google.protobuf.ByteString rawData_ = com.google.protobuf.ByteString.EMPTY; /** * <pre> * Serializations can either use one of the fields above, or use this * raw bytes field. The only exception is the string case, where one is * required to store the content in the repeated bytes string_data field. * When this raw_data field is used to store tensor value, elements MUST * be stored in as fixed-width, little-endian order. * Floating-point data types MUST be stored in IEEE 754 format. * Complex64 elements must be written as two consecutive FLOAT values, real component first. * Complex128 elements must be written as two consecutive DOUBLE values, real component first. * Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false). * Note: the advantage of specific field rather than the raw_data field is * that in some cases (e.g. int data), protobuf does a better packing via * variable length storage, and may lead to smaller binary footprint. * When this field is present, the data_type field MUST NOT be STRING or UNDEFINED * </pre> * * <code>bytes raw_data = 9;</code> */ public com.google.protobuf.ByteString getRawData() { return rawData_; } /** * <pre> * Serializations can either use one of the fields above, or use this * raw bytes field. The only exception is the string case, where one is * required to store the content in the repeated bytes string_data field. * When this raw_data field is used to store tensor value, elements MUST * be stored in as fixed-width, little-endian order. * Floating-point data types MUST be stored in IEEE 754 format. * Complex64 elements must be written as two consecutive FLOAT values, real component first. * Complex128 elements must be written as two consecutive DOUBLE values, real component first. * Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false). * Note: the advantage of specific field rather than the raw_data field is * that in some cases (e.g. int data), protobuf does a better packing via * variable length storage, and may lead to smaller binary footprint. * When this field is present, the data_type field MUST NOT be STRING or UNDEFINED * </pre> * * <code>bytes raw_data = 9;</code> */ public Builder setRawData(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } rawData_ = value; onChanged(); return this; } /** * <pre> * Serializations can either use one of the fields above, or use this * raw bytes field. The only exception is the string case, where one is * required to store the content in the repeated bytes string_data field. * When this raw_data field is used to store tensor value, elements MUST * be stored in as fixed-width, little-endian order. * Floating-point data types MUST be stored in IEEE 754 format. * Complex64 elements must be written as two consecutive FLOAT values, real component first. * Complex128 elements must be written as two consecutive DOUBLE values, real component first. * Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false). * Note: the advantage of specific field rather than the raw_data field is * that in some cases (e.g. int data), protobuf does a better packing via * variable length storage, and may lead to smaller binary footprint. * When this field is present, the data_type field MUST NOT be STRING or UNDEFINED * </pre> * * <code>bytes raw_data = 9;</code> */ public Builder clearRawData() { rawData_ = getDefaultInstance().getRawData(); onChanged(); return this; } private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> externalData_ = java.util.Collections.emptyList(); private void ensureExternalDataIsMutable() { if (!((bitField0_ & 0x00000020) != 0)) { externalData_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto>(externalData_); bitField0_ |= 0x00000020; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> externalDataBuilder_; /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> getExternalDataList() { if (externalDataBuilder_ == null) { return java.util.Collections.unmodifiableList(externalData_); } else { return externalDataBuilder_.getMessageList(); } } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public int getExternalDataCount() { if (externalDataBuilder_ == null) { return externalData_.size(); } else { return externalDataBuilder_.getCount(); } } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto getExternalData(int index) { if (externalDataBuilder_ == null) { return externalData_.get(index); } else { return externalDataBuilder_.getMessage(index); } } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder setExternalData( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (externalDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExternalDataIsMutable(); externalData_.set(index, value); onChanged(); } else { externalDataBuilder_.setMessage(index, value); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder setExternalData( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (externalDataBuilder_ == null) { ensureExternalDataIsMutable(); externalData_.set(index, builderForValue.build()); onChanged(); } else { externalDataBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder addExternalData(org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (externalDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExternalDataIsMutable(); externalData_.add(value); onChanged(); } else { externalDataBuilder_.addMessage(value); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder addExternalData( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto value) { if (externalDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExternalDataIsMutable(); externalData_.add(index, value); onChanged(); } else { externalDataBuilder_.addMessage(index, value); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder addExternalData( org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (externalDataBuilder_ == null) { ensureExternalDataIsMutable(); externalData_.add(builderForValue.build()); onChanged(); } else { externalDataBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder addExternalData( int index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder builderForValue) { if (externalDataBuilder_ == null) { ensureExternalDataIsMutable(); externalData_.add(index, builderForValue.build()); onChanged(); } else { externalDataBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder addAllExternalData( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto> values) { if (externalDataBuilder_ == null) { ensureExternalDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, externalData_); onChanged(); } else { externalDataBuilder_.addAllMessages(values); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder clearExternalData() { if (externalDataBuilder_ == null) { externalData_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { externalDataBuilder_.clear(); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public Builder removeExternalData(int index) { if (externalDataBuilder_ == null) { ensureExternalDataIsMutable(); externalData_.remove(index); onChanged(); } else { externalDataBuilder_.remove(index); } return this; } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder getExternalDataBuilder( int index) { return getExternalDataFieldBuilder().getBuilder(index); } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder getExternalDataOrBuilder( int index) { if (externalDataBuilder_ == null) { return externalData_.get(index); } else { return externalDataBuilder_.getMessageOrBuilder(index); } } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getExternalDataOrBuilderList() { if (externalDataBuilder_ != null) { return externalDataBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(externalData_); } } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder addExternalDataBuilder() { return getExternalDataFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.getDefaultInstance()); } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder addExternalDataBuilder( int index) { return getExternalDataFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.getDefaultInstance()); } /** * <pre> * Data can be stored inside the protobuf file using type-specific fields or raw_data. * Alternatively, raw bytes data can be stored in an external file, using the external_data field. * external_data stores key-value pairs describing data location. Recognized keys are: * - "location" (required) - POSIX filesystem path relative to the directory where the ONNX * protobuf model was stored * - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. * Offset values SHOULD be multiples 4096 (page size) to enable mmap support. * - "length" (optional) - number of bytes containing data. Integer stored as string. * - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. * </pre> * * <code>repeated .onnx.StringStringEntryProto external_data = 13;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder> getExternalDataBuilderList() { return getExternalDataFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder> getExternalDataFieldBuilder() { if (externalDataBuilder_ == null) { externalDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.StringStringEntryProtoOrBuilder>( externalData_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); externalData_ = null; } return externalDataBuilder_; } private int dataLocation_ = 0; /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ public int getDataLocationValue() { return dataLocation_; } /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ public Builder setDataLocationValue(int value) { dataLocation_ = value; onChanged(); return this; } /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation getDataLocation() { @SuppressWarnings("deprecation") org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation result = org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation.valueOf(dataLocation_); return result == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation.UNRECOGNIZED : result; } /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ public Builder setDataLocation(org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto.DataLocation value) { if (value == null) { throw new NullPointerException(); } dataLocation_ = value.getNumber(); onChanged(); return this; } /** * <pre> * If value not set, data is stored in raw_data (if set) otherwise in type-specified field. * </pre> * * <code>.onnx.TensorProto.DataLocation data_location = 14;</code> */ public Builder clearDataLocation() { dataLocation_ = 0; onChanged(); return this; } private com.google.protobuf.Internal.DoubleList doubleData_ = emptyDoubleList(); private void ensureDoubleDataIsMutable() { if (!((bitField0_ & 0x00000040) != 0)) { doubleData_ = mutableCopy(doubleData_); bitField0_ |= 0x00000040; } } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public java.util.List<java.lang.Double> getDoubleDataList() { return ((bitField0_ & 0x00000040) != 0) ? java.util.Collections.unmodifiableList(doubleData_) : doubleData_; } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public int getDoubleDataCount() { return doubleData_.size(); } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public double getDoubleData(int index) { return doubleData_.getDouble(index); } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public Builder setDoubleData( int index, double value) { ensureDoubleDataIsMutable(); doubleData_.setDouble(index, value); onChanged(); return this; } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public Builder addDoubleData(double value) { ensureDoubleDataIsMutable(); doubleData_.addDouble(value); onChanged(); return this; } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public Builder addAllDoubleData( java.lang.Iterable<? extends java.lang.Double> values) { ensureDoubleDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, doubleData_); onChanged(); return this; } /** * <pre> * For double * Complex128 tensors are encoded as a single array of doubles, * with the real components appearing in odd numbered positions, * and the corresponding imaginary component apparing in the * subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] * is encoded as [1.0, 2.0 ,3.0 ,4.0] * When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 * </pre> * * <code>repeated double double_data = 10 [packed = true];</code> */ public Builder clearDoubleData() { doubleData_ = emptyDoubleList(); bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } private com.google.protobuf.Internal.LongList uint64Data_ = emptyLongList(); private void ensureUint64DataIsMutable() { if (!((bitField0_ & 0x00000080) != 0)) { uint64Data_ = mutableCopy(uint64Data_); bitField0_ |= 0x00000080; } } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public java.util.List<java.lang.Long> getUint64DataList() { return ((bitField0_ & 0x00000080) != 0) ? java.util.Collections.unmodifiableList(uint64Data_) : uint64Data_; } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public int getUint64DataCount() { return uint64Data_.size(); } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public long getUint64Data(int index) { return uint64Data_.getLong(index); } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public Builder setUint64Data( int index, long value) { ensureUint64DataIsMutable(); uint64Data_.setLong(index, value); onChanged(); return this; } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public Builder addUint64Data(long value) { ensureUint64DataIsMutable(); uint64Data_.addLong(value); onChanged(); return this; } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public Builder addAllUint64Data( java.lang.Iterable<? extends java.lang.Long> values) { ensureUint64DataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, uint64Data_); onChanged(); return this; } /** * <pre> * For uint64 and uint32 values * When this field is present, the data_type field MUST be * UINT32 or UINT64 * </pre> * * <code>repeated uint64 uint64_data = 11 [packed = true];</code> */ public Builder clearUint64Data() { uint64Data_ = emptyLongList(); bitField0_ = (bitField0_ & ~0x00000080); 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:onnx.TensorProto) } // @@protoc_insertion_point(class_scope:onnx.TensorProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<TensorProto> PARSER = new com.google.protobuf.AbstractParser<TensorProto>() { @java.lang.Override public TensorProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new TensorProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<TensorProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<TensorProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface TensorShapeProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.TensorShapeProto) com.google.protobuf.MessageOrBuilder { /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension> getDimList(); /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension getDim(int index); /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ int getDimCount(); /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder> getDimOrBuilderList(); /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder getDimOrBuilder( int index); } /** * <pre> * Defines a tensor shape. A dimension can be either an integer value * or a symbolic variable. A symbolic variable represents an unknown * dimension. * </pre> * * Protobuf type {@code onnx.TensorShapeProto} */ public static final class TensorShapeProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.TensorShapeProto) TensorShapeProtoOrBuilder { private static final long serialVersionUID = 0L; // Use TensorShapeProto.newBuilder() to construct. private TensorShapeProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private TensorShapeProto() { dim_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new TensorShapeProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private TensorShapeProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { dim_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension>(); mutable_bitField0_ |= 0x00000001; } dim_.add( input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.parser(), extensionRegistry)); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { dim_ = java.util.Collections.unmodifiableList(dim_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Builder.class); } public interface DimensionOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.TensorShapeProto.Dimension) com.google.protobuf.MessageOrBuilder { /** * <code>int64 dim_value = 1;</code> */ long getDimValue(); /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ java.lang.String getDimParam(); /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ com.google.protobuf.ByteString getDimParamBytes(); /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ java.lang.String getDenotation(); /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ com.google.protobuf.ByteString getDenotationBytes(); public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.ValueCase getValueCase(); } /** * Protobuf type {@code onnx.TensorShapeProto.Dimension} */ public static final class Dimension extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.TensorShapeProto.Dimension) DimensionOrBuilder { private static final long serialVersionUID = 0L; // Use Dimension.newBuilder() to construct. private Dimension(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Dimension() { denotation_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Dimension(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Dimension( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { valueCase_ = 1; value_ = input.readInt64(); break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); valueCase_ = 2; value_ = s; break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); denotation_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_Dimension_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_Dimension_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder.class); } private int valueCase_ = 0; private java.lang.Object value_; public enum ValueCase implements com.google.protobuf.Internal.EnumLite { DIM_VALUE(1), DIM_PARAM(2), VALUE_NOT_SET(0); private final int value; private ValueCase(int value) { this.value = value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static ValueCase valueOf(int value) { return forNumber(value); } public static ValueCase forNumber(int value) { switch (value) { case 1: return DIM_VALUE; case 2: return DIM_PARAM; case 0: return VALUE_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public ValueCase getValueCase() { return ValueCase.forNumber( valueCase_); } public static final int DIM_VALUE_FIELD_NUMBER = 1; /** * <code>int64 dim_value = 1;</code> */ public long getDimValue() { if (valueCase_ == 1) { return (java.lang.Long) value_; } return 0L; } public static final int DIM_PARAM_FIELD_NUMBER = 2; /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ public java.lang.String getDimParam() { java.lang.Object ref = ""; if (valueCase_ == 2) { ref = value_; } if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (valueCase_ == 2) { value_ = s; } return s; } } /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ public com.google.protobuf.ByteString getDimParamBytes() { java.lang.Object ref = ""; if (valueCase_ == 2) { ref = value_; } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); if (valueCase_ == 2) { value_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DENOTATION_FIELD_NUMBER = 3; private volatile java.lang.Object denotation_; /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ public java.lang.String getDenotation() { java.lang.Object ref = denotation_; 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(); denotation_ = s; return s; } } /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ public com.google.protobuf.ByteString getDenotationBytes() { java.lang.Object ref = denotation_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); denotation_ = 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 (valueCase_ == 1) { output.writeInt64( 1, (long)((java.lang.Long) value_)); } if (valueCase_ == 2) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); } if (!getDenotationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, denotation_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (valueCase_ == 1) { size += com.google.protobuf.CodedOutputStream .computeInt64Size( 1, (long)((java.lang.Long) value_)); } if (valueCase_ == 2) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); } if (!getDenotationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, denotation_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension other = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension) obj; if (!getDenotation() .equals(other.getDenotation())) return false; if (!getValueCase().equals(other.getValueCase())) return false; switch (valueCase_) { case 1: if (getDimValue() != other.getDimValue()) return false; break; case 2: if (!getDimParam() .equals(other.getDimParam())) return false; break; case 0: default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + DENOTATION_FIELD_NUMBER; hash = (53 * hash) + getDenotation().hashCode(); switch (valueCase_) { case 1: hash = (37 * hash) + DIM_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getDimValue()); break; case 2: hash = (37 * hash) + DIM_PARAM_FIELD_NUMBER; hash = (53 * hash) + getDimParam().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension 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(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension 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 onnx.TensorShapeProto.Dimension} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.TensorShapeProto.Dimension) org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_Dimension_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_Dimension_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder.class); } // Construct using onnx.OnnxProto3.TensorShapeProto.Dimension.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); denotation_ = ""; valueCase_ = 0; value_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_Dimension_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension build() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension result = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension(this); if (valueCase_ == 1) { result.value_ = value_; } if (valueCase_ == 2) { result.value_ = value_; } result.denotation_ = denotation_; result.valueCase_ = valueCase_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.getDefaultInstance()) return this; if (!other.getDenotation().isEmpty()) { denotation_ = other.denotation_; onChanged(); } switch (other.getValueCase()) { case DIM_VALUE: { setDimValue(other.getDimValue()); break; } case DIM_PARAM: { valueCase_ = 2; value_ = other.value_; onChanged(); break; } case VALUE_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int valueCase_ = 0; private java.lang.Object value_; public ValueCase getValueCase() { return ValueCase.forNumber( valueCase_); } public Builder clearValue() { valueCase_ = 0; value_ = null; onChanged(); return this; } /** * <code>int64 dim_value = 1;</code> */ public long getDimValue() { if (valueCase_ == 1) { return (java.lang.Long) value_; } return 0L; } /** * <code>int64 dim_value = 1;</code> */ public Builder setDimValue(long value) { valueCase_ = 1; value_ = value; onChanged(); return this; } /** * <code>int64 dim_value = 1;</code> */ public Builder clearDimValue() { if (valueCase_ == 1) { valueCase_ = 0; value_ = null; onChanged(); } return this; } /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ public java.lang.String getDimParam() { java.lang.Object ref = ""; if (valueCase_ == 2) { ref = value_; } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (valueCase_ == 2) { value_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ public com.google.protobuf.ByteString getDimParamBytes() { java.lang.Object ref = ""; if (valueCase_ == 2) { ref = value_; } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); if (valueCase_ == 2) { value_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ public Builder setDimParam( java.lang.String value) { if (value == null) { throw new NullPointerException(); } valueCase_ = 2; value_ = value; onChanged(); return this; } /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ public Builder clearDimParam() { if (valueCase_ == 2) { valueCase_ = 0; value_ = null; onChanged(); } return this; } /** * <pre> * namespace Shape * </pre> * * <code>string dim_param = 2;</code> */ public Builder setDimParamBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); valueCase_ = 2; value_ = value; onChanged(); return this; } private java.lang.Object denotation_ = ""; /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ public java.lang.String getDenotation() { java.lang.Object ref = denotation_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); denotation_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ public com.google.protobuf.ByteString getDenotationBytes() { java.lang.Object ref = denotation_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); denotation_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ public Builder setDenotation( java.lang.String value) { if (value == null) { throw new NullPointerException(); } denotation_ = value; onChanged(); return this; } /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ public Builder clearDenotation() { denotation_ = getDefaultInstance().getDenotation(); onChanged(); return this; } /** * <pre> * Standard denotation can optionally be used to denote tensor * dimensions with standard semantic descriptions to ensure * that operations are applied to the correct axis of a tensor. * Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition * for pre-defined dimension denotations. * </pre> * * <code>string denotation = 3;</code> */ public Builder setDenotationBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); denotation_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:onnx.TensorShapeProto.Dimension) } // @@protoc_insertion_point(class_scope:onnx.TensorShapeProto.Dimension) private static final org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Dimension> PARSER = new com.google.protobuf.AbstractParser<Dimension>() { @java.lang.Override public Dimension parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Dimension(input, extensionRegistry); } }; public static com.google.protobuf.Parser<Dimension> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Dimension> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public static final int DIM_FIELD_NUMBER = 1; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension> dim_; /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension> getDimList() { return dim_; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder> getDimOrBuilderList() { return dim_; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public int getDimCount() { return dim_.size(); } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension getDim(int index) { return dim_.get(index); } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder getDimOrBuilder( int index) { return dim_.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 < dim_.size(); i++) { output.writeMessage(1, dim_.get(i)); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < dim_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, dim_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto) obj; if (!getDimList() .equals(other.getDimList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getDimCount() > 0) { hash = (37 * hash) + DIM_FIELD_NUMBER; hash = (53 * hash) + getDimList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto 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> * Defines a tensor shape. A dimension can be either an integer value * or a symbolic variable. A symbolic variable represents an unknown * dimension. * </pre> * * Protobuf type {@code onnx.TensorShapeProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.TensorShapeProto) org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Builder.class); } // Construct using onnx.OnnxProto3.TensorShapeProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getDimFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); if (dimBuilder_ == null) { dim_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { dimBuilder_.clear(); } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TensorShapeProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto(this); int from_bitField0_ = bitField0_; if (dimBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { dim_ = java.util.Collections.unmodifiableList(dim_); bitField0_ = (bitField0_ & ~0x00000001); } result.dim_ = dim_; } else { result.dim_ = dimBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.getDefaultInstance()) return this; if (dimBuilder_ == null) { if (!other.dim_.isEmpty()) { if (dim_.isEmpty()) { dim_ = other.dim_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDimIsMutable(); dim_.addAll(other.dim_); } onChanged(); } } else { if (!other.dim_.isEmpty()) { if (dimBuilder_.isEmpty()) { dimBuilder_.dispose(); dimBuilder_ = null; dim_ = other.dim_; bitField0_ = (bitField0_ & ~0x00000001); dimBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDimFieldBuilder() : null; } else { dimBuilder_.addAllMessages(other.dim_); } } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension> dim_ = java.util.Collections.emptyList(); private void ensureDimIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { dim_ = new java.util.ArrayList<org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension>(dim_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder> dimBuilder_; /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension> getDimList() { if (dimBuilder_ == null) { return java.util.Collections.unmodifiableList(dim_); } else { return dimBuilder_.getMessageList(); } } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public int getDimCount() { if (dimBuilder_ == null) { return dim_.size(); } else { return dimBuilder_.getCount(); } } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension getDim(int index) { if (dimBuilder_ == null) { return dim_.get(index); } else { return dimBuilder_.getMessage(index); } } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder setDim( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension value) { if (dimBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDimIsMutable(); dim_.set(index, value); onChanged(); } else { dimBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder setDim( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder builderForValue) { if (dimBuilder_ == null) { ensureDimIsMutable(); dim_.set(index, builderForValue.build()); onChanged(); } else { dimBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder addDim(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension value) { if (dimBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDimIsMutable(); dim_.add(value); onChanged(); } else { dimBuilder_.addMessage(value); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder addDim( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension value) { if (dimBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDimIsMutable(); dim_.add(index, value); onChanged(); } else { dimBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder addDim( org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder builderForValue) { if (dimBuilder_ == null) { ensureDimIsMutable(); dim_.add(builderForValue.build()); onChanged(); } else { dimBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder addDim( int index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder builderForValue) { if (dimBuilder_ == null) { ensureDimIsMutable(); dim_.add(index, builderForValue.build()); onChanged(); } else { dimBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder addAllDim( java.lang.Iterable<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension> values) { if (dimBuilder_ == null) { ensureDimIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, dim_); onChanged(); } else { dimBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder clearDim() { if (dimBuilder_ == null) { dim_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { dimBuilder_.clear(); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public Builder removeDim(int index) { if (dimBuilder_ == null) { ensureDimIsMutable(); dim_.remove(index); onChanged(); } else { dimBuilder_.remove(index); } return this; } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder getDimBuilder( int index) { return getDimFieldBuilder().getBuilder(index); } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder getDimOrBuilder( int index) { if (dimBuilder_ == null) { return dim_.get(index); } else { return dimBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public java.util.List<? extends org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder> getDimOrBuilderList() { if (dimBuilder_ != null) { return dimBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(dim_); } } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder addDimBuilder() { return getDimFieldBuilder().addBuilder( org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.getDefaultInstance()); } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder addDimBuilder( int index) { return getDimFieldBuilder().addBuilder( index, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.getDefaultInstance()); } /** * <code>repeated .onnx.TensorShapeProto.Dimension dim = 1;</code> */ public java.util.List<org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder> getDimBuilderList() { return getDimFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder> getDimFieldBuilder() { if (dimBuilder_ == null) { dimBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Dimension.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.DimensionOrBuilder>( dim_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); dim_ = null; } return dimBuilder_; } @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:onnx.TensorShapeProto) } // @@protoc_insertion_point(class_scope:onnx.TensorShapeProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<TensorShapeProto> PARSER = new com.google.protobuf.AbstractParser<TensorShapeProto>() { @java.lang.Override public TensorShapeProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new TensorShapeProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<TensorShapeProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<TensorShapeProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface TypeProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.TypeProto) com.google.protobuf.MessageOrBuilder { /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ boolean hasTensorType(); /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor getTensorType(); /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.TensorOrBuilder getTensorTypeOrBuilder(); /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ java.lang.String getDenotation(); /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ com.google.protobuf.ByteString getDenotationBytes(); public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.ValueCase getValueCase(); } /** * <pre> * Types * The standard ONNX data types. * </pre> * * Protobuf type {@code onnx.TypeProto} */ public static final class TypeProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.TypeProto) TypeProtoOrBuilder { private static final long serialVersionUID = 0L; // Use TypeProto.newBuilder() to construct. private TypeProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private TypeProto() { denotation_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new TypeProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private TypeProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.Builder subBuilder = null; if (valueCase_ == 1) { subBuilder = ((org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_).toBuilder(); } value_ = input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_); value_ = subBuilder.buildPartial(); } valueCase_ = 1; break; } case 50: { java.lang.String s = input.readStringRequireUtf8(); denotation_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Builder.class); } public interface TensorOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.TypeProto.Tensor) com.google.protobuf.MessageOrBuilder { /** * <pre> * This field MUST NOT have the value of UNDEFINED * This field MUST have a valid TensorProto.DataType value * This field MUST be present for this version of the IR. * </pre> * * <code>int32 elem_type = 1;</code> */ int getElemType(); /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ boolean hasShape(); /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto getShape(); /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProtoOrBuilder getShapeOrBuilder(); } /** * Protobuf type {@code onnx.TypeProto.Tensor} */ public static final class Tensor extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.TypeProto.Tensor) TensorOrBuilder { private static final long serialVersionUID = 0L; // Use Tensor.newBuilder() to construct. private Tensor(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Tensor() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Tensor(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Tensor( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { elemType_ = input.readInt32(); break; } case 18: { org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Builder subBuilder = null; if (shape_ != null) { subBuilder = shape_.toBuilder(); } shape_ = input.readMessage(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(shape_); shape_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_Tensor_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_Tensor_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.class, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.Builder.class); } public static final int ELEM_TYPE_FIELD_NUMBER = 1; private int elemType_; /** * <pre> * This field MUST NOT have the value of UNDEFINED * This field MUST have a valid TensorProto.DataType value * This field MUST be present for this version of the IR. * </pre> * * <code>int32 elem_type = 1;</code> */ public int getElemType() { return elemType_; } public static final int SHAPE_FIELD_NUMBER = 2; private org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto shape_; /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public boolean hasShape() { return shape_ != null; } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto getShape() { return shape_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.getDefaultInstance() : shape_; } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProtoOrBuilder getShapeOrBuilder() { return getShape(); } 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 (elemType_ != 0) { output.writeInt32(1, elemType_); } if (shape_ != null) { output.writeMessage(2, getShape()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (elemType_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, elemType_); } if (shape_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getShape()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor other = (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) obj; if (getElemType() != other.getElemType()) return false; if (hasShape() != other.hasShape()) return false; if (hasShape()) { if (!getShape() .equals(other.getShape())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ELEM_TYPE_FIELD_NUMBER; hash = (53 * hash) + getElemType(); if (hasShape()) { hash = (37 * hash) + SHAPE_FIELD_NUMBER; hash = (53 * hash) + getShape().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor 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 org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor 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 org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor 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(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor 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 onnx.TypeProto.Tensor} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.TypeProto.Tensor) org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.TensorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_Tensor_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_Tensor_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.class, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.Builder.class); } // Construct using onnx.OnnxProto3.TypeProto.Tensor.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); elemType_ = 0; if (shapeBuilder_ == null) { shape_ = null; } else { shape_ = null; shapeBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_Tensor_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor build() { org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor result = new org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor(this); result.elemType_ = elemType_; if (shapeBuilder_ == null) { result.shape_ = shape_; } else { result.shape_ = shapeBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance()) return this; if (other.getElemType() != 0) { setElemType(other.getElemType()); } if (other.hasShape()) { mergeShape(other.getShape()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int elemType_ ; /** * <pre> * This field MUST NOT have the value of UNDEFINED * This field MUST have a valid TensorProto.DataType value * This field MUST be present for this version of the IR. * </pre> * * <code>int32 elem_type = 1;</code> */ public int getElemType() { return elemType_; } /** * <pre> * This field MUST NOT have the value of UNDEFINED * This field MUST have a valid TensorProto.DataType value * This field MUST be present for this version of the IR. * </pre> * * <code>int32 elem_type = 1;</code> */ public Builder setElemType(int value) { elemType_ = value; onChanged(); return this; } /** * <pre> * This field MUST NOT have the value of UNDEFINED * This field MUST have a valid TensorProto.DataType value * This field MUST be present for this version of the IR. * </pre> * * <code>int32 elem_type = 1;</code> */ public Builder clearElemType() { elemType_ = 0; onChanged(); return this; } private org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto shape_; private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProtoOrBuilder> shapeBuilder_; /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public boolean hasShape() { return shapeBuilder_ != null || shape_ != null; } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto getShape() { if (shapeBuilder_ == null) { return shape_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.getDefaultInstance() : shape_; } else { return shapeBuilder_.getMessage(); } } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public Builder setShape(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto value) { if (shapeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } shape_ = value; onChanged(); } else { shapeBuilder_.setMessage(value); } return this; } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public Builder setShape( org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Builder builderForValue) { if (shapeBuilder_ == null) { shape_ = builderForValue.build(); onChanged(); } else { shapeBuilder_.setMessage(builderForValue.build()); } return this; } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public Builder mergeShape(org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto value) { if (shapeBuilder_ == null) { if (shape_ != null) { shape_ = org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); } else { shape_ = value; } onChanged(); } else { shapeBuilder_.mergeFrom(value); } return this; } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public Builder clearShape() { if (shapeBuilder_ == null) { shape_ = null; onChanged(); } else { shape_ = null; shapeBuilder_ = null; } return this; } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Builder getShapeBuilder() { onChanged(); return getShapeFieldBuilder().getBuilder(); } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProtoOrBuilder getShapeOrBuilder() { if (shapeBuilder_ != null) { return shapeBuilder_.getMessageOrBuilder(); } else { return shape_ == null ? org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.getDefaultInstance() : shape_; } } /** * <code>.onnx.TensorShapeProto shape = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProtoOrBuilder> getShapeFieldBuilder() { if (shapeBuilder_ == null) { shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProto.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TensorShapeProtoOrBuilder>( getShape(), getParentForChildren(), isClean()); shape_ = null; } return shapeBuilder_; } @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:onnx.TypeProto.Tensor) } // @@protoc_insertion_point(class_scope:onnx.TypeProto.Tensor) private static final org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Tensor> PARSER = new com.google.protobuf.AbstractParser<Tensor>() { @java.lang.Override public Tensor parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Tensor(input, extensionRegistry); } }; public static com.google.protobuf.Parser<Tensor> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Tensor> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private int valueCase_ = 0; private java.lang.Object value_; public enum ValueCase implements com.google.protobuf.Internal.EnumLite { TENSOR_TYPE(1), VALUE_NOT_SET(0); private final int value; private ValueCase(int value) { this.value = value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static ValueCase valueOf(int value) { return forNumber(value); } public static ValueCase forNumber(int value) { switch (value) { case 1: return TENSOR_TYPE; case 0: return VALUE_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public ValueCase getValueCase() { return ValueCase.forNumber( valueCase_); } public static final int TENSOR_TYPE_FIELD_NUMBER = 1; /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public boolean hasTensorType() { return valueCase_ == 1; } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor getTensorType() { if (valueCase_ == 1) { return (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_; } return org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance(); } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.TensorOrBuilder getTensorTypeOrBuilder() { if (valueCase_ == 1) { return (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_; } return org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance(); } public static final int DENOTATION_FIELD_NUMBER = 6; private volatile java.lang.Object denotation_; /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ public java.lang.String getDenotation() { java.lang.Object ref = denotation_; 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(); denotation_ = s; return s; } } /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ public com.google.protobuf.ByteString getDenotationBytes() { java.lang.Object ref = denotation_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); denotation_ = 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 (valueCase_ == 1) { output.writeMessage(1, (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_); } if (!getDenotationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, denotation_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (valueCase_ == 1) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_); } if (!getDenotationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, denotation_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto) obj; if (!getDenotation() .equals(other.getDenotation())) return false; if (!getValueCase().equals(other.getValueCase())) return false; switch (valueCase_) { case 1: if (!getTensorType() .equals(other.getTensorType())) return false; break; case 0: default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + DENOTATION_FIELD_NUMBER; hash = (53 * hash) + getDenotation().hashCode(); switch (valueCase_) { case 1: hash = (37 * hash) + TENSOR_TYPE_FIELD_NUMBER; hash = (53 * hash) + getTensorType().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto 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> * Types * The standard ONNX data types. * </pre> * * Protobuf type {@code onnx.TypeProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.TypeProto) org.onnx4j.onnx.prototypes.OnnxProto3.TypeProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Builder.class); } // Construct using onnx.OnnxProto3.TypeProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); denotation_ = ""; valueCase_ = 0; value_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_TypeProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto(this); if (valueCase_ == 1) { if (tensorTypeBuilder_ == null) { result.value_ = value_; } else { result.value_ = tensorTypeBuilder_.build(); } } result.denotation_ = denotation_; result.valueCase_ = valueCase_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.getDefaultInstance()) return this; if (!other.getDenotation().isEmpty()) { denotation_ = other.denotation_; onChanged(); } switch (other.getValueCase()) { case TENSOR_TYPE: { mergeTensorType(other.getTensorType()); break; } case VALUE_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int valueCase_ = 0; private java.lang.Object value_; public ValueCase getValueCase() { return ValueCase.forNumber( valueCase_); } public Builder clearValue() { valueCase_ = 0; value_ = null; onChanged(); return this; } private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.TensorOrBuilder> tensorTypeBuilder_; /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public boolean hasTensorType() { return valueCase_ == 1; } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor getTensorType() { if (tensorTypeBuilder_ == null) { if (valueCase_ == 1) { return (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_; } return org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance(); } else { if (valueCase_ == 1) { return tensorTypeBuilder_.getMessage(); } return org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance(); } } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public Builder setTensorType(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor value) { if (tensorTypeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } value_ = value; onChanged(); } else { tensorTypeBuilder_.setMessage(value); } valueCase_ = 1; return this; } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public Builder setTensorType( org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.Builder builderForValue) { if (tensorTypeBuilder_ == null) { value_ = builderForValue.build(); onChanged(); } else { tensorTypeBuilder_.setMessage(builderForValue.build()); } valueCase_ = 1; return this; } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public Builder mergeTensorType(org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor value) { if (tensorTypeBuilder_ == null) { if (valueCase_ == 1 && value_ != org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance()) { value_ = org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.newBuilder((org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_) .mergeFrom(value).buildPartial(); } else { value_ = value; } onChanged(); } else { if (valueCase_ == 1) { tensorTypeBuilder_.mergeFrom(value); } tensorTypeBuilder_.setMessage(value); } valueCase_ = 1; return this; } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public Builder clearTensorType() { if (tensorTypeBuilder_ == null) { if (valueCase_ == 1) { valueCase_ = 0; value_ = null; onChanged(); } } else { if (valueCase_ == 1) { valueCase_ = 0; value_ = null; } tensorTypeBuilder_.clear(); } return this; } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.Builder getTensorTypeBuilder() { return getTensorTypeFieldBuilder().getBuilder(); } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.TensorOrBuilder getTensorTypeOrBuilder() { if ((valueCase_ == 1) && (tensorTypeBuilder_ != null)) { return tensorTypeBuilder_.getMessageOrBuilder(); } else { if (valueCase_ == 1) { return (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_; } return org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance(); } } /** * <pre> * The type of a tensor. * </pre> * * <code>.onnx.TypeProto.Tensor tensor_type = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.TensorOrBuilder> getTensorTypeFieldBuilder() { if (tensorTypeBuilder_ == null) { if (!(valueCase_ == 1)) { value_ = org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.getDefaultInstance(); } tensorTypeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor.Builder, org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.TensorOrBuilder>( (org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto.Tensor) value_, getParentForChildren(), isClean()); value_ = null; } valueCase_ = 1; onChanged();; return tensorTypeBuilder_; } private java.lang.Object denotation_ = ""; /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ public java.lang.String getDenotation() { java.lang.Object ref = denotation_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); denotation_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ public com.google.protobuf.ByteString getDenotationBytes() { java.lang.Object ref = denotation_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); denotation_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ public Builder setDenotation( java.lang.String value) { if (value == null) { throw new NullPointerException(); } denotation_ = value; onChanged(); return this; } /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ public Builder clearDenotation() { denotation_ = getDefaultInstance().getDenotation(); onChanged(); return this; } /** * <pre> * An optional denotation can be used to denote the whole * type with a standard semantic description as to what is * stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition * for pre-defined type denotations. * </pre> * * <code>string denotation = 6;</code> */ public Builder setDenotationBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); denotation_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:onnx.TypeProto) } // @@protoc_insertion_point(class_scope:onnx.TypeProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<TypeProto> PARSER = new com.google.protobuf.AbstractParser<TypeProto>() { @java.lang.Override public TypeProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new TypeProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<TypeProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<TypeProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.TypeProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface OperatorSetIdProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:onnx.OperatorSetIdProto) com.google.protobuf.MessageOrBuilder { /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ java.lang.String getDomain(); /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ com.google.protobuf.ByteString getDomainBytes(); /** * <pre> * The version of the operator set being identified. * This field MUST be present in this version of the IR. * </pre> * * <code>int64 version = 2;</code> */ long getVersion(); } /** * <pre> * Operator Sets * OperatorSets are uniquely identified by a (domain, opset_version) pair. * </pre> * * Protobuf type {@code onnx.OperatorSetIdProto} */ public static final class OperatorSetIdProto extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:onnx.OperatorSetIdProto) OperatorSetIdProtoOrBuilder { private static final long serialVersionUID = 0L; // Use OperatorSetIdProto.newBuilder() to construct. private OperatorSetIdProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private OperatorSetIdProto() { domain_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new OperatorSetIdProto(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private OperatorSetIdProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); domain_ = s; break; } case 16: { version_ = input.readInt64(); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_OperatorSetIdProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_OperatorSetIdProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder.class); } public static final int DOMAIN_FIELD_NUMBER = 1; private volatile java.lang.Object domain_; /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ public java.lang.String getDomain() { java.lang.Object ref = domain_; 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(); domain_ = s; return s; } } /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ public com.google.protobuf.ByteString getDomainBytes() { java.lang.Object ref = domain_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); domain_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int VERSION_FIELD_NUMBER = 2; private long version_; /** * <pre> * The version of the operator set being identified. * This field MUST be present in this version of the IR. * </pre> * * <code>int64 version = 2;</code> */ public long getVersion() { return version_; } 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 (!getDomainBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, domain_); } if (version_ != 0L) { output.writeInt64(2, version_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getDomainBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, domain_); } if (version_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(2, version_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto)) { return super.equals(obj); } org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto other = (org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto) obj; if (!getDomain() .equals(other.getDomain())) return false; if (getVersion() != other.getVersion()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + DOMAIN_FIELD_NUMBER; hash = (53 * hash) + getDomain().hashCode(); hash = (37 * hash) + VERSION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getVersion()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto 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 org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto 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(org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto 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> * Operator Sets * OperatorSets are uniquely identified by a (domain, opset_version) pair. * </pre> * * Protobuf type {@code onnx.OperatorSetIdProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:onnx.OperatorSetIdProto) org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_OperatorSetIdProto_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_OperatorSetIdProto_fieldAccessorTable .ensureFieldAccessorsInitialized( org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.class, org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.Builder.class); } // Construct using onnx.OnnxProto3.OperatorSetIdProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); domain_ = ""; version_ = 0L; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.internal_static_onnx_OperatorSetIdProto_descriptor; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto getDefaultInstanceForType() { return org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.getDefaultInstance(); } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto build() { org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto buildPartial() { org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto result = new org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto(this); result.domain_ = domain_; result.version_ = version_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto) { return mergeFrom((org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto other) { if (other == org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto.getDefaultInstance()) return this; if (!other.getDomain().isEmpty()) { domain_ = other.domain_; onChanged(); } if (other.getVersion() != 0L) { setVersion(other.getVersion()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object domain_ = ""; /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ public java.lang.String getDomain() { java.lang.Object ref = domain_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); domain_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ public com.google.protobuf.ByteString getDomainBytes() { java.lang.Object ref = domain_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); domain_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ public Builder setDomain( java.lang.String value) { if (value == null) { throw new NullPointerException(); } domain_ = value; onChanged(); return this; } /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ public Builder clearDomain() { domain_ = getDefaultInstance().getDomain(); onChanged(); return this; } /** * <pre> * The domain of the operator set being identified. * The empty string ("") or absence of this field implies the operator * set that is defined as part of the ONNX specification. * This field MUST be present in this version of the IR when referring to any other operator set. * </pre> * * <code>string domain = 1;</code> */ public Builder setDomainBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); domain_ = value; onChanged(); return this; } private long version_ ; /** * <pre> * The version of the operator set being identified. * This field MUST be present in this version of the IR. * </pre> * * <code>int64 version = 2;</code> */ public long getVersion() { return version_; } /** * <pre> * The version of the operator set being identified. * This field MUST be present in this version of the IR. * </pre> * * <code>int64 version = 2;</code> */ public Builder setVersion(long value) { version_ = value; onChanged(); return this; } /** * <pre> * The version of the operator set being identified. * This field MUST be present in this version of the IR. * </pre> * * <code>int64 version = 2;</code> */ public Builder clearVersion() { version_ = 0L; 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:onnx.OperatorSetIdProto) } // @@protoc_insertion_point(class_scope:onnx.OperatorSetIdProto) private static final org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto(); } public static org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<OperatorSetIdProto> PARSER = new com.google.protobuf.AbstractParser<OperatorSetIdProto>() { @java.lang.Override public OperatorSetIdProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new OperatorSetIdProto(input, extensionRegistry); } }; public static com.google.protobuf.Parser<OperatorSetIdProto> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<OperatorSetIdProto> getParserForType() { return PARSER; } @java.lang.Override public org.onnx4j.onnx.prototypes.OnnxProto3.OperatorSetIdProto getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_AttributeProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_AttributeProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_ValueInfoProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_ValueInfoProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_NodeProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_NodeProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_ModelProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_ModelProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_StringStringEntryProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_StringStringEntryProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_TensorAnnotation_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_TensorAnnotation_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_GraphProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_GraphProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_TensorProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_TensorProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_TensorProto_Segment_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_TensorProto_Segment_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_TensorShapeProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_TensorShapeProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_TensorShapeProto_Dimension_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_TensorShapeProto_Dimension_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_TypeProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_TypeProto_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_TypeProto_Tensor_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_TypeProto_Tensor_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_onnx_OperatorSetIdProto_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_onnx_OperatorSetIdProto_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\013onnx.proto3\022\004onnx\"\340\003\n\016AttributeProto\022\014" + "\n\004name\030\001 \001(\t\022\025\n\rref_attr_name\030\025 \001(\t\022\022\n\nd" + "oc_string\030\r \001(\t\0220\n\004type\030\024 \001(\0162\".onnx.Att" + "ributeProto.AttributeType\022\t\n\001f\030\002 \001(\002\022\t\n\001" + "i\030\003 \001(\003\022\t\n\001s\030\004 \001(\014\022\034\n\001t\030\005 \001(\0132\021.onnx.Ten" + "sorProto\022\033\n\001g\030\006 \001(\0132\020.onnx.GraphProto\022\016\n" + "\006floats\030\007 \003(\002\022\014\n\004ints\030\010 \003(\003\022\017\n\007strings\030\t" + " \003(\014\022\"\n\007tensors\030\n \003(\0132\021.onnx.TensorProto" + "\022 \n\006graphs\030\013 \003(\0132\020.onnx.GraphProto\"\221\001\n\rA" + "ttributeType\022\r\n\tUNDEFINED\020\000\022\t\n\005FLOAT\020\001\022\007" + "\n\003INT\020\002\022\n\n\006STRING\020\003\022\n\n\006TENSOR\020\004\022\t\n\005GRAPH" + "\020\005\022\n\n\006FLOATS\020\006\022\010\n\004INTS\020\007\022\013\n\007STRINGS\020\010\022\013\n" + "\007TENSORS\020\t\022\n\n\006GRAPHS\020\n\"Q\n\016ValueInfoProto" + "\022\014\n\004name\030\001 \001(\t\022\035\n\004type\030\002 \001(\0132\017.onnx.Type" + "Proto\022\022\n\ndoc_string\030\003 \001(\t\"\226\001\n\tNodeProto\022" + "\r\n\005input\030\001 \003(\t\022\016\n\006output\030\002 \003(\t\022\014\n\004name\030\003" + " \001(\t\022\017\n\007op_type\030\004 \001(\t\022\016\n\006domain\030\007 \001(\t\022\'\n" + "\tattribute\030\005 \003(\0132\024.onnx.AttributeProto\022\022" + "\n\ndoc_string\030\006 \001(\t\"\223\002\n\nModelProto\022\022\n\nir_" + "version\030\001 \001(\003\022.\n\014opset_import\030\010 \003(\0132\030.on" + "nx.OperatorSetIdProto\022\025\n\rproducer_name\030\002" + " \001(\t\022\030\n\020producer_version\030\003 \001(\t\022\016\n\006domain" + "\030\004 \001(\t\022\025\n\rmodel_version\030\005 \001(\003\022\022\n\ndoc_str" + "ing\030\006 \001(\t\022\037\n\005graph\030\007 \001(\0132\020.onnx.GraphPro" + "to\0224\n\016metadata_props\030\016 \003(\0132\034.onnx.String" + "StringEntryProto\"4\n\026StringStringEntryPro" + "to\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"k\n\020Tensor" + "Annotation\022\023\n\013tensor_name\030\001 \001(\t\022B\n\034quant" + "_parameter_tensor_names\030\002 \003(\0132\034.onnx.Str" + "ingStringEntryProto\"\243\002\n\nGraphProto\022\035\n\004no" + "de\030\001 \003(\0132\017.onnx.NodeProto\022\014\n\004name\030\002 \001(\t\022" + "&\n\013initializer\030\005 \003(\0132\021.onnx.TensorProto\022" + "\022\n\ndoc_string\030\n \001(\t\022#\n\005input\030\013 \003(\0132\024.onn" + "x.ValueInfoProto\022$\n\006output\030\014 \003(\0132\024.onnx." + "ValueInfoProto\022(\n\nvalue_info\030\r \003(\0132\024.onn" + "x.ValueInfoProto\0227\n\027quantization_annotat" + "ion\030\016 \003(\0132\026.onnx.TensorAnnotation\"\270\005\n\013Te" + "nsorProto\022\014\n\004dims\030\001 \003(\003\022\021\n\tdata_type\030\002 \001" + "(\005\022*\n\007segment\030\003 \001(\0132\031.onnx.TensorProto.S" + "egment\022\026\n\nfloat_data\030\004 \003(\002B\002\020\001\022\026\n\nint32_" + "data\030\005 \003(\005B\002\020\001\022\023\n\013string_data\030\006 \003(\014\022\026\n\ni" + "nt64_data\030\007 \003(\003B\002\020\001\022\014\n\004name\030\010 \001(\t\022\022\n\ndoc" + "_string\030\014 \001(\t\022\020\n\010raw_data\030\t \001(\014\0223\n\rexter" + "nal_data\030\r \003(\0132\034.onnx.StringStringEntryP" + "roto\0225\n\rdata_location\030\016 \001(\0162\036.onnx.Tenso" + "rProto.DataLocation\022\027\n\013double_data\030\n \003(\001" + "B\002\020\001\022\027\n\013uint64_data\030\013 \003(\004B\002\020\001\032%\n\007Segment" + "\022\r\n\005begin\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\"\332\001\n\010DataTyp" + "e\022\r\n\tUNDEFINED\020\000\022\t\n\005FLOAT\020\001\022\t\n\005UINT8\020\002\022\010" + "\n\004INT8\020\003\022\n\n\006UINT16\020\004\022\t\n\005INT16\020\005\022\t\n\005INT32" + "\020\006\022\t\n\005INT64\020\007\022\n\n\006STRING\020\010\022\010\n\004BOOL\020\t\022\013\n\007F" + "LOAT16\020\n\022\n\n\006DOUBLE\020\013\022\n\n\006UINT32\020\014\022\n\n\006UINT" + "64\020\r\022\r\n\tCOMPLEX64\020\016\022\016\n\nCOMPLEX128\020\017\022\014\n\010B" + "FLOAT16\020\020\")\n\014DataLocation\022\013\n\007DEFAULT\020\000\022\014" + "\n\010EXTERNAL\020\001\"\225\001\n\020TensorShapeProto\022-\n\003dim" + "\030\001 \003(\0132 .onnx.TensorShapeProto.Dimension" + "\032R\n\tDimension\022\023\n\tdim_value\030\001 \001(\003H\000\022\023\n\tdi" + "m_param\030\002 \001(\tH\000\022\022\n\ndenotation\030\003 \001(\tB\007\n\005v" + "alue\"\233\001\n\tTypeProto\022-\n\013tensor_type\030\001 \001(\0132" + "\026.onnx.TypeProto.TensorH\000\022\022\n\ndenotation\030" + "\006 \001(\t\032B\n\006Tensor\022\021\n\telem_type\030\001 \001(\005\022%\n\005sh" + "ape\030\002 \001(\0132\026.onnx.TensorShapeProtoB\007\n\005val" + "ue\"5\n\022OperatorSetIdProto\022\016\n\006domain\030\001 \001(\t" + "\022\017\n\007version\030\002 \001(\003*\227\001\n\007Version\022\022\n\016_START_" + "VERSION\020\000\022\031\n\025IR_VERSION_2017_10_10\020\001\022\031\n\025" + "IR_VERSION_2017_10_30\020\002\022\030\n\024IR_VERSION_20" + "17_11_3\020\003\022\030\n\024IR_VERSION_2019_1_22\020\004\022\016\n\nI" + "R_VERSION\020\005b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }); internal_static_onnx_AttributeProto_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_onnx_AttributeProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_AttributeProto_descriptor, new java.lang.String[] { "Name", "RefAttrName", "DocString", "Type", "F", "I", "S", "T", "G", "Floats", "Ints", "Strings", "Tensors", "Graphs", }); internal_static_onnx_ValueInfoProto_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_onnx_ValueInfoProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_ValueInfoProto_descriptor, new java.lang.String[] { "Name", "Type", "DocString", }); internal_static_onnx_NodeProto_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_onnx_NodeProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_NodeProto_descriptor, new java.lang.String[] { "Input", "Output", "Name", "OpType", "Domain", "Attribute", "DocString", }); internal_static_onnx_ModelProto_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_onnx_ModelProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_ModelProto_descriptor, new java.lang.String[] { "IrVersion", "OpsetImport", "ProducerName", "ProducerVersion", "Domain", "ModelVersion", "DocString", "Graph", "MetadataProps", }); internal_static_onnx_StringStringEntryProto_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_onnx_StringStringEntryProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_StringStringEntryProto_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_onnx_TensorAnnotation_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_onnx_TensorAnnotation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_TensorAnnotation_descriptor, new java.lang.String[] { "TensorName", "QuantParameterTensorNames", }); internal_static_onnx_GraphProto_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_onnx_GraphProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_GraphProto_descriptor, new java.lang.String[] { "Node", "Name", "Initializer", "DocString", "Input", "Output", "ValueInfo", "QuantizationAnnotation", }); internal_static_onnx_TensorProto_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_onnx_TensorProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_TensorProto_descriptor, new java.lang.String[] { "Dims", "DataType", "Segment", "FloatData", "Int32Data", "StringData", "Int64Data", "Name", "DocString", "RawData", "ExternalData", "DataLocation", "DoubleData", "Uint64Data", }); internal_static_onnx_TensorProto_Segment_descriptor = internal_static_onnx_TensorProto_descriptor.getNestedTypes().get(0); internal_static_onnx_TensorProto_Segment_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_TensorProto_Segment_descriptor, new java.lang.String[] { "Begin", "End", }); internal_static_onnx_TensorShapeProto_descriptor = getDescriptor().getMessageTypes().get(8); internal_static_onnx_TensorShapeProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_TensorShapeProto_descriptor, new java.lang.String[] { "Dim", }); internal_static_onnx_TensorShapeProto_Dimension_descriptor = internal_static_onnx_TensorShapeProto_descriptor.getNestedTypes().get(0); internal_static_onnx_TensorShapeProto_Dimension_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_TensorShapeProto_Dimension_descriptor, new java.lang.String[] { "DimValue", "DimParam", "Denotation", "Value", }); internal_static_onnx_TypeProto_descriptor = getDescriptor().getMessageTypes().get(9); internal_static_onnx_TypeProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_TypeProto_descriptor, new java.lang.String[] { "TensorType", "Denotation", "Value", }); internal_static_onnx_TypeProto_Tensor_descriptor = internal_static_onnx_TypeProto_descriptor.getNestedTypes().get(0); internal_static_onnx_TypeProto_Tensor_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_TypeProto_Tensor_descriptor, new java.lang.String[] { "ElemType", "Shape", }); internal_static_onnx_OperatorSetIdProto_descriptor = getDescriptor().getMessageTypes().get(10); internal_static_onnx_OperatorSetIdProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_onnx_OperatorSetIdProto_descriptor, new java.lang.String[] { "Domain", "Version", }); } // @@protoc_insertion_point(outer_class_scope) }
6f40bc6e5da7b7766b697cd1a5368d9968ca6ff6
94abad55ef05f6979a21402ab57d4f4a4873f1c6
/src/main/java/br/com/ivana/springPost/model/Pokedex.java
6dfce24b1652dfbb7046d8f2f5e5c2985f575013
[]
no_license
ivana-queiroz-assis/springpost
6254c1300caafe198b73084835f4fdcb968d89e7
a134081fb9941591123d18e79a4fef9024b95d00
refs/heads/master
2021-04-15T04:32:55.729173
2018-03-27T02:47:12
2018-03-27T02:47:12
126,613,992
0
0
null
null
null
null
UTF-8
Java
false
false
1,321
java
package br.com.ivana.springPost.model; import java.io.Serializable; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.OrderColumn; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @Entity public class Pokedex implements Serializable{ public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @Id @GeneratedValue(strategy=GenerationType.AUTO) private Integer id; private Integer count; @Embedded @OneToMany @OrderColumn private Pokemon[] results; public Pokemon[] getResults() { return results; } @Override public String toString() { return "Pokedex [count=" + count + ", previous=" + ", results=" + getResults()[0].toString()+ "]"; } public void setResults(Pokemon[] results) { this.results = results; } public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public Pokedex() { super(); } public Pokedex(Integer count, Pokemon[] results) { super(); this.count = count; this.results = results; } }
59ae4e7987368fd8d63eee962343d0ace5aca069
1f19aec2ecfd756934898cf0ad2758ee18d9eca2
/u-1/u-11/u-11-f3754.java
7f9aeb8a4ac8ae53dc6ef5685391fecd9b5e54cb
[]
no_license
apertureatf/perftest
f6c6e69efad59265197f43af5072aa7af8393a34
584257a0c1ada22e5486052c11395858a87b20d5
refs/heads/master
2020-06-07T17:52:51.172890
2019-06-21T18:53:01
2019-06-21T18:53:01
193,039,805
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117 9678382438666
e3a10e54d14a4c3609cce2be315d10b451342ac4
c3adebe2cc533a59b4f1c419bc825c66f59d47f5
/src/sample/model/Person.java
5e329068f6ecf34f41add6be69cf71d9c42ae6ae
[]
no_license
MarekPelka/javafx-DatabaseClient-BusLines
617854afc8d2c5f419a2fd286e204d914c32e57e
164b4374cca4df398ea4c30fa905d743542ada55
refs/heads/master
2021-01-21T09:06:27.497088
2017-03-19T21:56:34
2017-03-19T21:56:34
82,856,896
0
0
null
null
null
null
UTF-8
Java
false
false
825
java
package sample.model; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; public class Person { private int id; private final StringProperty name; private final StringProperty surname; public Person() { this(0, null,null); } public Person(int id, String name, String surname) { this.id = id; this.name = new SimpleStringProperty(name); this.surname = new SimpleStringProperty(surname); } public int getId() { return id; } public void setId(int id) { this.id = id; } public StringProperty nameProperty() { return name; } public String getName() { return name.get(); } public StringProperty surnameProperty() { return surname; } public String getSurname() { return surname.get(); } }
7bbf5df2ff9b43c13aa4cdd553f0f924c493afb5
15a93234746a82107ba37af856d5b938c2cf1398
/app/src/main/java/com/org/network/di/ActivityModule.java
b48bb242c009ac4a47ee5aa515588b76b9453f87
[ "Apache-2.0" ]
permissive
quhong/networkTest
4a55f584115de1e4e7dc849bb3a637ea284e5fb4
e20161810241e371222c6b221726f209e5fa73fa
refs/heads/master
2020-03-25T10:10:11.603770
2018-08-06T07:33:00
2018-08-06T07:33:00
143,685,588
0
0
null
null
null
null
UTF-8
Java
false
false
96
java
package com.org.network.di; import dagger.Module; @Module() public class ActivityModule { }
5185dffe1c9745901f0f452b4ecde0464b739c5b
e4d49951680e5cb76bb7ce5195fcda50e078a257
/src/main/java/lumien/randomthings/block/BlockPod.java
0aff7b338fc910d599136de543dc24bf922c3a08
[ "MIT" ]
permissive
hanleybrand/minecraft_lumien231_Random-Things
7854527b70e8f5416da56c252675edca577ab9ed
bba049b0fe8e3aa88fc9c7a8c427a591c4caf498
refs/heads/master
2020-12-11T09:14:35.007556
2015-09-15T13:36:05
2015-09-15T13:36:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,424
java
package lumien.randomthings.block; import java.util.ArrayList; import java.util.List; import java.util.Random; import lumien.randomthings.item.ModItems; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; public class BlockPod extends BlockBase { protected BlockPod() { super("beanPod", Material.plants); } @Override public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); Random rng = new Random(); rng.setSeed(System.currentTimeMillis()); int ironAmount = rng.nextInt(13) + 8; int goldAmount = rng.nextInt(12) + 4; int diamondAmount = rng.nextInt(5) + 1; int emeraldAmount = rng.nextInt(3); int beanAmount = rng.nextInt(5) + 4; if (beanAmount > 0) { drops.add(new ItemStack(ModItems.beans, beanAmount)); } if (ironAmount > 0) { drops.add(new ItemStack(Items.iron_ingot, ironAmount)); } if (goldAmount > 0) { drops.add(new ItemStack(Items.gold_ingot, goldAmount)); } if (diamondAmount > 0) { drops.add(new ItemStack(Items.diamond, diamondAmount)); } if (emeraldAmount > 0) { drops.add(new ItemStack(Items.emerald, emeraldAmount)); } return drops; } }
80d2d3a5dd49428cb089a862b8afe0312fd58759
ccf0dbed897f100c0f7b08875cf397504ef80415
/jetbrick-commons/src/main/java/jetbrick/lang/tuple/Tuple3.java
248b14d93c95a99453e918745dbe5184d4f73924
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
subchen/jetbrick-all-1x
0019b08e908ac454ee9aefa8a2fb0b972ac94961
abe54629a508592287afe5ca4ffc93bf8bf4940c
refs/heads/master
2023-06-15T20:24:29.959390
2014-10-09T09:37:47
2014-10-09T09:37:47
19,665,561
3
0
null
null
null
null
UTF-8
Java
false
false
2,951
java
/** * Copyright 2013-2014 Guoqiang Chen, Shanghai, China. All rights reserved. * * Email: [email protected] * URL: http://subchen.github.io/ * * 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 jetbrick.lang.tuple; import java.io.Serializable; public class Tuple3<T1, T2, T3> implements Serializable { private static final long serialVersionUID = 1L; private T1 v1; private T2 v2; private T3 v3; public Tuple3() { } public Tuple3(T1 v1, T2 v2, T3 v3) { this.v1 = v1; this.v2 = v2; this.v3 = v3; } public T1 v1() { return v1; } public T2 v2() { return v2; } public T3 v3() { return v3; } public void v1(T1 value) { this.v1 = value; } public void v2(T2 value) { this.v2 = value; } public void v3(T3 value) { this.v3 = value; } @SuppressWarnings("serial") public Tuple3<T1, T2, T3> unmodifiedTuple3() { return new Tuple3<T1, T2, T3>(v1, v2, v3) { @Override public void v1(T1 value) { throw new UnsupportedOperationException(); } @Override public void v2(T2 value) { throw new UnsupportedOperationException(); } @Override public void v3(T3 value) { throw new UnsupportedOperationException(); } }; } @Override public boolean equals(Object o) { if (this == o) { return true; } if ((o == null) || (getClass() != o.getClass())) { return false; } Tuple3<?, ?, ?> tuple3 = (Tuple3<?, ?, ?>) o; if (v1 != null ? !v1.equals(tuple3.v1) : tuple3.v1 != null) { return false; } if (v2 != null ? !v2.equals(tuple3.v2) : tuple3.v2 != null) { return false; } if (v3 != null ? !v3.equals(tuple3.v3) : tuple3.v3 != null) { return false; } return true; } @Override public int hashCode() { int result = v1 != null ? v1.hashCode() : 0; result = 31 * result + (v2 != null ? v2.hashCode() : 0); result = 31 * result + (v3 != null ? v3.hashCode() : 0); return result; } @Override public String toString() { return "Tuple{v1=" + v1 + ", v2=" + v2 + ", v3=" + v3 + '}'; } }
a636d6d6dc043a46c3eab9c405e59ac3c4dcd7da
3ed9b803f4be8ce16502cb61fcc015fa7c6f19df
/build/generated/src/org/apache/jsp/Ejercicio02_jsp.java
c720b13a654eae8263ab916c5a00931389dd72f7
[]
no_license
Unicaes/Multiplataforma
0ceb916875e16de0e5bcfa566b124b2e831bfbbc
551bb0b5fad007e96693868dcfcbb4213fd2ed81
refs/heads/master
2023-08-27T20:29:26.873822
2021-10-02T00:42:51
2021-10-02T00:42:51
412,647,444
0
0
null
null
null
null
UTF-8
Java
false
false
4,981
java
package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class Ejercicio02_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory(); private static java.util.List<String> _jspx_dependants; private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector; public java.util.List<String> getDependants() { return _jspx_dependants; } public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html;charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; _jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<!DOCTYPE html>\n"); out.write("<html>\n"); out.write(" <head>\n"); out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"); out.write(" <title>JSP Page</title>\n"); out.write(" <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU\" crossorigin=\"anonymous\">\n"); out.write(" </head>\n"); out.write(" <body>\n"); out.write(" <nav class=\"navbar navbar-expand-lg navbar-light bg-light\">\n"); out.write(" <div class=\"container-fluid\">\n"); out.write(" <a class=\"navbar-brand\" href=\"#\">Bryan Palma</a>\n"); out.write(" <div class=\"collapse navbar-collapse\" id=\"navbarNav\">\n"); out.write(" <ul class=\"navbar-nav\">\n"); out.write(" <li class=\"nav-item\">\n"); out.write(" <a class=\"nav-link active\" aria-current=\"page\" href=\"Ejercicio01.jsp\">Ejercicio 01</a>\n"); out.write(" </li>\n"); out.write(" <li class=\"nav-item\">\n"); out.write(" <a class=\"nav-link\" href=\"Ejercicio02.jsp\">Ejercicio 02</a>\n"); out.write(" </li>\n"); out.write(" </ul>\n"); out.write(" </div>\n"); out.write(" </div>\n"); out.write(" </nav>\n"); out.write(" <div class=\"container\">\n"); out.write(" <form action=\""); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null)); out.write("/Servlet02\" method=\"POST\">\n"); out.write(" <div class=\"mb-3\">\n"); out.write(" <label for=\"exampleInputEmail1\" class=\"form-label\">Nombre del departamento</label>\n"); out.write(" <input type=\"text\" name=\"txtDepartamento\" class=\"form-control\" id=\"txtDepartamento\" aria-describedby=\"emailHelp\">\n"); out.write(" </div>\n"); out.write(" <div class=\"mb-3\">\n"); out.write(" <label for=\"exampleInputEmail1\" class=\"form-label\">Ubicacion</label>\n"); out.write(" <input type=\"text\" name=\"txtDepartamento\" class=\"form-control\" id=\"txtDepartamento\" aria-describedby=\"emailHelp\">\n"); out.write(" </div>\n"); out.write(" <button type=\"submit\" class=\"btn btn-primary\">Enviar Datos</button>\n"); out.write(" </form>\n"); out.write(" </div>\n"); out.write(" </body>\n"); out.write("</html>\n"); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
287a89a7d84f154545abaf526077ea2587e16dac
8e61c92e78c0bb18b35a2ee4a0c4c3a4bcd2c3a9
/AlgorithmicTasks/src/main/java/checker/check/package-info.java
de88f8e8cc2083875a412f82577882e2a4dea826
[]
no_license
alex-skorikov/IPAddress
6c77b5d99e7874672327e0aaf94c0424d0b990eb
d946bca9ae8fad32c8e06b6c3236db1d68629ba5
refs/heads/master
2020-11-25T10:20:32.672915
2020-07-13T04:17:34
2020-07-13T04:17:34
228,616,490
0
0
null
2020-01-31T18:28:26
2019-12-17T12:54:54
Java
UTF-8
Java
false
false
48
java
/** * Check package. */ package checker.check;
e06ddb7020144a30d7057187adc78ba386fc4b57
992a31fbf0b72248f956353a8714d7964075a550
/app/src/main/java/com/example/sketch/newsdotnet/ArchiveNewsFragment.java
a5e1fd746dd820ec56d66764814fb92b8ff23612
[]
no_license
sketchturner/NewsDotNet
ee0d67da581406f2e424a4314912d8f0b625abe4
ffe1a66bcf2bd1c4d02bc3b8519be05cf582fee3
refs/heads/master
2021-01-10T21:23:41.867793
2015-06-16T22:32:33
2015-06-16T22:32:33
37,409,294
0
0
null
null
null
null
UTF-8
Java
false
false
5,452
java
package com.example.sketch.newsdotnet; import android.app.Activity; import android.app.FragmentTransaction; import android.content.ContentValues; import android.location.Address; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.Date; import java.util.Vector; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the * Use the {@link ArchiveNewsFragment#newInstance} factory method to * create an instance of this fragment. */ public class ArchiveNewsFragment extends Fragment implements ArchiveRecyclerAdapter.ArchiveAdapterCallbacks { private RecyclerView mRecyclerView; private RecyclerView.LayoutManager mLayoutManager; private ArchiveRecyclerAdapter mAdapter; /** * Use this factory method to create a new instance of * this fragment using the provided parameters. */ // TODO: Rename and change types and number of parameters public static ArchiveNewsFragment newInstance() { ArchiveNewsFragment fragment = new ArchiveNewsFragment(); return fragment; } public ArchiveNewsFragment() { // Required empty public constructor } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d("NewsDotNet", "onCreate"); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log.d("NewsDotNet", "onCreateView"); // Inflate the layout for this fragment View rootView = inflater.inflate(R.layout.fragment_archive_news, container, false); mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view_archive); mRecyclerView.setHasFixedSize(true); mLayoutManager = new LinearLayoutManager(getActivity()); mRecyclerView.setLayoutManager(mLayoutManager); mAdapter = new ArchiveRecyclerAdapter(new ArrayList<Article>()); mRecyclerView.setAdapter(mAdapter); mAdapter.setOnArchiveItemClickListener(this); new ArchiveAsyncTask().execute(); return rootView; } @Override public void onAttach(Activity activity) { super.onAttach(activity); Log.d("NewsDotNet", "onAttach"); Log.d("NewsDotNet", "called task"); //new ArchiveAsyncTask().execute(); } @Override public void onDetach() { Log.d("NewsDotNet", "onDetach"); super.onDetach(); } @Override public void onArchiveItemClick(View view) { int position = mRecyclerView.getChildAdapterPosition(view); Article article = mAdapter.getItem(position); if (article == null) return; ((ArticleSelectCallback)getActivity()).onArticleSelected(article.AddressName); } //-------------------------- Archive Async Task ---------------------------------- public class ArchiveAsyncTask extends AsyncTask<Void, Void, ArrayList<Article>> { @Override protected ArrayList<Article> doInBackground(Void... params) { Log.d("NewsDotNet", "started task"); String archiveArticlesJSON = getArchiveArticles(); Log.d("NewsDotNet", "received json"); if (null == archiveArticlesJSON) return null; return parseJson(archiveArticlesJSON); } private String getArchiveArticles() { Uri uriGetArchiveArticles = Uri.parse("https://newsdotnet.azurewebsites.net/ClientApi/ArchiveArticles"); return ApiHelper.executeApiMethod(uriGetArchiveArticles); } @Override protected void onPostExecute(ArrayList<Article> articles) { if (articles == null) { Toast.makeText(getActivity(), "Не удалось получить данные с сервера. Проверьте сетевое соединение", Toast.LENGTH_SHORT).show(); return; } mAdapter.setData(articles); mAdapter.notifyDataSetChanged(); } private ArrayList<Article> parseJson(String json) { ArrayList<Article> result = new ArrayList<Article>(); try { JSONArray articlesArray = new JSONArray(json); for (int i = 0; i < articlesArray.length(); i++) { Article article = new Article(); JSONObject jsonArticle = articlesArray.getJSONObject(i); article.Title = jsonArticle.getString("Title"); article.AddressName = jsonArticle.getString("AddressName"); result.add(article); } } catch (JSONException e) { Log.e("NewsDotNet", e.getMessage(), e); e.printStackTrace(); } Log.d("NewsDotNet", "parse finished"); return result; } } }
668ae1bcee07dcb4b3f1a152b478246dc5eb8fe2
669c9969af6eb47cf13b1eee64c90b4971ff1b4b
/toast-backend-main/src/main/java/com/ngteam/toastapp/services/CategoryService.java
1a2b31b9aa18d61d7bddc0a36641cf4b042afbbc
[]
no_license
oleg-romanov/ToastBackEnd
3105b429875a0b35792422af11f3805a5e5fa3ea
50f3c24a284b52fc36f514ed9dbdc86ac1bfa648
refs/heads/main
2023-05-09T08:09:19.153759
2021-05-28T21:58:14
2021-05-28T21:58:14
370,687,879
0
0
null
null
null
null
UTF-8
Java
false
false
580
java
package com.ngteam.toastapp.services; import com.ngteam.toastapp.dto.in.CategoryDto; import org.springframework.http.ResponseEntity; public interface CategoryService { ResponseEntity createCategory(String authorization, CategoryDto categoryDto); ResponseEntity updateCategoryById(String authorization, CategoryDto categoryDto, long id); ResponseEntity getAllCategories(String authorization); ResponseEntity deleteCategoryById(String authorization, long id); ResponseEntity getCategoryById(String authorization, long id); void createDefaultCategories(); }
41420d0a14e9e0e6e216d295fa1ba2ac0d6c87ed
310df90d55b4f57978ba4ab1ce9ba4550c0d43c9
/KClientChat/src/com/zkai/chat/view/ChatMainThread.java
9c590e5627b7456752c2652b68c43db1e0b28569
[]
no_license
Super-Supreme/Chatroom
06fae26856ddbeefbb6a171b97aafa1a5781cd79
0c36aa34433c3398b1c89385ed5648bb411f57e3
refs/heads/master
2020-04-02T06:15:32.152282
2018-12-14T09:11:07
2018-12-14T09:11:07
154,138,091
0
0
null
2018-11-27T07:45:28
2018-10-22T12:16:19
Java
GB18030
Java
false
false
1,151
java
package com.zkai.chat.view; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.Socket; import com.zkai.chat.util.ChatUtils; public class ChatMainThread implements Runnable { private Socket socket; private String userName; public ChatMainThread(Socket socket, String userName) { super(); this.socket = socket; this.userName = userName; } @Override public void run() { try { // 1.接收服务器端信息 BufferedReader in = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); while (true) { String row = in.readLine(); String strFlag = row.substring(0, 1); if ("3".equals(strFlag)) {// 聊天信息,格式:3#发送者名称@发送者IP@消息内容@发送时间 String receiveMsg = row.substring(2);// msg = "发送者名称@发送者IP@消息内容@发送时间" // 在此窗体上显示信息 String showMsg = ChatUtils.makeMsg(1, receiveMsg); ChatUtils.append(ChatMainFrm.txtShow, showMsg); } } } catch (IOException e) { e.printStackTrace(); } } }
6b3bfa4caab7f99cdec8c5d76f2edcd5941522d5
c13da44fd0627df92d8c17b8cc248bb05ce5e8af
/src/main/java/chart/waterloo/plot/MarkerInterface.java
ad7be2618514366fb27190485e2eb19ca8e0591b
[ "Apache-2.0" ]
permissive
AdamStuart/appFX
a411929b3f2249205b0a7a862bc594b24f63ecf4
3e87cea537cb777ccaad312a31a1be916482e24e
refs/heads/master2
2021-01-24T06:47:20.363628
2017-05-16T18:27:31
2017-05-16T18:27:31
43,520,600
2
2
null
2016-06-07T21:49:58
2015-10-01T20:55:19
Java
UTF-8
Java
false
false
1,252
java
/* * * <http://sigtool.github.io/waterlooFX/> * * Copyright King's College London 2014. Copyright Malcolm Lidierth 2014-. * * @author Malcolm Lidierth <a href="https://github.com/sigtool/waterlooFX/issues"> [Contact]</a> * * Project Waterloo 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 3 of the License, or * (at your option) any later version. * * Project Waterloo 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 program. If not, see <http://www.gnu.org/licenses/>. * */ package chart.waterloo.plot; /** * MarkerInterface is implemented by subclasses that make use of the marker * properties in the VisualModel. * * The CssMetaData return false from isSettable on marker properties if this * interface is not implemented. * * @author Malcolm Lidierth */ public interface MarkerInterface { }
dff1691260b106a823ce35e380179bf845a8fc9a
f6d17defdfe7fb54966f156baa8907d326ae26f7
/src/ciftsayilar/Main.java
98ec5335830c3ef8379f7edea8a37ba25a7c9447
[]
no_license
enescelep/patika-java-101
6d3dd4c2ffd0a0ceb289279f61abf6f3b110554f
7ed66604608b3bf0945620b0e8c92a45be2a1ae2
refs/heads/master
2023-06-05T10:11:00.113763
2021-06-21T16:18:41
2021-06-21T16:18:41
376,852,000
1
0
null
null
null
null
UTF-8
Java
false
false
521
java
package ciftsayilar; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int total = 0, num, count = 0; System.out.print("Please enter the number: "); num = scanner.nextInt(); for (int i = 1; i <= num; i++) { if (i % 12 == 0) { total += i; count++; } } int result = total / count; System.out.println(result); } }
4d70a2c2d6f532ebb14b4017eb9f089e6de3e690
12d19fb2cbb1d4cb4a74466c86b7b6a7c4d1e07e
/src/main/java/pfa/demo/security/SecurityConfig.java
bbffdefcb501d8bb4709b5b6bf4e81178879e413
[]
no_license
abdelkalek/-GestionCentreFormation
65c5ff20233478fe1c538e9468743597113406f2
01d6438f8bb7afad1498e2def7a28e584ff96a13
refs/heads/main
2023-06-08T05:48:29.282278
2021-06-12T08:22:46
2021-06-12T08:22:46
376,238,098
0
0
null
null
null
null
UTF-8
Java
false
false
3,108
java
package pfa.demo.security; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; @Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsServiceImpl userDetailsService; @Autowired private BCryptPasswordEncoder bCryptPasswordEncoder; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder); } @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); http.authorizeRequests().antMatchers("/login/**","/register/**").permitAll(); http.authorizeRequests().antMatchers("/appUsers/**","/appRoles/**").hasAuthority("ADMIN"); http.authorizeRequests().antMatchers("/formateur/**").permitAll(); http.authorizeRequests().antMatchers("/candidat/**").permitAll(); http.authorizeRequests().antMatchers("/formation/**").permitAll(); http.authorizeRequests().antMatchers("/Categorie/**").permitAll(); http.authorizeRequests().antMatchers("/admin/**").permitAll(); http.authorizeRequests().antMatchers("/reclamation/**").permitAll(); http.authorizeRequests().antMatchers("/commentaire/**").permitAll(); http.authorizeRequests().antMatchers("/promotion/**").permitAll(); http.authorizeRequests().antMatchers("/Avis/**").permitAll(); http.authorizeRequests().antMatchers("/upload/**").permitAll(); http.authorizeRequests().antMatchers("/fichedepresence/**").permitAll(); http.authorizeRequests().antMatchers("/emploiT/**").permitAll(); http.authorizeRequests().antMatchers("/session/**").permitAll(); http.authorizeRequests().antMatchers("/salle/**").permitAll(); http.authorizeRequests().antMatchers("/support/**").permitAll(); http.authorizeRequests().antMatchers("/Materil/**").permitAll(); http.authorizeRequests().antMatchers("/Besoin/**").permitAll(); http.authorizeRequests().anyRequest().authenticated(); http.addFilter(new JWTAuthenticationFilter(authenticationManager())); http.addFilterBefore(new JWTAuthorizationFiler(), UsernamePasswordAuthenticationFilter.class); } }
54f8a6f55591f8a9f36aecc8588fd514c015fd52
d706c68bff118051ad52cd666af74ac8bb21f5aa
/myCourse/src/view/HomePane.java
d92b1b951b485eb6a631c6564ca3102d0615cf2f
[]
no_license
Ryzar/Uyphuli
89b6cc806e94d68fb6f691ab383c8698ffc6ac54
63eee808f6cb172b08b7feff56c7faa6ecc0ae16
refs/heads/master
2021-05-04T10:33:46.639530
2016-04-09T14:48:34
2016-04-09T14:48:34
55,815,538
0
1
null
2017-02-11T00:29:06
2016-04-08T23:23:24
Java
UTF-8
Java
false
false
952
java
package view; import java.awt.GridLayout; import java.awt.Insets; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.border.EmptyBorder; import main.IconLibrary; public class HomePane extends JPanel { JButton listButton, graphButton; JLabel listLabel, graphLabel; public HomePane() { super(new GridLayout(2,2)); this.setBorder(new EmptyBorder(new Insets(90, 90, 90, 90))); listButton = new JButton("View as List"); graphButton = new JButton("View as Graph"); listLabel = new JLabel(); listLabel.setIcon(IconLibrary.LIST_ICON); listLabel.setHorizontalAlignment(SwingConstants.CENTER); graphLabel = new JLabel(); graphLabel.setIcon(IconLibrary.GRAPH_ICON); graphLabel.setHorizontalAlignment(SwingConstants.CENTER); this.add(listLabel); this.add(graphLabel); this.add(listButton); this.add(graphButton); } }
c5efa447d25354ea579cfaed73261de3c81213cb
05dfd3b46b9328d8259afdc259b0255b5e262302
/savewords-renove/gen/sw/main/BuildConfig.java
faba7c3cd74090fb73a87fc0d27fee5557ff0300
[]
no_license
pisapapiros/Savewords
e630635973792b2f6266dfbcf84a05ac357259e3
3669c313905157029e047bccdd84cf3644f8e065
refs/heads/master
2021-01-25T05:34:29.263916
2013-01-06T19:24:21
2013-01-06T19:24:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
149
java
/** Automatically generated file. DO NOT MODIFY */ package sw.main; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "Pablo@Pablo-PC" ]
Pablo@Pablo-PC
3d5958b8005d70e1e6c3d6e1de3c4d77c32e3a9e
3a66db67db2255eaf94e61bf9bebd7ada0e49330
/src/main/java/net/chwthewke/maven/protobuf/ProtocTestCompileMojo.java
20c40689d60818e6ca0ab462514a995630d7927b
[]
no_license
chwthewke/chwthewke-protobuf.mojo
b778f7a8f310fe8dc12836e506da2e964abb363a
6f991659c28b38301486f7733221ae8398ab15ac
refs/heads/master
2021-01-19T00:08:06.157072
2014-06-02T10:03:16
2014-06-02T10:03:16
34,840,480
0
0
null
null
null
null
UTF-8
Java
false
false
1,183
java
package net.chwthewke.maven.protobuf; import com.google.common.collect.ImmutableList; import net.chwthewke.maven.protobuf.source.ProtocolSource; import net.chwthewke.maven.protobuf.source.ProtocolSourceFactory; import java.nio.file.Paths; import static net.chwthewke.maven.protobuf.MojoType.TEST; /** * Goal which executes the protoc compiler. * * @requiresProject * @goal test-compile * @phase generate-test-sources */ @SuppressWarnings( "unused" ) public class ProtocTestCompileMojo extends AbstractProtocCompileMojo { @Override protected MojoType runType( ) { return TEST; } @Override protected ImmutableList<ProtocolSource> getProtocolSources( final ProtocolSourceFactory protocolSourceFactory ) { return ImmutableList.<ProtocolSource>builder( ) .addAll( super.getProtocolSources( protocolSourceFactory ) ) .addAll( protocolSourceFactory.productionSourcesAsTestDependency( ) ) .build( ); } protected ImmutableList<String> defaultSourceDirectory( ) { return ImmutableList.of( Paths.get( "src", "test", "proto" ).toString( ) ); } }
53ec20bee7566bb3e390832fdfcbefe09e497b1f
a35e16a787a1b348d8d3f05e5b1a0dda046d3a0c
/basic/src/main/java/com/sny/tangyong/basic/BasicErrorReportActivity.java
b1cacb02d7736f2f1b6400bd6f5eabe2ce0b9894
[]
no_license
tangyong3g/Android-Road
e6161c7198dda1f8bb6bfd99e5a1777594cc38ae
43e7c2ac8f0b4639105cb5a8b86099a83fbe9da7
refs/heads/master
2020-04-15T06:48:55.288998
2016-07-09T08:13:59
2016-07-09T08:13:59
8,734,686
5
2
null
null
null
null
UTF-8
Java
false
false
924
java
package com.sny.tangyong.basic; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.Button; /** * 错误反馈提示 */ public class BasicErrorReportActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); Button btn = new Button(getBaseContext()); btn.setLayoutParams(layoutParams); btn.setText(R.string.crashOccur); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // occurs a problem . int i = 1 / 0; } }); setContentView(btn); } }
ab747759cc29539cd05b9623e9b51778b7169873
d90895810ec04f169b1d1f48b75470bd08c220f5
/jbpm-nrp-vdml/src/main/java/org/jbpm/vdml/services/impl/namedmeasures/AbstractDurationStrategy.java
8199aee651d5fe40cf9799536fe31b27256c249f
[]
no_license
ifu-lobuntu/jbpm-nrp
58c965ac767ada990b5e3862390dd616647a0dfc
8db8bbbeab263f39c48d8b4691c867ec2fcc87ff
refs/heads/master
2021-01-19T00:01:43.319216
2016-08-07T07:33:05
2016-08-07T07:33:05
42,999,423
0
0
null
null
null
null
UTF-8
Java
false
false
419
java
package org.jbpm.vdml.services.impl.namedmeasures; import org.joda.time.DateTime; public class AbstractDurationStrategy { Double calcDurationInMinutes(DateTime from, DateTime to){ if(from==null||to==null){ return null; } long l = to.getMillis() - from.getMillis(); return toMinutes(l); } public double toMinutes(long l) { return l /(1000*60); } }
9ed2ce4a12b1f5bc331164cd3cbe03b9d95147bb
9b825b16ebd79ab179148498da58c95827a56869
/jse/src/oop01/syntax/AverageA519.java
ebc33047a0797231e5cec189615be6847c1799fd
[]
no_license
jwjang81/jse-2
809990d02f170a75eb63376e3231a06a74d84c11
c73c499c215c96449bef4cc91cd4d25ab76599db
refs/heads/master
2020-12-30T22:44:17.067718
2015-05-21T02:57:38
2015-05-21T02:57:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,571
java
package oop01.syntax; public class AverageA519 { String name; int kor; int eng; int tot; double avg; public static void main(String[] args) { /*학생 객체 생성 및 메모리 할당*/ AverageA519 hulk = new AverageA519(); AverageA519 iron = new AverageA519(); AverageA519 hawk = new AverageA519(); /* 이름 저장*/ hulk.name = "헐크"; iron.name = "아이언"; hawk.name = "호크"; /*점수 저장*/ hulk.kor = 100; hulk.eng = 80; iron.kor = 50; iron.eng = 90; hawk.kor = 20; hawk.eng = 40; /*총점, 평균 계산*/ hulk.tot = hulk.kor + hulk.eng; hulk.avg = hulk.tot/2; iron.tot = iron.kor + iron.eng; iron.avg = iron.tot/2; hawk.tot = hawk.kor + hawk.eng; hawk.avg = hawk.tot/2; /*출력*/ System.out.println("==="+iron.name+" 의 성적표==="); System.out.println("국어 : " + iron.kor); System.out.println("영어 : " + iron.eng); System.out.println("합계 : " + iron.tot); System.out.println("평균 : " + iron.avg); System.out.println(); System.out.println("==="+hulk.name+" 의 성적표==="); System.out.println("국어 : " + hulk.kor); System.out.println("영어 : " + hulk.eng); System.out.println("합계 : " + hulk.tot); System.out.println("평균 : " + hulk.avg); System.out.println(); System.out.println("==="+hawk.name+" 의 성적표==="); System.out.println("국어 : " + hawk.kor); System.out.println("영어 : " + hawk.eng); System.out.println("합계 : " + hawk.tot); System.out.println("평균 : " + hawk.avg); System.out.println(); } }
ade96b701fca4006e653d91d6166ed5618d59170
d265272d9313c6ea636472d84754405a1bf9d035
/reddit/reddit-api/src/main/java/com/upgrad/reddit/api/RedditApiApplication.java
562f745311701e422a281a470cedb85e06dc05c1
[]
no_license
sumeett00/Reddit-app
a242eef484db7c8eabf82587b178cff3cd3832c5
e3676d135270b7c15bd60a5f977c3b00fbb0d9bb
refs/heads/master
2022-06-13T16:53:26.413132
2020-05-07T16:25:52
2020-05-07T16:25:52
262,101,461
0
0
null
null
null
null
UTF-8
Java
false
false
474
java
package com.upgrad.reddit.api; import com.upgrad.reddit.service.ServiceConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; @SpringBootApplication @Import(ServiceConfiguration.class) public class RedditApiApplication { public static void main(String [] args){ SpringApplication.run(RedditApiApplication.class,args); } }
be8dab3113f12d18a3783c1fd6b02240052239d6
29c4b14d99a30074602047e642ccd38a355557eb
/SumOfDigitsTest.java
e8880c69f08fd0ead9398b18db9982179333ce79
[]
no_license
gayathiriravichandran/Redington
04832c20c00d087d7e93b54c7a0cfcc0f08e606c
2c3078e928292409fd0a71d6e6e4346f79ed7fdf
refs/heads/master
2022-04-11T21:00:58.737679
2020-03-11T11:29:20
2020-03-11T11:29:20
197,902,813
0
0
null
null
null
null
UTF-8
Java
false
false
252
java
package com.redington.java.testpractice; public class SumOfDigitsTest { public static void main(String[] args) { // TODO Auto-generated method stub SumOfDigits s1 = new SumOfDigits(); s1.getInput(); s1.findSumofDigits(); } }
3803d724bcad90fda0c6b2afa80c3b0995690140
6b710a389648613a42c240a903a1f620b95abce4
/java_exam/src/myjavatestpakage/Restaurant.java
597f5a9c724239a8fc37022302b727139b783a07
[]
no_license
aa1107/app_exam
d269863102da0a6b480146249bd5ec2073fdc340
d5a253c026e546272b35f7e090a53d69a7c1dc23
refs/heads/master
2021-05-14T03:55:56.468520
2018-04-11T07:00:26
2018-04-11T07:00:26
116,629,009
0
0
null
null
null
null
UTF-8
Java
false
false
356
java
package myjavatestpakage; public class Restaurant { public static void main(String[] args){ Food food = new Food(); Waiter Waiter = new Waiter("웨이터", food); Chef Chef = new Chef("주방장",food); System.out.println("시작!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); Waiter.start(); Chef.start(); } }
a94daadc99910b1ecd9e1b7c42bd5d3a756f4bc5
f0c8f872404e2d4a8f33296a1e9b690054f1bfc3
/src/cardgame/Queueable.java
90e0697d5b589c97e726ba33c5993b4df03d7d6f
[]
no_license
Dthompson1411/BasicCardGame
f2ef2e3116feb819bff986569cf5ddc716cc2b91
cd7224724c32bf0cdbf4660f5eb1de21fe0e68ea
refs/heads/master
2020-03-27T05:58:11.028032
2018-09-05T07:30:59
2018-09-05T07:30:59
146,067,552
0
0
null
null
null
null
UTF-8
Java
false
false
2,413
java
/* * Author: David Thompson * Course: COP2551 * Semester: Spring 2016 * Project #: * Title: * Due Date: * * Description: * * * * */ package cardgame; /** * Provides the methods required to implement a priority queue of Card objects. * * This interface MUST be implemented by a class. * i.e., public class Queue implements Queueable { * i.e., public class PriorityQueue implements Queueable { * * @author Jim Littleton * @since January 30, 2014 */ public interface Queueable { /** * Display the Card objects stored in the queue. */ public void DisplayQueue(); /** * Inserts a Card object to the appropriate location of the queue. * * Note: The isFull method should be called first to prevent errors. * * @param card The Card object to insert. */ public void insert(Card card); /** * Determines if the queue is empty. * * @return True if the queue is empty; otherwise, false. */ public boolean isEmpty(); /** * Determines if the queue is full. * * Note: A queue implemented as a linked-list can never be full. * * @return True if the queue is full; otherwise, false. */ public boolean isFull(); /** * Returns the Card object at the front of the queue. * * Note: The isEmpty method should be called first to prevent errors. * * @return The Card object at the front of the queue. */ public Card peek(); /** * Returns the value of the Card object at the specified position in the queue. * * @param position The position of the queue at which to peek. * @return the value of the Card object at the specified position in the queue. */ public int peek(int position); /** * Removes a Card object from the front of the queue. * * Note: The isEmpty method should be called first to prevent errors. * * @return The Card object that was removed. */ public Card remove(); /** * Removes a Card object from the specified position in the queue. * * Note: The isEmpty method should be called first to prevent errors. * * @param position The position of the queue at which to remove the Card object. * @return The Card object that was removed. */ public Card remove(int position); }
6b36499253c4112727ccef83091bd693195d4ec4
00b070467a7a9d53bfbd3ec7984782b3ac45db73
/app/src/androidTest/java/com/bjnangle/rainbow/app/ExampleInstrumentedTest.java
78cdbc86f373add67a677568ed9b3c51d3c5ce1d
[]
no_license
kym2005/Rainbow
a722b7c9fe7a788cfd7e04066d318dbeab345b41
19045603f7532debd673d4380168b82fbc1975ef
refs/heads/master
2021-01-21T11:37:51.684807
2017-05-19T00:49:40
2017-05-19T00:49:40
91,750,304
0
0
null
null
null
null
UTF-8
Java
false
false
752
java
package com.bjnangle.rainbow.app; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.bjnangle.rainbow.app", appContext.getPackageName()); } }
b76e7c654535c12046b039eed21522c54c2c2f36
59993abfd3b10abaddafac55d8802fb161996293
/src/hr/fer/poslovna/dao/IDao.java
02e0b3e3efe9044c2bdb817377e9f6f8e62e6fd7
[]
no_license
xylik/adhoc-mobileBI
8a4b99f26f5518994de799a4ca2b73e00d8b7a4a
5d7eb44f578e889ababa2e16e084fe197fd5a3bd
refs/heads/master
2020-12-24T16:14:40.833892
2015-06-15T16:17:56
2015-06-15T16:17:56
37,472,911
1
1
null
null
null
null
UTF-8
Java
false
false
140
java
package hr.fer.poslovna.dao; import hr.fer.poslovna.model.IResult; public interface IDao { public IResult executeQuery(String query); }
44902dc19cc016aa7464af763e5dc9b31e5a73b7
ed7c210165cfba2066d215652c3e00a53af3f5b7
/MockDemo2/src/com/sapient/test/SpyTest.java
358d071d0942fe01d97d0f5fb3cca3fa59a28835
[]
no_license
saurab2612/sap17
8ae82a51841809f89f53a5046028b5aed2cd858d
ca08366a21dd238766c0894b31ece3046da89482
refs/heads/master
2021-09-04T05:38:58.132360
2018-01-16T11:52:17
2018-01-16T11:52:17
114,456,397
0
2
null
null
null
null
UTF-8
Java
false
false
1,141
java
package com.sapient.test; import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.platform.runner.JUnitPlatform; import org.junit.runner.RunWith; import org.mockito.Mockito; import name.falgout.jeffrey.testing.junit5.MockitoExtension; @ExtendWith(MockitoExtension.class) @RunWith(JUnitPlatform.class) public class SpyTest { @Test public void m1(){ List<String> lst = Mockito.mock(List.class); lst.add("ram"); lst.add("tom"); System.out.println(lst.size()); assertTrue(lst.size()==0); } @Test public void m2(){ List<String> lst = Mockito.spy(new ArrayList<>()); lst.add("ram"); lst.add("tom"); System.out.println(lst.size()); assertTrue(lst.size()==2); } @Test public void m3(){ List<String> lst = Mockito.spy(new ArrayList<>()); Mockito.when(lst.size()).thenReturn(100); lst.add("ram"); lst.add("tom"); System.out.println(lst.size()); assertTrue(lst.size()==100); } }
b510dccccb034e7b463b85975a6b8e34e7492550
98c5f3b35ff11b68433c91d88bb577261100356f
/app/src/androidTest/java/com/automsg/sss/automsg/ExampleInstrumentedTest.java
065fd0ffc7cc1969669217ea7207cb6fc6b2d416
[]
no_license
SSS15181518/AutoMsg
de8ed338bbcd9b49f256dabe7a071be78667b586
d7648b4632b7d4bbd8807cfaf4d54c8034711225
refs/heads/master
2021-04-12T08:07:00.685605
2018-03-20T18:14:37
2018-03-20T18:14:37
126,062,767
0
0
null
null
null
null
UTF-8
Java
false
false
747
java
package com.automsg.sss.automsg; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.automsg.sss.automsg", appContext.getPackageName()); } }
495a81428d7ee78748e97452795d3d32e3fddff7
7026449ae66601dc3e29b2a88bd7152f50f2ef45
/DearMyDiary/src/main/java/com/diary/mydiary/dao/DUserDaoImpl.java
121f67f3d780082e7073be1a6cf2cabf52e4295e
[]
no_license
noheunchong/DearMyDiary
f3b2e14e3385d636ae9fc385a84693b4ed19a275
6c5e534d77c6202fd2749dbffb83e549931b1669
refs/heads/main
2023-06-24T14:50:41.946025
2021-07-23T06:54:47
2021-07-23T06:54:47
376,825,511
0
0
null
null
null
null
UTF-8
Java
false
false
1,132
java
package com.diary.mydiary.dao; import org.apache.ibatis.session.SqlSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.diary.mydiary.domain.DUserVO; @Repository public class DUserDaoImpl implements DUserDao { @Autowired private SqlSession sqlSession; // 1. 로그인 @Override public DUserVO login(DUserVO vo) { return sqlSession.selectOne("duser.login", vo); } // 2. 아이디 중복체크 @Override public String idCheck(String id) { return sqlSession.selectOne("duser.idCheck", id); } // 3. 회원 가입 @Override public int join(DUserVO vo) { return sqlSession.insert("duser.join", vo); } // 4. 회원 조회 -> 프로필 조회 @Override public DUserVO selectProfile(String id) { return sqlSession.selectOne("duser.selectProfile", id); } // 5. 프로필 변경 @Override public int updateProfile(DUserVO vo) { return sqlSession.update("duser.updateProfile", vo); } // 6. 회원 탈퇴 @Override public int deleteUser(String id) { return sqlSession.delete("duser.deleteUser", id); } }
90b6495ebc9648f409180d6d626114ea5043fa97
b40011ccf7b4f36b1fc68042f9c8882f6031f2be
/src/main/java/ru/usachev/LogiWebProject/dao/OrderDAO.java
cc8b0bb89868895c72e20bbf78ee60ae49212f1a
[]
no_license
alexusachev1999/LogiWeb
192ecb50dd6e3a522730d4ea2baa3f68cd009f99
3a7c0d14371db0e9edb52f76f6be95cbbf7f682b
refs/heads/master
2023-04-19T03:26:38.244330
2021-04-30T13:22:41
2021-04-30T13:22:41
361,223,507
0
0
null
null
null
null
UTF-8
Java
false
false
297
java
package ru.usachev.LogiWebProject.dao; import ru.usachev.LogiWebProject.entity.Order; import java.util.List; public interface OrderDAO { public List<Order> getAllOrders(); public void saveOrder(Order order); public Order getOrder(int id); public void deleteOrder(int id); }
cd4c785f6187d6778f38bd09a5d0239067dab779
d30969f72c504ef5745725eec3ead8f442b9c473
/src/no/hvl/dat102/klient/KlientBSTre.java
c2cf3d716733495b4d4b307ca26181cf18d0fc64
[]
no_license
h593277/BSTre
b14f70d48380500c2dacf4201bec99ad6982aff7
93de01f3aea38ba5bb2da1ca85df6a14f26fbef1
refs/heads/main
2023-03-15T00:40:34.451122
2021-03-26T11:42:49
2021-03-26T11:42:49
351,762,709
0
0
null
null
null
null
UTF-8
Java
false
false
3,158
java
package no.hvl.dat102.klient; import java.util.ArrayList; import java.util.List; import java.util.Random; import no.hvl.dat102.KjedetBSTre; public class KlientBSTre { /** * @param args */ public static void main(String[] args) { KjedetBSTre bstre = new KjedetBSTre(); bstre.leggTil(7); bstre.leggTil(5); bstre.leggTil(6); bstre.leggTil(4); bstre.leggTil(9); bstre.leggTil(10); bstre.leggTil(8); bstre.leggTil(3); System.out.println("Tester hoyde funksjon: " + bstre.hoyde()); // Tester p� sortert utskrift System.out.println("Skriver ut elementene sortert i bs-treet"); bstre.visInorden(); // Tester p� om et bestemt element fins int element = 8; System.out.println("\nTester paa om elementet " + element + " fins"); if (bstre.finn(element) != null) { System.out.println("Elementet " + element + " fins i bs-treet"); } else { System.out.println("Elementet " + element + " fins ikke i bs-treet"); } element = 1; System.out.println("\nTester paa om elementet " + element + " fins"); if (bstre.finn(element) != null) { System.out.println("Elementet " + element + " fins i bs-treet"); } else { System.out.println("Elementet " + element + " fins ikke i bs-treet"); } //treGenerator(100, 1023); treGenerator(10, 8192); System.out.println("Minste elementet skal være 3, faktisk tall: " + bstre.fjernMin()); System.out.println("Minste elementet skal være 4, faktisk tall: " + bstre.fjernMin()); System.out.println("Minste elementet skal være 5, faktisk tall: " + bstre.fjernMin()); System.out.println("Minste elementet skal være 6, faktisk tall: " + bstre.fjernMin()); System.out.println("Minste elementet skal være 7, faktisk tall: " + bstre.fjernMin()); System.out.println("Minste elementet skal være 8, faktisk tall: " + bstre.fjernMin()); System.out.println("Minste elementet skal være 9, faktisk tall: " + bstre.fjernMin()); } public static List<KjedetBSTre> treGenerator(int trer, int noder) { System.out.println("Antall noder:" + noder); int minsteHoyde = 0; int maksHoyde = 0; int snittHoyde = 0; List<KjedetBSTre> trear = new ArrayList<KjedetBSTre>(); for(int t = 0; t < trer; t++) { KjedetBSTre<Integer> tret = new KjedetBSTre(); for(int n = 0; n < noder; n++) { Random terning = new Random(); int tall = terning.nextInt(); tret.leggTil(tall); } trear.add(tret); if(minsteHoyde == 0 || tret.hoyde() < minsteHoyde) { minsteHoyde = tret.hoyde(); } if(maksHoyde == 0 || tret.hoyde() > maksHoyde) { maksHoyde = tret.hoyde(); } snittHoyde += tret.hoyde(); } System.out.println("Minimum hoyde paa tre: " + minHoyde(noder)); System.out.println("Maksimum hoyde paa tre: " + maksHoyde(noder)); System.out.println("Laveste tre var: " + minsteHoyde); System.out.println("Hoyeste tre var: " + maksHoyde); System.out.println("Gjennomsnitt hoyde var: " + snittHoyde/trer); return trear; } public static int maksHoyde(int n) { return n-1; } public static int minHoyde(int n) { return (int) (Math.log((double)n)-1); } }
7f87874211dfca9b5bf563f22b0141532b1e8c2a
b6e3dafce3d8c9d031eba7960356fe605e69e846
/app/src/main/java/com/songhaoxiang/myfirstapp/net/download/DownloadThread.java
b4914e265b3f99a810388ee5bcbe3ebc6dc1ea2d
[ "Apache-2.0" ]
permissive
yangzhengze/MyFirstApp
c342cafecca7a643c259691d64cd6925bc79e787
3380c843c081639579faf2947a0d8ea95dd3da19
refs/heads/master
2020-03-14T00:33:49.918755
2017-03-21T11:17:46
2017-03-21T11:17:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,837
java
package com.songhaoxiang.myfirstapp.net.download; import android.util.Log; import java.io.File; import java.io.InputStream; import java.io.RandomAccessFile; import java.net.HttpURLConnection; import java.net.URL; public class DownloadThread extends Thread { private static final String TAG = "DownloadThread"; private File saveFile; private URL downUrl; private int block; /* 下载开始位置 */ private int threadId = -1; private int downLength; private boolean finish = false; private FileDownloader downloader; public DownloadThread(FileDownloader downloader, URL downUrl, File saveFile, int block, int downLength, int threadId) { this.downUrl = downUrl; this.saveFile = saveFile; this.block = block; this.downloader = downloader; this.threadId = threadId; this.downLength = downLength; } @Override public void run() { if (downLength < block) {// 未下载完成 try { HttpURLConnection http = (HttpURLConnection) downUrl .openConnection(); http.setConnectTimeout(5 * 1000); // 设置连接超时 http.setRequestMethod("GET"); // 设置请求方法,这里是“GET” // 浏览器可接受的MIME类型 http.setRequestProperty( "Accept", "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"); http.setRequestProperty("Accept-Language", "zh-CN"); // 浏览器所希望的语言种类,当服务器能够提供一种以上的语言版本时要用到 http.setRequestProperty("Referer", downUrl.toString());// 包含一个URL,用户从该URL代表的页面出发访问当前请求的页面。 http.setRequestProperty("Charset", "UTF-8"); // 字符集 int startPos = block * (threadId - 1) + downLength;// 开始位置 int endPos = block * threadId - 1;// 结束位置 http.setRequestProperty("Range", "bytes=" + startPos + "-" + endPos);// 设置获取实体数据的范围 // 浏览器类型,如果Servlet返回的内容与浏览器类型有关则该值非常有用。 http.setRequestProperty( "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"); http.setRequestProperty("Connection", "Keep-Alive"); // 设置为持久连接 // 得到输入流 InputStream inStream = http.getInputStream(); byte[] buffer = new byte[1024]; int offset = 0; print("Thread " + this.threadId + " start download from position " + startPos); // 随机访问文件 RandomAccessFile threadfile = new RandomAccessFile( this.saveFile, "rwd"); // 定位到pos位置 threadfile.seek(startPos); while (!downloader.getExit() && (offset = inStream.read(buffer, 0, 1024)) != -1) { // 写入文件 threadfile.write(buffer, 0, offset); downLength += offset; // 累加下载的大小 downloader.update(this.threadId, downLength); // 更新指定线程下载最后的位置 downloader.append(offset); // 累加已下载大小 } threadfile.close(); inStream.close(); print("Thread " + this.threadId + " download finish"); this.finish = true; } catch (Exception e) { this.downLength = -1; print("Thread " + this.threadId + ":" + e); } } } private static void print(String msg) { Log.i(TAG, msg); } /** * 下载是否完成 * * @return */ public boolean isFinish() { return finish; } /** * 已经下载的内容大小 * * @return 如果返回值为-1,代表下载失败 */ public long getDownLength() { return downLength; } }
3c4171fb8f7fc3131b5d70707ed37b498c863e42
95f858fef69642a2013715796fcc4d5c9d0f056e
/bos-parent/bos-service/src/main/java/com/zhp/bos/service/impl/DecidedzoneServiceImpl.java
492a67c41895a0de3a6d559cbc9fa0478b21a841
[]
no_license
meak1102/bos
6484e8db49641d516cb4307c6181c149a2af3579
e76529bc18d82f07bd021c3e8cbafa7046a60653
refs/heads/master
2021-06-23T10:02:44.225132
2017-08-02T05:20:22
2017-08-02T05:20:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,906
java
package com.zhp.bos.service.impl; import java.util.List; import org.hibernate.Hibernate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.zhp.bos.dao.DecidedzoneDao; import com.zhp.bos.dao.SubareaDao; import com.zhp.bos.entity.bc.Decidedzone; import com.zhp.bos.service.intf.IDecidedzoneService; @Service @Transactional public class DecidedzoneServiceImpl implements IDecidedzoneService { @Autowired private DecidedzoneDao decidedzoneDao; @Autowired private SubareaDao SubareaDao; @Override public void save(Decidedzone model, String[] sids) { SubareaDao.clearSubarea(model); decidedzoneDao.save(model);// 必须先保存,外键约束 if (sids != null && sids.length != 0) { for (String id : sids) { SubareaDao.updateDecidedzone(id, model); } } } @Override public Decidedzone checkdecidedzoneId(Decidedzone model) { return decidedzoneDao.findOne(model.getId()); } @Override public Page<Decidedzone> pageQuery(Specification<Decidedzone> specification, PageRequest pageRequest) { Page<Decidedzone> pages = decidedzoneDao.findAll(specification, pageRequest); // 解决懒加载 List<Decidedzone> content = pages.getContent(); if (content != null && content.size() != 0) { for (Decidedzone d : content) { Hibernate.initialize(d.getStaff()); } } return pages; } @Override public void delete(String[] idsarr) { if (idsarr != null && idsarr.length != 0) { for (String id : idsarr) { Decidedzone decidedzone = new Decidedzone(); decidedzone.setId(id); SubareaDao.clearSubarea(decidedzone); decidedzoneDao.delete(id); } } } }
cac137bfdccc8d3bca6622f2b389535fec1656e0
5e4ebd6cd61457e0bd3e881d58e2accb3025539a
/src/main/java/ciir/yggdrasil/util/XMLFind.java
95feb0b531010e3fc2a2a28bde3c6f387b113759
[]
no_license
jjfiv/chem-q-code
ab0aa3d11766caa2e4867b6ae298e64fa5090d8c
a368579bbf230d20de305ffda2735a9de6f98ae2
refs/heads/master
2020-03-10T08:26:36.502977
2018-04-12T17:33:09
2018-04-12T17:33:09
129,285,459
0
0
null
null
null
null
UTF-8
Java
false
false
2,595
java
package ciir.yggdrasil.util; import org.lemurproject.galago.utility.Parameters; import org.lemurproject.galago.utility.json.JSONUtil; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** * @user jfoley */ public class XMLFind { public static Document loadAsDocumentPath(String path) { try { return DocumentBuilderFactory.newInstance() .newDocumentBuilder() .parse(new File(path)); } catch (SAXException | ParserConfigurationException | IOException e) { throw new RuntimeException(e); } } public static String nodeAsString(Node n) { if(n == null) throw new RuntimeException("Node is null!"); if(n.getNodeType() == Node.TEXT_NODE || n.getNodeType() == Node.CDATA_SECTION_NODE) { return n.getTextContent(); } else if(n.getNodeType() == Node.ATTRIBUTE_NODE) { return n.getTextContent(); } throw new RuntimeException("Not a terminal node! "+n); } public static String childNodesAsString(Node n) { NodeList children = n.getChildNodes(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < children.getLength(); i++) { sb.append(nodeAsString(children.item(i))); } return sb.toString(); } public static List<Node> findChildrenByTagName(Node root, String tagName) { List<Node> output = new ArrayList<>(); recursivelyFindChildrenByTagName(output, root, tagName); return output; } private static void recursivelyFindChildrenByTagName(List<Node> output, Node root, String query) { if(Objects.equals(root.getNodeName(), query)) { output.add(root); return; } NodeList children = root.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { recursivelyFindChildrenByTagName(output, children.item(i), query); } } public static Parameters getAttributes(Node xmlNode) { Parameters output = Parameters.create(); NamedNodeMap attributes = xmlNode.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { Node item = attributes.item(i); assert item.getNodeType() == Node.ATTRIBUTE_NODE : "Attribute map should have attribute nodes!"; output.put(item.getNodeName(), JSONUtil.parseString(item.getTextContent())); } return output; } }
50ef6f3faa0940e8e9ad760bb7e8838c61df5658
3c560474a4a6c8f825bd94382756ec0e5fd0efc5
/app/src/main/java/com/example/androiddevelopment/pripremnizadatak/model/Glumac.java
f229787bd3b8cddb331a6e3b70939dfc8dbd0073
[]
no_license
neorns/PripremniZadatak
b09daf0b4c4fee3220423391b345112edca1d803
17644dbd7e6bb3c88defdcac276f927bcdcd27e4
refs/heads/master
2020-05-21T05:58:31.423247
2017-03-19T10:12:49
2017-03-19T10:12:49
84,582,841
0
0
null
null
null
null
UTF-8
Java
false
false
2,275
java
package com.example.androiddevelopment.pripremnizadatak.model; import com.j256.ormlite.dao.ForeignCollection; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.field.ForeignCollectionField; import com.j256.ormlite.table.DatabaseTable; /** * Created by androiddevelopment on 10.3.17.. */ @DatabaseTable(tableName = Glumac.TABLE_NAME_GLUMAC) public class Glumac { public static final String TABLE_NAME_GLUMAC = "glumci"; public static final String FIELD_NAME_ID = "id"; public static final String FIELD_NAME_IME = "ime"; public static final String FIELD_NAME_BIOGRAFIJA = "biografija"; public static final String FIELD_NAME_OCENA = "ocena"; public static final String FIELD_NAME_DATUMRODJENJA = "datumrodjenja"; @DatabaseField(columnName = FIELD_NAME_ID, generatedId = true) private int mId; @DatabaseField(columnName = FIELD_NAME_IME) private String mIme; @DatabaseField(columnName = FIELD_NAME_BIOGRAFIJA) private String mBiografija; @DatabaseField(columnName = FIELD_NAME_OCENA) private double mOcena; @DatabaseField(columnName = FIELD_NAME_DATUMRODJENJA) private String mDatumRodjenja; @ForeignCollectionField(foreignFieldName = "glumac") private ForeignCollection<Film> filmovi ; public Glumac() { } public int getmId() { return mId; } public String getmIme() { return mIme; } public void setmIme(String mIme) { this.mIme = mIme; } public String getmBiografija() { return mBiografija; } public void setmBiografija(String mBiografija) { this.mBiografija = mBiografija; } public double getmOcena() { return mOcena; } public void setmOcena(double mOcena) { this.mOcena = mOcena; } public String getmDatumRodjenja() { return mDatumRodjenja; } public void setmDatumRodjenja(String mDatumRodjenja) { this.mDatumRodjenja = mDatumRodjenja; } public ForeignCollection<Film> getFilmovi() { return filmovi; } public void setFilmovi(ForeignCollection<Film> filmovi) { this.filmovi = filmovi; } @Override public String toString() { return mIme; } }
d745157e730dcadeb77aa239960638fdfe6cf5c4
28ec193f4cadb83ced43cb4f5ad836cfb04846e7
/src/test/java/com/rakuten/buildcharacterbackend/service/SessionServiceTest.java
87c1e3d05c5d907fa55888b4b7175bc177a3e1bb
[]
no_license
Renanxc/build-character-backend
8e79696bc87337de23701416fc30d82f50991b29
408ad0a37d950439ca7222f85aa632f3fc2649a2
refs/heads/master
2022-12-16T05:57:12.905143
2020-09-22T04:47:50
2020-09-22T04:47:50
292,160,031
1
0
null
null
null
null
UTF-8
Java
false
false
6,192
java
package com.rakuten.buildcharacterbackend.service; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.concurrent.TimeUnit; import com.rakuten.buildcharacterbackend.domain.entity.Session; import com.rakuten.buildcharacterbackend.infrastructure.repository.SessionRepository; import com.rakuten.buildcharacterbackend.testUtil.SessionRequestCreator; import com.rakuten.buildcharacterbackend.testUtil.SessionResponseCreator; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.test.context.junit.jupiter.SpringExtension; @ExtendWith(SpringExtension.class) public class SessionServiceTest { @InjectMocks private SessionService service; @Mock SessionRepository repo; @Mock RedisTemplate<String, String> redis; @Test @DisplayName("create returns a inserted SessionID when a valid Session is sended") public void create_returnsInsertedSessionID_whenValidSession() { // Given // Prepare Session sessionResponseStub = SessionResponseCreator.creatValidSessionResponse(); // Expected String expectedResponse = sessionResponseStub.getId(); // Requests Params Session request = SessionResponseCreator.creatValidSessionResponse(); // When when(repo.save(any(Session.class))).thenReturn(sessionResponseStub); String actualResponse = service.create(request); // Then // WithAllOptions assertThat(actualResponse).isNotNull(); assertThat(actualResponse).isEqualTo(expectedResponse); } @Test @DisplayName("get returns a Session when a valid SessionID is sended") public void get_returnsSession_whenValidSessionID() { // Given // Prepare Optional<Session> sessionResponseStub = Optional.of(SessionResponseCreator.creatValidSessionResponse()); // Expected Session expectedResponse = SessionResponseCreator.creatValidSessionResponse(); // Requests Params String request = SessionResponseCreator.creatValidResponse().getSessionID(); // When when(repo.findById(anyString())).thenReturn(sessionResponseStub); Session actualResponse = service.get(request); // Then // WithAllOptions assertThat(actualResponse).isNotNull(); assertThat(actualResponse).isEqualTo(expectedResponse); } @Test @DisplayName("set returns a inserted Session when a valid Session is sended") public void set_returnsInsertedSession_whenValidSession() { // Given // Prepare Session sessionResponseStub = SessionResponseCreator.creatValidSessionResponse(); // Expected Session expectedResponse = SessionResponseCreator.creatValidSessionResponse(); // Requests Params Session request = SessionResponseCreator.creatValidSessionResponse(); // When when(repo.save(any(Session.class))).thenReturn(sessionResponseStub); Session actualResponse = service.set(request); // Then // WithAllOptions assertThat(actualResponse).isNotNull(); assertThat(actualResponse).isEqualTo(expectedResponse); } @Test @DisplayName("delete should call delete Repository when a valid Session is sended") public void delete_shouldCallDeleteRepository_whenValidSession() { // Given // Prepare ArgumentCaptor<Session> sessionToDelete = ArgumentCaptor.forClass(Session.class); // Expected Session expectedResponse = SessionResponseCreator.creatValidSessionResponse(); // Requests Params Session request = SessionResponseCreator.creatValidSessionResponse(); // When doNothing().when(repo).delete(sessionToDelete.capture()); service.delete(request); // Then assertThat(sessionToDelete.getValue()).isEqualTo(expectedResponse); verify(repo,times(1)).delete(any(Session.class)); } @Test @DisplayName("delete should call deleteAll Repository when no Session is sended") public void delete_shouldCallDeleteAllRepository_whenNoSession() { // Given // When doNothing().when(repo).deleteAll(); service.delete(); // Then verify(repo,times(1)).deleteAll(); } @Test @DisplayName("getAll returns a SessionList when no Session is sended") public void getAll_returnsSessionList_whenNoSession() { // Given // Prepare Iterable<Session> sessionResponseStub = SessionResponseCreator.creatValidListSessionResponse(); // Expected List<Session> expectedResponse = new ArrayList<>(); sessionResponseStub.forEach(expectedResponse::add); // When when(repo.findAll()).thenReturn(sessionResponseStub); List<Session> actualResponse = service.getAll(); // Then assertThat(actualResponse).isNotNull(); assertThat(actualResponse).isEqualTo(expectedResponse); } @Test @DisplayName("setTtl should call expire Repository when Valid SessionID and ttl is sended") public void setTtl_shouldCallExpireRepository_whenValidSessionIDandTTLisSended() { // Given // Prepare ArgumentCaptor<String> keyToSet = ArgumentCaptor.forClass(String.class); // Expected String expectedResponse = SessionResponseCreator.creatValidHashKeyResponse(); // Request Params String sessionID = SessionRequestCreator.createValidTokenRequest(); Long ttl = 600L; // When when(redis.expire(keyToSet.capture(),anyLong(),any(TimeUnit.class))).thenReturn(true); service.setTtl(sessionID,ttl); // Then verify(redis,times(1)).expire(anyString(),anyLong(),any(TimeUnit.class)); assertThat(keyToSet.getValue()).isEqualTo(expectedResponse); } }
fd08531123359657dcf7003dd8b7a6213360fa17
e02d56806e1a16e20895c4b65290a5b7824ac1d7
/src/main/java/com/hello/screen/FirstTimeInitializer.java
eefa02b89a64bb759287f950a42e27e4e9f78f1a
[]
no_license
Kubarant/HelloScreen
826728d1682458b99324eadb871ce21f4127738b
6564d0730b67a5bc253ec355cd0d6e0f120d8e56
refs/heads/master
2020-03-25T00:27:17.806388
2019-05-21T18:47:14
2019-05-21T18:47:14
143,184,081
0
0
null
null
null
null
UTF-8
Java
false
false
2,151
java
package com.hello.screen; import com.hello.screen.datacollectors.biedronka.BiedronkaImageDownloader; import com.hello.screen.model.CategoryPreferences; import com.hello.screen.model.Profile; import com.hello.screen.repository.ProfileRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import reactor.core.publisher.Mono; import javax.annotation.PostConstruct; import java.io.File; import java.util.Arrays; import java.util.Collections; import java.util.List; @Configuration public class FirstTimeInitializer { public static final String GUEST_PROFILE_NAME = "unknown"; @Value(BiedronkaImageDownloader.IMAGES_DIRECTORY_SPEL) private String productsImagesPath; private ProfileRepository repository; @Autowired public FirstTimeInitializer(ProfileRepository repository) { this.repository = repository; } @PostConstruct public void init() { saveGuestProfileIfNotExist(); checkProductImagesDirectoryExist(); } public void saveGuestProfileIfNotExist() { Mono<Profile> profileMono = repository.findByName(GUEST_PROFILE_NAME) .switchIfEmpty(Mono.just(createGuestProfile())); repository.saveAll(profileMono) .subscribe(); } public Profile createGuestProfile() { List<CategoryPreferences> categoryPreferences = Arrays.asList(new CategoryPreferences("All", 16), new CategoryPreferences("Sport", 14), new CategoryPreferences("Pol", 14), new CategoryPreferences("Fun", 14), new CategoryPreferences("Local", 14), new CategoryPreferences("Economy", 14), new CategoryPreferences("Tech", 14)); Profile profile = new Profile(GUEST_PROFILE_NAME, Collections.emptyList()); profile.setPreferredCategories(categoryPreferences); return profile; } public void checkProductImagesDirectoryExist() { if (!new File(productsImagesPath).isDirectory()) { new File(productsImagesPath).mkdirs(); } } }