hexsha
stringlengths
40
40
size
int64
8
1.04M
content
stringlengths
8
1.04M
avg_line_length
float64
2.24
100
max_line_length
int64
4
1k
alphanum_fraction
float64
0.25
0.97
885aca47d7d269b46b2e68919636bd8d880635a2
1,866
package com.wizzardo.servlet.war; import com.wizzardo.servlet.WarBuilder; import com.wizzardo.servlet.WarTest; import org.junit.Assert; import org.junit.Test; import javax.servlet.*; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Created by wizzardo on 22.01.15. */ public class TestFilter extends WarTest { @Override protected void customizeWar(WarBuilder builder) { servletPath = "/filtered"; builder.addClass(SimpleServlet.class); builder.addClass(SimpleFilter.class); builder.getWebXmlBuilder() .append(new WarBuilder.ServletMapping(SimpleServlet.class).url("/filtered")) .append(new WarBuilder.FilterMapping(SimpleFilter.class).url("/*")) ; } @Test public void test() throws IOException { test(request -> request.get().asString()); Assert.assertEquals("<response>ok</response>", myRequest().get().asString()); } public static class SimpleServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.getWriter().write("ok"); } } public static class SimpleFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { response.getWriter().write("<response>"); chain.doFilter(request, response); response.getWriter().write("</response>"); } @Override public void destroy() { } } }
30.590164
136
0.67149
192e60aaf49f4d58dde560ce56207c777f8b388f
9,627
package softuni.aggregator.service; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; import org.modelmapper.ModelMapper; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.web.multipart.MultipartFile; import softuni.aggregator.domain.entities.*; import softuni.aggregator.domain.model.vo.page.ImportsPageVO; import softuni.aggregator.domain.repository.ImportRepository; import softuni.aggregator.service.excel.reader.ExcelReader; import softuni.aggregator.service.excel.reader.imports.ImportType; import softuni.aggregator.service.excel.reader.model.EmployeeImportDto; import softuni.aggregator.service.excel.reader.model.ExcelImportDto; import softuni.aggregator.service.excel.reader.model.OrbisCompanyImportDto; import softuni.aggregator.service.excel.reader.model.XingCompanyImportDto; import softuni.aggregator.service.impl.ImportServiceImpl; import javax.servlet.ServletContext; import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @SpringBootTest @RunWith(MockitoJUnitRunner.class) public class ImportServiceTests { @Mock private ImportRepository mockImportRepository; @Mock private CompanyService mockCompanyService; @Mock private EmployeeService mockEmployeeService; @Mock private SubIndustryService mockSubIndustryService; @Mock private MainIndustryService mockMainIndustryService; @Mock private ServletContext mockServletContext; @Mock private ExcelReader mockExcelReader; @Mock private User mockUser; private ImportService importService; @Before public void init() { ModelMapper mapper = new ModelMapper(); importService = new ImportServiceImpl(mockCompanyService, mockEmployeeService, mockSubIndustryService, mockMainIndustryService, mockImportRepository, mockServletContext, mockExcelReader, mapper); } @Test public void getImportsPage_always_shouldFillPageVoCorrectly() { Long testExportsCount = 50L; User user = new User(); Pageable pageable = PageRequest.of(1, 20); List<Import> imports = buildImports(); Mockito.when(mockImportRepository.findAllByUser(user, pageable)).thenReturn(imports); Mockito.when(mockImportRepository.countByUser(user)).thenReturn(testExportsCount); ImportsPageVO importsPageVO = importService.getImportsPage(pageable, user); Assert.assertEquals(imports.size(), importsPageVO.getImports().size()); Assert.assertEquals((long) testExportsCount, importsPageVO.getTotalItemsCount()); for (Import imp : imports) { boolean containsExport = importsPageVO.getImports().stream() .anyMatch(i -> i.getNewEntriesCount() == imp.getNewEntriesCount()); Assert.assertTrue(containsExport); } } @Test public void getAllImportsPage_always_shouldFillPageVoCorrectly() { Long testExportsCount = 50L; Pageable pageable = PageRequest.of(1, 20); List<Import> imports = buildImports(); Page<Import> importPage = new PageImpl<>(imports); Mockito.when(mockImportRepository.findAll(pageable)).thenReturn(importPage); Mockito.when(mockImportRepository.count()).thenReturn(testExportsCount); ImportsPageVO importsPageVO = importService.getAllImportsPage(pageable); Assert.assertEquals(imports.size(), importsPageVO.getImports().size()); Assert.assertEquals((long) testExportsCount, importsPageVO.getTotalItemsCount()); for (Import imp : imports) { boolean containsExport = importsPageVO.getImports().stream() .anyMatch(i -> i.getNewEntriesCount() == imp.getNewEntriesCount()); Assert.assertTrue(containsExport); } } @Test public void getImportTypes_always_shouldReturnCorrectImportTypeKeyValueMap() { Map<String, String> importTypesMap = importService.getImportTypes(); ImportType[] importTypes = ImportType.values(); Assert.assertEquals(importTypes.length, importTypesMap.size()); for (ImportType importType : importTypes) { Assert.assertEquals(importType.toString(), importTypesMap.get(importType.getEndpoint())); } } @Test public void importCompaniesFromXing_always_shouldReadMapAndSaveData() { MultipartFile mockFile = Mockito.mock(MultipartFile.class); Mockito.when(mockFile.getOriginalFilename()).thenReturn("someName"); List<ExcelImportDto> data = List.of( new XingCompanyImportDto(), new XingCompanyImportDto(), new XingCompanyImportDto() ); Map<String, MainIndustry> mainIndustryMap = Map.of("name", new MainIndustry()); Map<String, SubIndustry> subIndustryMap = Map.of("name", new SubIndustry()); Map<String, Company> companiesMap = Map.of("website", new Company()); Mockito.when(mockExcelReader.readExcel(Mockito.any(), Mockito.any())).thenReturn(data); Mockito.when(mockMainIndustryService.getAllIndustriesByName()).thenReturn(mainIndustryMap); Mockito.when(mockSubIndustryService.getAllIndustriesByName()).thenReturn(subIndustryMap); Mockito.when(mockCompanyService.getCompaniesByWebsite(Mockito.any())).thenReturn(companiesMap); int importedCompanies = importService.importCompaniesFromXing(mockUser, mockFile); Mockito.verify(mockSubIndustryService).saveAll(subIndustryMap.values()); Mockito.verify(mockCompanyService).saveCompanies(companiesMap.values()); Mockito.verify(mockImportRepository).save(Mockito.any()); Assert.assertEquals(importedCompanies, importedCompanies); } @Test public void importCompaniesFromOrbis_always_shouldReadMapAndSaveData() { MultipartFile mockFile = Mockito.mock(MultipartFile.class); Mockito.when(mockFile.getOriginalFilename()).thenReturn("someName"); List<ExcelImportDto> data = List.of( new OrbisCompanyImportDto(), new OrbisCompanyImportDto(), new OrbisCompanyImportDto() ); Map<String, Company> companiesMap = Map.of("website", new Company()); Mockito.when(mockExcelReader.readExcel(Mockito.any(), Mockito.any())).thenReturn(data); Mockito.when(mockCompanyService.getCompaniesByWebsite(Mockito.any())).thenReturn(companiesMap); int importedCompanies = importService.importCompaniesFromOrbis(mockUser, mockFile); Mockito.verify(mockCompanyService).saveCompanies(companiesMap.values()); Mockito.verify(mockImportRepository).save(Mockito.any()); Assert.assertEquals(importedCompanies, importedCompanies); } @Test public void importEmployees_always_shouldReadMapAndSaveData() { MultipartFile mockFile = Mockito.mock(MultipartFile.class); Mockito.when(mockFile.getOriginalFilename()).thenReturn("someName"); EmployeeImportDto employeeImportDto1 = new EmployeeImportDto(); employeeImportDto1.setEmail("someEmail1"); EmployeeImportDto employeeImportDto2 = new EmployeeImportDto(); employeeImportDto2.setEmail("someEmail2"); EmployeeImportDto employeeImportDto3 = new EmployeeImportDto(); employeeImportDto3.setEmail("someEmail3"); List<ExcelImportDto> data = List.of( employeeImportDto1, employeeImportDto2, employeeImportDto3 ); Map<String, Employee> employeesMap = new HashMap<>() {{ put("email", new Employee()); }}; Map<String, Company> companiesMap = Map.of("website", new Company()); Mockito.when(mockExcelReader.readExcel(Mockito.any(), Mockito.any())).thenReturn(data); Mockito.when(mockEmployeeService.getEmployeesByEmail(Mockito.any())).thenReturn(employeesMap); Mockito.when(mockCompanyService.getCompaniesByWebsite(Mockito.any())).thenReturn(companiesMap); int importedEmployees = importService.importEmployees(mockUser, mockFile); Mockito.verify(mockEmployeeService).saveEmployees(employeesMap.values()); Mockito.verify(mockImportRepository).save(Mockito.any()); Assert.assertEquals(importedEmployees, importedEmployees); } private List<Import> buildImports() { Import import1 = new Import(); import1.setImportType(ImportType.EMPLOYEES); import1.setUser(new User()); import1.setDate(LocalDateTime.now()); import1.setNewEntriesCount(2000); import1.setTotalItemsCount(4000); Import import2 = new Import(); import2.setImportType(ImportType.ORBIS_COMPANIES); import2.setUser(new User()); import2.setDate(LocalDateTime.now().minusHours(9)); import2.setNewEntriesCount(1000); import2.setTotalItemsCount(1000); Import import3 = new Import(); import3.setImportType(ImportType.XING_COMPANIES); import3.setUser(new User()); import3.setDate(LocalDateTime.now().minusDays(1)); import3.setNewEntriesCount(500); import3.setTotalItemsCount(6000); return List.of(import1, import2, import3); } }
40.1125
110
0.718708
c7987b8ada050f16bce97e1906c1939bbf4014b8
1,102
package com.glume.common.core.exception.servlet; /** * 业务异常 * @author tuoyingtao * @create 2021-10-23 16:55 */ public class ServiceException extends RuntimeException { private static final long serialVersionUID = 1L; /** * 状态码 */ private Integer code; /** * 错误提示 */ private String message; /** * 错误明细,内部调试错误 */ private String detailMessage; /** * 空构造方法,避免反序列化问题 */ public ServiceException() { } public ServiceException(String message) { this.message = message; } public ServiceException(Integer code, String message) { this.code = code; this.message = message; } public Integer getCode() { return code; } @Override public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getDetailMessage() { return detailMessage; } public void setDetailMessage(String detailMessage) { this.detailMessage = detailMessage; } }
17.774194
59
0.598911
a94415a4cf77d0059ea2ca3063ffbfb14a5ad12d
2,495
package com.ecm.portal.archivegc.workflowEvent; import java.util.List; import java.util.Map; import org.flowable.engine.delegate.DelegateExecution; import org.flowable.engine.delegate.JavaDelegate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import com.ecm.core.entity.EcmDocument; import com.ecm.core.entity.EcmFolder; import com.ecm.core.entity.EcmUser; import com.ecm.core.service.AuthService; import com.ecm.core.service.DocumentService; import com.ecm.core.service.FolderPathService; import com.ecm.core.service.FolderService; import com.ecm.icore.service.IEcmSession; @Component(value = "documentListener") public class countDocuments implements JavaDelegate{ @Autowired private AuthService authService; @Autowired private Environment env; @Autowired private FolderPathService folderPathService; @Autowired private DocumentService documentService; @Autowired private FolderService folderService; private final Logger logger = LoggerFactory.getLogger(DocCommitComplete.class); private int AN; //案卷 private int WJ; //文件 @Override public void execute(DelegateExecution execution) { // TODO Auto-generated method stub AN = 0; WJ = 0; //初始化计数器 String workflowSpecialUserName = env.getProperty("ecm.username"); IEcmSession ecmSession = null; try { ecmSession = authService.login("workflow", workflowSpecialUserName, env.getProperty("ecm.password")); Map<String, Object> varMap = execution.getVariables(); String formId = varMap.get("formId").toString(); EcmDocument form = documentService.getObjectById(ecmSession.getToken(), formId); //表单对象 String sql = "select TYPE_NAME,C_ITEM_TYPE from ecm_document where id in(select CHILD_ID from ecm_relation where parent_id = '"+formId+"')"; List<Map<String,Object>> Res = documentService.getMapList(ecmSession.getToken(), sql); for(Map<String,Object> mp : Res) { if(mp.get("C_ITEM_TYPE")!=null) { String type = mp.get("C_ITEM_TYPE").toString(); if(type.equals("案卷")) { AN++; } if(type.equals("文件")) { WJ++; } } if(AN>10||WJ>50) { execution.setVariable("MoreThan50", "是"); } else { execution.setVariable("MoreThan50", "否"); } } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } logger.info("完成"); } }
31.987179
144
0.73988
c9ab2f701ac1c04f8b6334b62c5a62d4abee5615
3,800
package com.mypurecloud.sdk.v2.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import java.util.Objects; import java.io.IOException; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import java.io.Serializable; /** * ValidationServiceRequest */ public class ValidationServiceRequest implements Serializable { private Date dateImportEnded = null; private String fileUrl = null; private String uploadKey = null; /** * The last day of the data you are importing. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z **/ public ValidationServiceRequest dateImportEnded(Date dateImportEnded) { this.dateImportEnded = dateImportEnded; return this; } @ApiModelProperty(example = "null", required = true, value = "The last day of the data you are importing. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z") @JsonProperty("dateImportEnded") public Date getDateImportEnded() { return dateImportEnded; } public void setDateImportEnded(Date dateImportEnded) { this.dateImportEnded = dateImportEnded; } /** * File URL is deprecated, please use upload key **/ public ValidationServiceRequest fileUrl(String fileUrl) { this.fileUrl = fileUrl; return this; } @ApiModelProperty(example = "null", value = "File URL is deprecated, please use upload key") @JsonProperty("fileUrl") public String getFileUrl() { return fileUrl; } public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } /** * S3 key for the uploaded file **/ public ValidationServiceRequest uploadKey(String uploadKey) { this.uploadKey = uploadKey; return this; } @ApiModelProperty(example = "null", value = "S3 key for the uploaded file") @JsonProperty("uploadKey") public String getUploadKey() { return uploadKey; } public void setUploadKey(String uploadKey) { this.uploadKey = uploadKey; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ValidationServiceRequest validationServiceRequest = (ValidationServiceRequest) o; return Objects.equals(this.dateImportEnded, validationServiceRequest.dateImportEnded) && Objects.equals(this.fileUrl, validationServiceRequest.fileUrl) && Objects.equals(this.uploadKey, validationServiceRequest.uploadKey); } @Override public int hashCode() { return Objects.hash(dateImportEnded, fileUrl, uploadKey); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ValidationServiceRequest {\n"); sb.append(" dateImportEnded: ").append(toIndentedString(dateImportEnded)).append("\n"); sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); sb.append(" uploadKey: ").append(toIndentedString(uploadKey)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
29.92126
197
0.712895
87ff5a9d6d7c774d3da50a64e23cc2f5a6fc3eec
733
package com.aptoide.models.displayables; import com.aptoide.models.displayables.Displayable; import com.fasterxml.jackson.annotation.JsonProperty; /** * Created by hsousa on 08-10-2015. */ public class HomeStoreItem extends Displayable { public long id; public String repoName; public String avatar; public String added; public String modified; public String description; public String theme; public String view; public long storeApps; public long storeDwnNumber; public long storeSubscribers; public HomeStoreItem(@JsonProperty("BUCKETSIZE") int bucketSize) { super(bucketSize); } @Override public int getSpanSize() { return FULL_ROW / 2; } }
21.558824
70
0.706685
e37435187586942846171653bf036a3bd996e2e8
717
package smithereen.util; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.time.Instant; public class InstantMillisJsonAdapter extends TypeAdapter<Instant>{ @Override public void write(JsonWriter writer, Instant instant) throws IOException{ if(instant==null){ writer.nullValue(); return; } writer.value(instant.toEpochMilli()); } @Override public Instant read(JsonReader reader) throws IOException{ if(reader.peek()==JsonToken.NULL){ reader.nextNull(); return null; } long l=reader.nextLong(); return Instant.ofEpochMilli(l); } }
23.129032
74
0.760112
f4364169a887ff989379dc02d220d3fe3e84a95d
583
package io18; import java.io.*; public class StoringAndRecouveringData { public static void main(String[] args) throws IOException { DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("Data.txt"))); out.writeDouble(3.14155); out.writeUTF("That was pi"); out.writeDouble(1.41411); out.close(); DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream("Data.txt"))); System.out.println(in.readDouble()); System.out.println(in.readUTF()); System.out.println(in.readDouble()); in.close(); } }
26.5
106
0.73928
9bb618036f5bd1b0a66d492a84557d162eb2de85
1,734
/** * Async.java * * Copyright 2016 the original author or authors. * * We licenses this file to you under the Apache License, version 2.0 * (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package org.apache.niolex.spring.cloud.async; import java.util.concurrent.Executor; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.scheduling.annotation.AsyncConfigurerSupport; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; /** * @author <a href="mailto:[email protected]">Xie, Jiyun</a> * @version 3.0.1 * @since Dec 29, 2016 */ @SpringBootApplication @EnableAsync public class Async extends AsyncConfigurerSupport { public static void main(String[] args) { SpringApplication.run(Async.class, args); } @Override public Executor getAsyncExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(3); executor.setMaxPoolSize(3); executor.setQueueCapacity(500); executor.setThreadNamePrefix("GithubLookup-"); executor.initialize(); return executor; } }
32.716981
76
0.743945
a517064912ebb2b1e40946febf2a61b053e6858f
456
package trabajadores; import ejercicio1.ContadorSincronizado; public class DecrementadorContadorSincronizadoRunnable implements Runnable{ private ContadorSincronizado cantidad = null; public DecrementadorContadorSincronizadoRunnable(ContadorSincronizado cont) { cantidad = cont; } public void run() { for(int i = 0; i< 1000; i++) cantidad.bajarContador(); // como no es una operacion atomica, no se puede saber el valor que va a tener } }
26.823529
107
0.776316
d0aa892f28a8c786a43fdb6535fd8993869e8320
1,440
/******************************************************************************* * Copyright Duke Comprehensive Cancer Center and SemanticBits * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/c3pr/LICENSE.txt for details. ******************************************************************************/ package edu.duke.cabig.c3pr.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.transaction.annotation.Transactional; import edu.duke.cabig.c3pr.domain.CompanionStudyAssociation; import edu.duke.cabig.c3pr.domain.Study; import gov.nih.nci.cabig.ctms.dao.MutableDomainObjectDao; public class CompanionStudyAssociationDao extends GridIdentifiableDao<CompanionStudyAssociation> implements MutableDomainObjectDao<CompanionStudyAssociation> { private static Log log = LogFactory.getLog(CompanionStudyAssociation.class); @Override public Class<CompanionStudyAssociation> domainClass() { return CompanionStudyAssociation.class; } @Transactional(readOnly = false) public void save(CompanionStudyAssociation companionStudyAssociation) { getHibernateTemplate().saveOrUpdate(companionStudyAssociation); } @Transactional(readOnly = false) public void initialize(CompanionStudyAssociation companionStudyAssociation){ } }
40
97
0.680556
24db7da4aad91f7720ad2879dca4c591922eb62c
9,164
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.calcite.avatica.util; import com.fasterxml.jackson.annotation.JsonValue; import java.io.IOException; import java.io.Serializable; import java.util.Arrays; /** * Collection of bytes. * * <p>ByteString is to bytes what {@link String} is to chars: It is immutable, * implements equality ({@link #hashCode} and {@link #equals}), * comparison ({@link #compareTo}) and * {@link Serializable serialization} correctly.</p> */ public class ByteString implements Comparable<ByteString>, Serializable { private final byte[] bytes; /** An empty byte string. */ public static final ByteString EMPTY = new ByteString(new byte[0], false); private static final char[] DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; /** * Creates a ByteString. * * @param bytes Bytes */ public ByteString(byte[] bytes) { this(bytes.clone(), false); } // private constructor that does not copy private ByteString(byte[] bytes, boolean dummy) { this.bytes = bytes; } @Override public int hashCode() { return Arrays.hashCode(bytes); } @Override public boolean equals(Object obj) { return this == obj || obj instanceof ByteString && Arrays.equals(bytes, ((ByteString) obj).bytes); } public int compareTo(ByteString that) { final byte[] v1 = bytes; final byte[] v2 = that.bytes; final int n = Math.min(v1.length, v2.length); for (int i = 0; i < n; i++) { int c1 = v1[i] & 0xff; int c2 = v2[i] & 0xff; if (c1 != c2) { return c1 - c2; } } return v1.length - v2.length; } /** * Returns this byte string in hexadecimal format. * * @return Hexadecimal string */ @Override public String toString() { return toString(16); } /** * Returns this byte string in a given base. * * @return String in given base */ public String toString(int base) { return toString(bytes, base); } /** * Returns the given byte array in hexadecimal format. * * <p>For example, <tt>toString(new byte[] {0xDE, 0xAD})</tt> * returns {@code "DEAD"}.</p> * * @param bytes Array of bytes * @param base Base (2 or 16) * @return String */ public static String toString(byte[] bytes, int base) { char[] chars; int j = 0; switch (base) { case 2: chars = new char[bytes.length * 8]; for (byte b : bytes) { chars[j++] = DIGITS[(b & 0x80) >> 7]; chars[j++] = DIGITS[(b & 0x40) >> 6]; chars[j++] = DIGITS[(b & 0x20) >> 5]; chars[j++] = DIGITS[(b & 0x10) >> 4]; chars[j++] = DIGITS[(b & 0x08) >> 3]; chars[j++] = DIGITS[(b & 0x04) >> 2]; chars[j++] = DIGITS[(b & 0x02) >> 1]; chars[j++] = DIGITS[b & 0x01]; } break; case 16: chars = new char[bytes.length * 2]; for (byte b : bytes) { chars[j++] = DIGITS[(b & 0xF0) >> 4]; chars[j++] = DIGITS[b & 0x0F]; } break; default: throw new IllegalArgumentException("bad base " + base); } return new String(chars, 0, j); } /** * Returns this byte string in Base64 format. * * @return Base64 string */ public String toBase64String() { return Base64.encodeBytes(bytes); } /** * Creates a byte string from a hexadecimal or binary string. * * <p>For example, <tt>of("DEAD", 16)</tt> * returns the same as {@code ByteString(new byte[] {0xDE, 0xAD})}. * * @param string Array of bytes * @param base Base (2 or 16) * @return String */ public static ByteString of(String string, int base) { final byte[] bytes = parse(string, base); return new ByteString(bytes, false); } /** * Parses a hexadecimal or binary string to a byte array. * * @param string Hexadecimal or binary string * @param base Base (2 or 16) * @return Byte array */ public static byte[] parse(String string, int base) { char[] chars = string.toCharArray(); byte[] bytes; int j = 0; byte b = 0; switch (base) { case 2: bytes = new byte[chars.length / 8]; for (char c : chars) { b <<= 1; if (c == '1') { b |= 0x1; } if (j % 8 == 7) { bytes[j / 8] = b; b = 0; } ++j; } break; case 16: if (chars.length % 2 != 0) { throw new IllegalArgumentException("hex string has odd length"); } bytes = new byte[chars.length / 2]; for (char c : chars) { b <<= 4; byte i = decodeHex(c); b |= i & 0x0F; if (j % 2 == 1) { bytes[j / 2] = b; b = 0; } ++j; } break; default: throw new IllegalArgumentException("bad base " + base); } return bytes; } private static byte decodeHex(char c) { if (c >= '0' && c <= '9') { return (byte) (c - '0'); } if (c >= 'a' && c <= 'f') { return (byte) (c - 'a' + 10); } if (c >= 'A' && c <= 'F') { return (byte) (c - 'A' + 10); } throw new IllegalArgumentException("invalid hex character: " + c); } /** * Creates a byte string from a Base64 string. * * @param string Base64 string * @return Byte string */ public static ByteString ofBase64(String string) { final byte[] bytes = parseBase64(string); return new ByteString(bytes, false); } /** * Parses a Base64 to a byte array. * * @param string Base64 string * @return Byte array */ public static byte[] parseBase64(String string) { try { return Base64.decode(string); } catch (IOException e) { throw new IllegalArgumentException("bad base64 string", e); } } @SuppressWarnings({ "CloneDoesntCallSuperClone", "CloneDoesntDeclareCloneNotSupportedException" }) @Override public Object clone() { return this; } /** * Returns the number of bytes in this byte string. * * @return Length of this byte string */ public int length() { return bytes.length; } /** * Returns the byte at a given position in the byte string. * * @param i Index * @throws IndexOutOfBoundsException * if the <tt>index</tt> argument is negative or not less than * <tt>length()</tt> * @return Byte at given position */ public byte byteAt(int i) { return bytes[i]; } /** * Returns a ByteString that consists of a given range. * * @param start Start of range * @param end Position after end of range * @return Substring */ public ByteString substring(int start, int end) { byte[] bytes = Arrays.copyOfRange(this.bytes, start, end); return new ByteString(bytes, false); } /** * Returns a ByteString that starts at a given position. * * @param start Start of range * @return Substring */ public ByteString substring(int start) { return substring(start, length()); } /** * Returns a copy of the byte array. */ @JsonValue public byte[] getBytes() { return bytes.clone(); } /** * Returns a ByteString consisting of the concatenation of this and another * string. * * @param other Byte string to concatenate * @return Combined byte string */ public ByteString concat(ByteString other) { int otherLen = other.length(); if (otherLen == 0) { return this; } int len = bytes.length; byte[] buf = Arrays.copyOf(bytes, len + otherLen); System.arraycopy(other.bytes, 0, buf, len, other.bytes.length); return new ByteString(buf, false); } /** Returns the position at which {@code seek} first occurs in this byte * string, or -1 if it does not occur. */ public int indexOf(ByteString seek) { return indexOf(seek, 0); } /** Returns the position at which {@code seek} first occurs in this byte * string, starting at the specified index, or -1 if it does not occur. */ public int indexOf(ByteString seek, int start) { iLoop: for (int i = start; i < bytes.length - seek.bytes.length + 1; i++) { for (int j = 0;; j++) { if (j == seek.bytes.length) { return i; } if (bytes[i + j] != seek.bytes[j]) { continue iLoop; } } } return -1; } } // End ByteString.java
25.887006
78
0.586534
cdb4a9a39f57d2981a80af9d21db7f1d94ca935a
813
package app.dassana.ruleengine.grammar.specification; import app.dassana.ruleengine.IJqPathParser; import com.fasterxml.jackson.core.JsonProcessingException; import org.apache.commons.text.StringEscapeUtils; public abstract class AbstractSpecification implements ISpecification { protected IJqPathParser jsonPathParser; protected String jsonPathExpression ; protected String value; public AbstractSpecification(IJqPathParser jsonPathParser, String jsonPathExpression, String value) { String unescapeJava = StringEscapeUtils.unescapeJava(jsonPathExpression); this.jsonPathParser = jsonPathParser; this.jsonPathExpression = unescapeJava; this.value = value; } public abstract boolean isSatisfiedBy(String jsonData) throws JsonProcessingException; }
30.111111
105
0.793358
ce2d9c999d9b0425aef5c8e7d24741772ed1236d
989
package controller; import model.Product; import persistence.FileIO; import java.io.IOException; import java.util.ArrayList; public class Ctrl { FileIO io = new FileIO(); public void readProducts(String f) { try { io.readFile(f); } catch (NumberFormatException | IOException e) { e.printStackTrace(); } } public String addProduct(Product p) { try { return io.addNewProduct(p); } catch (NumberFormatException | IOException e) { e.printStackTrace(); } return "error"; } public ArrayList<Product> getProductsCategory(String cat) { return io.getProductsCategory(cat); } public int getStockProduct(String pname) { return io.getStockProduct(pname); } // TODO usage public ArrayList<Product> stockSituation() { return io.stockSituation(); } }
17.981818
61
0.569262
0d18b512fd51ee58d25fae7dac4d8f1011301f51
25,026
package com.orion.utils.reflect; import com.orion.constant.Const; import com.orion.lang.collect.ConcurrentReferenceHashMap; import com.orion.utils.Arrays1; import com.orion.utils.Exceptions; import com.orion.utils.Strings; import com.orion.utils.Valid; import com.orion.utils.collect.Lists; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; import static java.util.function.Function.identity; import static java.util.stream.Collectors.toCollection; import static java.util.stream.Collectors.toMap; /** * 反射 方法工具类 * <p> * 如果需要调用基本类型入参的方法 可以先获取Method * * @author Jiahang Li * @version 1.0.0 * @since 2020/5/15 13:15 */ @SuppressWarnings("ALL") public class Methods { /** * set方法前缀 */ protected static final String SETTER_PREFIX = "set"; /** * get方法前缀 */ protected static final String GETTER_PREFIX = "get"; /** * boolean get方法前缀 */ protected static final String BOOLEAN_GETTER_PREFIX = "is"; private static final Map<Class<?>, List<Method>> CLASS_SET_METHOD_CACHE = new ConcurrentReferenceHashMap<>(Const.CAPACITY_16, ConcurrentReferenceHashMap.ReferenceType.SOFT); private static final Map<Class<?>, List<Method>> CLASS_GET_METHOD_CACHE = new ConcurrentReferenceHashMap<>(Const.CAPACITY_16, ConcurrentReferenceHashMap.ReferenceType.SOFT); private Methods() { } // -------------------- cache start -------------------- /** * 获取getter方法 * * @param clazz class * @param field field * @return getter */ public static Method getGetterMethodByCache(Class<?> clazz, String field) { List<Method> methods = getGetterMethodsByCache(clazz); if (methods == null) { return null; } String methodName1 = GETTER_PREFIX + Strings.firstUpper(field); for (Method method : methods) { if (method.getParameterCount() == 0 && method.getName().equals(methodName1)) { return method; } } String methodName2 = BOOLEAN_GETTER_PREFIX + Strings.firstUpper(field); for (Method method : methods) { if (method.getParameterCount() == 0 && method.getName().equals(methodName2)) { return method; } } return null; } /** * 获取setter方法 * * @param clazz class * @param field field * @return method */ public static Method getSetterMethodByCache(Class<?> clazz, String field) { List<Method> methods = getSetterMethodsByCache(clazz); if (methods == null) { return null; } String methodName = SETTER_PREFIX + Strings.firstUpper(field); for (Method method : methods) { if (method.getParameterCount() == 1 && method.getName().equals(methodName)) { return method; } } return null; } /** * 获取所有getter方法 * * @param clazz class * @return method */ public static List<Method> getGetterMethodsByCache(Class<?> clazz) { List<Method> methodList = CLASS_GET_METHOD_CACHE.get(clazz); if (methodList == null) { CLASS_GET_METHOD_CACHE.put(clazz, methodList = getGetterMethods(clazz)); } return methodList; } /** * 获取所有setter方法 * * @param clazz class * @return method */ public static List<Method> getSetterMethodsByCache(Class<?> clazz) { List<Method> methodList = CLASS_SET_METHOD_CACHE.get(clazz); if (methodList == null) { CLASS_SET_METHOD_CACHE.put(clazz, methodList = getSetterMethods(clazz)); } return methodList; } // -------------------- cache end -------------------- /** * 通过字段获取getter方法 * * @param field field * @return getter方法 */ public static String getGetterMethodNameByField(Field field) { return getGetterMethodNameByFieldName(field.getName(), field.getType().equals(Boolean.TYPE)); } /** * 通过字段名称获取getter方法 * * @param fieldName fieldName * @return getter方法 */ public static String getGetterMethodNameByFieldName(String fieldName) { if (Strings.isBlank(fieldName)) { return null; } return GETTER_PREFIX + Strings.firstUpper(fieldName.trim()); } /** * 通过字段名称获取getter方法 * * @param fieldName fieldName * @param isBooleanClass 是否为 Boolean.TYPE * @return getter方法 */ public static String getGetterMethodNameByFieldName(String fieldName, boolean isBooleanClass) { if (Strings.isBlank(fieldName)) { return null; } return (isBooleanClass ? BOOLEAN_GETTER_PREFIX : GETTER_PREFIX) + Strings.firstUpper(fieldName.trim()); } /** * 通过字段获取setter方法 * * @param field field * @return setter方法 */ public static String getSetterMethodNameByField(Field field) { return SETTER_PREFIX + Strings.firstUpper(field.getName()); } /** * 通过字段名称获取setter方法 * * @param fieldName fieldName * @return setter方法 */ public static String getSetterMethodNameByFieldName(String fieldName) { if (Strings.isBlank(fieldName)) { return null; } return SETTER_PREFIX + Strings.firstUpper(fieldName.trim()); } /** * 通过方法获取所有的getter方法 * * @param clazz class * @return getter方法 */ public static List<Method> getGetterMethods(Class<?> clazz) { List<Method> list = new ArrayList<>(); // get super class methods for (Method method : clazz.getMethods()) { if (!"getClass".equals(method.getName()) && !Modifier.isStatic(method.getModifiers()) && method.getParameters().length == 0) { String name = method.getName(); if (name.startsWith(GETTER_PREFIX) && name.length() != 3 && !method.getReturnType().equals(Void.TYPE)) { setAccessible(method); list.add(method); } else if (method.getName().startsWith(BOOLEAN_GETTER_PREFIX) && name.length() != 2 && method.getReturnType().equals(Boolean.TYPE)) { setAccessible(method); list.add(method); } } } return list; } /** * 通过方法获取所有的setter方法 * * @param clazz class * @return setter方法 */ public static List<Method> getSetterMethods(Class<?> clazz) { List<Method> list = new ArrayList<>(); // get super class methods for (Method method : clazz.getMethods()) { String name = method.getName(); if (name.startsWith(SETTER_PREFIX) && name.length() != 3 && !Modifier.isStatic(method.getModifiers()) && method.getParameters().length == 1) { setAccessible(method); list.add(method); } } return list; } /** * 通过字段获取所有的getter方法 * * @param clazz class * @return getter方法 */ public static List<Method> getGetterMethodsByField(Class<?> clazz) { List<Method> list = new ArrayList<>(); List<Field> fields = Fields.getFields(clazz); for (Field field : fields) { if (!Modifier.isStatic(field.getModifiers())) { Method method; if (field.getType().equals(Boolean.TYPE)) { String fieldName = Strings.firstUpper(field.getName()); method = getAccessibleMethod(clazz, BOOLEAN_GETTER_PREFIX + fieldName, 0); if (method == null) { method = getAccessibleMethod(clazz, GETTER_PREFIX + fieldName, 0); } } else { method = getAccessibleMethod(clazz, GETTER_PREFIX + Strings.firstUpper(field.getName()), 0); } if (method != null) { list.add(method); } } } return list; } /** * 通过字段获取所有的setter方法 * * @param clazz class * @return setter方法 */ public static List<Method> getSetterMethodsByField(Class<?> clazz) { List<Method> list = new ArrayList<>(); List<Field> fields = Fields.getFields(clazz); for (Field field : fields) { if (!Modifier.isStatic(field.getModifiers())) { String methodName = SETTER_PREFIX + Strings.firstUpper(field.getName()); Method method = getAccessibleMethod(clazz, methodName, field.getType()); if (method != null) { list.add(method); } } } return list; } /** * 通过字段获取getter方法 * * @param clazz class * @param field field * @return get方法 */ public static Method getGetterMethodByField(Class<?> clazz, Field field) { Method method; if (field.getType().equals(Boolean.TYPE)) { String fieldName = Strings.firstUpper(field.getName()); method = getAccessibleMethod(clazz, BOOLEAN_GETTER_PREFIX + fieldName, 0); if (method == null) { method = getAccessibleMethod(clazz, GETTER_PREFIX + fieldName, 0); } } else { String methodName = GETTER_PREFIX + Strings.firstUpper(field.getName()); method = getAccessibleMethod(clazz, methodName, 0); } return method; } /** * 通过字段名称获取getter方法 * * @param clazz class * @param fieldName fieldName * @return getter方法 */ public static Method getGetterMethodByFieldName(Class<?> clazz, String fieldName) { if (Strings.isBlank(fieldName)) { return null; } fieldName = Strings.firstUpper(fieldName.trim()); Method method = getAccessibleMethod(clazz, GETTER_PREFIX + fieldName, 0); if (method == null) { method = getAccessibleMethod(clazz, BOOLEAN_GETTER_PREFIX + fieldName, 0); } return method; } /** * 通过字段名称获取setter方法 * * @param clazz class * @param field field * @return setter方法 */ public static Method getSetterMethodByField(Class<?> clazz, Field field) { String methodName = SETTER_PREFIX + Strings.firstUpper(field.getName()); return getAccessibleMethod(clazz, methodName, field.getType()); } /** * 通过字段获取setter方法 * * @param clazz class * @param fieldName field * @return setter方法 */ public static Method getSetterMethodByFieldName(Class<?> clazz, String fieldName) { if (Strings.isBlank(fieldName)) { return null; } fieldName = fieldName.trim(); String methodName = SETTER_PREFIX + Strings.firstUpper(fieldName); return getAccessibleMethod(clazz, methodName, 1); } /** * 获取对象匹配方法名和参数类型的DeclaredMethod, 并强制设置为可访问, 可以获取基本类型的方法 * * @param clazz class * @param methodName 方法名 * @param parameterTypes 参数类型 * @return 方法对象 */ public static Method getAccessibleMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { Valid.notNull(clazz, "method class is null"); for (Class<?> searchType = clazz; searchType != Object.class; searchType = searchType.getSuperclass()) { try { Method method = searchType.getDeclaredMethod(methodName, parameterTypes); setAccessible(method); return method; } catch (Exception e) { // ignore } } return null; } /** * 获取对象匹配方法名和参数长度的第一个DeclaredMethod, 并强制设置为可访问, 可以获取基本类型的方法 * * @param clazz class * @param methodName 方法名称 * @param argsNum 参数数量 * @return 方法对象 */ public static Method getAccessibleMethod(Class<?> clazz, String methodName, int argsNum) { Valid.notNull(clazz, "method class is null"); for (Class<?> searchType = clazz; searchType != Object.class; searchType = searchType.getSuperclass()) { Method[] methods = searchType.getDeclaredMethods(); for (Method method : methods) { if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum) { setAccessible(method); return method; } } } return null; } /** * 获取对象匹配方法名的第一个DeclaredMethod, 并强制设置为可访问, 可以获取基本类型的方法 * * @param clazz class * @param methodName 方法名称 * @return 方法对象 */ public static Method getAccessibleMethod(Class<?> clazz, String methodName) { for (Class<?> searchType = clazz; searchType != Object.class; searchType = searchType.getSuperclass()) { Method[] methods = searchType.getDeclaredMethods(); for (Method method : methods) { if (method.getName().equals(methodName)) { setAccessible(method); return method; } } } return null; } /** * 获取对象匹配方法名和参数长度的DeclaredMethod, 并强制设置为可访问, 可以获取基本类型的方法 * * @param clazz class * @param methodName 方法名称 * @param argsNum 参数数量 * @return 方法对象 */ public static List<Method> getAccessibleMethods(Class<?> clazz, String methodName, int argsNum) { Valid.notNull(clazz, "method class is null"); List<Method> methods = new ArrayList<>(); for (Class<?> searchType = clazz; searchType != Object.class; searchType = searchType.getSuperclass()) { Method[] searchMethods = searchType.getDeclaredMethods(); for (Method method : searchMethods) { if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum) { setAccessible(method); methods.add(method); } } } return methods; } /** * 获取对象匹配方法名的DeclaredMethod, 并强制设置为可访问 * * @param clazz class * @param methodName 方法名称 * @return 方法对象 */ public static List<Method> getAccessibleMethods(Class<?> clazz, String methodName) { Valid.notNull(clazz, "method class is null"); List<Method> methods = new ArrayList<>(); for (Class<?> searchType = clazz; searchType != Object.class; searchType = searchType.getSuperclass()) { Method[] searchMethods = searchType.getDeclaredMethods(); for (Method method : searchMethods) { if (method.getName().equals(methodName)) { setAccessible(method); methods.add(method); } } } return methods; } /** * 获取该类的所有方法 * * @param clazz 反射类 * @return 方法 */ public static List<Method> getAccessibleMethods(Class<?> clazz) { Valid.notNull(clazz, "method class is null"); if (clazz.getSuperclass() != null) { List<Method> methodList = Stream.of(clazz.getDeclaredMethods()) .filter(field -> !Modifier.isStatic(field.getModifiers())) .peek(Methods::setAccessible) .collect(toCollection(ArrayList::new)); Class<?> superClass = clazz.getSuperclass(); // 当前类方法 Map<String, Method> methodMap = methodList.stream().collect(toMap(Method::getName, identity())); // 父类方法 getAccessibleMethods(superClass).stream().filter(m -> !methodMap.containsKey(m.getName())).forEach(methodList::add); return methodList; } else { return new ArrayList<>(); } } /** * 获取该类的所有方法列表 * * @param clazz 反射类 * @return 方法 */ public static Map<String, Method> getAccessibleMethodMap(Class<?> clazz) { List<Method> methodList = getAccessibleMethods(clazz); return Lists.isNotEmpty(methodList) ? methodList.stream().collect(Collectors.toMap(Method::getName, identity())) : new HashMap<>(); } /** * 设置方法可访问 */ public static void setAccessible(Method method) { Valid.notNull(method, "set accessible method class is null"); if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) && !method.isAccessible()) { method.setAccessible(true); } } /** * 获取所有static的方法 * * @param clazz 类 * @return static方法 */ public static List<Method> getStaticMethods(Class<?> clazz) { Valid.notNull(clazz, "class is null"); Method[] methods = clazz.getDeclaredMethods(); return Arrays.stream(methods) .filter(m -> Modifier.isStatic(m.getModifiers())) .collect(Collectors.toList()); } /** * 调用field的getter方法 * * @param obj 对象 * @param fieldName 字段名称 * @param <E> 属性类型 * @return ignore */ public static <E> E invokeGetter(Object obj, String fieldName) { Valid.notNull(obj, "invoke object is null"); Valid.notBlank(fieldName, "invoke getter field is null"); try { Field field = Fields.getAccessibleField(obj.getClass(), fieldName); if (field == null || !field.getType().equals(Boolean.TYPE)) { return invokeMethod(obj, GETTER_PREFIX + Strings.firstUpper(fieldName), null, (Object[]) null); } else { return invokeMethod(obj, BOOLEAN_GETTER_PREFIX + Strings.firstUpper(fieldName), null, (Object[]) null); } } catch (Exception e) { throw Exceptions.invoke(Strings.format("invoke field: {} setter method error {}", fieldName, e.getMessage()), e); } } /** * 调用setter方法 不支持基本类型 * * @param obj 对象 * @param fieldName 字段名称 * @param value ignore * @param <E> 属性类型 */ public static <E, R> R invokeSetter(Object obj, String fieldName, E value) { return (R) invokeMethod(obj, SETTER_PREFIX + Strings.firstUpper(fieldName), new Class[]{value.getClass()}, new Object[]{value}); } /** * 调用setter方法, 多级调用需要手动拼接set 不支持基本类型 * * @param obj 对象 * @param fieldSetterMethodName 字段名称 * @param values ignore * @param <E> 属性类型 */ @SafeVarargs public static <E, R> R invokeSetter(Object obj, String fieldSetterMethodName, E... values) { Valid.notNull(obj, "invoke object is null"); Valid.notBlank(fieldSetterMethodName, "invoke Setter Method is null"); String[] names = fieldSetterMethodName.split("\\."); if (names.length != Arrays1.length(values)) { throw Exceptions.argument("setting method and parameter length are inconsistent"); } if (names.length == 1) { return (R) invokeMethod(obj, SETTER_PREFIX + Strings.firstUpper(names[0]), new Class[]{values[0].getClass()}, new Object[]{values[0]}); } else { for (int i = 0; i < names.length - 1; i++) { E value = values[i]; invokeMethod(obj, names[i], value == null ? null : new Class[]{value.getClass()}, value == null ? null : new Object[]{values[i]}); } int end = names.length - 1; return (R) invokeMethod(obj, names[end], values[end] == null ? null : new Class[]{values[end].getClass()}, values[end] == null ? null : new Object[]{values[end]}); } } /** * 调用setter方法 类型推断调用 支持基本数据类型 * * @param obj 对象 * @param fieldName 字段名称 * @param value ignore * @param <E> 属性类型 */ public static <E, R> R invokeSetterInfer(Object obj, String fieldName, E value) { return invokeMethodInfer(obj, SETTER_PREFIX + Strings.firstUpper(fieldName), new Object[]{value}); } /** * 调用setter方法 类型推断调用 支持基本数据类型 * * @param obj 对象 * @param method method * @param value ignore * @param <E> 属性类型 */ public static <E, R> R invokeSetterInfer(Object obj, Method method, E value) { return invokeMethodInfer(obj, method, new Object[]{value}); } /** * 直接调用对象方法 不支持基本类型 * * @param obj 对象 * @param methodName 方法名称 * @param parameterTypes 参数列表类型 * @param args 参数列表 * @param <E> 返回值类型 * @return ignore */ public static <E> E invokeMethod(Object obj, String methodName, Class<?>[] parameterTypes, Object... args) { Valid.notNull(obj, "invoker object is null"); Valid.notBlank(methodName, "invoke method is null"); Method method = Methods.getAccessibleMethod(obj.getClass(), methodName, parameterTypes); if (method == null) { throw Exceptions.invoke(Strings.format("method {} not found in class {}", methodName, obj.getClass())); } try { return (E) method.invoke(obj, args); } catch (Exception e) { throw Exceptions.invoke(Strings.format("invoke method error: {}, class: {}, args: {}", methodName, obj.getClass(), Arrays.toString(args)), e); } } /** * 直接调用对象方法 * * @param obj 对象 * @param methodName 方法名称 * @param <E> 返回值类型 * @return 对象 */ public static <E> E invokeMethod(Object obj, String methodName) { return invokeMethod(obj, methodName, (Object[]) null); } /** * 直接调用对象方法 * * @param obj 对象 * @param method 方法 * @param <E> 返回值类型 * @return 对象 */ public static <E> E invokeMethod(Object obj, Method method) { return invokeMethod(obj, method, (Object[]) null); } /** * 直接调用对象方法 不支持基本数据类型 * * @param obj 对象 * @param methodName 方法名称 * @param args 参数列表 * @param <E> 返回值类型 * @return 对象 */ public static <E> E invokeMethod(Object obj, String methodName, Object... args) { Valid.notNull(obj, "invoker object is null"); Valid.notBlank(methodName, "invoke method is null"); Method method = Methods.getAccessibleMethod(obj.getClass(), methodName, Arrays1.length(args)); if (method == null) { throw Exceptions.invoke(Strings.format("invoke method error: {} not found in class {}", methodName, obj.getClass().getName())); } try { return (E) method.invoke(obj, args); } catch (Exception e) { throw Exceptions.invoke(Strings.format("invoke method error: {}, class: {}, args: {}", methodName, obj.getClass().getName(), Arrays.toString(args)), e); } } /** * 直接调用对象方法 不支持基本数据类型 * * @param obj 对象 * @param method 方法 * @param args 参数列表 * @param <E> 返回值类型 * @return 对象 */ public static <E> E invokeMethod(Object obj, Method method, Object... args) { Valid.notNull(obj, "invoke object is null"); Valid.notNull(method, "invoke method is null"); try { Methods.setAccessible(method); return (E) method.invoke(obj, args); } catch (Exception e) { throw Exceptions.invoke(Strings.format("invoke method error: {}, class: {}, args: {}", method.getName(), obj.getClass().getName(), Arrays.toString(args)), e); } } /** * 直接调用对象方法, 会进行参数推断, 支持基本数据类型 * * @param obj 对象 * @param method 方法 * @param args 参数列表 * @param <E> 返回值类型 * @return 对象 */ public static <E> E invokeMethodInfer(Object obj, Method method, Object... args) { Valid.notNull(obj, "invoke object is null"); Valid.notNull(method, "invoke method is null"); if (Arrays1.isEmpty(args)) { return invokeMethod(obj, method, (Object[]) null); } return TypeInfer.invokeInfer(obj, Lists.singleton(method), args); } /** * 直接调用对象方法, 会进行参数推断, 支持基本数据类型 * * @param obj 对象 * @param methodName 方法名称 * @param args 参数列表 * @param <E> 返回值类型 * @return 对象 */ public static <E> E invokeMethodInfer(Object obj, String methodName, Object... args) { Valid.notNull(obj, "invoke object is null"); Valid.notBlank(methodName, "invoke method is null"); if (Arrays1.isEmpty(args)) { return invokeMethod(obj, methodName, (Object[]) null); } int len = Arrays1.length(args); List<Method> methods = Methods.getAccessibleMethods(obj.getClass(), methodName, len); return TypeInfer.invokeInfer(obj, methods, args); } }
33.682369
177
0.575402
278d28c8216d4cfeeabd9ffbf7579f5636ab5193
5,907
package com.irtimaled.bbor.common; import com.irtimaled.bbor.Logger; import com.irtimaled.bbor.client.config.ConfigManager; import com.irtimaled.bbor.common.events.PlayerLoggedIn; import com.irtimaled.bbor.common.events.PlayerLoggedOut; import com.irtimaled.bbor.common.events.PlayerSubscribed; import com.irtimaled.bbor.common.events.ServerTick; import com.irtimaled.bbor.common.events.StructuresLoaded; import com.irtimaled.bbor.common.events.WorldLoaded; import com.irtimaled.bbor.common.messages.AddBoundingBox; import com.irtimaled.bbor.common.messages.InitializeClient; import com.irtimaled.bbor.common.messages.PayloadBuilder; import com.irtimaled.bbor.common.models.AbstractBoundingBox; import com.irtimaled.bbor.common.models.DimensionId; import com.irtimaled.bbor.common.models.ServerPlayer; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; public class CommonProxy { private final Map<Integer, ServerPlayer> players = new ConcurrentHashMap<>(); private final Map<Integer, Set<AbstractBoundingBox>> playerBoundingBoxesCache = new HashMap<>(); private final Map<DimensionId, StructureProcessor> structureProcessors = new HashMap<>(); private final Map<DimensionId, BoundingBoxCache> dimensionCache = new ConcurrentHashMap<>(); private Long seed = null; private Integer spawnX = null; private Integer spawnZ = null; public CommonProxy(){ ConfigManager.loadConfig(); } public void init() { BoundingBoxType.registerTypes(); EventBus.subscribe(WorldLoaded.class, this::worldLoaded); EventBus.subscribe(StructuresLoaded.class, this::structuresLoaded); EventBus.subscribe(PlayerLoggedIn.class, this::playerLoggedIn); EventBus.subscribe(PlayerLoggedOut.class, this::playerLoggedOut); EventBus.subscribe(PlayerSubscribed.class, this::onPlayerSubscribed); EventBus.subscribe(ServerTick.class, e -> serverTick()); } protected void setSeed(long seed) { this.seed = seed; } protected void setWorldSpawn(int spawnX, int spawnZ) { this.spawnX = spawnX; this.spawnZ = spawnZ; } private void worldLoaded(WorldLoaded event) { DimensionId dimensionId = event.getDimensionId(); long seed = event.getSeed(); if (dimensionId == DimensionId.OVERWORLD) { setSeed(seed); setWorldSpawn(event.getSpawnX(), event.getSpawnZ()); } Logger.info("create world dimension: %s (seed: %d)", dimensionId, seed); } private void structuresLoaded(StructuresLoaded event) { DimensionId dimensionId = event.getDimensionId(); StructureProcessor structureProcessor = getStructureProcessor(dimensionId); structureProcessor.process(event.getStructures()); } private StructureProcessor getStructureProcessor(DimensionId dimensionId) { StructureProcessor structureProcessor = structureProcessors.get(dimensionId); if (structureProcessor == null) { structureProcessor = new StructureProcessor(getOrCreateCache(dimensionId)); structureProcessors.put(dimensionId, structureProcessor); } return structureProcessor; } private void playerLoggedIn(PlayerLoggedIn event) { if (seed == null || spawnX == null || spawnZ == null) { return; } ServerPlayer player = event.getPlayer(); player.sendPacket(InitializeClient.getPayload(seed, spawnX, spawnZ)); } private void playerLoggedOut(PlayerLoggedOut event) { int playerId = event.getPlayerId(); players.remove(playerId); playerBoundingBoxesCache.remove(playerId); } private void onPlayerSubscribed(PlayerSubscribed event) { int playerId = event.getPlayerId(); ServerPlayer player = event.getPlayer(); players.put(playerId, player); sendToPlayer(playerId, player); } private void sendToPlayer(int playerId, ServerPlayer player) { for (Map.Entry<DimensionId, BoundingBoxCache> entry : dimensionCache.entrySet()) { DimensionId dimensionId = entry.getKey(); BoundingBoxCache boundingBoxCache = entry.getValue(); if (boundingBoxCache == null) return; Set<AbstractBoundingBox> playerBoundingBoxes = playerBoundingBoxesCache.computeIfAbsent(playerId, k -> new HashSet<>()); Map<AbstractBoundingBox, Set<AbstractBoundingBox>> boundingBoxMap = boundingBoxCache.getBoundingBoxes(); for (AbstractBoundingBox key : boundingBoxMap.keySet()) { if (playerBoundingBoxes.contains(key)) { continue; } Set<AbstractBoundingBox> boundingBoxes = boundingBoxMap.get(key); PayloadBuilder payload = AddBoundingBox.getPayload(dimensionId, key, boundingBoxes); if (payload != null) player.sendPacket(payload); playerBoundingBoxes.add(key); } } } private void serverTick() { for (Map.Entry<Integer, ServerPlayer> playerEntry : players.entrySet()) { int playerId = playerEntry.getKey(); ServerPlayer player = playerEntry.getValue(); sendToPlayer(playerId, player); } } protected BoundingBoxCache getCache(DimensionId dimensionId) { return dimensionCache.get(dimensionId); } protected BoundingBoxCache getOrCreateCache(DimensionId dimensionId) { return dimensionCache.computeIfAbsent(dimensionId, dt -> new BoundingBoxCache()); } protected void clearCaches() { structureProcessors.clear(); for (BoundingBoxCache cache : dimensionCache.values()) { cache.clear(); } dimensionCache.clear(); } }
39.119205
132
0.69206
35d132523bdff80dc761ad1fbe0d125cdff88987
2,096
package org.black_ixx.bossshop.core.rewards; import org.black_ixx.bossshop.core.BSBuy; import org.black_ixx.bossshop.managers.ClassManager; import org.black_ixx.bossshop.managers.misc.InputReader; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; public class BSRewardTypeShop extends BSRewardType { public Object createObject(Object o, boolean force_final_state) { return InputReader.readString(o, true); } public boolean validityCheck(String item_name, Object o) { if (o != null) { return true; } ClassManager.manager.getBugFinder().severe("Was not able to create ShopItem " + item_name + "! The reward object needs to be the name of a shop (a single text line)."); return false; } public void enableType() { } @Override public boolean canBuy(Player p, BSBuy buy, boolean message_if_no_success, Object reward, ClickType clickType) { return true; } @Override public void giveReward(Player p, BSBuy buy, Object reward, ClickType clickType) { String shopName = (String) reward; if (shopName == null || shopName == "" || shopName.length() < 1) { p.closeInventory(); } else { ClassManager.manager.getShops().openShop(p, shopName); } } @Override public String getDisplayReward(Player p, BSBuy buy, Object reward, ClickType clickType) { String shopName = (String) reward; if (shopName == null || shopName == "" || shopName.length() < 1) { return ClassManager.manager.getMessageHandler().get("Display.Close"); } return ClassManager.manager.getMessageHandler().get("Display.Shop").replace("%shop%", shopName); } @Override public String[] createNames() { return new String[]{"shop"}; } public boolean logTransaction() { return false; } @Override public boolean mightNeedShopUpdate() { return false; } @Override public boolean isActualReward() { return false; } }
28.324324
176
0.647424
300c62e7308dbf8412383b4c20bb48a49268e192
6,293
/* * Copyright 2005 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.drools.guvnor.client.explorer.navigation.admin.widget; import com.google.gwt.user.client.ui.*; import org.drools.guvnor.client.common.GenericCallback; import org.drools.guvnor.client.common.LoadingPopup; import org.drools.guvnor.client.common.PrettyFormLayout; import org.drools.guvnor.client.messages.ConstantsCore; import org.drools.guvnor.client.resources.GuvnorImages; import org.drools.guvnor.client.resources.ImagesCore; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Window; import org.drools.guvnor.client.rpc.RepositoryService; import org.drools.guvnor.client.rpc.RepositoryServiceAsync; import org.uberfire.client.annotations.WorkbenchPartTitle; import org.uberfire.client.annotations.WorkbenchPartView; import org.uberfire.client.annotations.WorkbenchScreen; import javax.enterprise.context.Dependent; @Dependent @WorkbenchScreen(identifier = "statusManager") public class StateManager extends Composite { private RepositoryServiceAsync repositoryService = GWT.create(RepositoryService.class); private ListBox currentStatuses; public StateManager() { PrettyFormLayout form = new PrettyFormLayout(); form.addHeader( GuvnorImages.INSTANCE.Status(), new HTML( "<b>" + ConstantsCore.INSTANCE.ManageStatuses() + "</b>" ) ); form.startSection( ConstantsCore.INSTANCE.StatusTagsAreForTheLifecycleOfAnAsset() ); currentStatuses = new ListBox(); currentStatuses.setVisibleItemCount( 7 ); currentStatuses.setWidth( "50%" ); refreshList(); form.addAttribute( ConstantsCore.INSTANCE.CurrentStatuses(), currentStatuses ); HorizontalPanel hPanel = new HorizontalPanel(); Button create = new Button( ConstantsCore.INSTANCE.NewStatus() ); //create.setTitle( ConstantsCore.INSTANCE.CreateANewCategory() ); create.addClickHandler( new ClickHandler() { public void onClick(ClickEvent w) { StatusEditor newCat = new StatusEditor( new Command() { public void execute() { refreshList(); } } ); newCat.show(); } } ); Button edit = new Button( ConstantsCore.INSTANCE.RenameSelected() ); edit.addClickHandler( new ClickHandler() { public void onClick(ClickEvent w) { if ( !currentStatuses.isItemSelected( currentStatuses.getSelectedIndex() ) ) { Window.alert( ConstantsCore.INSTANCE.PleaseSelectAStatusToRename() ); return; } renameSelected(); } } ); Button remove = new Button( ConstantsCore.INSTANCE.DeleteSelected() ); remove.addClickHandler( new ClickHandler() { public void onClick(ClickEvent w) { if ( !currentStatuses.isItemSelected( currentStatuses.getSelectedIndex() ) ) { Window.alert( ConstantsCore.INSTANCE.PleaseSelectAStatusToRemove() ); return; } removeStatus(); } } ); hPanel.add( create ); hPanel.add( edit ); hPanel.add( remove ); form.addAttribute("", hPanel ); form.endSection(); initWidget( form ); } private void removeStatus() { String name = currentStatuses.getItemText( currentStatuses.getSelectedIndex() ); repositoryService.removeState(name, new GenericCallback<java.lang.Void>() { public void onSuccess(Void v) { Window.alert(ConstantsCore.INSTANCE.StatusRemoved()); refreshList(); } }); } private void renameSelected() { String newName = Window.prompt( ConstantsCore.INSTANCE.PleaseEnterTheNameYouWouldLikeToChangeThisStatusTo(), "" ); String oldName = currentStatuses.getItemText( currentStatuses.getSelectedIndex() ); if ( newName != null ) { repositoryService.renameState( oldName, newName, new GenericCallback<Void>() { public void onSuccess(Void data) { Window.alert( ConstantsCore.INSTANCE.StatusRenamed() ); refreshList(); } } ); } } private void refreshList() { LoadingPopup.showMessage( ConstantsCore.INSTANCE.LoadingStatuses() ); repositoryService.listStates( new GenericCallback<String[]>() { public void onSuccess(String[] statii) { currentStatuses.clear(); for (String aStatii : statii) { currentStatuses.addItem(aStatii); } LoadingPopup.close(); } } ); } @WorkbenchPartView public Widget asWidget() { return this; } @WorkbenchPartTitle public String getTitle() { return ConstantsCore.INSTANCE.StateManager(); } }
37.236686
126
0.588908
9f901d17436c55aed13141c2b8454e40a00b4bb3
2,259
package com.ckf.crm.service; import com.ckf.crm.entity.Employee; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; /** * @author xuan * @version 1.0 * @date 2020/3/25 18:08 */ @RunWith(SpringRunner.class) @SpringBootTest public class EmployeeServiceTest { @Autowired private EmployeeService employeeService; @Autowired private Employee employee; /** * 添加 */ @Test public void add() { employee.setEmpName("aa"); employee.setEPwd("123"); employee.setSalt("1111"); employee.setAge(12); employee.setSex("男"); employee.setPhone("13018596458"); employee.setAddress("广州"); employee.setRoleList(null); employeeService.save(employee); } /** * 添加 */ @Test public void addEmployee() { Employee employee = new Employee(null,null, "test", "123", "123", 18, "男", "13533", "天河", null); employee.setCreateTime("2020-3-25"); employee.setUpdateTime("2020-3-25"); employee.setIsDel(0); employeeService.save(employee); } /** * 加密的添加 */ @Test public void addEmployee1() { Employee employee = new Employee(null,null, "陈克丰", "123", "123", 18, "男", "13533", "天河", null); employeeService.addEmployee(employee, 2); } /** * 修改 */ @Test public void updateEmployee() { Employee employee = new Employee(2,null, "陈克丰", "123", "123", 18, "女", "13015866235", "广州天河", null); employeeService.updateEmployee(employee, 1); } /** * 修改密码 */ @Test public void updatePassword() { String username = "ss"; employee.setEmpName(username); String password = "1122"; System.out.println("--密码:" + password); employee.setEPwd(password); boolean flag = employeeService.updatePassword(employee); if (flag) { System.out.println("修改成功"); } else { System.out.println("修改失败"); } } }
22.59
108
0.585215
6a4b646169732f6f335ad3bca224fbfdb93721a7
216
package memorialize; public abstract class SeminarRead { protected double hours; protected String dope; public double now() { return this.hours; } public String scoop() { return this.dope; } }
14.4
35
0.685185
b31b24292828d6378d780dd7476cac3e00b3b84f
2,128
package com.xiezizuocai.pureacg.task; import android.os.AsyncTask; import com.xiezizuocai.pureacg.constant.API; import com.xiezizuocai.pureacg.entity.LatestInfo; import com.xiezizuocai.pureacg.utils.ParserUtils; import com.xiezizuocai.pureacg.utils.Request; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; public class FetchLatestInfoTask { private static final long CACHE_MAX_AGE = 86400000L * 7; public interface FetchLatestInfoCallback { void onSuccess(ArrayList<LatestInfo> latestInfos); void onError(String errorMsg); } // 获取最新资讯数据 public static void fetch( final FetchLatestInfoCallback fetchCallback) { Request.requestUrl(API.LATEST_INFO, CACHE_MAX_AGE, false, new Request.RequestCallback() { @Override public void onSuccess(String result) { parseLatestResult(result, fetchCallback); } @Override public void onError(String errorMsg) { fetchCallback.onError(errorMsg); } }); } // 解析最新结果 private static void parseLatestResult(String result, final FetchLatestInfoCallback fetchCallback) { new AsyncTask<String, Void, ArrayList<LatestInfo>>() { private String errorMsg = null; @Override protected ArrayList<LatestInfo> doInBackground(String... params) { String result = params[0]; try { return ParserUtils.parseLatestResult(result); } catch (JSONException e) { e.printStackTrace(); this.errorMsg = e.toString(); } return null; } @Override protected void onPostExecute(ArrayList<LatestInfo> latestInfos) { if (latestInfos != null) { fetchCallback.onSuccess(latestInfos); } else if (this.errorMsg != null) { fetchCallback.onError(this.errorMsg); } } }.execute(result); } }
30.4
103
0.605263
4c706d17ae6bce64d1dd023f4f104439c01e8313
716
package com.ntbrock.seatop.pebble.protocol; /** * Created by brockman on 2/7/16. */ public class SeatopPointDistroStruct { int point_type; // Picked 20 arbirarility. This is a limitation of the protocol // Will not allow of very large, dyanmically sized histograms. // It also means that smaller historgrams will transmit empty data. SeatopDistroBucketStruct bucket[] = new SeatopDistroBucketStruct[20]; // seatop_distro_bucket bucket[20]; // I can do pointer math here, make iteration easier and less verbose. int start_bucket_number; // Used for rendering with a subset of information int stop_bucket_number; int youngest_bucket_number; int oldest_bucket_number; }
31.130435
110
0.743017
9f21da3929d0e1553e4f38f9f441b14ddf589ce4
81
package com.example.p2psharelibrary; public interface DiscoverPeersCallBack { }
16.2
40
0.839506
1fa5ad935473c04bd5c95d04b47df69c217fe6bd
1,086
package com.hrh.mall.service; import com.hrh.mall.domain.UmsOss; import com.hrh.mall.dto.FileInfo; import com.hrh.mall.dto.ResponseResult; import org.springframework.web.multipart.MultipartFile; import java.util.List; /** * @ProjectName: mall-monomer * @Package: com.hrh.mall.service * @ClassName: UmsOssService * @Author: HuRonghua * @Description: ${description} * @Date: 2020/5/8 14:57 * @Version: 1.0 */ public interface UmsOssService { /** * 更新 新增 * @param umsOss {@link UmsOss} * @return */ ResponseResult<Integer> save(UmsOss umsOss); /** * 删除 * @param UmsOssId {@link Long} * @return */ ResponseResult<Integer> delete(Long UmsOssId); /** * 分页 * @param keyword {@link String} * @param pageSize {@link String} * @param pageNum {@link String} * @return */ List<UmsOss> page(String keyword, Integer pageSize, Integer pageNum); /** * oss 云存储 上传 * @param multipartFile * @return */ ResponseResult<FileInfo> upload(MultipartFile multipartFile); }
20.884615
73
0.633517
0908603eb6f4c81551f777dff229a9f3e4f24211
12,344
/** * NOTE: This class is auto generated by the swagger code generator program (3.0.18). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ package io.swagger.api.germ; import io.swagger.model.BrAPIResponse; import io.swagger.model.Model202AcceptedSearchResponse; import io.swagger.model.germ.GermplasmAttributeCategoryListResponse; import io.swagger.model.germ.GermplasmAttributeListResponse; import io.swagger.model.germ.GermplasmAttributeNewRequest; import io.swagger.model.germ.GermplasmAttributeSearchRequest; import io.swagger.model.germ.GermplasmAttributeSingleResponse; import io.swagger.annotations.*; import org.brapi.test.BrAPITestServer.exceptions.BrAPIServerException; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import javax.validation.Valid; import java.util.List; @javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-03-20T16:33:36.513Z[GMT]") @Api(value = "attributes", description = "the attributes API") public interface AttributesApi { @ApiOperation(value = "Get the details for a specific Germplasm Attribute", nickname = "attributesAttributeDbIdGet", notes = "Get the details for a specific Germplasm Attribute", response = GermplasmAttributeSingleResponse.class, authorizations = { @Authorization(value = "AuthorizationToken") }, tags = { "Germplasm Attributes", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = GermplasmAttributeSingleResponse.class), @ApiResponse(code = 400, message = "Bad Request", response = String.class), @ApiResponse(code = 401, message = "Unauthorized", response = String.class), @ApiResponse(code = 403, message = "Forbidden", response = String.class) }) @RequestMapping(value = "/attributes/{attributeDbId}", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity<GermplasmAttributeSingleResponse> attributesAttributeDbIdGet( @ApiParam(value = "The unique id for an attribute", required = true) @PathVariable("attributeDbId") String attributeDbId, @ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization) throws BrAPIServerException; @ApiOperation(value = "Update an existing Germplasm Attribute", nickname = "attributesAttributeDbIdPut", notes = "Update an existing Germplasm Attribute", response = GermplasmAttributeSingleResponse.class, authorizations = { @Authorization(value = "AuthorizationToken") }, tags = { "Germplasm Attributes", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = GermplasmAttributeSingleResponse.class), @ApiResponse(code = 400, message = "Bad Request", response = String.class), @ApiResponse(code = 401, message = "Unauthorized", response = String.class), @ApiResponse(code = 403, message = "Forbidden", response = String.class) }) @RequestMapping(value = "/attributes/{attributeDbId}", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PUT) ResponseEntity<GermplasmAttributeSingleResponse> attributesAttributeDbIdPut( @ApiParam(value = "The unique id for an attribute", required = true) @PathVariable("attributeDbId") String attributeDbId, @ApiParam(value = "") @Valid @RequestBody GermplasmAttributeNewRequest body, @ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization) throws BrAPIServerException; @ApiOperation(value = "Get the Categories of Germplasm Attributes", nickname = "attributesCategoriesGet", notes = "List all available attribute categories.", response = GermplasmAttributeCategoryListResponse.class, authorizations = { @Authorization(value = "AuthorizationToken") }, tags = { "Germplasm Attributes", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = GermplasmAttributeCategoryListResponse.class), @ApiResponse(code = 400, message = "Bad Request", response = String.class), @ApiResponse(code = 401, message = "Unauthorized", response = String.class), @ApiResponse(code = 403, message = "Forbidden", response = String.class) }) @RequestMapping(value = "/attributes/categories", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity<GermplasmAttributeCategoryListResponse> attributesCategoriesGet( @ApiParam(value = "Used to request a specific page of data to be returned. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`.") @Valid @RequestParam(value = "page", required = false) Integer page, @ApiParam(value = "The size of the pages to be returned. Default is `1000`.") @Valid @RequestParam(value = "pageSize", required = false) Integer pageSize, @ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization) throws BrAPIServerException; @ApiOperation(value = "Get the Germplasm Attributes", nickname = "attributesGet", notes = "List available attributes.", response = GermplasmAttributeListResponse.class, authorizations = { @Authorization(value = "AuthorizationToken") }, tags = { "Germplasm Attributes", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = GermplasmAttributeListResponse.class), @ApiResponse(code = 400, message = "Bad Request", response = String.class), @ApiResponse(code = 401, message = "Unauthorized", response = String.class), @ApiResponse(code = 403, message = "Forbidden", response = String.class) }) @RequestMapping(value = "/attributes", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity<GermplasmAttributeListResponse> attributesGet( @ApiParam(value = "The general category for the attribute. very similar to Trait class.") @Valid @RequestParam(value = "attributeCategory", required = false) String attributeCategory, @ApiParam(value = "The unique id for an attribute") @Valid @RequestParam(value = "attributeDbId", required = false) String attributeDbId, @ApiParam(value = "The human readable name for an attribute") @Valid @RequestParam(value = "attributeName", required = false) String attributeName, @ApiParam(value = "Get all attributes associated with this germplasm") @Valid @RequestParam(value = "germplasmDbId", required = false) String germplasmDbId, @ApiParam(value = "Search for Germplasm by an external reference") @Valid @RequestParam(value = "externalReferenceID", required = false) String externalReferenceID, @ApiParam(value = "Search for Germplasm by an external reference") @Valid @RequestParam(value = "externalReferenceSource", required = false) String externalReferenceSource, @ApiParam(value = "Used to request a specific page of data to be returned. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`.") @Valid @RequestParam(value = "page", required = false) Integer page, @ApiParam(value = "The size of the pages to be returned. Default is `1000`.") @Valid @RequestParam(value = "pageSize", required = false) Integer pageSize, @ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization) throws BrAPIServerException; @ApiOperation(value = "Create new Germplasm Attributes", nickname = "attributesPost", notes = "Create new Germplasm Attributes", response = GermplasmAttributeListResponse.class, authorizations = { @Authorization(value = "AuthorizationToken") }, tags = { "Germplasm Attributes", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = GermplasmAttributeListResponse.class), @ApiResponse(code = 400, message = "Bad Request", response = String.class), @ApiResponse(code = 401, message = "Unauthorized", response = String.class), @ApiResponse(code = 403, message = "Forbidden", response = String.class) }) @RequestMapping(value = "/attributes", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.POST) ResponseEntity<GermplasmAttributeListResponse> attributesPost( @ApiParam(value = "") @Valid @RequestBody List<GermplasmAttributeNewRequest> body, @ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization) throws BrAPIServerException; @ApiOperation(value = "Submit a search request for Germplasm Attributes", nickname = "searchAttributesPost", notes = "Search for a set of Germplasm Attributes based on some criteria See Search Services for additional implementation details.", response = GermplasmAttributeListResponse.class, authorizations = { @Authorization(value = "AuthorizationToken") }, tags = { "Germplasm Attributes", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = GermplasmAttributeListResponse.class), @ApiResponse(code = 202, message = "Accepted", response = Model202AcceptedSearchResponse.class), @ApiResponse(code = 400, message = "Bad Request", response = String.class), @ApiResponse(code = 401, message = "Unauthorized", response = String.class), @ApiResponse(code = 403, message = "Forbidden", response = String.class) }) @RequestMapping(value = "/search/attributes", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.POST) ResponseEntity<? extends BrAPIResponse> searchAttributesPost( @ApiParam(value = "") @Valid @RequestBody GermplasmAttributeSearchRequest body, @ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization) throws BrAPIServerException; @ApiOperation(value = "Get the results of a Germplasm Attributes search request", nickname = "searchAttributesSearchResultsDbIdGet", notes = "Get the results of a Germplasm Attributes search request See Search Services for additional implementation details.", response = GermplasmAttributeListResponse.class, authorizations = { @Authorization(value = "AuthorizationToken") }, tags = { "Germplasm Attributes", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = GermplasmAttributeListResponse.class), @ApiResponse(code = 202, message = "Accepted", response = Model202AcceptedSearchResponse.class), @ApiResponse(code = 400, message = "Bad Request", response = String.class), @ApiResponse(code = 401, message = "Unauthorized", response = String.class), @ApiResponse(code = 403, message = "Forbidden", response = String.class), @ApiResponse(code = 404, message = "Not Found", response = String.class) }) @RequestMapping(value = "/search/attributes/{searchResultsDbId}", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity<? extends BrAPIResponse> searchAttributesSearchResultsDbIdGet( @ApiParam(value = "Permanent unique identifier which references the search results", required = true) @PathVariable("searchResultsDbId") String searchResultsDbId, @ApiParam(value = "Used to request a specific page of data to be returned. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`.") @Valid @RequestParam(value = "page", required = false) Integer page, @ApiParam(value = "The size of the pages to be returned. Default is `1000`.") @Valid @RequestParam(value = "pageSize", required = false) Integer pageSize, @ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization) throws BrAPIServerException; }
89.449275
329
0.755752
c76bac7115f53570b1c8fc2deeec57782ce349df
16,258
/** * Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is governed by a * license that can be found in the LICENSE file. * * This file was generated automatically. Changes to this file will be lost every time the * code is regenerated. */ package com.blockchyp.client.dto; import com.fasterxml.jackson.annotation.JsonProperty; /** * Creates a payment link. */ public class PaymentLinkRequest implements ICoreRequest, IRequestAmount, ITerminalReference { private String transactionRef; private boolean async; private boolean queue; private boolean waitForRemovedCard; private boolean force; private String orderRef; private String destinationAccount; private boolean test; private int timeout; private String currencyCode; private String amount; private boolean taxExempt; private boolean surcharge; private boolean cashDiscount; private String terminalName; private boolean autoSend; private boolean enroll; private boolean enrollOnly; private boolean cashier; private String description; private String subject; private TransactionDisplayTransaction transaction; private Customer customer; private String callbackUrl; private String tcAlias; private String tcName; private String tcContent; /** * Sets a user-assigned reference that can be used to recall or reverse transactions. * @param value a user-assigned reference that can be used to recall or reverse * transactions. */ public void setTransactionRef(String value) { this.transactionRef = value; } /** * Gets a user-assigned reference that can be used to recall or reverse transactions. * @return a user-assigned reference that can be used to recall or reverse * transactions. */ @JsonProperty("transactionRef") public String getTransactionRef() { return this.transactionRef; } /** * Sets defers the response to the transaction and returns immediately. * @param value defers the response to the transaction and returns immediately. * Callers should retrive the transaction result using the Transaction Status API. */ public void setAsync(boolean value) { this.async = value; } /** * Gets defers the response to the transaction and returns immediately. * @return defers the response to the transaction and returns immediately. Callers * should retrive the transaction result using the Transaction Status API. */ @JsonProperty("async") public boolean isAsync() { return this.async; } /** * Sets adds the transaction to the queue and returns immediately. * @param value adds the transaction to the queue and returns immediately. Callers * should retrive the transaction result using the Transaction Status API. */ public void setQueue(boolean value) { this.queue = value; } /** * Gets adds the transaction to the queue and returns immediately. * @return adds the transaction to the queue and returns immediately. Callers should * retrive the transaction result using the Transaction Status API. */ @JsonProperty("queue") public boolean isQueue() { return this.queue; } /** * Sets whether or not the request should block until all cards have been removed from * the card reader. * @param value whether or not the request should block until all cards have been * removed from the card reader. */ public void setWaitForRemovedCard(boolean value) { this.waitForRemovedCard = value; } /** * Gets whether or not the request should block until all cards have been removed from * the card reader. * @return whether or not the request should block until all cards have been removed * from the card reader. */ @JsonProperty("waitForRemovedCard") public boolean isWaitForRemovedCard() { return this.waitForRemovedCard; } /** * Sets override any in-progress transactions. * @param value override any in-progress transactions. */ public void setForce(boolean value) { this.force = value; } /** * Gets override any in-progress transactions. * @return override any in-progress transactions. */ @JsonProperty("force") public boolean isForce() { return this.force; } /** * Sets an identifier from an external point of sale system. * @param value an identifier from an external point of sale system. */ public void setOrderRef(String value) { this.orderRef = value; } /** * Gets an identifier from an external point of sale system. * @return an identifier from an external point of sale system. */ @JsonProperty("orderRef") public String getOrderRef() { return this.orderRef; } /** * Sets the settlement account for merchants with split settlements. * @param value the settlement account for merchants with split settlements. */ public void setDestinationAccount(String value) { this.destinationAccount = value; } /** * Gets the settlement account for merchants with split settlements. * @return the settlement account for merchants with split settlements. */ @JsonProperty("destinationAccount") public String getDestinationAccount() { return this.destinationAccount; } /** * Sets whether or not to route transaction to the test gateway. * @param value whether or not to route transaction to the test gateway. */ public void setTest(boolean value) { this.test = value; } /** * Gets whether or not to route transaction to the test gateway. * @return whether or not to route transaction to the test gateway. */ @JsonProperty("test") public boolean isTest() { return this.test; } /** * Sets the request timeout in seconds. * @param value the request timeout in seconds. */ public void setTimeout(int value) { this.timeout = value; } /** * Gets the request timeout in seconds. * @return the request timeout in seconds. */ @JsonProperty("timeout") public int getTimeout() { return this.timeout; } /** * Sets the transaction currency code. * @param value the transaction currency code. */ public void setCurrencyCode(String value) { this.currencyCode = value; } /** * Gets the transaction currency code. * @return the transaction currency code. */ @JsonProperty("currencyCode") public String getCurrencyCode() { return this.currencyCode; } /** * Sets the requested amount. * @param value the requested amount. */ public void setAmount(String value) { this.amount = value; } /** * Gets the requested amount. * @return the requested amount. */ @JsonProperty("amount") public String getAmount() { return this.amount; } /** * Sets that the request is tax exempt. * @param value that the request is tax exempt. Only required for tax exempt level 2 * processing. */ public void setTaxExempt(boolean value) { this.taxExempt = value; } /** * Gets that the request is tax exempt. * @return that the request is tax exempt. Only required for tax exempt level 2 * processing. */ @JsonProperty("taxExempt") public boolean isTaxExempt() { return this.taxExempt; } /** * Sets a flag to add a surcharge to the transaction to cover credit card fees, if * permitted. * @param value a flag to add a surcharge to the transaction to cover credit card fees, * if permitted. */ public void setSurcharge(boolean value) { this.surcharge = value; } /** * Gets a flag to add a surcharge to the transaction to cover credit card fees, if * permitted. * @return a flag to add a surcharge to the transaction to cover credit card fees, if * permitted. */ @JsonProperty("surcharge") public boolean isSurcharge() { return this.surcharge; } /** * Sets a flag that applies a discount to negate the surcharge for debit transactions * or other surcharge ineligible payment methods. * @param value a flag that applies a discount to negate the surcharge for debit * transactions or other surcharge ineligible payment methods. */ public void setCashDiscount(boolean value) { this.cashDiscount = value; } /** * Gets a flag that applies a discount to negate the surcharge for debit transactions * or other surcharge ineligible payment methods. * @return a flag that applies a discount to negate the surcharge for debit * transactions or other surcharge ineligible payment methods. */ @JsonProperty("cashDiscount") public boolean isCashDiscount() { return this.cashDiscount; } /** * Sets the name of the target payment terminal. * @param value the name of the target payment terminal. */ public void setTerminalName(String value) { this.terminalName = value; } /** * Gets the name of the target payment terminal. * @return the name of the target payment terminal. */ @JsonProperty("terminalName") public String getTerminalName() { return this.terminalName; } /** * Sets automatically send the link via an email. * @param value automatically send the link via an email. */ public void setAutoSend(boolean value) { this.autoSend = value; } /** * Gets automatically send the link via an email. * @return automatically send the link via an email. */ @JsonProperty("autoSend") public boolean isAutoSend() { return this.autoSend; } /** * Sets that the payment method should be added to the token vault alongside the * authorization. * @param value that the payment method should be added to the token vault alongside * the authorization. */ public void setEnroll(boolean value) { this.enroll = value; } /** * Gets that the payment method should be added to the token vault alongside the * authorization. * @return that the payment method should be added to the token vault alongside the * authorization. */ @JsonProperty("enroll") public boolean isEnroll() { return this.enroll; } /** * Sets that the link should be used to enroll a token only. * @param value that the link should be used to enroll a token only. Can only be used in * cashier mode. */ public void setEnrollOnly(boolean value) { this.enrollOnly = value; } /** * Gets that the link should be used to enroll a token only. * @return that the link should be used to enroll a token only. Can only be used in * cashier mode. */ @JsonProperty("enrollOnly") public boolean isEnrollOnly() { return this.enrollOnly; } /** * Sets flags the payment link as cashier facing. * @param value flags the payment link as cashier facing. */ public void setCashier(boolean value) { this.cashier = value; } /** * Gets flags the payment link as cashier facing. * @return flags the payment link as cashier facing. */ @JsonProperty("cashier") public boolean isCashier() { return this.cashier; } /** * Sets description explaining the transaction for display to the user. * @param value description explaining the transaction for display to the user. */ public void setDescription(String value) { this.description = value; } /** * Gets description explaining the transaction for display to the user. * @return description explaining the transaction for display to the user. */ @JsonProperty("description") public String getDescription() { return this.description; } /** * Sets subject of the payment email. * @param value subject of the payment email. */ public void setSubject(String value) { this.subject = value; } /** * Gets subject of the payment email. * @return subject of the payment email. */ @JsonProperty("subject") public String getSubject() { return this.subject; } /** * Sets transaction details for display on the payment email. * @param value transaction details for display on the payment email. */ public void setTransaction(TransactionDisplayTransaction value) { this.transaction = value; } /** * Gets transaction details for display on the payment email. * @return transaction details for display on the payment email. */ @JsonProperty("transaction") public TransactionDisplayTransaction getTransaction() { return this.transaction; } /** * Sets customer information. * @param value customer information. */ public void setCustomer(Customer value) { this.customer = value; } /** * Gets customer information. * @return customer information. */ @JsonProperty("customer") public Customer getCustomer() { return this.customer; } /** * Sets optional callback url to which transaction responses for this link will be * posted. * @param value optional callback url to which transaction responses for this link * will be posted. */ public void setCallbackUrl(String value) { this.callbackUrl = value; } /** * Gets optional callback url to which transaction responses for this link will be * posted. * @return optional callback url to which transaction responses for this link will be * posted. */ @JsonProperty("callbackUrl") public String getCallbackUrl() { return this.callbackUrl; } /** * Sets an alias for a Terms and Conditions template configured in the BlockChyp * dashboard. * @param value an alias for a Terms and Conditions template configured in the * BlockChyp dashboard. */ public void setTcAlias(String value) { this.tcAlias = value; } /** * Gets an alias for a Terms and Conditions template configured in the BlockChyp * dashboard. * @return an alias for a Terms and Conditions template configured in the BlockChyp * dashboard. */ @JsonProperty("tcAlias") public String getTcAlias() { return this.tcAlias; } /** * Sets the name of the Terms and Conditions the user is accepting. * @param value the name of the Terms and Conditions the user is accepting. */ public void setTcName(String value) { this.tcName = value; } /** * Gets the name of the Terms and Conditions the user is accepting. * @return the name of the Terms and Conditions the user is accepting. */ @JsonProperty("tcName") public String getTcName() { return this.tcName; } /** * Sets the content of the terms and conditions that will be presented to the user. * @param value the content of the terms and conditions that will be presented to the * user. */ public void setTcContent(String value) { this.tcContent = value; } /** * Gets the content of the terms and conditions that will be presented to the user. * @return the content of the terms and conditions that will be presented to the user. */ @JsonProperty("tcContent") public String getTcContent() { return this.tcContent; } }
28.623239
93
0.639193
5ab6b2d412156e903e31688a7ebc08e9bac945fd
1,004
package com.example.processor; import lombok.AllArgsConstructor; import lombok.Data; import lombok.extern.log4j.Log4j2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.annotation.StreamListener; import org.springframework.cloud.stream.messaging.Processor; import org.springframework.messaging.handler.annotation.SendTo; @Log4j2 @EnableBinding(Processor.class) @SpringBootApplication public class ProcessorApplication { public static void main(String[] args) { SpringApplication.run(ProcessorApplication.class, args); } @StreamListener(Processor.INPUT) @SendTo(Processor.OUTPUT) public PersonEvent receiveAndSend(String name) { log.info("receive event {}", name); return new PersonEvent(name); } } @Data @AllArgsConstructor class PersonEvent { private String name; }
26.421053
68
0.786853
1d86e3ea9cb10308ed5a0f37ade6a64c2c0bcb2c
449
package br.com.zupacademy.antonio.dtos; import br.com.zupacademy.antonio.entities.Biometria; public class BiometriaResponse { private String fingerprint; private String cartao; public BiometriaResponse(Biometria biometria) { this.fingerprint = biometria.getFingerprint(); this.cartao = biometria.getCartao().getId(); } public String getFingerprint() { return fingerprint; } public String getCartao() { return cartao; } }
18.708333
52
0.750557
96b851606f9a2bed61369af6806cf329d1a19fe2
869
/* * 版权所有 (c) 2015 。 李倍存 (iPso)。 * 所有者对该文件所包含的代码的正确性、执行效率等任何方面不作任何保证。 * 所有个人和组织均可不受约束地将该文件所包含的代码用于非商业用途。若需要将其用于商业软件的开发,请首先联系所有者以取得许可。 */ package org.ipso.lbc.common.frameworks.jfreechart; import org.jfree.chart.renderer.category.BarRenderer; import org.jfree.data.category.CategoryDataset; import java.awt.*; /** * 李倍存 创建于 2015-03-08 15:16。电邮 [email protected]。 */ public class BarChartRendererWithThreshold extends BarRenderer { private Double threshold; public BarChartRendererWithThreshold(Double threshold) { this.threshold = threshold; } public Paint getItemPaint(int i, int j) { CategoryDataset categorydataset = this.getPlot().getDataset(); Double d = categorydataset.getValue(i, j).doubleValue(); if (d >= threshold) return Color.green; else return Color.red; } }
25.558824
70
0.698504
678a4b6a7e210806bcbabdd12501747fe5b8b74e
388
package com.xuxianda.feign; import com.xuxianda.entity.User; import org.springframework.web.bind.annotation.PathVariable; /** * Created by Xianda Xu on 2018/3/18. */ public class HystrixClientFallback implements UserFeignClient{ @Override public User findById(@PathVariable("id") Long id) { User user = new User(); user.setId(0L); return user; } }
22.823529
62
0.690722
aff9ba6a387af8457704fc85c3661dd41c1abaac
4,147
/* * Copyright 2018 Nextworks s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package it.nextworks.nfvmano.libs.ifa.descriptors.common.elements; import java.util.ArrayList; import java.util.List; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.ManyToOne; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import com.fasterxml.jackson.annotation.JsonIgnore; import it.nextworks.nfvmano.libs.ifa.common.DescriptorInformationElement; import it.nextworks.nfvmano.libs.ifa.common.enums.LcmEventType; import it.nextworks.nfvmano.libs.ifa.common.exceptions.MalformattedElementException; import it.nextworks.nfvmano.libs.ifa.descriptors.nsd.Nsd; import it.nextworks.nfvmano.libs.ifa.descriptors.vnfd.Vnfd; /** * Information element related to the lifecycle management script for the VNF. * * REF. IFA-011 v2.3.1 - section 7.1.13 * REF. IFA-014 v2.3.1 - section 6.2.9 * * @author nextworks * */ @Entity public class LifeCycleManagementScript implements DescriptorInformationElement { @Id @GeneratedValue @JsonIgnore private Long id; @ManyToOne @JsonIgnore private Vnfd vnfd; @ManyToOne @JsonIgnore private Nsd nsd; @ElementCollection(fetch=FetchType.EAGER) @Fetch(FetchMode.SELECT) @Cascade(org.hibernate.annotations.CascadeType.ALL) private List<LcmEventType> event = new ArrayList<>(); @Lob @Basic(fetch=FetchType.EAGER) @Column(columnDefinition = "TEXT") private String script; public LifeCycleManagementScript() { } /** * Constructor * * @param vnfd VNFD this script belongs to * @param event Describes VNF lifecycle event(s) or an external stimulus detected on a VNFM reference point. * @param script Includes a VNF LCM script triggered to react to one of the events listed in the event attribute. */ public LifeCycleManagementScript(Vnfd vnfd, List<LcmEventType> event, String script) { this.vnfd = vnfd; if (event != null) this.event = event; this.script = script; } /** * Constructor * * @param nsd NSD this script belongs to * @param event Describes NS lifecycle event(s) or an external stimulus detected on an NFVO reference point. * @param script Includes a NS LCM script triggered to react to one of the events listed in the event attribute. */ public LifeCycleManagementScript(Nsd nsd, List<LcmEventType> event, String script) { this.nsd = nsd; if (event != null) this.event = event; this.script = script; } /** * @return the event */ public List<LcmEventType> getEvent() { return event; } /** * @return the script */ public String getScript() { return script; } @JsonIgnore public boolean includeEvent(LcmEventType eventType) { for (LcmEventType t : event) { if (t == eventType) return true; } return false; } @Override public void isValid() throws MalformattedElementException { if (script == null) throw new MalformattedElementException("LCM script without script info"); if ((event == null) || (event.isEmpty())) throw new MalformattedElementException("LCM script without event"); } public void setVnfd(Vnfd vnfd) { this.vnfd = vnfd; } public void setNsd(Nsd nsd) { this.nsd = nsd; } public void setEvent(List<LcmEventType> event) { this.event = event; } public void setScript(String script) { this.script = script; } }
26.928571
114
0.742947
1b17be4f153c535617e139b0e477573482bf8413
1,716
package com.microsoft.hsg.android.simplexml.test; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import junit.framework.TestCase; import android.util.Base64; import com.microsoft.hsg.Connection; import com.microsoft.hsg.android.simplexml.ConnectionFactory; import com.microsoft.hsg.android.simplexml.HealthVaultApp; import com.microsoft.hsg.android.simplexml.methods.getauthorizedpeople.request.GetAuthorizedPeopleParameters; import com.microsoft.hsg.android.simplexml.methods.getauthorizedpeople.request.GetAuthorizedPeopleRequest; import com.microsoft.hsg.android.simplexml.methods.getauthorizedpeople.response.GetAuthorizedPeopleResponse; import com.microsoft.hsg.android.simplexml.methods.getauthorizedpeople.response.GetAuthorizedPeopleResponseInfo; import com.microsoft.hsg.android.simplexml.methods.request.RequestTemplate; public class GetAuthorizedPeopleTest extends TestCase { private Connection connection; public GetAuthorizedPeopleTest() { } public void setUp() { HVSettings settings = new HVSettings(); settings.setAppId("90976b0c-e0c2-467e-b65c-ed9117aa94e9"); settings.setAuthenticationSecret("JpGYZ54MRAhy2Gw9uoWCfxTG97ufR3v7kZ/i2JG+Utw="); HealthVaultApp app = new HealthVaultApp(settings); HealthVaultApp.setInstance(app); } public void testGetAuthorizedPeople() { RequestTemplate requestTemplate = new RequestTemplate( HealthVaultApp.getInstance().getConnection()); GetAuthorizedPeopleRequest request = new GetAuthorizedPeopleRequest( new GetAuthorizedPeopleParameters()); GetAuthorizedPeopleResponse response = requestTemplate.makeRequest( request, GetAuthorizedPeopleResponse.class); } }
36.510638
112
0.81993
334942e986b283979ad18dbcf7742dd948d1567e
1,875
package com.gh4a.resolver; import android.content.Intent; import android.support.v4.app.FragmentActivity; import com.gh4a.activities.FileViewerActivity; import com.gh4a.utils.ApiHelpers; import com.gh4a.utils.FileUtils; import com.gh4a.utils.Optional; import com.gh4a.utils.RxUtils; import com.meisolsson.githubsdk.model.GitHubFile; import com.meisolsson.githubsdk.model.PositionalCommentBase; import java.util.List; import io.reactivex.Single; public abstract class DiffLoadTask<C extends PositionalCommentBase> extends UrlLoadTask { protected final String mRepoOwner; protected final String mRepoName; protected final DiffHighlightId mDiffId; public DiffLoadTask(FragmentActivity activity, String repoOwner, String repoName, DiffHighlightId diffId) { super(activity); mRepoOwner = repoOwner; mRepoName = repoName; mDiffId = diffId; } @Override protected Single<Optional<Intent>> getSingle() { Single<Optional<GitHubFile>> fileSingle = getFiles() .compose(RxUtils.filterAndMapToFirst( f -> ApiHelpers.md5(f.filename()).equalsIgnoreCase(mDiffId.fileHash))); return Single.zip(getSha(), fileSingle, (sha, fileOpt) -> fileOpt.map(file -> { if (FileUtils.isImage(file.filename())) { return FileViewerActivity.makeIntent(mActivity, mRepoOwner, mRepoName, sha, file.filename()); } return getLaunchIntent(sha, file, getComments().blockingGet(), mDiffId); })); } protected abstract Single<List<GitHubFile>> getFiles(); protected abstract Single<String> getSha(); protected abstract Single<List<C>> getComments(); protected abstract Intent getLaunchIntent(String sha, GitHubFile file, List<C> comments, DiffHighlightId diffId); }
36.057692
95
0.698133
5950def98f5b09a750861c690c4081289c28f411
885
package com.abocode.jfaster.system.entity; import com.abocode.jfaster.core.AbstractIdEntity; import lombok.Data; import javax.persistence.*; /** * 权限操作表 */ @Entity @Table(name = "t_s_operation") @Data public class Operation extends AbstractIdEntity implements java.io.Serializable { @Column(name = "operation_name", length = 20) private String operationName; @Column(name = "operation_code", length = 50) private String operationCode; @Column(name = "operation_icon", length = 100) private String operationIcon; @Column private Short status; @Column(name = "operation_type") private Short operationType; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "icon_id") private Icon icon = new Icon(); @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "function_id") private Function function = new Function(); }
27.65625
81
0.710734
fa7822ded6bd30578510d8d33a1986b019a7b968
226
package de.cgrotz.kademlia.storage; import lombok.Builder; import lombok.Data; /** * Created by Christoph on 27.09.2016. */ @Builder @Data public class Value { private long lastPublished; private String content; }
15.066667
38
0.725664
e320ce2bf8627ff3e1f2e1d84dd82708ea1ce52b
9,296
/* * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.ui.actions; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.AXIS2_CLIENT_PROPERTIES_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.AXIS2_CLIENT_PROPERTY_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.AXIS2_PROPERTIES_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.AXIS2_PROPERTY_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.CLEAR_COMMAND; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.OPERATION_PROPERTIES_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.OPERATION_PROPERTY_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.SYANPSE_PROPERTY_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.SYNAPSE_PROPERTIES_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.TRANSPORT_PROPERTIES_TAG; import static org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.ESBDebuggerConstants.TRANSPORT_PROPERTY_TAG; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IVariable; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.messages.command.PropertyChangeCommand; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.messages.util.PropertyValueBean; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.debugger.utils.Messages; /** * This class manages the dialog box for property clear message. * */ public class AddPropertyToTableDialog extends TitleAreaDialog { private String propertyContext; private String propertyKey; private Map<String, List<String>> propertyVariableMap; public AddPropertyToTableDialog(Shell parent, List<IVariable> variables) throws DebugException { super(parent); propertyVariableMap = new HashMap<String, List<String>>(); populatePropertyVariableMap(variables); } @Override public void create() { super.create(); setTitle(Messages.AddPropertyToTableDialog_DialogTitle); setMessage(Messages.AddPropertyToTableDialog_DialogDescription, IMessageProvider.INFORMATION); } @Override protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); GridLayout layout = new GridLayout(2, false); container.setLayout(layout); GridData dataPropertyConfigText = new GridData(); dataPropertyConfigText.grabExcessHorizontalSpace = true; dataPropertyConfigText.horizontalAlignment = GridData.FILL; Label propertyContextLabel = new Label(container, SWT.NULL); propertyContextLabel.setText(Messages.ClearPropertyDialog_PropertContextLabel); final Combo propertyContextValueDropDown = new Combo(container, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); propertyContextValueDropDown.setLayoutData(dataPropertyConfigText); propertyContextValueDropDown.add(AXIS2_CLIENT_PROPERTY_TAG); propertyContextValueDropDown.add(TRANSPORT_PROPERTY_TAG); propertyContextValueDropDown.add(AXIS2_PROPERTY_TAG); propertyContextValueDropDown.add(OPERATION_PROPERTY_TAG); propertyContextValueDropDown.add(SYANPSE_PROPERTY_TAG); Label propertyKeyLabel = new Label(container, SWT.NULL); propertyKeyLabel.setText(Messages.ClearPropertyDialog_PropertyNameLabel); final Combo propertyKeyValueDropDown = new Combo(container, SWT.DROP_DOWN | SWT.BORDER | SWT.H_SCROLL | SWT.READ_ONLY); propertyKeyValueDropDown.setLayoutData(dataPropertyConfigText); propertyContextValueDropDown.addListener(SWT.Modify, new Listener() { public void handleEvent(Event event) { try { propertyContext = new String(propertyContextValueDropDown.getText()); propertyKeyValueDropDown.setText(""); //$NON-NLS-1$ propertyKeyValueDropDown.clearSelection(); updatePropertyKeyList(); if (!(StringUtils.isEmpty(propertyContext) || StringUtils.isEmpty(propertyKey))) { getButton(IDialogConstants.OK_ID).setEnabled(true); } else { getButton(IDialogConstants.OK_ID).setEnabled(false); } } catch (Exception e) { getButton(IDialogConstants.OK_ID).setEnabled(false); } } private void updatePropertyKeyList() { propertyKeyValueDropDown.removeAll(); List<String> propertyKeyList = propertyVariableMap.get(propertyContext); for (String key : propertyKeyList) { propertyKeyValueDropDown.add(key); } } }); propertyKeyValueDropDown.addListener(SWT.Modify, new Listener() { public void handleEvent(Event event) { try { propertyKey = new String(propertyKeyValueDropDown.getText()); if (!(StringUtils.isEmpty(propertyContext) || StringUtils.isEmpty(propertyKey))) { getButton(IDialogConstants.OK_ID).setEnabled(true); } else { getButton(IDialogConstants.OK_ID).setEnabled(false); } } catch (Exception e) { getButton(IDialogConstants.OK_ID).setEnabled(false); } } }); return area; } @Override protected void okPressed() { super.okPressed(); } @Override protected void cancelPressed() { super.cancelPressed(); } @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText(Messages.AddPropertyToTableDialog_ShellTitle); } @Override protected boolean isResizable() { return true; } private String getESBContextNameFromUITableVariableName(String name) { switch (name) { case AXIS2_PROPERTIES_TAG: return AXIS2_PROPERTY_TAG; case AXIS2_CLIENT_PROPERTIES_TAG: return AXIS2_CLIENT_PROPERTY_TAG; case SYNAPSE_PROPERTIES_TAG: return SYANPSE_PROPERTY_TAG; case TRANSPORT_PROPERTIES_TAG: return TRANSPORT_PROPERTY_TAG; case OPERATION_PROPERTIES_TAG: return OPERATION_PROPERTY_TAG; } return name; } private void populatePropertyVariableMap(List<IVariable> variables) throws DebugException { for (IVariable iVariable : variables) { String propertyContextName = getESBContextNameFromUITableVariableName(iVariable.getName()); IVariable[] childPropertyArray = iVariable.getValue().getVariables(); List<String> childVariableList = new ArrayList<>(); for (IVariable childVariable : childPropertyArray) { childVariableList.add(childVariable.getName()); } propertyVariableMap.put(propertyContextName, childVariableList); } } public PropertyChangeCommand getCommandMessage() { PropertyValueBean property = new PropertyValueBean(propertyKey, null); PropertyChangeCommand command = new PropertyChangeCommand(CLEAR_COMMAND, propertyContext, property); return command; } }
45.793103
127
0.716007
7b467f816467b2ea14014a6a70e6a3aabc8a0a85
1,434
package common.net; import io.netty.handler.codec.http.HttpRequest; public class HttpPacket { private int playerid; private String deviceid; private String token; private int protocol; private String data; private HttpRequest request; private String ip; public HttpPacket(int playerid,String deviceid,String token,int protocol,String data,String ip,HttpRequest request){ this.playerid=playerid; this.deviceid=deviceid; this.token=token; this.protocol=protocol; this.data=data; this.ip=ip; this.request=request; } public int getPlayerid() { return playerid; } public void setPlayerid(int playerid) { this.playerid = playerid; } public String getDeviceid() { return deviceid; } public void setDeviceid(String deviceid) { this.deviceid = deviceid; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } public int getProtocol() { return protocol; } public void setProtocol(int protocol) { this.protocol = protocol; } public String getData() { return data; } public void setData(String data) { this.data = data; } public HttpRequest getRequest() { return request; } public void setRequest(HttpRequest request) { this.request = request; } public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } }
19.378378
118
0.682008
4ce1be8bfb6d6e0eef6ded5a8611787a53768c58
7,032
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dubbo.admin.config; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; import org.apache.dubbo.admin.common.exception.ConfigurationException; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.utils.NetUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.util.ReflectionTestUtils; import java.io.IOException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; @RunWith(SpringJUnit4ClassRunner.class) public class ConfigCenterTest { private String zkAddress; private TestingServer zkServer; private CuratorFramework zkClient; @Before public void setup() throws Exception { int zkServerPort = NetUtils.getAvailablePort(); zkAddress = "zookeeper://127.0.0.1:" + zkServerPort; zkServer = new TestingServer(zkServerPort, true); zkClient = CuratorFrameworkFactory.builder().connectString(zkServer.getConnectString()).retryPolicy(new ExponentialBackoffRetry(1000, 3)).build(); zkClient.start(); } @After public void tearDown() throws IOException { zkServer.close(); zkServer.stop(); } @InjectMocks private ConfigCenter configCenter; @Test public void testGetDynamicConfiguration() throws Exception { // mock @value inject ReflectionTestUtils.setField(configCenter, "configCenter", zkAddress); ReflectionTestUtils.setField(configCenter, "group", "dubbo"); ReflectionTestUtils.setField(configCenter, "username", "username"); ReflectionTestUtils.setField(configCenter, "password", "password"); // config is null configCenter.getDynamicConfiguration(); // config is registry address zkClient.createContainers("/dubbo/config/dubbo/dubbo.properties"); zkClient.setData().forPath("/dubbo/config/dubbo/dubbo.properties", "dubbo.registry.address=zookeeper://test-registry.com:2181".getBytes()); configCenter.getDynamicConfiguration(); Object registryUrl = ReflectionTestUtils.getField(configCenter, "registryUrl"); assertNotNull(registryUrl); assertEquals("test-registry.com", ((URL) registryUrl).getHost()); // config is meta date address zkClient.setData().forPath("/dubbo/config/dubbo/dubbo.properties", "dubbo.metadata-report.address=zookeeper://test-metadata.com:2181".getBytes()); configCenter.getDynamicConfiguration(); Object metadataUrl = ReflectionTestUtils.getField(configCenter, "metadataUrl"); assertNotNull(metadataUrl); assertEquals("test-metadata.com", ((URL) metadataUrl).getHost()); // config is empty zkClient.setData().forPath("/dubbo/config/dubbo/dubbo.properties", "".getBytes()); ReflectionTestUtils.setField(configCenter, "registryUrl", null); ReflectionTestUtils.setField(configCenter, "metadataUrl", null); configCenter.getDynamicConfiguration(); assertNull(ReflectionTestUtils.getField(configCenter, "registryUrl")); assertNull(ReflectionTestUtils.getField(configCenter, "metadataUrl")); // configCenter is null ReflectionTestUtils.setField(configCenter, "configCenter", null); // registryAddress is not null ReflectionTestUtils.setField(configCenter, "registryAddress", zkAddress); configCenter.getDynamicConfiguration(); registryUrl = ReflectionTestUtils.getField(configCenter, "registryUrl"); assertNotNull(registryUrl); assertEquals("127.0.0.1", ((URL) registryUrl).getHost()); // configCenter & registryAddress are null try { ReflectionTestUtils.setField(configCenter, "configCenter", null); ReflectionTestUtils.setField(configCenter, "registryAddress", null); configCenter.getDynamicConfiguration(); fail("should throw exception when configCenter, registryAddress are all null"); } catch (ConfigurationException e) { } } @Test public void testGetRegistry() throws Exception { try { configCenter.getRegistry(); fail("should throw exception when registryAddress is blank"); } catch (ConfigurationException e) { } assertNull(ReflectionTestUtils.getField(configCenter, "registryUrl")); // mock @value inject ReflectionTestUtils.setField(configCenter, "registryAddress", zkAddress); ReflectionTestUtils.setField(configCenter, "group", "dubbo"); ReflectionTestUtils.setField(configCenter, "username", "username"); ReflectionTestUtils.setField(configCenter, "password", "password"); configCenter.getRegistry(); Object registryUrl = ReflectionTestUtils.getField(configCenter, "registryUrl"); assertNotNull(registryUrl); assertEquals("127.0.0.1", ((URL) registryUrl).getHost()); } @Test public void testGetMetadataCollector() throws Exception { // when metadataAddress is empty ReflectionTestUtils.setField(configCenter, "metadataAddress", ""); configCenter.getMetadataCollector(); assertNull(ReflectionTestUtils.getField(configCenter, "metadataUrl")); // mock @value inject ReflectionTestUtils.setField(configCenter, "metadataAddress", zkAddress); ReflectionTestUtils.setField(configCenter, "group", "dubbo"); ReflectionTestUtils.setField(configCenter, "username", "username"); ReflectionTestUtils.setField(configCenter, "password", "password"); configCenter.getMetadataCollector(); Object metadataUrl = ReflectionTestUtils.getField(configCenter, "metadataUrl"); assertNotNull(metadataUrl); assertEquals("127.0.0.1", ((URL) metadataUrl).getHost()); } }
43.677019
154
0.718572
66623120db92ee74a6c6e4b69e01e7fd0da9d859
1,666
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.appium.espressoserver.lib.helpers.w3c.processor; import io.appium.espressoserver.lib.handlers.exceptions.InvalidArgumentException; @SuppressWarnings("unused") public class ProcessorHelpers { public static boolean isNullOrPositive(Long num) { return num == null || num >= 0; } public static void throwArgException(int index, String id, String message) throws InvalidArgumentException { throw new InvalidArgumentException(String.format("action in actions[%s] of action input source with id '%s' %s", index, id, message)); } public static void assertNullOrPositive(int index, String id, String propertyName, Long propertyValue) throws InvalidArgumentException { if (!isNullOrPositive(propertyValue)) { throwArgException(index, id, String.format( "must have property '%s' be greater than or equal to 0 or undefined. Found %s", propertyName, propertyValue) ); } } }
41.65
140
0.718487
43fb8b58f87f11b40d40292087e286da45485b53
14,221
package com.plealog.jgaf.prefs4j.implem.ui.tools; import java.awt.Container; import java.util.ArrayList; import java.util.List; import javax.swing.JLabel; import javax.swing.RootPaneContainer; /** * Swing LayoutManager that implements "Canonical Grids" as used by graphic artists to design * magazines, posters, forms... * * <p>Canonical grids are useful for, but not limited to, all kinds of forms mostly used in UI * dialogs. * * <p>DesignGridLayout provides a convenient API to have automatically well-balanced canonical grids * panels. With this API, there is no need for any graphical designer. * * <p>Typically, DesignGridLayout will be used as follows: * * <pre> * public class MyPanel extends JPanel { * public MyPanel() { * DesignGridLayout layout = new DesignGridLayout(this); * //... * layout.row().grid(labelA).add(fieldA); * layout.row().grid(labelB).add(fieldB); * //... * layout.row().center().add(okButton, cancelButton); * } * //... * </pre> * * @author Jason Aaron Osgood * @author Jean-Francois Poilpret */ public class DesignGridLayout { /** * Builds a DesignGridLayout instance attached to a {@link Container}. This instance should be * then used to add rows and components to the parent container. * * <p>Note that this constructor auomatically calls {@code parent.setLayout(this)} so you don't * need to call it yourself. * * <p>In no way should the {@link Container#add} and {@link Container#remove} ever be used with * {@code parent}. * * @param parent the container for which we want to use DesignGridLayout; cannot be {@code null}. */ public DesignGridLayout(Container parent) { if (parent == null) { throw new NullPointerException("parent cannot be null"); } Container target = parent; if (parent instanceof RootPaneContainer) { target = ((RootPaneContainer) parent).getContentPane(); } _wrapper = new ParentWrapper<Container>(target); _orientation = new OrientationPolicy(target); _layout = new DesignGridLayoutManager(this, _wrapper, _rows, _orientation); _layout.setHeightTester(_heightTester); target.setLayout(_layout); } /** * Define special margins ratios for the parent container. You normally won't use this method * because DesignGridLayout uses the best margin values for the current used Look and Feel. * However, it may be useful when you use DesignGridLayout in special containers such as views * used in a docking-based application, in which case you would rather avoid wasting too much * space as margins for each single docked view. * * @param top top margin ratio that will be applied to the standard top margin for the current * platform * @param left left margin ratio that will be applied to the standard left margin for the current * platform * @param bottom bottom margin ratio that will be applied to the standard bottom margin for the * current platform * @param right right margin ratio that will be applied to the standard right margin for the * current platform * @return {@code this} instance of DesignGridLayout, allowing for chained calls to other methods * (also known as "fluent API") */ public DesignGridLayout margins(double top, double left, double bottom, double right) { _layout.setMargins(top, left, bottom, right); return this; } /** * Define a special margins ratio for the parent container. You normally won't use this method * because DesignGridLayout uses the best margin values for the current used Look and Feel. * However, it may be useful when you use DesignGridLayout in special containers such as views * used in a docking-based application, in which case you would rather avoid wasting too much * space as margins for each single docked view. * * @param ratio the ratio to apply to each standard margin for the current platform * @return {@code this} instance of DesignGridLayout, allowing for chained calls to other methods * (also known as "fluent API") */ public DesignGridLayout margins(double ratio) { return margins(ratio, ratio, ratio, ratio); } /** * Requires to use consistent baselines spacing of all pairs of two consecutive rows which first * row has a fixed height. * * <p>Forcing consistent baselines spacing changes the global balance of forms: on one hand, it * makes all consecutive labels equidistant, on the other hand, it seems to introduce too much * space between actual components (fields, checkboxes...) Hence, this is only provided as an * option. DesignGridLayout defaults to always use the actual vertical gap between each pair of * rows. * * @return {@code this} instance of DesignGridLayout, allowing for chained calls to other methods * (also known as "fluent API") */ public DesignGridLayout forceConsistentBaselinesDistance() { _layout.setForceConsistentBaselinesDistance(true); return this; } /** * Disable DesignGridLayout "smart vertical resize" feature. This means that all variable height * components in {@code this} layout will have their height take every single available pixel, * possibly showing partial information (e.g. a {@code JTable} would show its last row truncated). * * <p><b>IMPORTANT NOTE!</b> This method should be called before adding any row to {@code this} * layout, otherwise results are unpredictable. This will not be considered a bug and, as such, * will not be fixed in future versions (or just as a side effect of potential future * refactoring). * * <p><b>WARNING!</b> You should avoid using this method at all costs since it gives your * application a poor user experience. It was added as a special request (issue #34) from one * DesignGridLayout user. * * @return {@code this} instance of DesignGridLayout, allowing for chained calls to other methods * (also known as "fluent API") */ public DesignGridLayout disableSmartVerticalResize() { if (!(_heightTester instanceof UnitHeightGrowPolicy)) { _heightTester = new UnitHeightGrowPolicy(_heightTester); } _layout.setHeightTester(_heightTester); return this; } /** * Define the alignment to use for labels in DesignGridLayout grids. This applies only to the * first column ("label column") of each grid. Labels in other locations are not impacted by this * method and are aligned according to their own settings. * * <p>By default, DesignGridLayout will use platform alignment for labels. But you can set any * alignment you want by calling {@code labelAlignment()}. * * <p>Note that if you call this method several times, only the last call is effective; this means * that you can't have different label alignments in the same layout, all alignments are always * consistent within one layout. * * @param align the alignment to apply to labels in grids * @return {@code this} instance of DesignGridLayout, allowing for chained calls to other methods * (also known as "fluent API") */ public DesignGridLayout labelAlignment(LabelAlignment align) { if (align != null) { _layout.labelAlignment(align); } return this; } /** * Disable DesignGridLayout feature that ensures all components located in non-grid rows all have * consistent width. This feature is enabled by default because this is the behavior expected by * end-users, e.g. non-grid rows are mostly used for showing JButtons and most UI guidelines * recommend having consistent buttons sizes in a form; that feature doesn't affect "filler * components" (as defined by {@link INonGridRow#fill()}). * * <p>However, you may face a situation when you don't want all component widths identical across * all non-grid rows of a given layout, in this case you can use this method. * * <p>Note that you can also disable this feature for individual non-grid rows in a layout, by * calling {@link INonGridRow#withOwnRowWidth()}; that way, only these rows escape the consistent * component width while other non-grid rows in the layout still share the same width for all * their components. * * @return {@code this} instance of DesignGridLayout, allowing for chained calls to other methods * (also known as "fluent API") */ public DesignGridLayout withoutConsistentWidthAcrossNonGridRows() { _layout.setConsistentWidthInNonGridRows(false); return this; } /** * Creates a new row. The type of the row is not determined yet, but will be determined by the * chained call performed on the returned {@link IRowCreator}. * * <p>The new row is located under the previously created row, which means that each line of code * using this method creates a new row and all lines can be read as defining the visual UI of the * container. * * <p>Note that this method has no effect on the layout if there's no chained call on the returned * {@link IRowCreator} (ie when you have code like {@code layout.row();}). * * @return a new {@code IRowCreator} that must be used to set the actual type of the created row. */ public IRowCreator row() { return new RowCreator(-1.0); } /** * Creates a new row. The type of the row is not determined yet, but will be determined by the * chained call performed on the returned {@link IRowCreator}. * * <p>The new row is located under the previously created row, which means that each line of code * using this method creates a new row and all lines can be read as defining the visual UI of the * container. * * <p>This method explicitly sets the vertical growth weight for this row; this is applicable only * if this row contains at least one component that can vary in height (eg JScrollPane, vertical * JSlider); if this row has no such component, then calling this method will have no impact, ie * this row will always have a fixed height. * * <p>Note that this method has no effect on the layout if there's no chained call on the returned * {@link IRowCreator} (ie when you have code like {@code layout.row();}). * * <p><b>Important!</b> Note that it is generally useless to use this method: DesignGridLayout * will by default assign a weight of 1.0 to all rows that should have a variable height, hence * during resize, extra height will be equally split to all such rows. Use this method only if you * want a row to get more ({@code verticalWeight > 1.0}) or less ({@code verticalWeight < 1.0}) * extra height than other rows. * * @param verticalWeight the weight given to this row when DesignGridLayout distributes extra * height during resize actions; must be {@code >= 0.0} or the value will be ignored. * @return a new {@code IRowCreator} that must be used to set the actual type of the created row. * @see #row() */ public IRowCreator row(double verticalWeight) { return new RowCreator(verticalWeight); } /** * Adds a new empty row to the container. This row will never contain any component and is used * only for introducing vertical space between rows or groups of rows. The height of that row is * automatically calculated based on the fact that the previously-added row and the next-added row * contain unrelated components. */ public void emptyRow() { if (_current != null) { _current.setUnrelatedGap(); } } private <T extends AbstractRow> T addRow(T row, double verticalWeight, List<RowGroup> groups) { _current = row; _rows.add(row); row.init(_wrapper, _heightTester, _orientation); row.growWeight(verticalWeight); for (RowGroup group : groups) { group.add(row); } return row; } // Returned by row() private class RowCreator implements IRowCreator { RowCreator(double weight) { _weight = weight; } @Override public IRowCreator group(RowGroup group) { _groups.add(group); return this; } @Override public INonGridRow center() { return addRow(new CenterRow(), _weight, _groups); } @Override public INonGridRow left() { return addRow(new LeftRow(), _weight, _groups); } @Override public INonGridRow right() { return addRow(new RightRow(), _weight, _groups); } @Override public IBarRow bar() { return addRow(new BarRow(), _weight, _groups); } @Override public ISpannableGridRow grid(JLabel label) { return addRow(newGridRow(), _weight, _groups).grid(label); } @Override public IGridRow grid(JLabel label, int gridspan) { return addRow(newGridRow(), _weight, _groups).grid(label, gridspan); } @Override public ISpannableGridRow grid() { return addRow(newGridRow(), _weight, _groups).grid(); } @Override public IGridRow grid(int gridspan) { return addRow(newGridRow(), _weight, _groups).grid(gridspan); } private GridRow newGridRow() { if (!_rows.isEmpty()) { AbstractRow previous = _rows.get(_rows.size() - 1); if (previous instanceof GridRow) { return new GridRow((GridRow) previous); } } return new GridRow(null); } private final double _weight; private final List<RowGroup> _groups = new ArrayList<RowGroup>(); } private static HeightGrowPolicy _defaultHeightTester = new DefaultGrowPolicy(); private final DesignGridLayoutManager _layout; private final ParentWrapper<Container> _wrapper; private final OrientationPolicy _orientation; private final List<AbstractRow> _rows = new ArrayList<AbstractRow>(); private AbstractRow _current = null; private HeightGrowPolicy _heightTester = _defaultHeightTester; }
41.949853
101
0.687786
0370b4621afef1026ca2abd3160ddd1b5301fe62
242
class G{ int i; void display(){ int i=1; System.out.println(this.i); } } class Run5{ public static void main(String...args){ G g1= new G(); g1.i=10; G g2=new G(); g2.i=20; g1.display(); g2.display(); } }
12.736842
41
0.528926
188a6025081c3c34194adb3d0bce136a3bdcc9d2
7,267
package com.mmoehler.sldt.analysis; /*- * #%L * dt * %% * Copyright (C) 2016 - 2020 Michael Moehler * %% * 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. * #L% */ import com.mmoehler.sldt.Analyzer; import com.mmoehler.sldt.Result; import com.mmoehler.sldt.intern.Indicators; import com.mmoehler.test.fixtures.TestUtils; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static com.mmoehler.test.fixtures.Tests.*; class StructuralAnalysisTest { Analyzer analysis; @BeforeEach public void setUp() { analysis = new DefaultAnalyzer(); } @AfterEach public void tearDown() { analysis = null; } @Test @DisplayName("Check Clash") void testClash() throws Exception { of(analysis) .given(Prepare.nothing()) .when( a -> { final Indicators indicators = TestUtils.allocateIndicators( 2, 1, "-Y" // +"Y-" // + "XX" // ); actual(a.apply(indicators)); return a; }) .then( dt -> { Result actual = actual(); Assertions.assertThat(actual.isFailure()).isTrue(); org.junit.jupiter.api.Assertions.assertThrows( AnalysisException.class, () -> { actual.get(); }); Assertions.assertThat(((AnalysisException)actual.getCause()).getRawResult()).isEqualTo("X"); }) .call(); } @Test @DisplayName("Check Inclusion") void testInclusion() throws Exception { of(analysis) .given(Prepare.nothing()) .when( a -> { final Indicators indicators = TestUtils.allocateIndicators( 1, 1, "-Y" // + "-X" // ); actual(a.apply(indicators)); return a; }) .then( dt -> { Result actual = actual(); Assertions.assertThat(actual.isFailure()).isTrue(); org.junit.jupiter.api.Assertions.assertThrows( AnalysisException.class, () -> { actual.get(); }); Assertions.assertThat(((AnalysisException)actual.getCause()).getRawResult()).isEqualTo(">"); }) .call(); } @Test @DisplayName("Check Exclusion") void testExclusion() throws Exception { of(analysis) .given(Prepare.nothing()) .when( a -> { final Indicators indicators = TestUtils.allocateIndicators( 1, 1, "YN" // + "-X" // ); actual(a.apply(indicators)); return a; }) .then( dt -> { Result actual = actual(); Assertions.assertThat(actual.isSuccess()).isTrue(); Assertions.assertThat(actual.get()).isEqualTo("-"); }) .call(); } @Test @DisplayName("Check Compression Note") void testCompressionNote() throws Exception { of(analysis) .given(Prepare.nothing()) .when( a -> { final Indicators indicators = TestUtils.allocateIndicators( 1, 1, "YN" // + "XX" // ); actual(a.apply(indicators)); return a; }) .then( dt -> { Result actual = actual(); Assertions.assertThat(actual.isFailure()).isTrue(); org.junit.jupiter.api.Assertions.assertThrows( AnalysisException.class, () -> { actual.get(); }); Assertions.assertThat(((AnalysisException)actual.getCause()).getRawResult()).isEqualTo("*"); }) .call(); } @SuppressWarnings("SpellCheckingInspection") @Test @DisplayName("Check Inclusion, Compression Note, Clash") void testMultipleIssues() throws Exception { of(analysis) .given(Prepare.nothing()) .when( a -> { final Indicators indicators = TestUtils.allocateIndicators( 4, 3, "" + "YYY-" // + "-NNN" // + "---N" // + "YYNN" // + "XXX-" // + "X--X" // + "-XX-" // ); actual(a.apply(indicators)); return a; }) .then( dt -> { Result actual = actual(); Assertions.assertThat(actual.isFailure()).isTrue(); org.junit.jupiter.api.Assertions.assertThrows( AnalysisException.class, () -> { actual.get(); }); Assertions.assertThat(((AnalysisException)actual.getCause()).getRawResult()).isEqualTo(">--*-X"); }) .call(); } }
35.276699
120
0.398376
855985b4e29e8315cff30854fd282e3b933c64f4
1,971
package ca.utoronto.utm.mvcexample; import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class MVCApplication extends Application { // REMEMBER: To run this in the lab put // --module-path "/usr/share/openjfx/lib" --add-modules javafx.controls,javafx.fxml // in the run configuration under VM arguments. // You can import the JavaFX.prototype launch configuration and use it as well. @Override public void start(Stage stage) throws Exception { // Create and hook up the Model, View and the controller // MODEL MCounter mcounter = new MCounter(); // CONTROLLER // CONTROLLER->MODEL hookup // https://docs.oracle.com/javase/8/javafx/events-tutorial/processing.htm#CEGJAAFD // https://docs.oracle.com/javase/8/javafx/api/javafx/event/Event.html CButtonPressEventHandler cpresshandler=new CButtonPressEventHandler(mcounter); // VIEW COMPONENTS Button vIncButton= new Button("increment"); Button vDecButton= new Button("decrement"); VCount vCount = new VCount(); VParity vParity = new VParity(); // VIEW LAYOUT HBox root = new HBox(); root.setPadding(new Insets(5)); root.getChildren().addAll(vIncButton, vDecButton, vCount, vParity); // VIEW SCENE Scene scene = new Scene(root); // Scene scene = new Scene(root, 200, 200); // VIEW STAGE stage.setTitle("Hi Bye"); stage.setScene(scene); // VIEW->CONTROLLER hookup // Note, for code below, could have had two different // controllers, one for each button. vIncButton.setOnAction(cpresshandler); vDecButton.setOnAction(cpresshandler); // MODEL->VIEW hookup mcounter.attach(vCount); mcounter.attach(vParity); // LAUNCH THE GUI stage.show(); } public static void main(String[] args) { launch(args); } }
29.41791
85
0.698123
a0bf7764c8b0aba6b379b165cce19c852a36ec42
8,848
/* National Crime Agency (c) Crown Copyright 2018 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 uk.gov.nca.graph.transform; import io.github.classgraph.ClassGraph; import io.github.classgraph.ScanResult; import java.io.IOException; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestClientBuilder; import org.elasticsearch.client.RestHighLevelClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.gov.nca.graph.transform.rules.TransformRule; /** * Transforms a graph into Elasticsearch, using all {@link TransformRule}s currently on the * classpath. */ public class TransformToElasticsearch { private static final Logger LOGGER = LoggerFactory.getLogger(TransformToElasticsearch.class); private static final int BULK_SIZE = 5000000; //5MB Size private TransformToElasticsearch(){ //Private constructor for utility class } /** * Process the sourceGraph using the transform rules on the classpath, and output the results * into Elasticsearch via the REST API. * * Alongside using the transform rules (whose indices will be prefixed with objIndexPrefix), the * raw content of each vertex will be added into indices prefixed with the rawIndexPrefix. * * This operation is performed multi-threaded where possible, with the number of threads set by * threadCount. */ public static void transformGraph(Graph sourceGraph, RestClientBuilder targetClient, String rawIndexPrefix, String objIndexPrefix, int threadCount) { final String rawIndexPrefixNotNull = (rawIndexPrefix == null) ? "" : rawIndexPrefix; final String objIndexPrefixNotNull = (objIndexPrefix == null) ? "" : objIndexPrefix; RestHighLevelClient client = new RestHighLevelClient(targetClient); LOGGER.info("Checking connection to Elasticsearch"); try { if (!client.ping(RequestOptions.DEFAULT)) { throw new IOException("Unable to ping server"); } } catch (IOException ioe) { LOGGER.error("Unable to connect to Elasticsearch", ioe); return; } LOGGER.info("Transforming content from Graph to Elasticsearch (raw) using {} threads", threadCount); //Can't use sourceGraph.vertices() as it doesn't seem to work correctly across multiple threads (for TinkerGraph at least) Iterator<Vertex> iterVertices = sourceGraph.traversal().V().toList().iterator(); Thread.UncaughtExceptionHandler h = (th, ex) -> LOGGER.error("Uncaught exception thrown by thread {}", th.getName(), ex); List<Thread> rawThreads = new ArrayList<>(); for(int i = 0; i < threadCount; i++) { Thread t = new Thread(new RawTransformer(iterVertices, client, rawIndexPrefixNotNull)); t.setUncaughtExceptionHandler(h); t.start(); rawThreads.add(t); } while(rawThreads.stream().anyMatch(Thread::isAlive)){ //Do nothing, wait for threads to finish } //TODO: Add a mapping //Loop through all the rules to produce processed objects LOGGER.info("Transforming content from Graph to Elasticsearch (processed), 1 thread per rule"); ScanResult sr = new ClassGraph().enableClassInfo().scan(); List<Class<TransformRule>> transformRulesClasses = sr.getClassesImplementing(TransformRule.class.getName()) .loadClasses(TransformRule.class, true); List<Thread> ruleThreads = new ArrayList<>(); for (Class<TransformRule> clazz : transformRulesClasses) { if (Modifier.isAbstract(clazz.getModifiers())) { continue; } LOGGER.info("Creating new thread for TransformRule {}", clazz.getName()); TransformRule rule; try { rule = clazz.getConstructor().newInstance(); } catch (Exception e) { LOGGER.error("Couldn't instantiate TransformRule {}", clazz.getName(), e); continue; } Thread t = new Thread(new RuleTransformer(rule, sourceGraph, client, objIndexPrefixNotNull)); t.setUncaughtExceptionHandler( (th, ex) -> LOGGER.error("Uncaught exception thrown by thread {} ({})", th.getName(), rule.getClass().getSimpleName(), ex)); ruleThreads.add(t); t.start(); } while(ruleThreads.stream().anyMatch(Thread::isAlive)){ //Do nothing, wait for threads to finish } try { client.close(); } catch (IOException e) { //Do nothing, closing client anyway } LOGGER.info("Finished transforming to Elasticsearch"); } private static synchronized void submitBulkRequest(RestHighLevelClient client, BulkRequest bulkRequest) { try { client.bulk(bulkRequest, RequestOptions.DEFAULT); } catch (Exception e) { LOGGER.error("Unable to write vertices to Elasticsearch", e); } } private static class RawTransformer implements Runnable{ private final Iterator<Vertex> vertexIterator; private final RestHighLevelClient restClient; private final String indexPrefix; public RawTransformer(Iterator<Vertex> vertexIterator, RestHighLevelClient restClient, String indexPrefix){ this.vertexIterator = vertexIterator; this.restClient = restClient; this.indexPrefix = indexPrefix; } @Override public void run() { BulkRequest br = new BulkRequest(); long count = 0; while(true) { Vertex v; if(!vertexIterator.hasNext()) break; try { v = vertexIterator.next(); } catch (NoSuchElementException e) { //No more vertices to process break; } if(!includeVertex(v)) continue; //Transform from vertex to document Map<String, Object> doc = new HashMap<>(); doc.put("originalId", v.id()); v.properties().forEachRemaining(p -> doc.put(p.key(), p.value())); //Add vertex to bulk request String index = indexPrefix + v.label(); br.add(new IndexRequest(index.toLowerCase(), "raw_" + v.label()).source(doc)); count++; if (br.estimatedSizeInBytes() >= BULK_SIZE) { //5MB Size submitBulkRequest(restClient, br); br = new BulkRequest(); LOGGER.info("{} has ingested {} raw vertices", Thread.currentThread().getName(), count); } } if(br.numberOfActions() > 0) submitBulkRequest(restClient, br); LOGGER.info("{} has finished ingesting {} raw vertices", Thread.currentThread().getName(), count); } private static boolean includeVertex(Vertex v) { //Only keep vertices with properties return v.properties().hasNext(); } } private static class RuleTransformer implements Runnable{ private final TransformRule rule; private final Graph graph; private final RestHighLevelClient restClient; private final String indexPrefix; public RuleTransformer(TransformRule rule, Graph graph, RestHighLevelClient restClient, String indexPrefix){ this.rule = rule; this.graph = graph; this.restClient = restClient; this.indexPrefix = indexPrefix; } @Override public void run() { BulkRequest br = new BulkRequest(); long count = 0; for (Map<String, Object> obj : rule.transform(graph)) { //TODO: Multi-thread this too? String index = indexPrefix + rule.getIndex(); br.add(new IndexRequest(index.toLowerCase(), rule.getType()).source(obj)); count++; if (br.estimatedSizeInBytes() >= BULK_SIZE) { submitBulkRequest(restClient, br); br = new BulkRequest(); LOGGER.info("{} has ingested {} objects produced by rule {}", Thread.currentThread().getName(), count, rule.getClass().getSimpleName()); } } if(br.numberOfActions() > 0) submitBulkRequest(restClient, br); LOGGER.info("{} has finished ingesting {} objects produced by rule {}", Thread.currentThread().getName(), count, rule.getClass().getSimpleName()); } } }
33.900383
152
0.688969
39645cc8615625831497b8385ef448480ea01be3
1,006
package example; import nlp4j.Document; import nlp4j.DocumentAnnotator; import nlp4j.impl.DefaultDocument; import nlp4j.krmj.annotator.KuromojiAnnotator; import nlp4j.util.DocumentUtil; import nlp4j.util.JsonUtils; /** * 日本語形態素解析とインデックス処理を利用して、共起性の高いキーワードを抽出するサンプルソースコードです。 <br> * Sample for Dependency Analysis and Morphological analysis. * * @author Hiroki Oya * */ public class HelloTextMiningKuromojiMain1 { /** * メイン関数です。<br> * Main Method * * @param args 無し * @throws Exception 実行時の例外 */ public static void main(String[] args) throws Exception { // ドキュメントの用意(CSVを読み込むなどでも可) Document doc = new DefaultDocument(); doc.setText("今日はいい天気です。"); // 形態素解析アノテーター DocumentAnnotator annotator = new KuromojiAnnotator(); // 形態素解析 annotator.setProperty("target", "text"); { annotator.annotate(doc); } { System.err.println(doc); System.err.println(JsonUtils.prettyPrint(DocumentUtil.toJsonObject(doc))); } } }
21.869565
78
0.695825
950d5ec77f6ff2f8e626224e7b52268f67b68c5a
827
package com.arcussmarthome.ipcd.client.handler; import com.arcussmarthome.ipcd.client.comm.IpcdClientDevice; import com.arcussmarthome.ipcd.msg.GetReportConfigurationCommand; import com.arcussmarthome.ipcd.msg.GetReportConfigurationResponse; import com.arcussmarthome.ipcd.msg.Status; public class GetReportConfigurationHandler extends CommandHandler<GetReportConfigurationCommand> { public GetReportConfigurationHandler(IpcdClientDevice client) { super(client); } @Override public void handleCommand(GetReportConfigurationCommand command) { GetReportConfigurationResponse resp = new GetReportConfigurationResponse(); resp.setDevice(getDevice()); resp.setRequest(command); resp.setStatus(new Status()); resp.setResponse(client.getReportConfiguration()); client.sendMessage(resp, false); } }
27.566667
98
0.816203
8f5b559b62a97d584ccfcda7202d7183602e8610
8,643
/* * Copyright 2016 Ali Moghnieh * * 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.blurengine.blur.modules.filters.serializer; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.blurengine.blur.framework.BlurSerializer; import com.blurengine.blur.framework.ModuleLoader; import com.blurengine.blur.modules.filters.Filter; import com.blurengine.blur.modules.filters.FilterManager; import com.blurengine.blur.modules.filters.lexer.FilterRecursiveDescentParser; import com.blurengine.blur.modules.filters.serializer.FilterSerializers.Material; import com.supaham.commons.bukkit.utils.SerializationUtils; import com.supaham.commons.utils.ArrayUtils; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.Nullable; import pluginbase.config.serializers.SerializerSet; public class FilterSerializer implements BlurSerializer<Filter> { private static final String[] RESERVED_SERIALIZERS = new String[]{"team"}; private static final Map<String, Class<? extends FilterTypeSerializer>> FILTER_SERIALIZERS = new HashMap<>(); private final ModuleLoader moduleLoader; private final Map<String, FilterTypeSerializer<?>> serializers; private final Function<String, Filter> filterGetter = s -> getManager().getFilterById(s); static { FILTER_SERIALIZERS.put("material", Material.class); } /** * Registers a clazz for a {@link FilterSerializer} to use when deserializing. The {@code filterType} is the name of the filter type, e.g. * union, that will be handled by the given clazz. * * @param filterType name of region type that is handled by the given {@code clazz} * @param clazz clazz to handle the {@code filterType} * * @return previous clazz that was removed by this execution */ public static Class<? extends FilterTypeSerializer> registerSerializer(String filterType, Class<? extends FilterTypeSerializer> clazz) { Preconditions.checkNotNull(filterType, "filterType cannot be null."); Preconditions.checkNotNull(clazz, "clazz cannot be null."); filterType = filterType.toLowerCase(); Preconditions.checkArgument(ArrayUtils.contains(RESERVED_SERIALIZERS, filterType), "%s is a reserved filter type.", filterType); return FILTER_SERIALIZERS.put(filterType, clazz); } public FilterSerializer(ModuleLoader moduleLoader) { this.moduleLoader = moduleLoader; Map<String, FilterTypeSerializer<?>> serializers = new HashMap<>(); FILTER_SERIALIZERS.forEach((k, v) -> { try { serializers.put(k, v.getDeclaredConstructor(FilterSerializer.class).newInstance(this)); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) { e.printStackTrace(); } }); this.serializers = ImmutableMap.copyOf(serializers); } @Override public Filter deserialize(@Nullable Object serialized, @Nonnull Class wantedType, @Nonnull SerializerSet serializerSet) { if (serialized == null) { return null; } else if (serialized instanceof Map) { return deserializeMapToFilter((Map<String, Object>) serialized); } else if (serialized instanceof String) { String str = serialized.toString().trim(); Preconditions.checkArgument(!str.isEmpty(), "Filter String is empty."); // Not ID reference. This is a definition. Filter found = null; // If the string doesn't have a whitespace, it's most likely an id reference if (!str.matches("\\s+")) { found = filterGetter.apply(str); } // If the string has spaces or the id reference was null, build a filter from the string. if (found == null) { found = deserializeStringToFilter(str); } Preconditions.checkNotNull(found, "Invalid reference id or definition: %s", str); return found; } throw new IllegalArgumentException("Expected List or Map, got data type of " + serialized.getClass().getName() + "."); } public Filter deserializeStringToFilter(String string) { return deserializeStringToFilter(null, string); } public Filter deserializeStringToFilter(String id, String string) { getManager().checkNonExistant(id); Filter filter = new FilterRecursiveDescentParser(this.filterGetter, string).call(); getManager().addFilter(id, filter); return filter; } public Filter deserializeMapToFilter(Map<String, Object> map) { Preconditions.checkArgument(!map.isEmpty(), "given map is empty."); if (map.size() == 1) { return deserializeSingleMapEntryToFilter(map); } List<String> invalidTypes = new ArrayList<>(); Optional<String> id = map.entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("id")).findFirst().map(e -> e.getValue().toString()); Filter filter = null; for (Entry<String, Object> e : map.entrySet()) { if (e.getKey().equalsIgnoreCase("id")) { continue; } // Get serializer by the name of the given key. FilterTypeSerializer<?> serializer = serializers.get(e.getKey()); if (serializer == null) { invalidTypes.add(e.getKey()); } else { filter = serializer.deserialize(e.getValue(), null, SerializationUtils.SERIALIZER_SET); } } // Notify the user of defined invalid extent types. if (!invalidTypes.isEmpty()) { moduleLoader.getLogger().warning("Unknown extent types: " + invalidTypes); } // If no filter was defined, then we must have an id reference if (filter == null) { String filterId = id.orElseThrow(() -> new NullPointerException("no filter id or filter definition.")); filter = getManager().getFilterById(filterId); Preconditions.checkNotNull(filter, "Could not find filter by id '%s'.", id); } else { getManager().addFilter(id.orElse(null), filter); } return filter; } public Filter deserializeSingleMapEntryToFilter(Map<String, Object> map) { Entry<String, Object> entry = map.entrySet().iterator().next(); String key = entry.getKey(); Object value = entry.getValue(); // Simple {id:"id"} map. if (key.equalsIgnoreCase("id")) { Preconditions.checkArgument(value instanceof String, "map of id expects String value, got: %s", value); return Preconditions.checkNotNull(getManager().getFilterById(value.toString()), "Could not find filter by id '%s'.", value); } Filter filter = null; String id = null; // If key starts with !, it's an explicit filter id if (!key.startsWith("!")) { FilterTypeSerializer<?> ser = this.serializers.get(key); if (ser != null) { filter = ser.deserialize(value, Filter.class, moduleLoader.getSerializerSet()); } } if (filter == null) { id = (key.startsWith("!") ? key.substring(1) : key).trim(); Preconditions.checkArgument(!id.isEmpty(), "A filter id is empty with the data: %s", value); Preconditions.checkArgument(value instanceof Map, "Filter value of '%s' must be Map. Got type %s", id, value.getClass().getName()); filter = deserializeMapToFilter((Map<String, Object>) value); } getManager().addFilter(id, filter); return filter; } public FilterManager getManager() { return this.moduleLoader.getModuleManager().getFilterManager(); } }
43.215
147
0.660882
7c649adc523697f90c20fd45f6dbf7731a18f206
2,856
package interop.wchar; /** * Client.java * * Java implemention of the reference wchar data supplied to both * clients and servers. This is independently maintained in parallel * with the c++ version, wchar_reference.cpp * * @author Phil Mesnier * @version $Id: WCharReference.java 63125 2005-01-06 04:09:37Z mesnier_p $ */ public class WCharReference { private char ref_wchar[] = {1234}; private String ref_wstring[] = {"have a nice day"}; private char ref_warray[][] = { {'a','A','!','1','4','[','?','%','X','E'} }; private String ref_except[] = {"TEST EXCEPTION"}; private boolean verbose = false; public WCharReference () { } public WCharReference (boolean v) { verbose = v; } public void set_verbose (boolean v) { verbose = v; } public char get_wchar (int key) { return ref_wchar[key]; } public String get_wstring (int key) { return ref_wstring[key]; } public char[] get_warray (int key) { return ref_warray[key]; } public String get_except (int key) { return ref_except[key]; } public boolean match_wchar (short key, char test) { if (verbose) System.out.println ("match_wchar: expecting " + ref_wchar[key] + " got " + test + " for key " + key); return ref_wchar[key] == test; } public boolean match_wstring (short key, String test) { if (key == -1) { if (verbose) System.out.println ("match_wstring: expcting nul string, " + "got string length " + test.length()); return test.length() == 0; } if (verbose) System.out.println ("match_wstring: expecting " + ref_wstring[key] + " got " + test + " for key " + key); return test.equals(ref_wstring[key]); } public boolean match_warray (short key, char test[]) { if (verbose) System.out.println ("match_warray: key " + key); for (int i = 0; i < test.length; i++) { if (verbose) System.out.println (" expecting[" + i + "] " + ref_warray[key][i] + ", got " + test[i]); if (ref_warray[key][i] != test[i]) return false; } return true; } public boolean match_except (short key, String test) { if (verbose) System.out.println ("match_except: expecting " + ref_except[key] + " got " + test + " for key " + key); return test.equals(ref_except[key]); } }
27.461538
76
0.502101
7d800571d9ee3bcdeec4729a67d8b47483aa5c66
7,500
// Interactive Web Physics (IWP) // Copyright (C) 1999 Nathaniel T. Brockman // // For full copyright information, see main source file, // "iwp.java" package edu.ncssm.iwp.objects.grapher; import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.border.EmptyBorder; import edu.ncssm.iwp.exceptions.DesignerInputException; import edu.ncssm.iwp.exceptions.InvalidEquationException; import edu.ncssm.iwp.exceptions.InvalidObjectNameX; import edu.ncssm.iwp.graphicsengine.GColor; import edu.ncssm.iwp.objects.DObject_designer; import edu.ncssm.iwp.plugin.IWPObject; import edu.ncssm.iwp.ui.widgets.GInput_ColorSelector; import edu.ncssm.iwp.util.IWPLogPopup; public class DObject_Grapher_designer extends DObject_designer implements KeyListener { private static final long serialVersionUID = 1L; static int TEXT_WIDTH = 6; DObject_Grapher object; public DObject_Grapher_designer (DObject_Grapher iobject ) { object = iobject; buildGui(); } JTextField inputName; JTextField inputEquation; JCheckBox inputShowBounding; JCheckBox inputTransformCoords; JTextField inputBoxX; JTextField inputBoxY; JTextField inputBoxH; JTextField inputBoxW; JTextField inputRes; JTextField inputStroke; GInput_ColorSelector inputColor; public void buildGui() { JPanel input = new JPanel(); int horizGap = 30; int vertGap = 10; input.setLayout ( new GridLayout( 10, 2, horizGap, vertGap) ); inputName = new JTextField ( "" + object.getName(), TEXT_WIDTH ); inputName.addKeyListener(this); inputEquation = new JTextField ( "" + object.getEquation(), TEXT_WIDTH ); inputBoxX = new JTextField ( "" + object.getBoxX(), TEXT_WIDTH ); inputBoxY = new JTextField ( "" + object.getBoxY(), TEXT_WIDTH ); inputBoxH = new JTextField ( "" + object.getBoxH(), TEXT_WIDTH ); inputBoxW = new JTextField ( "" + object.getBoxW(), TEXT_WIDTH ); inputRes = new JTextField ( "" + object.getRes(), TEXT_WIDTH ); inputStroke = new JTextField ( "" + object.getStroke(), TEXT_WIDTH); inputShowBounding = new JCheckBox ( "", object.getShowBounding() ); inputTransformCoords = new JCheckBox ( "", object.getTransformCoords() ); inputColor = new GInput_ColorSelector("Graph Color", object.getGColor().getAWTColor()); input.add ( new JLabel ( "Name: " ) ); input.add ( inputName ); input.add ( new JLabel ( "Equation f(x)=: " ) ); input.add ( inputEquation ); input.add ( new JLabel ( "Graph X Center: " ) ); input.add ( inputBoxX ); input.add ( new JLabel ( "Graph Y Center: " ) ); input.add ( inputBoxY ); input.add ( new JLabel ( "Graph Height: " ) ); input.add ( inputBoxH ); input.add ( new JLabel ( "Graph Width: " ) ); input.add ( inputBoxW ); input.add ( new JLabel ( "Graph Calculation Iterations: " ) ); input.add ( inputRes ); input.add ( new JLabel ( "Line Stroke Size: " ) ); input.add ( inputStroke ); //Two Option Boxes, Blocked under the label input.add (new JLabel( "Show Bounding Box?")); input.add (new JLabel("Transform Coordinates?")); input.add (inputShowBounding); input.add (inputTransformCoords); JPanel info = new JPanel(); info.setLayout(new GridLayout(1,1)); info.add(new JLabel( "<html><center><b>Grapher Object Beta 4.23.2008 -- Plugin by Cory Li </b></center><br>" + "Graphs a function within user specified bounding box (height, width center). " + "Equations should be functions of x and y, where x is the x position and y is time. " + "Also, note that none of the inputboxes currently support internal IWP variables and functions, and they follow their own function syntax." + "</html>")); info.setBorder(new EmptyBorder(10,10,10,10)); input.setBorder(new EmptyBorder(10,10,10,10)); //JPanel norther = new JPanel(); norther.setLayout(new BorderLayout()); //norther.add(BorderLayout.NORTH, inputColor); //norther.add(BorderLayout.CENTER, extraInput); JPanel combined = new JPanel(); combined.setLayout(new BorderLayout()); combined.add(BorderLayout.NORTH, info); combined.add(BorderLayout.CENTER, input); combined.add(BorderLayout.SOUTH, inputColor); //combined.add(BorderLayout.CENTER, norther); buildEasyGui ( "Grapher - Function Graph", Color.WHITE, new Color(183, 42, 125), combined ); } //ACCESSORS public String getName () { return object.getName ( ); } //object (g/s) public DObject_Grapher getObject() { return object; } public void setObject(DObject_Grapher iObject) { object = iObject; } public IWPObject buildObjectFromDesigner() throws InvalidEquationException, DesignerInputException { DObject_Grapher goingBack = new DObject_Grapher(); String newName = inputName.getText(); if ( newName.length() > 0 ) { try { goingBack.setName(inputName.getText()); } catch ( InvalidObjectNameX x ) { throw new DesignerInputException ("The name: " + inputName.getText() + " is invalid: " + x.getMessage() ); } } //goingBack.setText(inputText.getText()); goingBack.setEquation(inputEquation.getText()); goingBack.setBoxX (Double.valueOf(inputBoxX.getText())); goingBack.setBoxY (Double.valueOf(inputBoxY.getText())); goingBack.setBoxW (Double.valueOf(inputBoxW.getText())); goingBack.setBoxH (Double.valueOf(inputBoxH.getText())); goingBack.setRes (Integer.valueOf(inputRes.getText())); goingBack.setStroke (Integer.valueOf(inputStroke.getText())); goingBack.setFontColor( new GColor(inputColor.getColor() )); goingBack.setShowBounding(inputShowBounding.isSelected()); goingBack.setTransformCoords(inputTransformCoords.isSelected()); return goingBack; } public void keyTyped(KeyEvent e) { } public void keyPressed(KeyEvent e) {} public void keyReleased(KeyEvent e) { /*The only thing resistered is the name text field so just update the left panel of the designer */ // 2007-Jun-03 brockman: don't let people specify invalid object names. String newName = inputName.getText(); if ( newName.length() > 0 ) { try { object.setName(newName); } catch ( InvalidObjectNameX x ) { IWPLogPopup.error(this, x.getMessage() ); inputName.setText(object.getName()); } } if(parentProblemDesigner!=null) { parentProblemDesigner.refreshDesigner(this); } inputName.grabFocus(); } }
34.562212
153
0.621733
1bde8375ae757bc570056c80443a6a42e36b3714
316
package org.springframework.roo.addon.javabean.addon; import org.springframework.roo.classpath.itd.ItdTriggerBasedMetadataProvider; /** * Provides {@link SerializableMetadata}. * * @author Alan Stewart * @since 1.1 */ public interface SerializableMetadataProvider extends ItdTriggerBasedMetadataProvider { }
24.307692
87
0.800633
81acb67281d426a37e5a15c4bb19c36f80b83e26
668
package main; public class DBBinding { private String key; private String value; public DBBinding(String line) { String[] strArray = line.split(":"); key = strArray[0].trim(); value = strArray[1].trim(); } public String getKey() { return key; } public String getValue() { return value; } public boolean equals(DBBinding bind) { return key.toLowerCase().equals(bind.getKey().toLowerCase()) && value.toLowerCase().contains(bind.getValue().toLowerCase()); } @Override public String toString() { return key + ":" + value; } }
23.034483
80
0.558383
6136f1a96070a3104f8974388c204c4a6a0d2eaa
1,575
package test.xdef; import java.util.ArrayList; import java.util.List; import org.xdef.component.XComponent; import org.xdef.proc.XXNode; public class TestXComponents_G { XComponent _X, _Y, _G; private String _XX; private int _flags; public static void setXX(XXNode xx, String s) { if (xx.getXComponent() != null) { ((TestXComponents_G) xx.getXComponent())._XX = s; } } public static void genXC(XXNode xnode) { String name = xnode.getXXName(); TestXComponents_G xm = (TestXComponents_G) xnode.getUserObject(); if ("G".equals(name)) { xm._G = xnode.getXComponent(); } else if ("XXX".equals(name)) { xm._X = xnode.getXComponent(); } else if ("YYY".equals(name)) { xm._Y = xnode.getXComponent(); } else { throw new RuntimeException("Unknown element:" + name); } } public String getXX() {return _XX;} public final void xSetFlags(final int flags) {_flags |= flags;} public final void xClearFlags(final int flags) {_flags &= ~flags;} public final boolean xCheckFlags(final int flags) { return (flags & _flags) == flags; } public final int xGetFlags() {return _flags;} private final List<XComponent> _YYY = new ArrayList<XComponent>(); private String _g; private String XD_NAME_g; private XComponent _XXX; public String getg() {return _g;} public void setg(String x) {_g = x + '_';} public XComponent getXXX() {return _XXX;} public void setXXX(XComponent x) {_XXX = x;} public List<XComponent> listOfYYY() {return _YYY;} public void setYYY(List<XComponent> x) { _YYY.clear(); if (x != null) {_YYY.addAll(x);} } }
28.125
67
0.695873
0147d5cd6844dc2f7c0f8031715259492f10b6f7
340
package info.izumin.android.droidux.example.todoswithdagger.action; import info.izumin.android.droidux.Action; /** * Created by izumin on 12/5/15. */ public class ClearNewTodoTextAction implements Action { public static final String TAG = ClearNewTodoTextAction.class.getSimpleName(); public ClearNewTodoTextAction() { } }
24.285714
82
0.764706
c9782163a7f822a7444e87817cd7ced09db06248
789
package org.hisp.dhis.rules.android; import android.support.annotation.NonNull; import com.squareup.duktape.Duktape; import org.hisp.dhis.rules.RuleExpressionEvaluator; import javax.annotation.Nonnull; public final class DuktapeEvaluator implements RuleExpressionEvaluator { @NonNull private final Duktape duktape; public DuktapeEvaluator(@NonNull Duktape duktape) { if (duktape == null) { throw new NullPointerException("duktape == null"); } this.duktape = duktape; } @Nonnull @Override public String evaluate(@Nonnull String expression) { if (expression == null) { throw new NullPointerException("expression == null"); } return duktape.evaluate(expression).toString(); } }
23.205882
72
0.680608
83b39a2af64ed8a98bc39117aeb26c6dd9bea1a8
2,533
/* * Copyright (C) 2014 Ribot Ltd. * * 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 uk.co.ribot.easyadapterdemo; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import uk.co.ribot.easyadapter.ItemViewHolder; import uk.co.ribot.easyadapter.PositionInfo; import uk.co.ribot.easyadapter.annotations.LayoutId; import uk.co.ribot.easyadapter.annotations.ViewId; /** * The extension of ItemViewHolder for the ListView of Person. */ //Annotate the class with the layout ID of the item. @LayoutId(R.layout.person_item_layout) public class PersonViewHolder extends ItemViewHolder<Person> { //Annotate every field with the ID of the view in the layout. //The views will automatically be assigned to the fields. @ViewId(R.id.image_view_person) ImageView imageViewPerson; @ViewId(R.id.text_view_name) TextView textViewName; @ViewId(R.id.text_view_phone) TextView textViewPhone; //Extend ItemViewHolder and call super(view) public PersonViewHolder(View view) { super(view); } //Override onSetValues() to set the values of the items in the views. @Override public void onSetValues(Person person, PositionInfo positionInfo) { imageViewPerson.setImageResource(person.getResDrawableId()); textViewName.setText(person.getName()); textViewPhone.setText(person.getPhoneNumber()); } //Optionally override onSetListeners to add listeners to the views. @Override public void onSetListeners() { imageViewPerson.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { PersonHolderListener listener = getListener(PersonHolderListener.class); if (listener != null) { listener.onPersonImageClicked(getItem()); } } }); } public interface PersonHolderListener { void onPersonImageClicked(Person person); } }
32.896104
88
0.708251
18eba1a6857b089756919e458cf21b0b418b3fd9
1,976
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.flowable.form.engine.test; import org.flowable.common.engine.impl.test.LoggingExtension; import org.flowable.form.api.FormRepositoryService; import org.flowable.form.api.FormService; import org.flowable.form.engine.FormEngine; import org.flowable.form.engine.FormEngineConfiguration; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.extension.ExtendWith; /** * Parent class for internal Flowable Form tests. * * Boots up a form engine and caches it. * * When using H2 and the default schema name, it will also boot the H2 webapp (reachable with browser on http://localhost:8082/) * * @author Joram Barrez * @author Tijs Rademakers */ @ExtendWith(FlowableFormExtension.class) @ExtendWith(LoggingExtension.class) public class AbstractFlowableFormTest { public static String H2_TEST_JDBC_URL = "jdbc:h2:mem:flowableform;DB_CLOSE_DELAY=1000"; protected FormEngine formEngine; protected FormEngineConfiguration formEngineConfiguration; protected FormRepositoryService repositoryService; protected FormService formService; @BeforeEach public void initFormEngine(FormEngine formEngine) { this.formEngine = formEngine; this.formEngineConfiguration = formEngine.getFormEngineConfiguration(); this.repositoryService = formEngine.getFormRepositoryService(); this.formService = formEngine.getFormService(); } }
37.283019
128
0.769231
2b40292e51d5f3b645e9c6f08741e5ebbab8ea3b
7,042
package me.jlurena.revolvingweekview.sample; import android.graphics.Color; import android.graphics.RectF; import android.os.Bundle; import android.support.annotation.ColorInt; import android.support.v7.app.AppCompatActivity; import android.util.TypedValue; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Toast; import org.threeten.bp.DayOfWeek; import org.threeten.bp.LocalDateTime; import org.threeten.bp.format.TextStyle; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Random; import me.jlurena.revolvingweekview.DayTime; import me.jlurena.revolvingweekview.WeekView; import me.jlurena.revolvingweekview.WeekViewEvent; /** * This is a base activity which contains week view and all the codes necessary to initialize the * week view. * Created by Raquib-ul-Alam Kanak on 1/3/2014. * Website: http://alamkanak.github.io */ public class MainActivity extends AppCompatActivity implements WeekView.EventClickListener, WeekView.WeekViewLoader, WeekView.EventLongPressListener, WeekView.EmptyViewLongPressListener, WeekView.EmptyViewClickListener, WeekView.AddEventClickListener, WeekView.DropListener { private static final int TYPE_DAY_VIEW = 1; private static final int TYPE_THREE_DAY_VIEW = 2; private static final int TYPE_WEEK_VIEW = 3; private static final Random random = new Random(); protected WeekView mWeekView; private int mWeekViewType = TYPE_THREE_DAY_VIEW; private static @ColorInt int randomColor() { return Color.argb(255, random.nextInt(256), random.nextInt(256), random.nextInt(256)); } protected String getEventTitle(DayTime time) { return String.format(Locale.getDefault(), "Event of %s %02d:%02d", time.getDay().getDisplayName(TextStyle .SHORT, Locale.getDefault()), time.getHour(), time.getMinute()); } @Override public void onAddEventClicked(DayTime startTime, DayTime endTime) { Toast.makeText(this, "Add event clicked.", Toast.LENGTH_SHORT).show(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Get a reference for the week view in the layout. mWeekView = findViewById(R.id.weekView); // Show a toast message about the touched event. mWeekView.setOnEventClickListener(this); // The week view has infinite scrolling horizontally. We have to provide the events of a // month every time the month changes on the week view. mWeekView.setWeekViewLoader(this); // Set long press listener for events. mWeekView.setEventLongPressListener(this); // Set long press listener for empty view mWeekView.setEmptyViewLongPressListener(this); // Set EmptyView Click Listener mWeekView.setEmptyViewClickListener(this); // Set AddEvent Click Listener mWeekView.setAddEventClickListener(this); // Set Drag and Drop Listener mWeekView.setDropListener(this); setupDateTimeInterpreter(); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public void onDrop(View view, DayTime day) { Toast.makeText(this, "View dropped to " + day.toString(), Toast.LENGTH_SHORT).show(); } @Override public void onEmptyViewClicked(DayTime day) { Toast.makeText(this, "Empty view" + " clicked: " + getEventTitle(day), Toast.LENGTH_SHORT).show(); } @Override public void onEmptyViewLongPress(DayTime time) { Toast.makeText(this, "Empty view long pressed: " + getEventTitle(time), Toast.LENGTH_SHORT).show(); } @Override public void onEventClick(WeekViewEvent event, RectF eventRect) { Toast.makeText(this, "Clicked " + event.toString(), Toast.LENGTH_SHORT).show(); } @Override public void onEventLongPress(WeekViewEvent event, RectF eventRect) { Toast.makeText(this, "Long pressed event: " + event.getName(), Toast.LENGTH_SHORT).show(); } @Override public boolean onOptionsItemSelected(MenuItem item) { setupDateTimeInterpreter(); if (mWeekViewType != TYPE_WEEK_VIEW) { item.setChecked(!item.isChecked()); mWeekViewType = TYPE_WEEK_VIEW; mWeekView.setNumberOfVisibleDays(7); mWeekView.setHeaderColumnBackgroundColor(Color.WHITE); mWeekView.setNowLineColor(Color.BLUE); // Lets change some dimensions to best fit the view. mWeekView.setColumnGap((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics())); mWeekView.setTextSize((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 10, getResources().getDisplayMetrics())); mWeekView.setEventTextSize((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 10, getResources().getDisplayMetrics())); } return super.onOptionsItemSelected(item); } @Override protected void onResume() { super.onResume(); } @Override public List<? extends WeekViewEvent> onWeekViewLoad() { // Populate the week view with some events. List<WeekViewEvent> events = new ArrayList<>(); for (int i = 0; i < 10; i++) { DayTime startTime = new DayTime(LocalDateTime.now().plusHours(i * (random.nextInt(3) + 1))); DayTime endTime = new DayTime(startTime); endTime.addMinutes(random.nextInt(30) + 30); WeekViewEvent event = new WeekViewEvent("ID" + i, "Event " + i, startTime, endTime); event.setColor(randomColor()); events.add(event); } return events; } /** * Set up a date time interpreter which will show short date values when in week view and long * date values otherwise. */ private void setupDateTimeInterpreter() { mWeekView.setDayTimeInterpreter(new WeekView.DayTimeInterpreter() { @Override public String interpretDay(int date) { return DayOfWeek.of(date).getDisplayName(TextStyle.SHORT, Locale.getDefault()); } @Override public String interpretTime(int hour, int minutes) { String strMinutes = String.format(Locale.getDefault(), "%02d", minutes); if (hour > 11) { return (hour == 12 ? "12:" + strMinutes : (hour - 12) + ":" + strMinutes) + " PM"; } else { if (hour == 0) { return "12:" + strMinutes + " AM"; } else { return hour + ":" + strMinutes + " AM"; } } } }); } }
36.86911
116
0.656632
6bc12cad7b1b3d0efb5542dbd406f69c117cbf16
106,073
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: monitorhttp.proto package monitor.http; public final class Monitorhttp { private Monitorhttp() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } public interface http_requestOrBuilder extends // @@protoc_insertion_point(interface_extends:monitor.http.http_request) com.google.protobuf.MessageOrBuilder { /** * <code>optional int64 timestamp = 1;</code> */ boolean hasTimestamp(); /** * <code>optional int64 timestamp = 1;</code> */ long getTimestamp(); /** * <code>optional string hostname = 2;</code> */ boolean hasHostname(); /** * <code>optional string hostname = 2;</code> */ java.lang.String getHostname(); /** * <code>optional string hostname = 2;</code> */ com.google.protobuf.ByteString getHostnameBytes(); /** * <code>optional string server_name = 3;</code> */ boolean hasServerName(); /** * <code>optional string server_name = 3;</code> */ java.lang.String getServerName(); /** * <code>optional string server_name = 3;</code> */ com.google.protobuf.ByteString getServerNameBytes(); /** * <code>optional string server_ip = 4;</code> */ boolean hasServerIp(); /** * <code>optional string server_ip = 4;</code> */ java.lang.String getServerIp(); /** * <code>optional string server_ip = 4;</code> */ com.google.protobuf.ByteString getServerIpBytes(); /** * <code>optional string protocol = 5;</code> */ boolean hasProtocol(); /** * <code>optional string protocol = 5;</code> */ java.lang.String getProtocol(); /** * <code>optional string protocol = 5;</code> */ com.google.protobuf.ByteString getProtocolBytes(); /** * <code>optional string http_user = 6;</code> */ boolean hasHttpUser(); /** * <code>optional string http_user = 6;</code> */ java.lang.String getHttpUser(); /** * <code>optional string http_user = 6;</code> */ com.google.protobuf.ByteString getHttpUserBytes(); /** * <code>optional string method = 7;</code> */ boolean hasMethod(); /** * <code>optional string method = 7;</code> */ java.lang.String getMethod(); /** * <code>optional string method = 7;</code> */ com.google.protobuf.ByteString getMethodBytes(); /** * <code>optional string resource = 8;</code> */ boolean hasResource(); /** * <code>optional string resource = 8;</code> */ java.lang.String getResource(); /** * <code>optional string resource = 8;</code> */ com.google.protobuf.ByteString getResourceBytes(); /** * <code>optional string query = 9;</code> */ boolean hasQuery(); /** * <code>optional string query = 9;</code> */ java.lang.String getQuery(); /** * <code>optional string query = 9;</code> */ com.google.protobuf.ByteString getQueryBytes(); /** * <code>optional string full_request = 10;</code> */ boolean hasFullRequest(); /** * <code>optional string full_request = 10;</code> */ java.lang.String getFullRequest(); /** * <code>optional string full_request = 10;</code> */ com.google.protobuf.ByteString getFullRequestBytes(); /** * <code>optional int32 http_code = 11;</code> */ boolean hasHttpCode(); /** * <code>optional int32 http_code = 11;</code> */ int getHttpCode(); /** * <code>optional string conn_status = 12;</code> */ boolean hasConnStatus(); /** * <code>optional string conn_status = 12;</code> */ java.lang.String getConnStatus(); /** * <code>optional string conn_status = 12;</code> */ com.google.protobuf.ByteString getConnStatusBytes(); /** * <code>optional int64 content_size = 13;</code> */ boolean hasContentSize(); /** * <code>optional int64 content_size = 13;</code> */ long getContentSize(); /** * <code>optional string time_to_serve = 14;</code> */ boolean hasTimeToServe(); /** * <code>optional string time_to_serve = 14;</code> */ java.lang.String getTimeToServe(); /** * <code>optional string time_to_serve = 14;</code> */ com.google.protobuf.ByteString getTimeToServeBytes(); /** * <code>optional string header_referer = 15;</code> */ boolean hasHeaderReferer(); /** * <code>optional string header_referer = 15;</code> */ java.lang.String getHeaderReferer(); /** * <code>optional string header_referer = 15;</code> */ com.google.protobuf.ByteString getHeaderRefererBytes(); /** * <code>optional string header_user_agent = 16;</code> */ boolean hasHeaderUserAgent(); /** * <code>optional string header_user_agent = 16;</code> */ java.lang.String getHeaderUserAgent(); /** * <code>optional string header_user_agent = 16;</code> */ com.google.protobuf.ByteString getHeaderUserAgentBytes(); /** * <code>optional string header_accept = 17;</code> */ boolean hasHeaderAccept(); /** * <code>optional string header_accept = 17;</code> */ java.lang.String getHeaderAccept(); /** * <code>optional string header_accept = 17;</code> */ com.google.protobuf.ByteString getHeaderAcceptBytes(); /** * <code>optional string header_accept_language = 18;</code> */ boolean hasHeaderAcceptLanguage(); /** * <code>optional string header_accept_language = 18;</code> */ java.lang.String getHeaderAcceptLanguage(); /** * <code>optional string header_accept_language = 18;</code> */ com.google.protobuf.ByteString getHeaderAcceptLanguageBytes(); /** * <code>optional string file = 19;</code> */ boolean hasFile(); /** * <code>optional string file = 19;</code> */ java.lang.String getFile(); /** * <code>optional string file = 19;</code> */ com.google.protobuf.ByteString getFileBytes(); } /** * Protobuf type {@code monitor.http.http_request} */ public static final class http_request extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:monitor.http.http_request) http_requestOrBuilder { // Use http_request.newBuilder() to construct. private http_request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private http_request() { timestamp_ = 0L; hostname_ = ""; serverName_ = ""; serverIp_ = ""; protocol_ = ""; httpUser_ = ""; method_ = ""; resource_ = ""; query_ = ""; fullRequest_ = ""; httpCode_ = 0; connStatus_ = ""; contentSize_ = 0L; timeToServe_ = ""; headerReferer_ = ""; headerUserAgent_ = ""; headerAccept_ = ""; headerAcceptLanguage_ = ""; file_ = ""; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private http_request( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 8: { bitField0_ |= 0x00000001; timestamp_ = input.readInt64(); break; } case 18: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000002; hostname_ = bs; break; } case 26: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000004; serverName_ = bs; break; } case 34: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000008; serverIp_ = bs; break; } case 42: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000010; protocol_ = bs; break; } case 50: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000020; httpUser_ = bs; break; } case 58: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000040; method_ = bs; break; } case 66: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000080; resource_ = bs; break; } case 74: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000100; query_ = bs; break; } case 82: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000200; fullRequest_ = bs; break; } case 88: { bitField0_ |= 0x00000400; httpCode_ = input.readInt32(); break; } case 98: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000800; connStatus_ = bs; break; } case 104: { bitField0_ |= 0x00001000; contentSize_ = input.readInt64(); break; } case 114: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00002000; timeToServe_ = bs; break; } case 122: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00004000; headerReferer_ = bs; break; } case 130: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00008000; headerUserAgent_ = bs; break; } case 138: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00010000; headerAccept_ = bs; break; } case 146: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00020000; headerAcceptLanguage_ = bs; break; } case 154: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00040000; file_ = bs; 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 monitor.http.Monitorhttp.internal_static_monitor_http_http_request_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return monitor.http.Monitorhttp.internal_static_monitor_http_http_request_fieldAccessorTable .ensureFieldAccessorsInitialized( monitor.http.Monitorhttp.http_request.class, monitor.http.Monitorhttp.http_request.Builder.class); } private int bitField0_; public static final int TIMESTAMP_FIELD_NUMBER = 1; private long timestamp_; /** * <code>optional int64 timestamp = 1;</code> */ public boolean hasTimestamp() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>optional int64 timestamp = 1;</code> */ public long getTimestamp() { return timestamp_; } public static final int HOSTNAME_FIELD_NUMBER = 2; private volatile java.lang.Object hostname_; /** * <code>optional string hostname = 2;</code> */ public boolean hasHostname() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>optional string hostname = 2;</code> */ public java.lang.String getHostname() { java.lang.Object ref = hostname_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { hostname_ = s; } return s; } } /** * <code>optional string hostname = 2;</code> */ public com.google.protobuf.ByteString getHostnameBytes() { java.lang.Object ref = hostname_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); hostname_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SERVER_NAME_FIELD_NUMBER = 3; private volatile java.lang.Object serverName_; /** * <code>optional string server_name = 3;</code> */ public boolean hasServerName() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>optional string server_name = 3;</code> */ public java.lang.String getServerName() { java.lang.Object ref = serverName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { serverName_ = s; } return s; } } /** * <code>optional string server_name = 3;</code> */ public com.google.protobuf.ByteString getServerNameBytes() { java.lang.Object ref = serverName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); serverName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SERVER_IP_FIELD_NUMBER = 4; private volatile java.lang.Object serverIp_; /** * <code>optional string server_ip = 4;</code> */ public boolean hasServerIp() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>optional string server_ip = 4;</code> */ public java.lang.String getServerIp() { java.lang.Object ref = serverIp_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { serverIp_ = s; } return s; } } /** * <code>optional string server_ip = 4;</code> */ public com.google.protobuf.ByteString getServerIpBytes() { java.lang.Object ref = serverIp_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); serverIp_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PROTOCOL_FIELD_NUMBER = 5; private volatile java.lang.Object protocol_; /** * <code>optional string protocol = 5;</code> */ public boolean hasProtocol() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>optional string protocol = 5;</code> */ public java.lang.String getProtocol() { java.lang.Object ref = protocol_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { protocol_ = s; } return s; } } /** * <code>optional string protocol = 5;</code> */ public com.google.protobuf.ByteString getProtocolBytes() { java.lang.Object ref = protocol_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); protocol_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int HTTP_USER_FIELD_NUMBER = 6; private volatile java.lang.Object httpUser_; /** * <code>optional string http_user = 6;</code> */ public boolean hasHttpUser() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>optional string http_user = 6;</code> */ public java.lang.String getHttpUser() { java.lang.Object ref = httpUser_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { httpUser_ = s; } return s; } } /** * <code>optional string http_user = 6;</code> */ public com.google.protobuf.ByteString getHttpUserBytes() { java.lang.Object ref = httpUser_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); httpUser_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int METHOD_FIELD_NUMBER = 7; private volatile java.lang.Object method_; /** * <code>optional string method = 7;</code> */ public boolean hasMethod() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** * <code>optional string method = 7;</code> */ public java.lang.String getMethod() { java.lang.Object ref = method_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { method_ = s; } return s; } } /** * <code>optional string method = 7;</code> */ public com.google.protobuf.ByteString getMethodBytes() { java.lang.Object ref = method_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); method_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int RESOURCE_FIELD_NUMBER = 8; private volatile java.lang.Object resource_; /** * <code>optional string resource = 8;</code> */ public boolean hasResource() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** * <code>optional string resource = 8;</code> */ public java.lang.String getResource() { java.lang.Object ref = resource_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { resource_ = s; } return s; } } /** * <code>optional string resource = 8;</code> */ public com.google.protobuf.ByteString getResourceBytes() { java.lang.Object ref = resource_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); resource_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int QUERY_FIELD_NUMBER = 9; private volatile java.lang.Object query_; /** * <code>optional string query = 9;</code> */ public boolean hasQuery() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** * <code>optional string query = 9;</code> */ public java.lang.String getQuery() { java.lang.Object ref = query_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { query_ = s; } return s; } } /** * <code>optional string query = 9;</code> */ public com.google.protobuf.ByteString getQueryBytes() { java.lang.Object ref = query_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); query_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int FULL_REQUEST_FIELD_NUMBER = 10; private volatile java.lang.Object fullRequest_; /** * <code>optional string full_request = 10;</code> */ public boolean hasFullRequest() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** * <code>optional string full_request = 10;</code> */ public java.lang.String getFullRequest() { java.lang.Object ref = fullRequest_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { fullRequest_ = s; } return s; } } /** * <code>optional string full_request = 10;</code> */ public com.google.protobuf.ByteString getFullRequestBytes() { java.lang.Object ref = fullRequest_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); fullRequest_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int HTTP_CODE_FIELD_NUMBER = 11; private int httpCode_; /** * <code>optional int32 http_code = 11;</code> */ public boolean hasHttpCode() { return ((bitField0_ & 0x00000400) == 0x00000400); } /** * <code>optional int32 http_code = 11;</code> */ public int getHttpCode() { return httpCode_; } public static final int CONN_STATUS_FIELD_NUMBER = 12; private volatile java.lang.Object connStatus_; /** * <code>optional string conn_status = 12;</code> */ public boolean hasConnStatus() { return ((bitField0_ & 0x00000800) == 0x00000800); } /** * <code>optional string conn_status = 12;</code> */ public java.lang.String getConnStatus() { java.lang.Object ref = connStatus_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { connStatus_ = s; } return s; } } /** * <code>optional string conn_status = 12;</code> */ public com.google.protobuf.ByteString getConnStatusBytes() { java.lang.Object ref = connStatus_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); connStatus_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int CONTENT_SIZE_FIELD_NUMBER = 13; private long contentSize_; /** * <code>optional int64 content_size = 13;</code> */ public boolean hasContentSize() { return ((bitField0_ & 0x00001000) == 0x00001000); } /** * <code>optional int64 content_size = 13;</code> */ public long getContentSize() { return contentSize_; } public static final int TIME_TO_SERVE_FIELD_NUMBER = 14; private volatile java.lang.Object timeToServe_; /** * <code>optional string time_to_serve = 14;</code> */ public boolean hasTimeToServe() { return ((bitField0_ & 0x00002000) == 0x00002000); } /** * <code>optional string time_to_serve = 14;</code> */ public java.lang.String getTimeToServe() { java.lang.Object ref = timeToServe_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { timeToServe_ = s; } return s; } } /** * <code>optional string time_to_serve = 14;</code> */ public com.google.protobuf.ByteString getTimeToServeBytes() { java.lang.Object ref = timeToServe_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); timeToServe_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int HEADER_REFERER_FIELD_NUMBER = 15; private volatile java.lang.Object headerReferer_; /** * <code>optional string header_referer = 15;</code> */ public boolean hasHeaderReferer() { return ((bitField0_ & 0x00004000) == 0x00004000); } /** * <code>optional string header_referer = 15;</code> */ public java.lang.String getHeaderReferer() { java.lang.Object ref = headerReferer_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { headerReferer_ = s; } return s; } } /** * <code>optional string header_referer = 15;</code> */ public com.google.protobuf.ByteString getHeaderRefererBytes() { java.lang.Object ref = headerReferer_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); headerReferer_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int HEADER_USER_AGENT_FIELD_NUMBER = 16; private volatile java.lang.Object headerUserAgent_; /** * <code>optional string header_user_agent = 16;</code> */ public boolean hasHeaderUserAgent() { return ((bitField0_ & 0x00008000) == 0x00008000); } /** * <code>optional string header_user_agent = 16;</code> */ public java.lang.String getHeaderUserAgent() { java.lang.Object ref = headerUserAgent_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { headerUserAgent_ = s; } return s; } } /** * <code>optional string header_user_agent = 16;</code> */ public com.google.protobuf.ByteString getHeaderUserAgentBytes() { java.lang.Object ref = headerUserAgent_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); headerUserAgent_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int HEADER_ACCEPT_FIELD_NUMBER = 17; private volatile java.lang.Object headerAccept_; /** * <code>optional string header_accept = 17;</code> */ public boolean hasHeaderAccept() { return ((bitField0_ & 0x00010000) == 0x00010000); } /** * <code>optional string header_accept = 17;</code> */ public java.lang.String getHeaderAccept() { java.lang.Object ref = headerAccept_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { headerAccept_ = s; } return s; } } /** * <code>optional string header_accept = 17;</code> */ public com.google.protobuf.ByteString getHeaderAcceptBytes() { java.lang.Object ref = headerAccept_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); headerAccept_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int HEADER_ACCEPT_LANGUAGE_FIELD_NUMBER = 18; private volatile java.lang.Object headerAcceptLanguage_; /** * <code>optional string header_accept_language = 18;</code> */ public boolean hasHeaderAcceptLanguage() { return ((bitField0_ & 0x00020000) == 0x00020000); } /** * <code>optional string header_accept_language = 18;</code> */ public java.lang.String getHeaderAcceptLanguage() { java.lang.Object ref = headerAcceptLanguage_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { headerAcceptLanguage_ = s; } return s; } } /** * <code>optional string header_accept_language = 18;</code> */ public com.google.protobuf.ByteString getHeaderAcceptLanguageBytes() { java.lang.Object ref = headerAcceptLanguage_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); headerAcceptLanguage_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int FILE_FIELD_NUMBER = 19; private volatile java.lang.Object file_; /** * <code>optional string file = 19;</code> */ public boolean hasFile() { return ((bitField0_ & 0x00040000) == 0x00040000); } /** * <code>optional string file = 19;</code> */ public java.lang.String getFile() { java.lang.Object ref = file_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { file_ = s; } return s; } } /** * <code>optional string file = 19;</code> */ public com.google.protobuf.ByteString getFileBytes() { java.lang.Object ref = file_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); file_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, timestamp_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, hostname_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serverName_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serverIp_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, protocol_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, httpUser_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, method_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 8, resource_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 9, query_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 10, fullRequest_); } if (((bitField0_ & 0x00000400) == 0x00000400)) { output.writeInt32(11, httpCode_); } if (((bitField0_ & 0x00000800) == 0x00000800)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 12, connStatus_); } if (((bitField0_ & 0x00001000) == 0x00001000)) { output.writeInt64(13, contentSize_); } if (((bitField0_ & 0x00002000) == 0x00002000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 14, timeToServe_); } if (((bitField0_ & 0x00004000) == 0x00004000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 15, headerReferer_); } if (((bitField0_ & 0x00008000) == 0x00008000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 16, headerUserAgent_); } if (((bitField0_ & 0x00010000) == 0x00010000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 17, headerAccept_); } if (((bitField0_ & 0x00020000) == 0x00020000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 18, headerAcceptLanguage_); } if (((bitField0_ & 0x00040000) == 0x00040000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 19, file_); } unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, timestamp_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, hostname_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serverName_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serverIp_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, protocol_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, httpUser_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, method_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, resource_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, query_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, fullRequest_); } if (((bitField0_ & 0x00000400) == 0x00000400)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(11, httpCode_); } if (((bitField0_ & 0x00000800) == 0x00000800)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, connStatus_); } if (((bitField0_ & 0x00001000) == 0x00001000)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(13, contentSize_); } if (((bitField0_ & 0x00002000) == 0x00002000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, timeToServe_); } if (((bitField0_ & 0x00004000) == 0x00004000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, headerReferer_); } if (((bitField0_ & 0x00008000) == 0x00008000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, headerUserAgent_); } if (((bitField0_ & 0x00010000) == 0x00010000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, headerAccept_); } if (((bitField0_ & 0x00020000) == 0x00020000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, headerAcceptLanguage_); } if (((bitField0_ & 0x00040000) == 0x00040000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, file_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof monitor.http.Monitorhttp.http_request)) { return super.equals(obj); } monitor.http.Monitorhttp.http_request other = (monitor.http.Monitorhttp.http_request) obj; boolean result = true; result = result && (hasTimestamp() == other.hasTimestamp()); if (hasTimestamp()) { result = result && (getTimestamp() == other.getTimestamp()); } result = result && (hasHostname() == other.hasHostname()); if (hasHostname()) { result = result && getHostname() .equals(other.getHostname()); } result = result && (hasServerName() == other.hasServerName()); if (hasServerName()) { result = result && getServerName() .equals(other.getServerName()); } result = result && (hasServerIp() == other.hasServerIp()); if (hasServerIp()) { result = result && getServerIp() .equals(other.getServerIp()); } result = result && (hasProtocol() == other.hasProtocol()); if (hasProtocol()) { result = result && getProtocol() .equals(other.getProtocol()); } result = result && (hasHttpUser() == other.hasHttpUser()); if (hasHttpUser()) { result = result && getHttpUser() .equals(other.getHttpUser()); } result = result && (hasMethod() == other.hasMethod()); if (hasMethod()) { result = result && getMethod() .equals(other.getMethod()); } result = result && (hasResource() == other.hasResource()); if (hasResource()) { result = result && getResource() .equals(other.getResource()); } result = result && (hasQuery() == other.hasQuery()); if (hasQuery()) { result = result && getQuery() .equals(other.getQuery()); } result = result && (hasFullRequest() == other.hasFullRequest()); if (hasFullRequest()) { result = result && getFullRequest() .equals(other.getFullRequest()); } result = result && (hasHttpCode() == other.hasHttpCode()); if (hasHttpCode()) { result = result && (getHttpCode() == other.getHttpCode()); } result = result && (hasConnStatus() == other.hasConnStatus()); if (hasConnStatus()) { result = result && getConnStatus() .equals(other.getConnStatus()); } result = result && (hasContentSize() == other.hasContentSize()); if (hasContentSize()) { result = result && (getContentSize() == other.getContentSize()); } result = result && (hasTimeToServe() == other.hasTimeToServe()); if (hasTimeToServe()) { result = result && getTimeToServe() .equals(other.getTimeToServe()); } result = result && (hasHeaderReferer() == other.hasHeaderReferer()); if (hasHeaderReferer()) { result = result && getHeaderReferer() .equals(other.getHeaderReferer()); } result = result && (hasHeaderUserAgent() == other.hasHeaderUserAgent()); if (hasHeaderUserAgent()) { result = result && getHeaderUserAgent() .equals(other.getHeaderUserAgent()); } result = result && (hasHeaderAccept() == other.hasHeaderAccept()); if (hasHeaderAccept()) { result = result && getHeaderAccept() .equals(other.getHeaderAccept()); } result = result && (hasHeaderAcceptLanguage() == other.hasHeaderAcceptLanguage()); if (hasHeaderAcceptLanguage()) { result = result && getHeaderAcceptLanguage() .equals(other.getHeaderAcceptLanguage()); } result = result && (hasFile() == other.hasFile()); if (hasFile()) { result = result && getFile() .equals(other.getFile()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasTimestamp()) { hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getTimestamp()); } if (hasHostname()) { hash = (37 * hash) + HOSTNAME_FIELD_NUMBER; hash = (53 * hash) + getHostname().hashCode(); } if (hasServerName()) { hash = (37 * hash) + SERVER_NAME_FIELD_NUMBER; hash = (53 * hash) + getServerName().hashCode(); } if (hasServerIp()) { hash = (37 * hash) + SERVER_IP_FIELD_NUMBER; hash = (53 * hash) + getServerIp().hashCode(); } if (hasProtocol()) { hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; hash = (53 * hash) + getProtocol().hashCode(); } if (hasHttpUser()) { hash = (37 * hash) + HTTP_USER_FIELD_NUMBER; hash = (53 * hash) + getHttpUser().hashCode(); } if (hasMethod()) { hash = (37 * hash) + METHOD_FIELD_NUMBER; hash = (53 * hash) + getMethod().hashCode(); } if (hasResource()) { hash = (37 * hash) + RESOURCE_FIELD_NUMBER; hash = (53 * hash) + getResource().hashCode(); } if (hasQuery()) { hash = (37 * hash) + QUERY_FIELD_NUMBER; hash = (53 * hash) + getQuery().hashCode(); } if (hasFullRequest()) { hash = (37 * hash) + FULL_REQUEST_FIELD_NUMBER; hash = (53 * hash) + getFullRequest().hashCode(); } if (hasHttpCode()) { hash = (37 * hash) + HTTP_CODE_FIELD_NUMBER; hash = (53 * hash) + getHttpCode(); } if (hasConnStatus()) { hash = (37 * hash) + CONN_STATUS_FIELD_NUMBER; hash = (53 * hash) + getConnStatus().hashCode(); } if (hasContentSize()) { hash = (37 * hash) + CONTENT_SIZE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getContentSize()); } if (hasTimeToServe()) { hash = (37 * hash) + TIME_TO_SERVE_FIELD_NUMBER; hash = (53 * hash) + getTimeToServe().hashCode(); } if (hasHeaderReferer()) { hash = (37 * hash) + HEADER_REFERER_FIELD_NUMBER; hash = (53 * hash) + getHeaderReferer().hashCode(); } if (hasHeaderUserAgent()) { hash = (37 * hash) + HEADER_USER_AGENT_FIELD_NUMBER; hash = (53 * hash) + getHeaderUserAgent().hashCode(); } if (hasHeaderAccept()) { hash = (37 * hash) + HEADER_ACCEPT_FIELD_NUMBER; hash = (53 * hash) + getHeaderAccept().hashCode(); } if (hasHeaderAcceptLanguage()) { hash = (37 * hash) + HEADER_ACCEPT_LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getHeaderAcceptLanguage().hashCode(); } if (hasFile()) { hash = (37 * hash) + FILE_FIELD_NUMBER; hash = (53 * hash) + getFile().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static monitor.http.Monitorhttp.http_request parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static monitor.http.Monitorhttp.http_request parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static monitor.http.Monitorhttp.http_request parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static monitor.http.Monitorhttp.http_request parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static monitor.http.Monitorhttp.http_request parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static monitor.http.Monitorhttp.http_request 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 monitor.http.Monitorhttp.http_request parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static monitor.http.Monitorhttp.http_request 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 monitor.http.Monitorhttp.http_request parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static monitor.http.Monitorhttp.http_request parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(monitor.http.Monitorhttp.http_request prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } 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 monitor.http.http_request} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:monitor.http.http_request) monitor.http.Monitorhttp.http_requestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return monitor.http.Monitorhttp.internal_static_monitor_http_http_request_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return monitor.http.Monitorhttp.internal_static_monitor_http_http_request_fieldAccessorTable .ensureFieldAccessorsInitialized( monitor.http.Monitorhttp.http_request.class, monitor.http.Monitorhttp.http_request.Builder.class); } // Construct using monitor.http.Monitorhttp.http_request.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } public Builder clear() { super.clear(); timestamp_ = 0L; bitField0_ = (bitField0_ & ~0x00000001); hostname_ = ""; bitField0_ = (bitField0_ & ~0x00000002); serverName_ = ""; bitField0_ = (bitField0_ & ~0x00000004); serverIp_ = ""; bitField0_ = (bitField0_ & ~0x00000008); protocol_ = ""; bitField0_ = (bitField0_ & ~0x00000010); httpUser_ = ""; bitField0_ = (bitField0_ & ~0x00000020); method_ = ""; bitField0_ = (bitField0_ & ~0x00000040); resource_ = ""; bitField0_ = (bitField0_ & ~0x00000080); query_ = ""; bitField0_ = (bitField0_ & ~0x00000100); fullRequest_ = ""; bitField0_ = (bitField0_ & ~0x00000200); httpCode_ = 0; bitField0_ = (bitField0_ & ~0x00000400); connStatus_ = ""; bitField0_ = (bitField0_ & ~0x00000800); contentSize_ = 0L; bitField0_ = (bitField0_ & ~0x00001000); timeToServe_ = ""; bitField0_ = (bitField0_ & ~0x00002000); headerReferer_ = ""; bitField0_ = (bitField0_ & ~0x00004000); headerUserAgent_ = ""; bitField0_ = (bitField0_ & ~0x00008000); headerAccept_ = ""; bitField0_ = (bitField0_ & ~0x00010000); headerAcceptLanguage_ = ""; bitField0_ = (bitField0_ & ~0x00020000); file_ = ""; bitField0_ = (bitField0_ & ~0x00040000); return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return monitor.http.Monitorhttp.internal_static_monitor_http_http_request_descriptor; } public monitor.http.Monitorhttp.http_request getDefaultInstanceForType() { return monitor.http.Monitorhttp.http_request.getDefaultInstance(); } public monitor.http.Monitorhttp.http_request build() { monitor.http.Monitorhttp.http_request result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public monitor.http.Monitorhttp.http_request buildPartial() { monitor.http.Monitorhttp.http_request result = new monitor.http.Monitorhttp.http_request(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.timestamp_ = timestamp_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.hostname_ = hostname_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.serverName_ = serverName_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.serverIp_ = serverIp_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.protocol_ = protocol_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } result.httpUser_ = httpUser_; if (((from_bitField0_ & 0x00000040) == 0x00000040)) { to_bitField0_ |= 0x00000040; } result.method_ = method_; if (((from_bitField0_ & 0x00000080) == 0x00000080)) { to_bitField0_ |= 0x00000080; } result.resource_ = resource_; if (((from_bitField0_ & 0x00000100) == 0x00000100)) { to_bitField0_ |= 0x00000100; } result.query_ = query_; if (((from_bitField0_ & 0x00000200) == 0x00000200)) { to_bitField0_ |= 0x00000200; } result.fullRequest_ = fullRequest_; if (((from_bitField0_ & 0x00000400) == 0x00000400)) { to_bitField0_ |= 0x00000400; } result.httpCode_ = httpCode_; if (((from_bitField0_ & 0x00000800) == 0x00000800)) { to_bitField0_ |= 0x00000800; } result.connStatus_ = connStatus_; if (((from_bitField0_ & 0x00001000) == 0x00001000)) { to_bitField0_ |= 0x00001000; } result.contentSize_ = contentSize_; if (((from_bitField0_ & 0x00002000) == 0x00002000)) { to_bitField0_ |= 0x00002000; } result.timeToServe_ = timeToServe_; if (((from_bitField0_ & 0x00004000) == 0x00004000)) { to_bitField0_ |= 0x00004000; } result.headerReferer_ = headerReferer_; if (((from_bitField0_ & 0x00008000) == 0x00008000)) { to_bitField0_ |= 0x00008000; } result.headerUserAgent_ = headerUserAgent_; if (((from_bitField0_ & 0x00010000) == 0x00010000)) { to_bitField0_ |= 0x00010000; } result.headerAccept_ = headerAccept_; if (((from_bitField0_ & 0x00020000) == 0x00020000)) { to_bitField0_ |= 0x00020000; } result.headerAcceptLanguage_ = headerAcceptLanguage_; if (((from_bitField0_ & 0x00040000) == 0x00040000)) { to_bitField0_ |= 0x00040000; } result.file_ = file_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof monitor.http.Monitorhttp.http_request) { return mergeFrom((monitor.http.Monitorhttp.http_request)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(monitor.http.Monitorhttp.http_request other) { if (other == monitor.http.Monitorhttp.http_request.getDefaultInstance()) return this; if (other.hasTimestamp()) { setTimestamp(other.getTimestamp()); } if (other.hasHostname()) { bitField0_ |= 0x00000002; hostname_ = other.hostname_; onChanged(); } if (other.hasServerName()) { bitField0_ |= 0x00000004; serverName_ = other.serverName_; onChanged(); } if (other.hasServerIp()) { bitField0_ |= 0x00000008; serverIp_ = other.serverIp_; onChanged(); } if (other.hasProtocol()) { bitField0_ |= 0x00000010; protocol_ = other.protocol_; onChanged(); } if (other.hasHttpUser()) { bitField0_ |= 0x00000020; httpUser_ = other.httpUser_; onChanged(); } if (other.hasMethod()) { bitField0_ |= 0x00000040; method_ = other.method_; onChanged(); } if (other.hasResource()) { bitField0_ |= 0x00000080; resource_ = other.resource_; onChanged(); } if (other.hasQuery()) { bitField0_ |= 0x00000100; query_ = other.query_; onChanged(); } if (other.hasFullRequest()) { bitField0_ |= 0x00000200; fullRequest_ = other.fullRequest_; onChanged(); } if (other.hasHttpCode()) { setHttpCode(other.getHttpCode()); } if (other.hasConnStatus()) { bitField0_ |= 0x00000800; connStatus_ = other.connStatus_; onChanged(); } if (other.hasContentSize()) { setContentSize(other.getContentSize()); } if (other.hasTimeToServe()) { bitField0_ |= 0x00002000; timeToServe_ = other.timeToServe_; onChanged(); } if (other.hasHeaderReferer()) { bitField0_ |= 0x00004000; headerReferer_ = other.headerReferer_; onChanged(); } if (other.hasHeaderUserAgent()) { bitField0_ |= 0x00008000; headerUserAgent_ = other.headerUserAgent_; onChanged(); } if (other.hasHeaderAccept()) { bitField0_ |= 0x00010000; headerAccept_ = other.headerAccept_; onChanged(); } if (other.hasHeaderAcceptLanguage()) { bitField0_ |= 0x00020000; headerAcceptLanguage_ = other.headerAcceptLanguage_; onChanged(); } if (other.hasFile()) { bitField0_ |= 0x00040000; file_ = other.file_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { monitor.http.Monitorhttp.http_request parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (monitor.http.Monitorhttp.http_request) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private long timestamp_ ; /** * <code>optional int64 timestamp = 1;</code> */ public boolean hasTimestamp() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>optional int64 timestamp = 1;</code> */ public long getTimestamp() { return timestamp_; } /** * <code>optional int64 timestamp = 1;</code> */ public Builder setTimestamp(long value) { bitField0_ |= 0x00000001; timestamp_ = value; onChanged(); return this; } /** * <code>optional int64 timestamp = 1;</code> */ public Builder clearTimestamp() { bitField0_ = (bitField0_ & ~0x00000001); timestamp_ = 0L; onChanged(); return this; } private java.lang.Object hostname_ = ""; /** * <code>optional string hostname = 2;</code> */ public boolean hasHostname() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>optional string hostname = 2;</code> */ public java.lang.String getHostname() { java.lang.Object ref = hostname_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { hostname_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string hostname = 2;</code> */ public com.google.protobuf.ByteString getHostnameBytes() { java.lang.Object ref = hostname_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); hostname_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string hostname = 2;</code> */ public Builder setHostname( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; hostname_ = value; onChanged(); return this; } /** * <code>optional string hostname = 2;</code> */ public Builder clearHostname() { bitField0_ = (bitField0_ & ~0x00000002); hostname_ = getDefaultInstance().getHostname(); onChanged(); return this; } /** * <code>optional string hostname = 2;</code> */ public Builder setHostnameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; hostname_ = value; onChanged(); return this; } private java.lang.Object serverName_ = ""; /** * <code>optional string server_name = 3;</code> */ public boolean hasServerName() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>optional string server_name = 3;</code> */ public java.lang.String getServerName() { java.lang.Object ref = serverName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { serverName_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string server_name = 3;</code> */ public com.google.protobuf.ByteString getServerNameBytes() { java.lang.Object ref = serverName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); serverName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string server_name = 3;</code> */ public Builder setServerName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; serverName_ = value; onChanged(); return this; } /** * <code>optional string server_name = 3;</code> */ public Builder clearServerName() { bitField0_ = (bitField0_ & ~0x00000004); serverName_ = getDefaultInstance().getServerName(); onChanged(); return this; } /** * <code>optional string server_name = 3;</code> */ public Builder setServerNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; serverName_ = value; onChanged(); return this; } private java.lang.Object serverIp_ = ""; /** * <code>optional string server_ip = 4;</code> */ public boolean hasServerIp() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>optional string server_ip = 4;</code> */ public java.lang.String getServerIp() { java.lang.Object ref = serverIp_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { serverIp_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string server_ip = 4;</code> */ public com.google.protobuf.ByteString getServerIpBytes() { java.lang.Object ref = serverIp_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); serverIp_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string server_ip = 4;</code> */ public Builder setServerIp( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000008; serverIp_ = value; onChanged(); return this; } /** * <code>optional string server_ip = 4;</code> */ public Builder clearServerIp() { bitField0_ = (bitField0_ & ~0x00000008); serverIp_ = getDefaultInstance().getServerIp(); onChanged(); return this; } /** * <code>optional string server_ip = 4;</code> */ public Builder setServerIpBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000008; serverIp_ = value; onChanged(); return this; } private java.lang.Object protocol_ = ""; /** * <code>optional string protocol = 5;</code> */ public boolean hasProtocol() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>optional string protocol = 5;</code> */ public java.lang.String getProtocol() { java.lang.Object ref = protocol_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { protocol_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string protocol = 5;</code> */ public com.google.protobuf.ByteString getProtocolBytes() { java.lang.Object ref = protocol_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); protocol_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string protocol = 5;</code> */ public Builder setProtocol( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; protocol_ = value; onChanged(); return this; } /** * <code>optional string protocol = 5;</code> */ public Builder clearProtocol() { bitField0_ = (bitField0_ & ~0x00000010); protocol_ = getDefaultInstance().getProtocol(); onChanged(); return this; } /** * <code>optional string protocol = 5;</code> */ public Builder setProtocolBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; protocol_ = value; onChanged(); return this; } private java.lang.Object httpUser_ = ""; /** * <code>optional string http_user = 6;</code> */ public boolean hasHttpUser() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>optional string http_user = 6;</code> */ public java.lang.String getHttpUser() { java.lang.Object ref = httpUser_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { httpUser_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string http_user = 6;</code> */ public com.google.protobuf.ByteString getHttpUserBytes() { java.lang.Object ref = httpUser_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); httpUser_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string http_user = 6;</code> */ public Builder setHttpUser( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; httpUser_ = value; onChanged(); return this; } /** * <code>optional string http_user = 6;</code> */ public Builder clearHttpUser() { bitField0_ = (bitField0_ & ~0x00000020); httpUser_ = getDefaultInstance().getHttpUser(); onChanged(); return this; } /** * <code>optional string http_user = 6;</code> */ public Builder setHttpUserBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; httpUser_ = value; onChanged(); return this; } private java.lang.Object method_ = ""; /** * <code>optional string method = 7;</code> */ public boolean hasMethod() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** * <code>optional string method = 7;</code> */ public java.lang.String getMethod() { java.lang.Object ref = method_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { method_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string method = 7;</code> */ public com.google.protobuf.ByteString getMethodBytes() { java.lang.Object ref = method_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); method_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string method = 7;</code> */ public Builder setMethod( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000040; method_ = value; onChanged(); return this; } /** * <code>optional string method = 7;</code> */ public Builder clearMethod() { bitField0_ = (bitField0_ & ~0x00000040); method_ = getDefaultInstance().getMethod(); onChanged(); return this; } /** * <code>optional string method = 7;</code> */ public Builder setMethodBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000040; method_ = value; onChanged(); return this; } private java.lang.Object resource_ = ""; /** * <code>optional string resource = 8;</code> */ public boolean hasResource() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** * <code>optional string resource = 8;</code> */ public java.lang.String getResource() { java.lang.Object ref = resource_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { resource_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string resource = 8;</code> */ public com.google.protobuf.ByteString getResourceBytes() { java.lang.Object ref = resource_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); resource_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string resource = 8;</code> */ public Builder setResource( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000080; resource_ = value; onChanged(); return this; } /** * <code>optional string resource = 8;</code> */ public Builder clearResource() { bitField0_ = (bitField0_ & ~0x00000080); resource_ = getDefaultInstance().getResource(); onChanged(); return this; } /** * <code>optional string resource = 8;</code> */ public Builder setResourceBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000080; resource_ = value; onChanged(); return this; } private java.lang.Object query_ = ""; /** * <code>optional string query = 9;</code> */ public boolean hasQuery() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** * <code>optional string query = 9;</code> */ public java.lang.String getQuery() { java.lang.Object ref = query_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { query_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string query = 9;</code> */ public com.google.protobuf.ByteString getQueryBytes() { java.lang.Object ref = query_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); query_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string query = 9;</code> */ public Builder setQuery( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000100; query_ = value; onChanged(); return this; } /** * <code>optional string query = 9;</code> */ public Builder clearQuery() { bitField0_ = (bitField0_ & ~0x00000100); query_ = getDefaultInstance().getQuery(); onChanged(); return this; } /** * <code>optional string query = 9;</code> */ public Builder setQueryBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000100; query_ = value; onChanged(); return this; } private java.lang.Object fullRequest_ = ""; /** * <code>optional string full_request = 10;</code> */ public boolean hasFullRequest() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** * <code>optional string full_request = 10;</code> */ public java.lang.String getFullRequest() { java.lang.Object ref = fullRequest_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { fullRequest_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string full_request = 10;</code> */ public com.google.protobuf.ByteString getFullRequestBytes() { java.lang.Object ref = fullRequest_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); fullRequest_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string full_request = 10;</code> */ public Builder setFullRequest( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000200; fullRequest_ = value; onChanged(); return this; } /** * <code>optional string full_request = 10;</code> */ public Builder clearFullRequest() { bitField0_ = (bitField0_ & ~0x00000200); fullRequest_ = getDefaultInstance().getFullRequest(); onChanged(); return this; } /** * <code>optional string full_request = 10;</code> */ public Builder setFullRequestBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000200; fullRequest_ = value; onChanged(); return this; } private int httpCode_ ; /** * <code>optional int32 http_code = 11;</code> */ public boolean hasHttpCode() { return ((bitField0_ & 0x00000400) == 0x00000400); } /** * <code>optional int32 http_code = 11;</code> */ public int getHttpCode() { return httpCode_; } /** * <code>optional int32 http_code = 11;</code> */ public Builder setHttpCode(int value) { bitField0_ |= 0x00000400; httpCode_ = value; onChanged(); return this; } /** * <code>optional int32 http_code = 11;</code> */ public Builder clearHttpCode() { bitField0_ = (bitField0_ & ~0x00000400); httpCode_ = 0; onChanged(); return this; } private java.lang.Object connStatus_ = ""; /** * <code>optional string conn_status = 12;</code> */ public boolean hasConnStatus() { return ((bitField0_ & 0x00000800) == 0x00000800); } /** * <code>optional string conn_status = 12;</code> */ public java.lang.String getConnStatus() { java.lang.Object ref = connStatus_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { connStatus_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string conn_status = 12;</code> */ public com.google.protobuf.ByteString getConnStatusBytes() { java.lang.Object ref = connStatus_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); connStatus_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string conn_status = 12;</code> */ public Builder setConnStatus( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000800; connStatus_ = value; onChanged(); return this; } /** * <code>optional string conn_status = 12;</code> */ public Builder clearConnStatus() { bitField0_ = (bitField0_ & ~0x00000800); connStatus_ = getDefaultInstance().getConnStatus(); onChanged(); return this; } /** * <code>optional string conn_status = 12;</code> */ public Builder setConnStatusBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000800; connStatus_ = value; onChanged(); return this; } private long contentSize_ ; /** * <code>optional int64 content_size = 13;</code> */ public boolean hasContentSize() { return ((bitField0_ & 0x00001000) == 0x00001000); } /** * <code>optional int64 content_size = 13;</code> */ public long getContentSize() { return contentSize_; } /** * <code>optional int64 content_size = 13;</code> */ public Builder setContentSize(long value) { bitField0_ |= 0x00001000; contentSize_ = value; onChanged(); return this; } /** * <code>optional int64 content_size = 13;</code> */ public Builder clearContentSize() { bitField0_ = (bitField0_ & ~0x00001000); contentSize_ = 0L; onChanged(); return this; } private java.lang.Object timeToServe_ = ""; /** * <code>optional string time_to_serve = 14;</code> */ public boolean hasTimeToServe() { return ((bitField0_ & 0x00002000) == 0x00002000); } /** * <code>optional string time_to_serve = 14;</code> */ public java.lang.String getTimeToServe() { java.lang.Object ref = timeToServe_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { timeToServe_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string time_to_serve = 14;</code> */ public com.google.protobuf.ByteString getTimeToServeBytes() { java.lang.Object ref = timeToServe_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); timeToServe_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string time_to_serve = 14;</code> */ public Builder setTimeToServe( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00002000; timeToServe_ = value; onChanged(); return this; } /** * <code>optional string time_to_serve = 14;</code> */ public Builder clearTimeToServe() { bitField0_ = (bitField0_ & ~0x00002000); timeToServe_ = getDefaultInstance().getTimeToServe(); onChanged(); return this; } /** * <code>optional string time_to_serve = 14;</code> */ public Builder setTimeToServeBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00002000; timeToServe_ = value; onChanged(); return this; } private java.lang.Object headerReferer_ = ""; /** * <code>optional string header_referer = 15;</code> */ public boolean hasHeaderReferer() { return ((bitField0_ & 0x00004000) == 0x00004000); } /** * <code>optional string header_referer = 15;</code> */ public java.lang.String getHeaderReferer() { java.lang.Object ref = headerReferer_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { headerReferer_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string header_referer = 15;</code> */ public com.google.protobuf.ByteString getHeaderRefererBytes() { java.lang.Object ref = headerReferer_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); headerReferer_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string header_referer = 15;</code> */ public Builder setHeaderReferer( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00004000; headerReferer_ = value; onChanged(); return this; } /** * <code>optional string header_referer = 15;</code> */ public Builder clearHeaderReferer() { bitField0_ = (bitField0_ & ~0x00004000); headerReferer_ = getDefaultInstance().getHeaderReferer(); onChanged(); return this; } /** * <code>optional string header_referer = 15;</code> */ public Builder setHeaderRefererBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00004000; headerReferer_ = value; onChanged(); return this; } private java.lang.Object headerUserAgent_ = ""; /** * <code>optional string header_user_agent = 16;</code> */ public boolean hasHeaderUserAgent() { return ((bitField0_ & 0x00008000) == 0x00008000); } /** * <code>optional string header_user_agent = 16;</code> */ public java.lang.String getHeaderUserAgent() { java.lang.Object ref = headerUserAgent_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { headerUserAgent_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string header_user_agent = 16;</code> */ public com.google.protobuf.ByteString getHeaderUserAgentBytes() { java.lang.Object ref = headerUserAgent_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); headerUserAgent_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string header_user_agent = 16;</code> */ public Builder setHeaderUserAgent( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00008000; headerUserAgent_ = value; onChanged(); return this; } /** * <code>optional string header_user_agent = 16;</code> */ public Builder clearHeaderUserAgent() { bitField0_ = (bitField0_ & ~0x00008000); headerUserAgent_ = getDefaultInstance().getHeaderUserAgent(); onChanged(); return this; } /** * <code>optional string header_user_agent = 16;</code> */ public Builder setHeaderUserAgentBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00008000; headerUserAgent_ = value; onChanged(); return this; } private java.lang.Object headerAccept_ = ""; /** * <code>optional string header_accept = 17;</code> */ public boolean hasHeaderAccept() { return ((bitField0_ & 0x00010000) == 0x00010000); } /** * <code>optional string header_accept = 17;</code> */ public java.lang.String getHeaderAccept() { java.lang.Object ref = headerAccept_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { headerAccept_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string header_accept = 17;</code> */ public com.google.protobuf.ByteString getHeaderAcceptBytes() { java.lang.Object ref = headerAccept_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); headerAccept_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string header_accept = 17;</code> */ public Builder setHeaderAccept( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00010000; headerAccept_ = value; onChanged(); return this; } /** * <code>optional string header_accept = 17;</code> */ public Builder clearHeaderAccept() { bitField0_ = (bitField0_ & ~0x00010000); headerAccept_ = getDefaultInstance().getHeaderAccept(); onChanged(); return this; } /** * <code>optional string header_accept = 17;</code> */ public Builder setHeaderAcceptBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00010000; headerAccept_ = value; onChanged(); return this; } private java.lang.Object headerAcceptLanguage_ = ""; /** * <code>optional string header_accept_language = 18;</code> */ public boolean hasHeaderAcceptLanguage() { return ((bitField0_ & 0x00020000) == 0x00020000); } /** * <code>optional string header_accept_language = 18;</code> */ public java.lang.String getHeaderAcceptLanguage() { java.lang.Object ref = headerAcceptLanguage_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { headerAcceptLanguage_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string header_accept_language = 18;</code> */ public com.google.protobuf.ByteString getHeaderAcceptLanguageBytes() { java.lang.Object ref = headerAcceptLanguage_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); headerAcceptLanguage_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string header_accept_language = 18;</code> */ public Builder setHeaderAcceptLanguage( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00020000; headerAcceptLanguage_ = value; onChanged(); return this; } /** * <code>optional string header_accept_language = 18;</code> */ public Builder clearHeaderAcceptLanguage() { bitField0_ = (bitField0_ & ~0x00020000); headerAcceptLanguage_ = getDefaultInstance().getHeaderAcceptLanguage(); onChanged(); return this; } /** * <code>optional string header_accept_language = 18;</code> */ public Builder setHeaderAcceptLanguageBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00020000; headerAcceptLanguage_ = value; onChanged(); return this; } private java.lang.Object file_ = ""; /** * <code>optional string file = 19;</code> */ public boolean hasFile() { return ((bitField0_ & 0x00040000) == 0x00040000); } /** * <code>optional string file = 19;</code> */ public java.lang.String getFile() { java.lang.Object ref = file_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { file_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string file = 19;</code> */ public com.google.protobuf.ByteString getFileBytes() { java.lang.Object ref = file_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); file_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string file = 19;</code> */ public Builder setFile( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00040000; file_ = value; onChanged(); return this; } /** * <code>optional string file = 19;</code> */ public Builder clearFile() { bitField0_ = (bitField0_ & ~0x00040000); file_ = getDefaultInstance().getFile(); onChanged(); return this; } /** * <code>optional string file = 19;</code> */ public Builder setFileBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00040000; file_ = value; onChanged(); return this; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:monitor.http.http_request) } // @@protoc_insertion_point(class_scope:monitor.http.http_request) private static final monitor.http.Monitorhttp.http_request DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new monitor.http.Monitorhttp.http_request(); } public static monitor.http.Monitorhttp.http_request getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser<http_request> PARSER = new com.google.protobuf.AbstractParser<http_request>() { public http_request parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new http_request(input, extensionRegistry); } }; public static com.google.protobuf.Parser<http_request> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<http_request> getParserForType() { return PARSER; } public monitor.http.Monitorhttp.http_request getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor internal_static_monitor_http_http_request_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_monitor_http_http_request_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\021monitorhttp.proto\022\014monitor.http\"\224\003\n\014ht" + "tp_request\022\021\n\ttimestamp\030\001 \001(\003\022\020\n\010hostnam" + "e\030\002 \001(\t\022\023\n\013server_name\030\003 \001(\t\022\021\n\tserver_i" + "p\030\004 \001(\t\022\020\n\010protocol\030\005 \001(\t\022\021\n\thttp_user\030\006" + " \001(\t\022\016\n\006method\030\007 \001(\t\022\020\n\010resource\030\010 \001(\t\022\r" + "\n\005query\030\t \001(\t\022\024\n\014full_request\030\n \001(\t\022\021\n\th" + "ttp_code\030\013 \001(\005\022\023\n\013conn_status\030\014 \001(\t\022\024\n\014c" + "ontent_size\030\r \001(\003\022\025\n\rtime_to_serve\030\016 \001(\t" + "\022\026\n\016header_referer\030\017 \001(\t\022\031\n\021header_user_" + "agent\030\020 \001(\t\022\025\n\rheader_accept\030\021 \001(\t\022\036\n\026he", "ader_accept_language\030\022 \001(\t\022\014\n\004file\030\023 \001(\t" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; return null; } }; com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); internal_static_monitor_http_http_request_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_monitor_http_http_request_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_monitor_http_http_request_descriptor, new java.lang.String[] { "Timestamp", "Hostname", "ServerName", "ServerIp", "Protocol", "HttpUser", "Method", "Resource", "Query", "FullRequest", "HttpCode", "ConnStatus", "ContentSize", "TimeToServe", "HeaderReferer", "HeaderUserAgent", "HeaderAccept", "HeaderAcceptLanguage", "File", }); } // @@protoc_insertion_point(outer_class_scope) }
31.691963
297
0.574048
6c854a097aaa5e957aeb137de6c10192d0670c22
1,880
package xyz.juanes.jviz.registry.routes; import org.json.simple.JSONObject; import xyz.juanes.jviz.registry.Config; import xyz.juanes.jviz.registry.firebase.FirebaseREST; import xyz.juanes.jviz.registry.firebase.FirebaseResponse; import xyz.juanes.jviz.registry.helpers.HttpOut; import xyz.juanes.jviz.registry.helpers.SplitUrl; import javax.servlet.ServletConfig; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class Download extends HttpServlet { //Init function public void init(ServletConfig conf){ Config.initFirebase(); } //Download public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { //Split the url String[] url = SplitUrl.split(request); //Check the length if(url.length != 2) { //Display the error HttpOut.error(response, 400, "Bad request"); return; } //Get the module info FirebaseResponse res = FirebaseREST.get("modules/" + url[0]); //Check for null or error if(res.isError() == true) { //Display the error HttpOut.error(response, 500, "Error connecting to the database"); return; } //Check for empty response if(res.isNull() == true) { //Display the error HttpOut.error(response, 404, "Module not found"); return; } //Try reading the information try { //Build the json object JSONObject obj = res.getBodyJSON(); //Build the download url String download = obj.get("repository") + Config.download.replace("{release}", url[1]); //Redirect response.sendRedirect(download); } catch(Exception e) { //Display error HttpOut.error(response, 500, "Error redirecting..."); return; } //Exit return; } }
25.405405
96
0.685106
fe56af795ade0f09444dbbc1ad698c7a392bfa4f
226
package com.monezhao.common.base; import org.springframework.web.bind.annotation.RestController; /** * @author [email protected] * @Date: 2020/5/23 9:58 * @Description: */ @RestController public class BaseController { }
16.142857
62
0.738938
0f03e11ce8f7fd7b693e8bea439c00fbe164e0d3
453
package com.stackroute.intelligentservice.repository; import com.stackroute.intelligentservice.domain.IntelligentService; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.stereotype.Repository; @Repository public interface IntelligentServiceRepository extends MongoRepository<IntelligentService,String> { public IntelligentService findByRole(String role); //repo method to find data by role }
25.166667
98
0.843267
c1607fd6be29751cab92c314c271726339b7cac5
2,491
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.executor.item; import org.apache.shardingsphere.elasticjob.executor.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.executor.fixture.executor.TypedFooJobExecutor; import org.apache.shardingsphere.elasticjob.executor.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.executor.fixture.job.FailedJob; import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.junit.Assert.assertThat; public final class JobItemExecutorFactoryTest { @Test(expected = JobConfigurationException.class) public void assertGetExecutorByClassFailureWithInvalidType() { JobItemExecutorFactory.getExecutor(FailedJob.class); } @Test public void assertGetExecutorByClassSuccessWithCurrentClass() { assertThat(JobItemExecutorFactory.getExecutor(FooJob.class), instanceOf(ClassedFooJobExecutor.class)); } @Test public void assertGetExecutorByClassSuccessWithSubClass() { assertThat(JobItemExecutorFactory.getExecutor(DetailedFooJob.class), instanceOf(ClassedFooJobExecutor.class)); } @Test(expected = JobConfigurationException.class) public void assertGetExecutorByTypeFailureWithInvalidType() { JobItemExecutorFactory.getExecutor("FAIL"); } @Test public void assertGetExecutorByTypeSuccess() { assertThat(JobItemExecutorFactory.getExecutor("FOO"), instanceOf(TypedFooJobExecutor.class)); } }
42.948276
118
0.78322
24f489fafe30faada20f1a91623fc7688df3625f
375
package ir.maktab.project.domain.dto; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @Getter @Setter @NoArgsConstructor @AllArgsConstructor public class UserOfCourseDTO { private String userName; private String firstName; private String lastName; private Long id; private RoleDTO role; }
18.75
37
0.784
4c7fb90767853102bc8116a0eaf22c16ff90345f
2,569
package cn.sexycode.myjpa.plus.injector.methods; import cn.sexycode.myjpa.plus.injector.AbstractMethod; import cn.sexycode.myjpa.plus.injector.MyTableInfoHelper; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.core.enums.SqlMethod; import com.baomidou.mybatisplus.core.metadata.TableInfo; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.sql.SqlScriptUtils; import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import org.apache.ibatis.executor.keygen.KeyGenerator; import org.apache.ibatis.executor.keygen.NoKeyGenerator; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.SqlSource; /** * <p> * 根据 ID 删除 * </p> * * @author hubin * @since 2018-04-06 */ @SuppressWarnings("all") public class Insert extends AbstractMethod { @Override public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) { KeyGenerator keyGenerator = new NoKeyGenerator(); SqlMethod sqlMethod = SqlMethod.INSERT_ONE; String columnScript = SqlScriptUtils.convertTrim(tableInfo.getAllInsertSqlColumn(false), LEFT_BRACKET, RIGHT_BRACKET, null, COMMA); String valuesScript = SqlScriptUtils.convertTrim(tableInfo.getAllInsertSqlProperty(false, null), LEFT_BRACKET, RIGHT_BRACKET, null, COMMA); String keyProperty = null; String keyColumn = null; // 表包含主键处理逻辑,如果不包含主键当普通字段处理 if (StringUtils.isNotEmpty(tableInfo.getKeyProperty())) { if (tableInfo.getIdType() == IdType.AUTO) { /** 自增主键 */ keyGenerator = new Jdbc3KeyGenerator(); keyProperty = tableInfo.getKeyProperty(); keyColumn = tableInfo.getKeyColumn(); } else { if (null != tableInfo.getKeySequence()) { keyGenerator = MyTableInfoHelper.genKeyGenerator(tableInfo, builderAssistant, sqlMethod.getMethod(), languageDriver); keyProperty = tableInfo.getKeyProperty(); keyColumn = tableInfo.getKeyColumn(); } } } String sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), columnScript, valuesScript); SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass); return this.addInsertMappedStatement(mapperClass, modelClass, sqlMethod.getMethod(), sqlSource, keyGenerator, keyProperty, keyColumn); } }
45.070175
142
0.705333
1ad5b7e04b9fb5d2a14927f5c88184f6fd668b98
231
/** * Event types */ public class Commands{ public static int PRESS_MOUSE = -1; public static int RELEASE_MOUSE = -2; public static int PRESS_KEY = -3; public static int RELEASE_KEY = -4; public static int MOVE_MOUSE = -5; }
23.1
38
0.705628
9a53610305229b57088cb23a151bf67397bd2eb2
1,843
package com.cmput301.penguindive; import junit.framework.TestCase; import org.junit.Assert; public class QuestionTest extends TestCase { public void testGetQuestion() { Question ques = new Question("Question", "ID","Title","123"); String result = ques.getQuestion(); Assert.assertEquals("Question",result); } public void testSetQuestion() { Question ques = new Question("Question", "ID","Title","1234"); ques.setQuestion("newQ"); Assert.assertEquals("newQ",ques.getQuestion()); } public void testGetQuestionId() { Question ques = new Question("Question", "ID","Title","1234"); String result = ques.getQuestionId(); Assert.assertEquals("ID",result); } public void testSetQuestionId() { Question ques = new Question("Question", "ID","Title","1234"); ques.setQuestionId("newId"); Assert.assertEquals("newId",ques.getQuestionId()); } public void testGetQuestionTitle() { Question ques = new Question("Question", "ID","Title","1234"); String result = ques.getQuestionTitle(); Assert.assertEquals("Title",result); } public void testSetQuestionTitle() { Question ques = new Question("Question", "ID","Title","1234"); ques.setQuestionTitle("newTitle"); Assert.assertEquals("newTitle",ques.getQuestionTitle()); } public void testGetQuestionUserId(){ Question ques = new Question("Question", "ID","Title","1234"); String result = ques.getQuestionUserId(); Assert.assertEquals("1234",result); } public void testSetQuestionUserId() { Question ques = new Question("Question", "ID","Title","1234"); ques.setQuestion_user_id("1234"); Assert.assertEquals("1234",ques.getQuestionUserId()); } }
32.910714
70
0.637005
c3be78655348b35d53b1de67d8d3c309e4534963
5,922
package com.api; import com.loopj.android.http.AsyncHttpResponseHandler; import com.loopj.android.http.RequestParams; /** * 活动系统API * * @author Jayin Ton * */ public class ActivityAPI { public ActivityAPI() { } /** * 根据给定的条件查找活动列表 String name should be appended! * * @param page * 第几页数 * @param activityId * 活动id * @param ownerid * 活动发起人id * @param groupid * 圈子id * @param name * 活动名称 * @param content * 内容 * @param statusid * 状态id * @param responseHandler * 处理器 * */ public void find(int page, int activityId, int ownerid, int groupid, int statusid, String name, String content, AsyncHttpResponseHandler responseHandler) { RequestParams params = new RequestParams(); if (activityId > 0) params.add("id", activityId + ""); if (ownerid > 0) params.add("ownerid", ownerid + ""); if (groupid > 0) params.add("groupid", groupid + ""); if (statusid > 0) params.add("statusid", statusid + ""); // 这里得注意了statusid的取值 if (name != null) params.add("name", name); if (content != null) params.add("content", content); RestClient.get("/api/activities/find", params, responseHandler); } /** * 获取活动列表 * * @param page * 第几页 * @param responseHandler * 处理器 */ public void getActivityList(int page, AsyncHttpResponseHandler responseHandler) { find(page, 0, 0, 0, -1, null, null, responseHandler); } /** * 加入一个活动 * * @param activityId * 活动id * @param responseHandler * 处理器 */ public void joinActivity(int activityId, AsyncHttpResponseHandler responseHandler) { RequestParams params = new RequestParams(); params.add("id", activityId + ""); RestClient.post("/api/activities/join", params, responseHandler); } /** * 发起人接受申请人 * * @param id * 这里是userlist(可以理解成报名列表的id)接口里面的那个id,不是userid <li>see * {@link#getUserList()} * @param activityid * 活动id * @param responseHandler * 处理器 */ public void accept(int id, int activityid, AsyncHttpResponseHandler responseHandler) { RequestParams params = new RequestParams(); params.add("id", id + ""); params.add("activityid", activityid + ""); RestClient.post("/api/activities/accept", params, responseHandler); } /** * 发起者更新活动资料 * * @param id * 活动id * @param maxnum * 最大人数 * @param duration * 持续时间,单位为分钟 * @param statusid * 活动状态 0接受报名、1截止报名、2活动结束、3活动取消] * @param money * 活动费用 * @param name * 活动名称 * @param content * 活动内容 * @param responseHandler * 处理器 */ public void update(int id, int maxnum, long duration, int statusid, long money, String name, String content, AsyncHttpResponseHandler responseHandler) { RequestParams params = new RequestParams(); params.add("id", id + ""); params.add("maxnum", maxnum + ""); params.add("duration", duration + ""); params.add("statusid", statusid + ""); params.add("money", money + ""); params.add("name", name); params.add("content", content); RestClient.post("/api/activities/update", params, responseHandler); } /** * 发起者终止活动 * * @param id * 活动id * @param responseHandler * 处理器 */ public void endActivity(int id, AsyncHttpResponseHandler responseHandler) { RequestParams params = new RequestParams(); params.add("id", id + ""); RestClient.post("/api/activities/end", params, responseHandler); } /** * 成员取消参加活动 * * @param id * 活动id * @param responseHandler * 处理器 */ public void cancelActivity(int id, AsyncHttpResponseHandler responseHandler) { RequestParams params = new RequestParams(); params.add("id", id + ""); RestClient.post("/api/activities/cancel", params, responseHandler); } /** * 更新活动图片 * * @param params * avatar-File * @param responseHandler * 处理器 */ public void updateAvatar(RequestParams params, AsyncHttpResponseHandler responseHandler) { RestClient.post("/api/activities/avatar/update", params, responseHandler); } /** * 群成员发起活动 * * @param groupid * 群id * @param maxnum * 活动最大人数 * @param starttime * 活动开始时间 * @param duration * 活动持续时间,单位为分钟 * @param statusid * 活动状态 0接受报名、1截止报名、2活动结束、3活动取消 * @param money * 花费 * @param name * 活动名称 * @param content * 活动描述 * @param site * 活动地点 * @param responseHandler * 处理器 */ public void creatAcivity(int groupid, int maxnum, long starttime, long duration, int statusid, long money, String name, String content, String site, AsyncHttpResponseHandler responseHandler) { RequestParams params = new RequestParams(); params.add("groupid", groupid + ""); params.add("maxnum", maxnum + ""); params.add("starttime", starttime + ""); params.add("duration", duration + ""); params.add("statusid", statusid + ""); params.add("money", money + ""); params.add("name", name); params.add("content", content); params.add("site", site); RestClient.post("/api/activities/create", params, responseHandler); } /** * 获取活动人员名单 * * @param id * 活动id * @param responseHandler * 处理器 */ public void getUserList(int id, AsyncHttpResponseHandler responseHandler) { RequestParams params = new RequestParams(); params.add("id", id + ""); RestClient.post("/api/activities/userslist", params, responseHandler); } }
25.2
80
0.580209
cc30cda5067bbe71c9370faa332567a362505253
586
/* FantastleX: A Maze/RPG Hybrid Game Copyright (C) 2008-2010 Eric Ahnell Any questions should be directed to the author via email at: [email protected] */ package com.puttysoftware.fantastlex.maze.objects; import com.puttysoftware.fantastlex.maze.abc.AbstractPort; import com.puttysoftware.fantastlex.resourcemanagers.ObjectImageConstants; public class WPort extends AbstractPort { // Constructors public WPort() { super(new WPlug(), 'W'); } @Override public int getBaseID() { return ObjectImageConstants.OBJECT_IMAGE_W_PORT; } }
26.636364
87
0.742321
9984c187ff208b89135830476af091dfb73e37ea
148
class Output { public static void main(String args[]) { Object obj=new Object(); System.out.println(obj.getClass()); } }
18.5
43
0.581081
5d45f5d952b3b10568761cb5a9436419a2a5f0e8
35,016
/* * This file was automatically generated by EvoSuite * Fri May 22 11:46:13 GMT 2020 */ package com.alibaba.fastjson.parser; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import com.alibaba.fastjson.parser.DefaultJSONParser; import com.alibaba.fastjson.parser.JSONReaderScanner; import com.alibaba.fastjson.parser.ParserConfig; import com.alibaba.fastjson.parser.SymbolTable; import java.io.PipedReader; import java.io.Reader; import java.io.StringReader; import java.math.BigDecimal; 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, useJEE = true) public class JSONReaderScanner_ESTest extends JSONReaderScanner_ESTest_scaffolding { @Test(timeout = 4000) public void test00() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 28, 28); assertEquals('\u0000', jSONReaderScanner0.getCurrent()); jSONReaderScanner0.nextToken(); assertEquals('\u001A', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test01() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("Z/K`:MJG.^"); jSONReaderScanner0.scanIdent(); // Undeclared exception! try { jSONReaderScanner0.decimalValue(); fail("Expecting exception: NumberFormatException"); } catch(NumberFormatException e) { // // no message in exception (getMessage() returned null) // verifyException("java.math.BigDecimal", e); } } @Test(timeout = 4000) public void test02() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("Ecdt"); // Undeclared exception! try { jSONReaderScanner0.sub_chars((-462), 16384); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test03() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("=xTR36vd5bX+ZV", 1175); jSONReaderScanner0.setToken(76); byte[] byteArray0 = jSONReaderScanner0.bytesValue(); assertEquals('=', jSONReaderScanner0.getCurrent()); assertEquals(0, byteArray0.length); } @Test(timeout = 4000) public void test04() throws Throwable { char[] charArray0 = new char[3]; charArray0[0] = 'D'; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 0); jSONReaderScanner0.scanFieldDate(charArray0); assertEquals((-2), jSONReaderScanner0.matchStat); } @Test(timeout = 4000) public void test05() throws Throwable { char[] charArray0 = new char[3]; charArray0[0] = '\"'; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 1, 1); jSONReaderScanner0.charAt(2120); // Undeclared exception! try { jSONReaderScanner0.scanIdent(); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test06() throws Throwable { char[] charArray0 = new char[3]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 1, 1); jSONReaderScanner0.charAt(2120); // Undeclared exception! try { jSONReaderScanner0.scanIdent(); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test07() throws Throwable { StringReader stringReader0 = new StringReader("{\"x\":\"hello\",\"y\":[],\"\":true,\"a\":[],\"\"\":{},\"xx\":null}"); JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(stringReader0, 0); jSONReaderScanner0.nextToken(); jSONReaderScanner0.scanDate('I'); assertEquals(12, jSONReaderScanner0.token()); } @Test(timeout = 4000) public void test08() throws Throwable { char[] charArray0 = new char[2]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 3, 3); jSONReaderScanner0.bp = 3; // Undeclared exception! try { jSONReaderScanner0.scanLong('H'); fail("Expecting exception: IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("java.io.CharArrayReader", e); } } @Test(timeout = 4000) public void test09() throws Throwable { StringReader stringReader0 = new StringReader("false"); JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(stringReader0, 0); char[] charArray0 = jSONReaderScanner0.sub_chars(1504, 0); assertEquals('f', jSONReaderScanner0.getCurrent()); assertEquals(0, charArray0.length); } @Test(timeout = 4000) public void test10() throws Throwable { StringReader stringReader0 = new StringReader("{\"x\":\"hello\",\"y\":[],\"\":true,\"a\":[],\"b\":{}}"); JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(stringReader0, 0); String string0 = jSONReaderScanner0.subString(0, 0); assertEquals('{', jSONReaderScanner0.getCurrent()); assertEquals("", string0); } @Test(timeout = 4000) public void test11() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("-99"); jSONReaderScanner0.scanIdent(); String string0 = jSONReaderScanner0.stringVal(); assertEquals("-99", string0); assertTrue(jSONReaderScanner0.isEOF()); } @Test(timeout = 4000) public void test12() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("Z/K`:MJG.^"); String string0 = jSONReaderScanner0.stringVal(); assertEquals('Z', jSONReaderScanner0.getCurrent()); assertEquals("", string0); } @Test(timeout = 4000) public void test13() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("=xTR36vd5bX+ZV", 1175); jSONReaderScanner0.scanIdent(); jSONReaderScanner0.nextToken(); jSONReaderScanner0.numberString(); assertEquals('Z', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test14() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("-99"); assertEquals('-', jSONReaderScanner0.getCurrent()); char char0 = jSONReaderScanner0.next(); assertEquals('9', char0); } @Test(timeout = 4000) public void test15() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("=xTR36vd5bX+ZV", 1175); assertEquals('=', jSONReaderScanner0.getCurrent()); char char0 = jSONReaderScanner0.next(); assertEquals('x', char0); } @Test(timeout = 4000) public void test16() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("\"a string\""); jSONReaderScanner0.nextToken(); boolean boolean0 = jSONReaderScanner0.isEOF(); assertEquals(4, jSONReaderScanner0.token()); assertTrue(boolean0); } @Test(timeout = 4000) public void test17() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("{\"x\":\"hello\",\"y\":7,\"z\":true,\"a\":[99],\"b\":{}}"); int int0 = jSONReaderScanner0.indexOf('r', 0); assertEquals('{', jSONReaderScanner0.getCurrent()); assertEquals(24, int0); } @Test(timeout = 4000) public void test18() throws Throwable { char[] charArray0 = new char[7]; charArray0[0] = '6'; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 28, 28); jSONReaderScanner0.nextToken(); BigDecimal bigDecimal0 = jSONReaderScanner0.decimalValue(); assertEquals((byte)6, bigDecimal0.byteValue()); } @Test(timeout = 4000) public void test19() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("-99"); assertEquals('-', jSONReaderScanner0.getCurrent()); jSONReaderScanner0.scanIdent(); jSONReaderScanner0.decimalValue(); assertEquals('\u001A', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test20() throws Throwable { char[] charArray0 = new char[7]; charArray0[0] = 'T'; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 10); char char0 = jSONReaderScanner0.charAt(0); assertEquals('T', char0); assertEquals('T', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test21() throws Throwable { char[] charArray0 = new char[0]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("not match "); boolean boolean0 = jSONReaderScanner0.charArrayCompare(charArray0); assertEquals('n', jSONReaderScanner0.getCurrent()); assertTrue(boolean0); } @Test(timeout = 4000) public void test22() throws Throwable { StringReader stringReader0 = new StringReader("{\"x\":\"hello\",\"y\":7,\"a\":[],\"b\":{},\"\":{}}"); JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(stringReader0, 20); char[] charArray0 = new char[9]; boolean boolean0 = jSONReaderScanner0.charArrayCompare(charArray0); assertFalse(boolean0); assertEquals('{', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test23() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("-99"); jSONReaderScanner0.scanIdent(); byte[] byteArray0 = jSONReaderScanner0.bytesValue(); assertEquals('\u001A', jSONReaderScanner0.getCurrent()); assertEquals(1, byteArray0.length); } @Test(timeout = 4000) public void test24() throws Throwable { char[] charArray0 = new char[3]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 66, (-1)); DefaultJSONParser defaultJSONParser0 = new DefaultJSONParser(""); jSONReaderScanner0.addSymbol(66, 66, 66, defaultJSONParser0.symbolTable); } @Test(timeout = 4000) public void test25() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("-99"); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.sub_chars(483, 90); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { } } @Test(timeout = 4000) public void test26() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("", 4); // Undeclared exception! try { jSONReaderScanner0.sub_chars(4, 82944); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test27() throws Throwable { StringReader stringReader0 = new StringReader("{\"y\":true,\"writeFieldValueStringWithDoubleQuote\":true,\"a\":[],\"b\":{}}"); JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(stringReader0, 3989); // Undeclared exception! try { jSONReaderScanner0.subString((-214748364), 2523); fail("Expecting exception: StringIndexOutOfBoundsException"); } catch(StringIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test28() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("\"a string\"", 1268); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.subString(1268, 1268); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test29() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("{\"x\":\"hello\",\"y\":7,\"z\":true,\"a\":[[]],\"b\":{}}", 2749); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.numberString(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test30() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("false"); // Undeclared exception! try { jSONReaderScanner0.numberString(); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // -1 // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test31() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("{\"\":[]}"); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.isEOF(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test32() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("0p9"); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.isBlankInput(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test33() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 70, 70); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.indexOf('g', 66); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test34() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("false"); // Undeclared exception! try { jSONReaderScanner0.indexOf(',', (-227)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // -227 // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test35() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("{}"); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.decimalValue(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test36() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("\"a string\""); char[] charArray0 = new char[1]; // Undeclared exception! try { jSONReaderScanner0.copyTo(501, 501, charArray0); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test37() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 14); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.close(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONLexerBase", e); } } @Test(timeout = 4000) public void test38() throws Throwable { char[] charArray0 = new char[2]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 16378, 70); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.charAt(70); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test39() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("false"); // Undeclared exception! try { jSONReaderScanner0.charArrayCompare((char[]) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test40() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("\"a sstring\""); jSONReaderScanner0.scanIdent(); jSONReaderScanner0.scanIdent(); jSONReaderScanner0.scanIdent(); jSONReaderScanner0.scanIdent(); // Undeclared exception! try { jSONReaderScanner0.bytesValue(); fail("Expecting exception: NegativeArraySizeException"); } catch(NegativeArraySizeException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.util.IOUtils", e); } } @Test(timeout = 4000) public void test41() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("{\"\":[],\"\":[]}"); char[] charArray0 = new char[3]; // Undeclared exception! try { jSONReaderScanner0.arrayCopy((-416), charArray0, 35, 2349); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test42() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("hy/c0=?E"); DefaultJSONParser defaultJSONParser0 = new DefaultJSONParser("hy/c0=?E"); // Undeclared exception! try { jSONReaderScanner0.addSymbol((-3316), 1581, 136, defaultJSONParser0.symbolTable); fail("Expecting exception: StringIndexOutOfBoundsException"); } catch(StringIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test43() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("-99"); // Undeclared exception! try { jSONReaderScanner0.addSymbol(1010, 2438, 1010, (SymbolTable) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test44() throws Throwable { JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner((char[]) null, 2, 0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("java.io.CharArrayReader", e); } } @Test(timeout = 4000) public void test45() throws Throwable { char[] charArray0 = new char[0]; JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner(charArray0, (-1), 212); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // no message in exception (getMessage() returned null) // verifyException("java.io.CharArrayReader", e); } } @Test(timeout = 4000) public void test46() throws Throwable { JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner((char[]) null, (-23)); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("java.io.CharArrayReader", e); } } @Test(timeout = 4000) public void test47() throws Throwable { char[] charArray0 = new char[0]; JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner(charArray0, (-1)); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // no message in exception (getMessage() returned null) // verifyException("java.io.CharArrayReader", e); } } @Test(timeout = 4000) public void test48() throws Throwable { JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner((String) null, 0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("java.io.StringReader", e); } } @Test(timeout = 4000) public void test49() throws Throwable { JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner((String) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("java.io.StringReader", e); } } @Test(timeout = 4000) public void test50() throws Throwable { PipedReader pipedReader0 = new PipedReader(65279); JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner(pipedReader0, 65279); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // Pipe not connected // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test51() throws Throwable { JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner((Reader) null, 126); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test52() throws Throwable { JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner((Reader) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test53() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("{\"\":null,\"illegal state, textLength is zero\":99}"); jSONReaderScanner0.scanIdent(); char char0 = jSONReaderScanner0.charAt(2935); assertEquals('\"', jSONReaderScanner0.getCurrent()); assertTrue(jSONReaderScanner0.isEOF()); assertEquals('\u001A', char0); } @Test(timeout = 4000) public void test54() throws Throwable { char[] charArray0 = new char[3]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 0, 0); // Undeclared exception! try { jSONReaderScanner0.integerValue(); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // -1 // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test55() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("gH.7H`PE>RcNV7 I19"); // Undeclared exception! try { jSONReaderScanner0.charAt((-2525)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // -2525 // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test56() throws Throwable { StringReader stringReader0 = new StringReader("\"a string\""); JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(stringReader0); assertEquals('\"', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test57() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("\"a string\""); jSONReaderScanner0.scanIdent(); jSONReaderScanner0.indexOf('\"', 12); boolean boolean0 = jSONReaderScanner0.isBlankInput(); assertEquals(' ', jSONReaderScanner0.getCurrent()); assertFalse(boolean0); } @Test(timeout = 4000) public void test58() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 68, 68); boolean boolean0 = jSONReaderScanner0.isBlankInput(); assertFalse(boolean0); assertFalse(jSONReaderScanner0.isEOF()); } @Test(timeout = 4000) public void test59() throws Throwable { char[] charArray0 = new char[4]; charArray0[0] = '\u001A'; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 26, (-672)); boolean boolean0 = jSONReaderScanner0.isEOF(); assertFalse(boolean0); assertEquals('\u001A', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test60() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("z"); boolean boolean0 = jSONReaderScanner0.isEOF(); assertEquals('', jSONReaderScanner0.getCurrent()); assertFalse(boolean0); } @Test(timeout = 4000) public void test61() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 68, 68); jSONReaderScanner0.close(); // Undeclared exception! try { jSONReaderScanner0.next(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test62() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 68, 68); jSONReaderScanner0.scanFieldIntArray(charArray0); jSONReaderScanner0.scanFieldUUID(charArray0); jSONReaderScanner0.close(); assertEquals((-1), jSONReaderScanner0.matchStat); } @Test(timeout = 4000) public void test63() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("\"a string\""); jSONReaderScanner0.scanIdent(); jSONReaderScanner0.numberString(); assertEquals(' ', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test64() throws Throwable { StringReader stringReader0 = new StringReader("false"); JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(stringReader0, 0); char[] charArray0 = jSONReaderScanner0.sub_chars(0, 199); assertEquals('f', jSONReaderScanner0.getCurrent()); assertEquals(16384, charArray0.length); } @Test(timeout = 4000) public void test65() throws Throwable { char[] charArray0 = new char[3]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 3495); // Undeclared exception! try { jSONReaderScanner0.sub_chars((-1341), (-4123)); fail("Expecting exception: StringIndexOutOfBoundsException"); } catch(StringIndexOutOfBoundsException e) { // // String index out of range: -4123 // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test66() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("hastr4|\""); // Undeclared exception! try { jSONReaderScanner0.subString((-715), (-3296)); fail("Expecting exception: StringIndexOutOfBoundsException"); } catch(StringIndexOutOfBoundsException e) { // // String index out of range: -3296 // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test67() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 70, 70); String string0 = jSONReaderScanner0.subString(66, 66); assertFalse(jSONReaderScanner0.isEOF()); assertEquals("\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000", string0); } @Test(timeout = 4000) public void test68() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("false"); jSONReaderScanner0.indexOf(',', 1068); assertEquals('f', jSONReaderScanner0.getCurrent()); assertTrue(jSONReaderScanner0.isEOF()); } @Test(timeout = 4000) public void test69() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("\"a string\""); int int0 = jSONReaderScanner0.indexOf('\"', 0); assertEquals('\"', jSONReaderScanner0.getCurrent()); assertEquals(0, int0); } @Test(timeout = 4000) public void test70() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, '6'); boolean boolean0 = jSONReaderScanner0.matchField(charArray0); assertEquals(20, jSONReaderScanner0.token()); assertTrue(boolean0); } @Test(timeout = 4000) public void test71() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("\"a string\""); jSONReaderScanner0.scanIdent(); assertEquals(' ', jSONReaderScanner0.getCurrent()); jSONReaderScanner0.scanIdent(); jSONReaderScanner0.next(); char char0 = jSONReaderScanner0.charAt(1323); assertEquals('\u001A', char0); } @Test(timeout = 4000) public void test72() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("z"); // Undeclared exception! try { jSONReaderScanner0.decimalValue(); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // -1 // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test73() throws Throwable { PipedReader pipedReader0 = new PipedReader(); JSONReaderScanner jSONReaderScanner0 = null; try { jSONReaderScanner0 = new JSONReaderScanner(pipedReader0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { // // Pipe not connected // verifyException("com.alibaba.fastjson.parser.JSONReaderScanner", e); } } @Test(timeout = 4000) public void test74() throws Throwable { char[] charArray0 = new char[7]; JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner(charArray0, 0); ParserConfig parserConfig0 = ParserConfig.global; String string0 = jSONReaderScanner0.addSymbol(0, 0, 0, parserConfig0.symbolTable); assertEquals("", string0); assertEquals('\u0000', jSONReaderScanner0.getCurrent()); } @Test(timeout = 4000) public void test75() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("z"); char[] charArray0 = new char[9]; jSONReaderScanner0.arrayCopy(1, charArray0, 1, 1); assertEquals('', jSONReaderScanner0.getCurrent()); assertArrayEquals(new char[] {'\u0000', 'z', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); } @Test(timeout = 4000) public void test76() throws Throwable { JSONReaderScanner jSONReaderScanner0 = new JSONReaderScanner("-99"); char[] charArray0 = new char[1]; jSONReaderScanner0.copyTo(0, 0, charArray0); assertArrayEquals(new char[] {'\u0000'}, charArray0); assertEquals('-', jSONReaderScanner0.getCurrent()); } }
35.334006
428
0.655872
8306bffe1eaeee9912f8cec95bdd3d2ea24ebf12
793
package com.feilong.namespace; import static org.junit.Assert.assertTrue; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; import com.feilong.net.bot.wxwork.WxworkBot; @ContextConfiguration(locations = { "classpath*:wxbot.xml" }) public class WxworkBotTagTest extends AbstractJUnit4SpringContextTests{ @Autowired @Qualifier("wxworkBot") private WxworkBot wxworkBot; //--------------------------------------------------------------- @Test public void test(){ assertTrue(wxworkBot.sendMessage("lalalal")); } }
30.5
80
0.723834
daef28f95875ecbe00d4ef9df667ab74a7435f30
1,421
/******************************************************************************* * Copyright 2018 Tremolo Security, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ // Copyright 2014 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd package com.google.u2f.server.data; public class SignSessionData extends EnrollSessionData { private static final long serialVersionUID = -1374014642398686120L; private final byte[] publicKey; public SignSessionData(String accountName, String appId, byte[] challenge, byte[] publicKey) { super(accountName, appId, challenge); this.publicKey = publicKey; } public byte[] getPublicKey() { return publicKey; } }
37.394737
96
0.660099
61dba50471f57ce1772d2a743733941be8822de5
3,850
package com.waterphobiadr.ui.feature.doctorlist; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.ActionBar; import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.view.MenuItem; import android.view.View; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.waterphobiadr.App; import com.waterphobiadr.R; import com.waterphobiadr.data.Repository; import com.waterphobiadr.data.model.Patient; import com.waterphobiadr.databinding.ActivityDoctorListBinding; import com.waterphobiadr.ui.base.BaseActivity; import com.waterphobiadr.ui.feature.doctorlist.adapter.DoctorAdapter; import java.util.ArrayList; import javax.inject.Inject; /* * Created by shayan.rais on 20/12/2017. */ public class DoctorListActivity extends BaseActivity implements DoctorListContract.View { //5 lines ActivityDoctorListBinding binding; @Inject Repository repository; DoctorListPresenter presenter; private DoctorAdapter adapter; private DatabaseReference mFirebaseDatabase; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = DataBindingUtil.setContentView(this, R.layout.activity_doctor_list); mFirebaseDatabase = FirebaseDatabase.getInstance().getReference(); App.getInstance().getComponent().injectDoctorListActivity(this); presenter = new DoctorListPresenter(this, repository); presenter.setupIntent(getIntent()); } //______________________________________________________________________________________________ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); break; } return super.onOptionsItemSelected(item); } //______________________________________________________________________________________________ CREATE @Override public void setupToolbar() { setSupportActionBar(binding.toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) actionBar.setDisplayHomeAsUpEnabled(true); } final ArrayList<Patient> data = new ArrayList(); @Override public void setupLayout() { DatabaseReference usersRef = mFirebaseDatabase.child("users"); usersRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for (DataSnapshot user : dataSnapshot.getChildren()) { data.add(user.getValue(Patient.class)); binding.recycler.setVisibility(View.VISIBLE); binding.layoutLoader.loading.setVisibility(View.GONE); adapter.notifyDataSetChanged(); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } } ); adapter = new DoctorAdapter(this, data); LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); binding.recycler.setAdapter(adapter); binding.recycler.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL)); binding.recycler.setLayoutManager(layoutManager); } @Override public void setupClickListeners() { } }
37.745098
111
0.717403
91d14468e429ec69d9d033b1800fc80af0aa7bc5
1,026
package org.rtest.framework.client.dynamicreload; import org.rtest.api.annotations.AllowedDataFetchPath; import java.util.Arrays; import java.util.Collections; import java.util.List; /** * By default checks whether the custom path has been specified by annotation and if not, just allows to bring everything in the package * Otherwise allows to bring exactly what has been specified at the level of packages or classes * Created by Mark Bramnik on 22/11/2016. */ public class DefaultRemoteResourcesListResolver implements RemoteResourcesListResolver { @Override public List<String> getResourcesList(Class<?> testClass) { if(testClass.isAnnotationPresent(AllowedDataFetchPath.class)) { AllowedDataFetchPath customPaths = testClass.getAnnotation(AllowedDataFetchPath.class); String [] values = customPaths.value(); return Arrays.asList(values); } else { return Collections.singletonList(testClass.getPackage().getName()); } } }
36.642857
136
0.733918
4cd84ccb360f848effdf20ebf9011078d3ea80fd
7,237
/* * ConnectBot: simple, powerful, open-source SSH client for Android * Copyright 2010 Kenny Root, Jeffrey Sharkey * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.connectbot.service; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import org.connectbot.ConsoleActivity; import org.connectbot.HostListActivity; import org.connectbot.R; import org.connectbot.bean.HostBean; import org.connectbot.util.HostDatabase; import org.connectbot.util.PreferenceConstants; import android.annotation.TargetApi; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.graphics.Color; import android.os.Build; import androidx.core.app.NotificationCompat; /** * @author Kenny Root * * Based on the concept from jasta's blog post. */ public abstract class ConnectionNotifier { private static final int ONLINE_NOTIFICATION = 1; private static final int ACTIVITY_NOTIFICATION = 2; private static final int ONLINE_DISCONNECT_NOTIFICATION = 3; private String id = "my_connectbot_channel"; NotificationChannel nc; public static ConnectionNotifier getInstance() { if (PreferenceConstants.PRE_ECLAIR) return PreEclair.Holder.sInstance; else return EclairAndBeyond.Holder.sInstance; } protected NotificationManager getNotificationManager(Context context) { return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); } protected NotificationCompat.Builder newNotificationBuilder(Context context, String id) { NotificationCompat.Builder builder = new NotificationCompat.Builder(context, id) .setSmallIcon(R.drawable.notification_icon) .setWhen(System.currentTimeMillis()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { createNotificationChannel(context, id); } return builder; } @TargetApi(Build.VERSION_CODES.O) private void createNotificationChannel(Context context, String id) { nc = new NotificationChannel(id, context.getString(R.string.app_name), NotificationManager.IMPORTANCE_DEFAULT); getNotificationManager(context).createNotificationChannel(nc); } protected Notification newActivityNotification(Context context, HostBean host) { NotificationCompat.Builder builder = newNotificationBuilder(context, id); Resources res = context.getResources(); String contentText = res.getString( R.string.notification_text, host.getNickname()); Intent notificationIntent = new Intent(context, ConsoleActivity.class); notificationIntent.setAction("android.intent.action.VIEW"); notificationIntent.setData(host.getUri()); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0); builder.setContentTitle(res.getString(R.string.app_name)) .setContentText(contentText) .setContentIntent(contentIntent); builder.setAutoCancel(true); int ledOnMS = 300; int ledOffMS = 1000; builder.setDefaults(Notification.DEFAULT_LIGHTS); if (HostDatabase.COLOR_RED.equals(host.getColor())) builder.setLights(Color.RED, ledOnMS, ledOffMS); else if (HostDatabase.COLOR_GREEN.equals(host.getColor())) builder.setLights(Color.GREEN, ledOnMS, ledOffMS); else if (HostDatabase.COLOR_BLUE.equals(host.getColor())) builder.setLights(Color.BLUE, ledOnMS, ledOffMS); else builder.setLights(Color.WHITE, ledOnMS, ledOffMS); return builder.build(); } protected Notification newRunningNotification(Context context) { NotificationCompat.Builder builder = newNotificationBuilder(context, id); builder.setOngoing(true); builder.setWhen(0); builder.setContentIntent(PendingIntent.getActivity(context, ONLINE_NOTIFICATION, new Intent(context, ConsoleActivity.class), 0)); Resources res = context.getResources(); builder.setContentTitle(res.getString(R.string.app_name)); builder.setContentText(res.getString(R.string.app_is_running)); Intent disconnectIntent = new Intent(context, HostListActivity.class); disconnectIntent.setAction(HostListActivity.DISCONNECT_ACTION); builder.addAction( android.R.drawable.ic_menu_close_clear_cancel, res.getString(R.string.list_host_disconnect), PendingIntent.getActivity( context, ONLINE_DISCONNECT_NOTIFICATION, disconnectIntent, 0)); return builder.build(); } public void showActivityNotification(Service context, HostBean host) { getNotificationManager(context).notify(ACTIVITY_NOTIFICATION, newActivityNotification(context, host)); } public void hideActivityNotification(Service context) { getNotificationManager(context).cancel(ACTIVITY_NOTIFICATION); } public abstract void showRunningNotification(Service context); public abstract void hideRunningNotification(Service context); private static class PreEclair extends ConnectionNotifier { private static final Class<?>[] setForegroundSignature = new Class[] {boolean.class}; private Method setForeground = null; private static class Holder { private static final PreEclair sInstance = new PreEclair(); } public PreEclair() { try { setForeground = Service.class.getMethod("setForeground", setForegroundSignature); } catch (Exception e) { } } @Override public void showRunningNotification(Service context) { if (setForeground != null) { Object[] setForegroundArgs = new Object[1]; setForegroundArgs[0] = Boolean.TRUE; try { setForeground.invoke(context, setForegroundArgs); } catch (InvocationTargetException e) { } catch (IllegalAccessException e) { } getNotificationManager(context).notify(ONLINE_NOTIFICATION, newRunningNotification(context)); } } @Override public void hideRunningNotification(Service context) { if (setForeground != null) { Object[] setForegroundArgs = new Object[1]; setForegroundArgs[0] = Boolean.FALSE; try { setForeground.invoke(context, setForegroundArgs); } catch (InvocationTargetException e) { } catch (IllegalAccessException e) { } getNotificationManager(context).cancel(ONLINE_NOTIFICATION); } } } @TargetApi(5) private static class EclairAndBeyond extends ConnectionNotifier { private static class Holder { private static final EclairAndBeyond sInstance = new EclairAndBeyond(); } @Override public void showRunningNotification(Service context) { context.startForeground(ONLINE_NOTIFICATION, newRunningNotification(context)); } @Override public void hideRunningNotification(Service context) { context.stopForeground(true); } } }
32.452915
104
0.77311
515a0ac6d6620224797a83edbc26814cbf24e78a
2,863
begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1 begin_comment comment|/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ end_comment begin_package DECL|package|org.apache.camel.component.dataset package|package name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|dataset package|; end_package begin_comment comment|/** * A simple DataSet that allows a static payload to be used to create each message exchange * along with using a pluggable transformer to randomize the message. */ end_comment begin_class DECL|class|SimpleDataSet specifier|public class|class name|SimpleDataSet extends|extends name|DataSetSupport block|{ DECL|field|defaultBody specifier|private name|Object name|defaultBody init|= literal|"<hello>world!</hello>" decl_stmt|; DECL|method|SimpleDataSet () specifier|public name|SimpleDataSet parameter_list|() block|{ } DECL|method|SimpleDataSet (int size) specifier|public name|SimpleDataSet parameter_list|( name|int name|size parameter_list|) block|{ name|super argument_list|( name|size argument_list|) expr_stmt|; block|} comment|// Properties comment|//------------------------------------------------------------------------- DECL|method|getDefaultBody () specifier|public name|Object name|getDefaultBody parameter_list|() block|{ return|return name|defaultBody return|; block|} DECL|method|setDefaultBody (Object defaultBody) specifier|public name|void name|setDefaultBody parameter_list|( name|Object name|defaultBody parameter_list|) block|{ name|this operator|. name|defaultBody operator|= name|defaultBody expr_stmt|; block|} comment|// Implementation methods comment|//------------------------------------------------------------------------- comment|/** * Creates the message body for a given message */ annotation|@ name|Override DECL|method|createMessageBody (long messageIndex) specifier|protected name|Object name|createMessageBody parameter_list|( name|long name|messageIndex parameter_list|) block|{ return|return name|getDefaultBody argument_list|() return|; block|} block|} end_class end_unit
25.792793
810
0.749563
83683ecc26e602b9508507acc48df4096e376ac4
3,539
package com.twitter.elephantbird.mapred.input; import com.twitter.elephantbird.mapreduce.input.MultiInputFormat; import com.twitter.elephantbird.mapreduce.io.BinaryWritable; import com.twitter.elephantbird.util.TypeRef; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.ql.exec.Utilities; import org.apache.hadoop.hive.ql.plan.PartitionDesc; import org.apache.hadoop.hive.serde.Constants; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.mapred.FileSplit; import org.apache.hadoop.mapred.InputSplit; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.RecordReader; import org.apache.hadoop.mapred.Reporter; import org.apache.hcatalog.common.HCatConstants; import org.apache.hcatalog.common.HCatUtil; import org.apache.hcatalog.mapreduce.InputJobInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.Map; import java.util.Properties; /** * Hive-specific wrapper around {@link MultiInputFormat}. This is necessary to set the * {@link TypeRef} because Hive does not support InputFormat constructor arguments. * This pairs well with {@link com.twitter.elephantbird.hive.serde.ThriftSerDe}. */ @SuppressWarnings("deprecation") public class HiveMultiInputFormat extends DeprecatedFileInputFormatWrapper<LongWritable, BinaryWritable> { private static final Logger LOG = LoggerFactory.getLogger(HiveMultiInputFormat.class); public HiveMultiInputFormat() { super(new MultiInputFormat()); } private void initialize(FileSplit split, JobConf job) throws IOException { LOG.info("Initializing HiveMultiInputFormat for " + split + " with job " + job); String thriftClassName = null; Properties properties = null; if (!"".equals(HiveConf.getVar(job, HiveConf.ConfVars.PLAN))) { // Running as a Hive query. Use MapredWork for metadata. Map<String, PartitionDesc> partitionDescMap = Utilities.getMapRedWork(job).getPathToPartitionInfo(); if (!partitionDescMap.containsKey(split.getPath().getParent().toUri().toString())) { throw new RuntimeException("Failed locating partition description for " + split.getPath().toUri().toString()); } properties = partitionDescMap.get(split.getPath().getParent().toUri().toString()) .getTableDesc().getProperties(); } else if (job.get(HCatConstants.HCAT_KEY_JOB_INFO, null) != null) { // Running as an HCatalog query. Use InputJobInfo for metadata. InputJobInfo inputJobInfo = (InputJobInfo) HCatUtil.deserialize( job.get(HCatConstants.HCAT_KEY_JOB_INFO)); properties = inputJobInfo.getTableInfo().getStorerInfo().getProperties(); } if (properties != null) { thriftClassName = properties.getProperty(Constants.SERIALIZATION_CLASS); } if (thriftClassName == null) { throw new RuntimeException( "Required property " + Constants.SERIALIZATION_CLASS + " is null."); } try { Class thriftClass = job.getClassByName(thriftClassName); setInputFormatInstance( new MultiInputFormat(new TypeRef(thriftClass) {})); } catch (ClassNotFoundException e) { throw new RuntimeException("Failed getting class for " + thriftClassName); } } @Override public RecordReader<LongWritable, BinaryWritable> getRecordReader(InputSplit split, JobConf job, Reporter reporter) throws IOException { initialize((FileSplit) split, job); return super.getRecordReader(split, job, reporter); } }
39.764045
98
0.747104
9ead1ba2485ff8e03f302cc03fd0b99c9144e5e8
1,984
package com.tazine.evo.webflux.error; import org.springframework.boot.autoconfigure.web.ResourceProperties; import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler; import org.springframework.boot.web.reactive.error.ErrorAttributes; import org.springframework.context.ApplicationContext; import org.springframework.core.annotation.Order; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.codec.HttpMessageWriter; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.server.*; import reactor.core.publisher.Mono; import java.util.List; import java.util.Map; /** * @author jiaer.ly * @date 2020/04/23 */ //@Order(-2) //@Component public class GlobalErrorWebExceptionHandler extends AbstractErrorWebExceptionHandler { public GlobalErrorWebExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties, ApplicationContext applicationContext) { super(errorAttributes, resourceProperties, applicationContext); } @Override public void setMessageWriters(List<HttpMessageWriter<?>> messageWriters) { super.setMessageWriters(messageWriters); } @Override protected RouterFunction<ServerResponse> getRoutingFunction(final ErrorAttributes errorAttributes) { return RouterFunctions.route(RequestPredicates.all(), this::renderErrorResponse); } private Mono<ServerResponse> renderErrorResponse(final ServerRequest request) { final Map<String, Object> errorPropertiesMap = getErrorAttributes(request, true); return ServerResponse.status(HttpStatus.OK) .contentType(MediaType.APPLICATION_JSON_UTF8) .body(BodyInserters.fromObject(errorPropertiesMap)); } }
38.153846
104
0.765121
589d1c54284d3e09b0c35a9517fabb952af6b3bd
180
package com.genesis.utils.time; /** * @author: KG * @description: * @date: Created in 下午9:47 2019/1/25 * @modified by: */ public enum IntervalLanguage { ENG, CHN }
12
37
0.622222
14ba83f599bb7110deec6900ad7f83e5301acab9
587,285
/** * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package alluxio.thrift; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-04-26") public class FileSystemMasterClientService { /** * This interface contains file system master service endpoints for Alluxio clients. */ public interface Iface extends alluxio.thrift.AlluxioService.Iface { /** * Marks a file as completed. * * @param path the path of the file * * @param options the method options */ public void completeFile(String path, CompleteFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Creates a directory. * * @param path the path of the directory * * @param options the method options */ public void createDirectory(String path, CreateDirectoryTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException; /** * Creates a file. * * @param path the path of the file * * @param options the options for creating the file */ public void createFile(String path, CreateFileTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException; /** * Frees the given file or directory from Alluxio. * * @param path the path of the file or directory * * @param recursive whether to free recursively */ public void free(String path, boolean recursive) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Returns the list of file blocks information for the given file. * * THIS METHOD IS DEPRECATED SINCE VERSION 1.1 AND WILL BE REMOVED IN VERSION 2.0. * * @param path the path of the file */ public List<FileBlockInfo> getFileBlockInfoList(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Returns the status of the file or directory. * * @param path the path of the file or directory */ public FileInfo getStatus(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Returns the status of the file or directory, only used internally by servers. * * @param fileId the id of the file or directory */ public FileInfo getStatusInternal(long fileId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Generates a new block id for the given file. * * @param path the path of the file */ public long getNewBlockIdForFile(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Returns the UFS address of the root mount point. * * THIS METHOD IS DEPRECATED SINCE VERSION 1.1 AND WILL BE REMOVED IN VERSION 2.0. */ public String getUfsAddress() throws org.apache.thrift.TException; /** * If the path points to a file, the method returns a singleton with its file information. * If the path points to a directory, the method returns a list with file information for the * directory contents. * * @param path the path of the file or directory */ public List<FileInfo> listStatus(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Loads metadata for the object identified by the given Alluxio path from UFS into Alluxio. * * @param ufsPath the path of the under file system * * @param recursive whether to load meta data recursively */ public long loadMetadata(String ufsPath, boolean recursive) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException; /** * Creates a new "mount point", mounts the given UFS path in the Alluxio namespace at the given * path. The path should not exist and should not be nested under any existing mount point. * * @param alluxioPath the path of alluxio mount point * * @param ufsPath the path of the under file system * * @param options the options for creating the mount point */ public void mount(String alluxioPath, String ufsPath, MountTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException; /** * Deletes a file or a directory and returns whether the remove operation succeeded. * NOTE: Unfortunately, the method cannot be called "delete" as that is a reserved Thrift keyword. * * @param path the path of the file or directory * * @param recursive whether to remove recursively */ public void remove(String path, boolean recursive) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Renames a file or a directory. * * @param path the path of the file or directory * * @param dstPath the desinationpath of the file */ public void rename(String path, String dstPath) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException; /** * Sets file or directory attributes. * * @param path the path of the file or directory * * @param options the method options */ public void setAttribute(String path, SetAttributeTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Schedules async persistence. * * @param path the path of the file */ public void scheduleAsyncPersist(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException; /** * Deletes an existing "mount point", voiding the Alluxio namespace at the given path. The path * should correspond to an existing mount point. Any files in its subtree that are backed by UFS * will be persisted before they are removed from the Alluxio namespace. * * @param alluxioPath the path of the alluxio mount point */ public void unmount(String alluxioPath) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException; } public interface AsyncIface extends alluxio.thrift.AlluxioService .AsyncIface { public void completeFile(String path, CompleteFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void createDirectory(String path, CreateDirectoryTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void createFile(String path, CreateFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void free(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getFileBlockInfoList(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getStatusInternal(long fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getNewBlockIdForFile(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getUfsAddress(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void listStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void loadMetadata(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void mount(String alluxioPath, String ufsPath, MountTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void remove(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void rename(String path, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void setAttribute(String path, SetAttributeTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void scheduleAsyncPersist(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void unmount(String alluxioPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } public static class Client extends alluxio.thrift.AlluxioService.Client implements Iface { public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> { public Factory() {} public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(org.apache.thrift.protocol.TProtocol prot) { super(prot, prot); } public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { super(iprot, oprot); } public void completeFile(String path, CompleteFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_completeFile(path, options); recv_completeFile(); } public void send_completeFile(String path, CompleteFileTOptions options) throws org.apache.thrift.TException { completeFile_args args = new completeFile_args(); args.setPath(path); args.setOptions(options); sendBase("completeFile", args); } public void recv_completeFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { completeFile_result result = new completeFile_result(); receiveBase(result, "completeFile"); if (result.e != null) { throw result.e; } return; } public void createDirectory(String path, CreateDirectoryTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { send_createDirectory(path, options); recv_createDirectory(); } public void send_createDirectory(String path, CreateDirectoryTOptions options) throws org.apache.thrift.TException { createDirectory_args args = new createDirectory_args(); args.setPath(path); args.setOptions(options); sendBase("createDirectory", args); } public void recv_createDirectory() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { createDirectory_result result = new createDirectory_result(); receiveBase(result, "createDirectory"); if (result.e != null) { throw result.e; } if (result.ioe != null) { throw result.ioe; } return; } public void createFile(String path, CreateFileTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { send_createFile(path, options); recv_createFile(); } public void send_createFile(String path, CreateFileTOptions options) throws org.apache.thrift.TException { createFile_args args = new createFile_args(); args.setPath(path); args.setOptions(options); sendBase("createFile", args); } public void recv_createFile() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { createFile_result result = new createFile_result(); receiveBase(result, "createFile"); if (result.e != null) { throw result.e; } if (result.ioe != null) { throw result.ioe; } return; } public void free(String path, boolean recursive) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_free(path, recursive); recv_free(); } public void send_free(String path, boolean recursive) throws org.apache.thrift.TException { free_args args = new free_args(); args.setPath(path); args.setRecursive(recursive); sendBase("free", args); } public void recv_free() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { free_result result = new free_result(); receiveBase(result, "free"); if (result.e != null) { throw result.e; } return; } public List<FileBlockInfo> getFileBlockInfoList(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_getFileBlockInfoList(path); return recv_getFileBlockInfoList(); } public void send_getFileBlockInfoList(String path) throws org.apache.thrift.TException { getFileBlockInfoList_args args = new getFileBlockInfoList_args(); args.setPath(path); sendBase("getFileBlockInfoList", args); } public List<FileBlockInfo> recv_getFileBlockInfoList() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { getFileBlockInfoList_result result = new getFileBlockInfoList_result(); receiveBase(result, "getFileBlockInfoList"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getFileBlockInfoList failed: unknown result"); } public FileInfo getStatus(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_getStatus(path); return recv_getStatus(); } public void send_getStatus(String path) throws org.apache.thrift.TException { getStatus_args args = new getStatus_args(); args.setPath(path); sendBase("getStatus", args); } public FileInfo recv_getStatus() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { getStatus_result result = new getStatus_result(); receiveBase(result, "getStatus"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getStatus failed: unknown result"); } public FileInfo getStatusInternal(long fileId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_getStatusInternal(fileId); return recv_getStatusInternal(); } public void send_getStatusInternal(long fileId) throws org.apache.thrift.TException { getStatusInternal_args args = new getStatusInternal_args(); args.setFileId(fileId); sendBase("getStatusInternal", args); } public FileInfo recv_getStatusInternal() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { getStatusInternal_result result = new getStatusInternal_result(); receiveBase(result, "getStatusInternal"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getStatusInternal failed: unknown result"); } public long getNewBlockIdForFile(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_getNewBlockIdForFile(path); return recv_getNewBlockIdForFile(); } public void send_getNewBlockIdForFile(String path) throws org.apache.thrift.TException { getNewBlockIdForFile_args args = new getNewBlockIdForFile_args(); args.setPath(path); sendBase("getNewBlockIdForFile", args); } public long recv_getNewBlockIdForFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { getNewBlockIdForFile_result result = new getNewBlockIdForFile_result(); receiveBase(result, "getNewBlockIdForFile"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNewBlockIdForFile failed: unknown result"); } public String getUfsAddress() throws org.apache.thrift.TException { send_getUfsAddress(); return recv_getUfsAddress(); } public void send_getUfsAddress() throws org.apache.thrift.TException { getUfsAddress_args args = new getUfsAddress_args(); sendBase("getUfsAddress", args); } public String recv_getUfsAddress() throws org.apache.thrift.TException { getUfsAddress_result result = new getUfsAddress_result(); receiveBase(result, "getUfsAddress"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUfsAddress failed: unknown result"); } public List<FileInfo> listStatus(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_listStatus(path); return recv_listStatus(); } public void send_listStatus(String path) throws org.apache.thrift.TException { listStatus_args args = new listStatus_args(); args.setPath(path); sendBase("listStatus", args); } public List<FileInfo> recv_listStatus() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { listStatus_result result = new listStatus_result(); receiveBase(result, "listStatus"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "listStatus failed: unknown result"); } public long loadMetadata(String ufsPath, boolean recursive) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { send_loadMetadata(ufsPath, recursive); return recv_loadMetadata(); } public void send_loadMetadata(String ufsPath, boolean recursive) throws org.apache.thrift.TException { loadMetadata_args args = new loadMetadata_args(); args.setUfsPath(ufsPath); args.setRecursive(recursive); sendBase("loadMetadata", args); } public long recv_loadMetadata() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { loadMetadata_result result = new loadMetadata_result(); receiveBase(result, "loadMetadata"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } if (result.ioe != null) { throw result.ioe; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "loadMetadata failed: unknown result"); } public void mount(String alluxioPath, String ufsPath, MountTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { send_mount(alluxioPath, ufsPath, options); recv_mount(); } public void send_mount(String alluxioPath, String ufsPath, MountTOptions options) throws org.apache.thrift.TException { mount_args args = new mount_args(); args.setAlluxioPath(alluxioPath); args.setUfsPath(ufsPath); args.setOptions(options); sendBase("mount", args); } public void recv_mount() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { mount_result result = new mount_result(); receiveBase(result, "mount"); if (result.e != null) { throw result.e; } if (result.ioe != null) { throw result.ioe; } return; } public void remove(String path, boolean recursive) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_remove(path, recursive); recv_remove(); } public void send_remove(String path, boolean recursive) throws org.apache.thrift.TException { remove_args args = new remove_args(); args.setPath(path); args.setRecursive(recursive); sendBase("remove", args); } public void recv_remove() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { remove_result result = new remove_result(); receiveBase(result, "remove"); if (result.e != null) { throw result.e; } return; } public void rename(String path, String dstPath) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { send_rename(path, dstPath); recv_rename(); } public void send_rename(String path, String dstPath) throws org.apache.thrift.TException { rename_args args = new rename_args(); args.setPath(path); args.setDstPath(dstPath); sendBase("rename", args); } public void recv_rename() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { rename_result result = new rename_result(); receiveBase(result, "rename"); if (result.e != null) { throw result.e; } if (result.ioe != null) { throw result.ioe; } return; } public void setAttribute(String path, SetAttributeTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_setAttribute(path, options); recv_setAttribute(); } public void send_setAttribute(String path, SetAttributeTOptions options) throws org.apache.thrift.TException { setAttribute_args args = new setAttribute_args(); args.setPath(path); args.setOptions(options); sendBase("setAttribute", args); } public void recv_setAttribute() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { setAttribute_result result = new setAttribute_result(); receiveBase(result, "setAttribute"); if (result.e != null) { throw result.e; } return; } public void scheduleAsyncPersist(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { send_scheduleAsyncPersist(path); recv_scheduleAsyncPersist(); } public void send_scheduleAsyncPersist(String path) throws org.apache.thrift.TException { scheduleAsyncPersist_args args = new scheduleAsyncPersist_args(); args.setPath(path); sendBase("scheduleAsyncPersist", args); } public void recv_scheduleAsyncPersist() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { scheduleAsyncPersist_result result = new scheduleAsyncPersist_result(); receiveBase(result, "scheduleAsyncPersist"); if (result.e != null) { throw result.e; } return; } public void unmount(String alluxioPath) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { send_unmount(alluxioPath); recv_unmount(); } public void send_unmount(String alluxioPath) throws org.apache.thrift.TException { unmount_args args = new unmount_args(); args.setAlluxioPath(alluxioPath); sendBase("unmount", args); } public void recv_unmount() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { unmount_result result = new unmount_result(); receiveBase(result, "unmount"); if (result.e != null) { throw result.e; } if (result.ioe != null) { throw result.ioe; } return; } } public static class AsyncClient extends alluxio.thrift.AlluxioService.AsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { private org.apache.thrift.async.TAsyncClientManager clientManager; private org.apache.thrift.protocol.TProtocolFactory protocolFactory; public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void completeFile(String path, CompleteFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); completeFile_call method_call = new completeFile_call(path, options, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class completeFile_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private CompleteFileTOptions options; public completeFile_call(String path, CompleteFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.options = options; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("completeFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); completeFile_args args = new completeFile_args(); args.setPath(path); args.setOptions(options); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_completeFile(); } } public void createDirectory(String path, CreateDirectoryTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); createDirectory_call method_call = new createDirectory_call(path, options, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createDirectory_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private CreateDirectoryTOptions options; public createDirectory_call(String path, CreateDirectoryTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.options = options; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createDirectory", org.apache.thrift.protocol.TMessageType.CALL, 0)); createDirectory_args args = new createDirectory_args(); args.setPath(path); args.setOptions(options); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_createDirectory(); } } public void createFile(String path, CreateFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); createFile_call method_call = new createFile_call(path, options, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createFile_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private CreateFileTOptions options; public createFile_call(String path, CreateFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.options = options; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); createFile_args args = new createFile_args(); args.setPath(path); args.setOptions(options); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_createFile(); } } public void free(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); free_call method_call = new free_call(path, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class free_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private boolean recursive; public free_call(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("free", org.apache.thrift.protocol.TMessageType.CALL, 0)); free_args args = new free_args(); args.setPath(path); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_free(); } } public void getFileBlockInfoList(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getFileBlockInfoList_call method_call = new getFileBlockInfoList_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getFileBlockInfoList_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public getFileBlockInfoList_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getFileBlockInfoList", org.apache.thrift.protocol.TMessageType.CALL, 0)); getFileBlockInfoList_args args = new getFileBlockInfoList_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public List<FileBlockInfo> getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getFileBlockInfoList(); } } public void getStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getStatus_call method_call = new getStatus_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getStatus_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public getStatus_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); getStatus_args args = new getStatus_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public FileInfo getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getStatus(); } } public void getStatusInternal(long fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getStatusInternal_call method_call = new getStatusInternal_call(fileId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getStatusInternal_call extends org.apache.thrift.async.TAsyncMethodCall { private long fileId; public getStatusInternal_call(long fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getStatusInternal", org.apache.thrift.protocol.TMessageType.CALL, 0)); getStatusInternal_args args = new getStatusInternal_args(); args.setFileId(fileId); args.write(prot); prot.writeMessageEnd(); } public FileInfo getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getStatusInternal(); } } public void getNewBlockIdForFile(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getNewBlockIdForFile_call method_call = new getNewBlockIdForFile_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getNewBlockIdForFile_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public getNewBlockIdForFile_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getNewBlockIdForFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); getNewBlockIdForFile_args args = new getNewBlockIdForFile_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getNewBlockIdForFile(); } } public void getUfsAddress(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getUfsAddress_call method_call = new getUfsAddress_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getUfsAddress_call extends org.apache.thrift.async.TAsyncMethodCall { public getUfsAddress_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUfsAddress", org.apache.thrift.protocol.TMessageType.CALL, 0)); getUfsAddress_args args = new getUfsAddress_args(); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getUfsAddress(); } } public void listStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); listStatus_call method_call = new listStatus_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listStatus_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public listStatus_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("listStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); listStatus_args args = new listStatus_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public List<FileInfo> getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_listStatus(); } } public void loadMetadata(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); loadMetadata_call method_call = new loadMetadata_call(ufsPath, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class loadMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { private String ufsPath; private boolean recursive; public loadMetadata_call(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.ufsPath = ufsPath; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("loadMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); loadMetadata_args args = new loadMetadata_args(); args.setUfsPath(ufsPath); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_loadMetadata(); } } public void mount(String alluxioPath, String ufsPath, MountTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); mount_call method_call = new mount_call(alluxioPath, ufsPath, options, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class mount_call extends org.apache.thrift.async.TAsyncMethodCall { private String alluxioPath; private String ufsPath; private MountTOptions options; public mount_call(String alluxioPath, String ufsPath, MountTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.alluxioPath = alluxioPath; this.ufsPath = ufsPath; this.options = options; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("mount", org.apache.thrift.protocol.TMessageType.CALL, 0)); mount_args args = new mount_args(); args.setAlluxioPath(alluxioPath); args.setUfsPath(ufsPath); args.setOptions(options); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_mount(); } } public void remove(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); remove_call method_call = new remove_call(path, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class remove_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private boolean recursive; public remove_call(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove", org.apache.thrift.protocol.TMessageType.CALL, 0)); remove_args args = new remove_args(); args.setPath(path); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_remove(); } } public void rename(String path, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); rename_call method_call = new rename_call(path, dstPath, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class rename_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private String dstPath; public rename_call(String path, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.dstPath = dstPath; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("rename", org.apache.thrift.protocol.TMessageType.CALL, 0)); rename_args args = new rename_args(); args.setPath(path); args.setDstPath(dstPath); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_rename(); } } public void setAttribute(String path, SetAttributeTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); setAttribute_call method_call = new setAttribute_call(path, options, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class setAttribute_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private SetAttributeTOptions options; public setAttribute_call(String path, SetAttributeTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.options = options; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setAttribute", org.apache.thrift.protocol.TMessageType.CALL, 0)); setAttribute_args args = new setAttribute_args(); args.setPath(path); args.setOptions(options); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_setAttribute(); } } public void scheduleAsyncPersist(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); scheduleAsyncPersist_call method_call = new scheduleAsyncPersist_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class scheduleAsyncPersist_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public scheduleAsyncPersist_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scheduleAsyncPersist", org.apache.thrift.protocol.TMessageType.CALL, 0)); scheduleAsyncPersist_args args = new scheduleAsyncPersist_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_scheduleAsyncPersist(); } } public void unmount(String alluxioPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); unmount_call method_call = new unmount_call(alluxioPath, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class unmount_call extends org.apache.thrift.async.TAsyncMethodCall { private String alluxioPath; public unmount_call(String alluxioPath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.alluxioPath = alluxioPath; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unmount", org.apache.thrift.protocol.TMessageType.CALL, 0)); unmount_args args = new unmount_args(); args.setAlluxioPath(alluxioPath); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_unmount(); } } } public static class Processor<I extends Iface> extends alluxio.thrift.AlluxioService.Processor<I> implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>())); } protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { processMap.put("completeFile", new completeFile()); processMap.put("createDirectory", new createDirectory()); processMap.put("createFile", new createFile()); processMap.put("free", new free()); processMap.put("getFileBlockInfoList", new getFileBlockInfoList()); processMap.put("getStatus", new getStatus()); processMap.put("getStatusInternal", new getStatusInternal()); processMap.put("getNewBlockIdForFile", new getNewBlockIdForFile()); processMap.put("getUfsAddress", new getUfsAddress()); processMap.put("listStatus", new listStatus()); processMap.put("loadMetadata", new loadMetadata()); processMap.put("mount", new mount()); processMap.put("remove", new remove()); processMap.put("rename", new rename()); processMap.put("setAttribute", new setAttribute()); processMap.put("scheduleAsyncPersist", new scheduleAsyncPersist()); processMap.put("unmount", new unmount()); return processMap; } public static class completeFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, completeFile_args> { public completeFile() { super("completeFile"); } public completeFile_args getEmptyArgsInstance() { return new completeFile_args(); } protected boolean isOneway() { return false; } public completeFile_result getResult(I iface, completeFile_args args) throws org.apache.thrift.TException { completeFile_result result = new completeFile_result(); try { iface.completeFile(args.path, args.options); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class createDirectory<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createDirectory_args> { public createDirectory() { super("createDirectory"); } public createDirectory_args getEmptyArgsInstance() { return new createDirectory_args(); } protected boolean isOneway() { return false; } public createDirectory_result getResult(I iface, createDirectory_args args) throws org.apache.thrift.TException { createDirectory_result result = new createDirectory_result(); try { iface.createDirectory(args.path, args.options); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } catch (alluxio.thrift.ThriftIOException ioe) { result.ioe = ioe; } return result; } } public static class createFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createFile_args> { public createFile() { super("createFile"); } public createFile_args getEmptyArgsInstance() { return new createFile_args(); } protected boolean isOneway() { return false; } public createFile_result getResult(I iface, createFile_args args) throws org.apache.thrift.TException { createFile_result result = new createFile_result(); try { iface.createFile(args.path, args.options); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } catch (alluxio.thrift.ThriftIOException ioe) { result.ioe = ioe; } return result; } } public static class free<I extends Iface> extends org.apache.thrift.ProcessFunction<I, free_args> { public free() { super("free"); } public free_args getEmptyArgsInstance() { return new free_args(); } protected boolean isOneway() { return false; } public free_result getResult(I iface, free_args args) throws org.apache.thrift.TException { free_result result = new free_result(); try { iface.free(args.path, args.recursive); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class getFileBlockInfoList<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getFileBlockInfoList_args> { public getFileBlockInfoList() { super("getFileBlockInfoList"); } public getFileBlockInfoList_args getEmptyArgsInstance() { return new getFileBlockInfoList_args(); } protected boolean isOneway() { return false; } public getFileBlockInfoList_result getResult(I iface, getFileBlockInfoList_args args) throws org.apache.thrift.TException { getFileBlockInfoList_result result = new getFileBlockInfoList_result(); try { result.success = iface.getFileBlockInfoList(args.path); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class getStatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getStatus_args> { public getStatus() { super("getStatus"); } public getStatus_args getEmptyArgsInstance() { return new getStatus_args(); } protected boolean isOneway() { return false; } public getStatus_result getResult(I iface, getStatus_args args) throws org.apache.thrift.TException { getStatus_result result = new getStatus_result(); try { result.success = iface.getStatus(args.path); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class getStatusInternal<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getStatusInternal_args> { public getStatusInternal() { super("getStatusInternal"); } public getStatusInternal_args getEmptyArgsInstance() { return new getStatusInternal_args(); } protected boolean isOneway() { return false; } public getStatusInternal_result getResult(I iface, getStatusInternal_args args) throws org.apache.thrift.TException { getStatusInternal_result result = new getStatusInternal_result(); try { result.success = iface.getStatusInternal(args.fileId); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class getNewBlockIdForFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getNewBlockIdForFile_args> { public getNewBlockIdForFile() { super("getNewBlockIdForFile"); } public getNewBlockIdForFile_args getEmptyArgsInstance() { return new getNewBlockIdForFile_args(); } protected boolean isOneway() { return false; } public getNewBlockIdForFile_result getResult(I iface, getNewBlockIdForFile_args args) throws org.apache.thrift.TException { getNewBlockIdForFile_result result = new getNewBlockIdForFile_result(); try { result.success = iface.getNewBlockIdForFile(args.path); result.setSuccessIsSet(true); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class getUfsAddress<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUfsAddress_args> { public getUfsAddress() { super("getUfsAddress"); } public getUfsAddress_args getEmptyArgsInstance() { return new getUfsAddress_args(); } protected boolean isOneway() { return false; } public getUfsAddress_result getResult(I iface, getUfsAddress_args args) throws org.apache.thrift.TException { getUfsAddress_result result = new getUfsAddress_result(); result.success = iface.getUfsAddress(); return result; } } public static class listStatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, listStatus_args> { public listStatus() { super("listStatus"); } public listStatus_args getEmptyArgsInstance() { return new listStatus_args(); } protected boolean isOneway() { return false; } public listStatus_result getResult(I iface, listStatus_args args) throws org.apache.thrift.TException { listStatus_result result = new listStatus_result(); try { result.success = iface.listStatus(args.path); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class loadMetadata<I extends Iface> extends org.apache.thrift.ProcessFunction<I, loadMetadata_args> { public loadMetadata() { super("loadMetadata"); } public loadMetadata_args getEmptyArgsInstance() { return new loadMetadata_args(); } protected boolean isOneway() { return false; } public loadMetadata_result getResult(I iface, loadMetadata_args args) throws org.apache.thrift.TException { loadMetadata_result result = new loadMetadata_result(); try { result.success = iface.loadMetadata(args.ufsPath, args.recursive); result.setSuccessIsSet(true); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } catch (alluxio.thrift.ThriftIOException ioe) { result.ioe = ioe; } return result; } } public static class mount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, mount_args> { public mount() { super("mount"); } public mount_args getEmptyArgsInstance() { return new mount_args(); } protected boolean isOneway() { return false; } public mount_result getResult(I iface, mount_args args) throws org.apache.thrift.TException { mount_result result = new mount_result(); try { iface.mount(args.alluxioPath, args.ufsPath, args.options); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } catch (alluxio.thrift.ThriftIOException ioe) { result.ioe = ioe; } return result; } } public static class remove<I extends Iface> extends org.apache.thrift.ProcessFunction<I, remove_args> { public remove() { super("remove"); } public remove_args getEmptyArgsInstance() { return new remove_args(); } protected boolean isOneway() { return false; } public remove_result getResult(I iface, remove_args args) throws org.apache.thrift.TException { remove_result result = new remove_result(); try { iface.remove(args.path, args.recursive); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class rename<I extends Iface> extends org.apache.thrift.ProcessFunction<I, rename_args> { public rename() { super("rename"); } public rename_args getEmptyArgsInstance() { return new rename_args(); } protected boolean isOneway() { return false; } public rename_result getResult(I iface, rename_args args) throws org.apache.thrift.TException { rename_result result = new rename_result(); try { iface.rename(args.path, args.dstPath); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } catch (alluxio.thrift.ThriftIOException ioe) { result.ioe = ioe; } return result; } } public static class setAttribute<I extends Iface> extends org.apache.thrift.ProcessFunction<I, setAttribute_args> { public setAttribute() { super("setAttribute"); } public setAttribute_args getEmptyArgsInstance() { return new setAttribute_args(); } protected boolean isOneway() { return false; } public setAttribute_result getResult(I iface, setAttribute_args args) throws org.apache.thrift.TException { setAttribute_result result = new setAttribute_result(); try { iface.setAttribute(args.path, args.options); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class scheduleAsyncPersist<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scheduleAsyncPersist_args> { public scheduleAsyncPersist() { super("scheduleAsyncPersist"); } public scheduleAsyncPersist_args getEmptyArgsInstance() { return new scheduleAsyncPersist_args(); } protected boolean isOneway() { return false; } public scheduleAsyncPersist_result getResult(I iface, scheduleAsyncPersist_args args) throws org.apache.thrift.TException { scheduleAsyncPersist_result result = new scheduleAsyncPersist_result(); try { iface.scheduleAsyncPersist(args.path); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } return result; } } public static class unmount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unmount_args> { public unmount() { super("unmount"); } public unmount_args getEmptyArgsInstance() { return new unmount_args(); } protected boolean isOneway() { return false; } public unmount_result getResult(I iface, unmount_args args) throws org.apache.thrift.TException { unmount_result result = new unmount_result(); try { iface.unmount(args.alluxioPath); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; } catch (alluxio.thrift.ThriftIOException ioe) { result.ioe = ioe; } return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends alluxio.thrift.AlluxioService.AsyncProcessor<I> { private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>())); } protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { processMap.put("completeFile", new completeFile()); processMap.put("createDirectory", new createDirectory()); processMap.put("createFile", new createFile()); processMap.put("free", new free()); processMap.put("getFileBlockInfoList", new getFileBlockInfoList()); processMap.put("getStatus", new getStatus()); processMap.put("getStatusInternal", new getStatusInternal()); processMap.put("getNewBlockIdForFile", new getNewBlockIdForFile()); processMap.put("getUfsAddress", new getUfsAddress()); processMap.put("listStatus", new listStatus()); processMap.put("loadMetadata", new loadMetadata()); processMap.put("mount", new mount()); processMap.put("remove", new remove()); processMap.put("rename", new rename()); processMap.put("setAttribute", new setAttribute()); processMap.put("scheduleAsyncPersist", new scheduleAsyncPersist()); processMap.put("unmount", new unmount()); return processMap; } public static class completeFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, completeFile_args, Void> { public completeFile() { super("completeFile"); } public completeFile_args getEmptyArgsInstance() { return new completeFile_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { completeFile_result result = new completeFile_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; completeFile_result result = new completeFile_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, completeFile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.completeFile(args.path, args.options,resultHandler); } } public static class createDirectory<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createDirectory_args, Void> { public createDirectory() { super("createDirectory"); } public createDirectory_args getEmptyArgsInstance() { return new createDirectory_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { createDirectory_result result = new createDirectory_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; createDirectory_result result = new createDirectory_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else if (e instanceof alluxio.thrift.ThriftIOException) { result.ioe = (alluxio.thrift.ThriftIOException) e; result.setIoeIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, createDirectory_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.createDirectory(args.path, args.options,resultHandler); } } public static class createFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createFile_args, Void> { public createFile() { super("createFile"); } public createFile_args getEmptyArgsInstance() { return new createFile_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { createFile_result result = new createFile_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; createFile_result result = new createFile_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else if (e instanceof alluxio.thrift.ThriftIOException) { result.ioe = (alluxio.thrift.ThriftIOException) e; result.setIoeIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, createFile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.createFile(args.path, args.options,resultHandler); } } public static class free<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, free_args, Void> { public free() { super("free"); } public free_args getEmptyArgsInstance() { return new free_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { free_result result = new free_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; free_result result = new free_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, free_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.free(args.path, args.recursive,resultHandler); } } public static class getFileBlockInfoList<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getFileBlockInfoList_args, List<FileBlockInfo>> { public getFileBlockInfoList() { super("getFileBlockInfoList"); } public getFileBlockInfoList_args getEmptyArgsInstance() { return new getFileBlockInfoList_args(); } public AsyncMethodCallback<List<FileBlockInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<FileBlockInfo>>() { public void onComplete(List<FileBlockInfo> o) { getFileBlockInfoList_result result = new getFileBlockInfoList_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getFileBlockInfoList_result result = new getFileBlockInfoList_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getFileBlockInfoList_args args, org.apache.thrift.async.AsyncMethodCallback<List<FileBlockInfo>> resultHandler) throws TException { iface.getFileBlockInfoList(args.path,resultHandler); } } public static class getStatus<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getStatus_args, FileInfo> { public getStatus() { super("getStatus"); } public getStatus_args getEmptyArgsInstance() { return new getStatus_args(); } public AsyncMethodCallback<FileInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<FileInfo>() { public void onComplete(FileInfo o) { getStatus_result result = new getStatus_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getStatus_result result = new getStatus_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getStatus_args args, org.apache.thrift.async.AsyncMethodCallback<FileInfo> resultHandler) throws TException { iface.getStatus(args.path,resultHandler); } } public static class getStatusInternal<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getStatusInternal_args, FileInfo> { public getStatusInternal() { super("getStatusInternal"); } public getStatusInternal_args getEmptyArgsInstance() { return new getStatusInternal_args(); } public AsyncMethodCallback<FileInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<FileInfo>() { public void onComplete(FileInfo o) { getStatusInternal_result result = new getStatusInternal_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getStatusInternal_result result = new getStatusInternal_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getStatusInternal_args args, org.apache.thrift.async.AsyncMethodCallback<FileInfo> resultHandler) throws TException { iface.getStatusInternal(args.fileId,resultHandler); } } public static class getNewBlockIdForFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getNewBlockIdForFile_args, Long> { public getNewBlockIdForFile() { super("getNewBlockIdForFile"); } public getNewBlockIdForFile_args getEmptyArgsInstance() { return new getNewBlockIdForFile_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { getNewBlockIdForFile_result result = new getNewBlockIdForFile_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getNewBlockIdForFile_result result = new getNewBlockIdForFile_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getNewBlockIdForFile_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.getNewBlockIdForFile(args.path,resultHandler); } } public static class getUfsAddress<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUfsAddress_args, String> { public getUfsAddress() { super("getUfsAddress"); } public getUfsAddress_args getEmptyArgsInstance() { return new getUfsAddress_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { getUfsAddress_result result = new getUfsAddress_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getUfsAddress_result result = new getUfsAddress_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getUfsAddress_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.getUfsAddress(resultHandler); } } public static class listStatus<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, listStatus_args, List<FileInfo>> { public listStatus() { super("listStatus"); } public listStatus_args getEmptyArgsInstance() { return new listStatus_args(); } public AsyncMethodCallback<List<FileInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<FileInfo>>() { public void onComplete(List<FileInfo> o) { listStatus_result result = new listStatus_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; listStatus_result result = new listStatus_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, listStatus_args args, org.apache.thrift.async.AsyncMethodCallback<List<FileInfo>> resultHandler) throws TException { iface.listStatus(args.path,resultHandler); } } public static class loadMetadata<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, loadMetadata_args, Long> { public loadMetadata() { super("loadMetadata"); } public loadMetadata_args getEmptyArgsInstance() { return new loadMetadata_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { loadMetadata_result result = new loadMetadata_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; loadMetadata_result result = new loadMetadata_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else if (e instanceof alluxio.thrift.ThriftIOException) { result.ioe = (alluxio.thrift.ThriftIOException) e; result.setIoeIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, loadMetadata_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.loadMetadata(args.ufsPath, args.recursive,resultHandler); } } public static class mount<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, mount_args, Void> { public mount() { super("mount"); } public mount_args getEmptyArgsInstance() { return new mount_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { mount_result result = new mount_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; mount_result result = new mount_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else if (e instanceof alluxio.thrift.ThriftIOException) { result.ioe = (alluxio.thrift.ThriftIOException) e; result.setIoeIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, mount_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.mount(args.alluxioPath, args.ufsPath, args.options,resultHandler); } } public static class remove<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, remove_args, Void> { public remove() { super("remove"); } public remove_args getEmptyArgsInstance() { return new remove_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { remove_result result = new remove_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; remove_result result = new remove_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, remove_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.remove(args.path, args.recursive,resultHandler); } } public static class rename<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, rename_args, Void> { public rename() { super("rename"); } public rename_args getEmptyArgsInstance() { return new rename_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { rename_result result = new rename_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; rename_result result = new rename_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else if (e instanceof alluxio.thrift.ThriftIOException) { result.ioe = (alluxio.thrift.ThriftIOException) e; result.setIoeIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, rename_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.rename(args.path, args.dstPath,resultHandler); } } public static class setAttribute<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, setAttribute_args, Void> { public setAttribute() { super("setAttribute"); } public setAttribute_args getEmptyArgsInstance() { return new setAttribute_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { setAttribute_result result = new setAttribute_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; setAttribute_result result = new setAttribute_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, setAttribute_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.setAttribute(args.path, args.options,resultHandler); } } public static class scheduleAsyncPersist<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, scheduleAsyncPersist_args, Void> { public scheduleAsyncPersist() { super("scheduleAsyncPersist"); } public scheduleAsyncPersist_args getEmptyArgsInstance() { return new scheduleAsyncPersist_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { scheduleAsyncPersist_result result = new scheduleAsyncPersist_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; scheduleAsyncPersist_result result = new scheduleAsyncPersist_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, scheduleAsyncPersist_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.scheduleAsyncPersist(args.path,resultHandler); } } public static class unmount<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unmount_args, Void> { public unmount() { super("unmount"); } public unmount_args getEmptyArgsInstance() { return new unmount_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { unmount_result result = new unmount_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; unmount_result result = new unmount_result(); if (e instanceof alluxio.thrift.AlluxioTException) { result.e = (alluxio.thrift.AlluxioTException) e; result.setEIsSet(true); msg = result; } else if (e instanceof alluxio.thrift.ThriftIOException) { result.ioe = (alluxio.thrift.ThriftIOException) e; result.setIoeIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, unmount_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.unmount(args.alluxioPath,resultHandler); } } } public static class completeFile_args implements org.apache.thrift.TBase<completeFile_args, completeFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<completeFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("completeFile_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new completeFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new completeFile_argsTupleSchemeFactory()); } private String path; // required private CompleteFileTOptions options; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file */ PATH((short)1, "path"), /** * the method options */ OPTIONS((short)2, "options"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // OPTIONS return OPTIONS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CompleteFileTOptions.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(completeFile_args.class, metaDataMap); } public completeFile_args() { } public completeFile_args( String path, CompleteFileTOptions options) { this(); this.path = path; this.options = options; } /** * Performs a deep copy on <i>other</i>. */ public completeFile_args(completeFile_args other) { if (other.isSetPath()) { this.path = other.path; } if (other.isSetOptions()) { this.options = new CompleteFileTOptions(other.options); } } public completeFile_args deepCopy() { return new completeFile_args(this); } @Override public void clear() { this.path = null; this.options = null; } /** * the path of the file */ public String getPath() { return this.path; } /** * the path of the file */ public completeFile_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } /** * the method options */ public CompleteFileTOptions getOptions() { return this.options; } /** * the method options */ public completeFile_args setOptions(CompleteFileTOptions options) { this.options = options; return this; } public void unsetOptions() { this.options = null; } /** Returns true if field options is set (has been assigned a value) and false otherwise */ public boolean isSetOptions() { return this.options != null; } public void setOptionsIsSet(boolean value) { if (!value) { this.options = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case OPTIONS: if (value == null) { unsetOptions(); } else { setOptions((CompleteFileTOptions)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case OPTIONS: return getOptions(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case OPTIONS: return isSetOptions(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof completeFile_args) return this.equals((completeFile_args)that); return false; } public boolean equals(completeFile_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_options = true && this.isSetOptions(); boolean that_present_options = true && that.isSetOptions(); if (this_present_options || that_present_options) { if (!(this_present_options && that_present_options)) return false; if (!this.options.equals(that.options)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_options = true && (isSetOptions()); list.add(present_options); if (present_options) list.add(options); return list.hashCode(); } @Override public int compareTo(completeFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions()); if (lastComparison != 0) { return lastComparison; } if (isSetOptions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("completeFile_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("options:"); if (this.options == null) { sb.append("null"); } else { sb.append(this.options); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (options != null) { options.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class completeFile_argsStandardSchemeFactory implements SchemeFactory { public completeFile_argsStandardScheme getScheme() { return new completeFile_argsStandardScheme(); } } private static class completeFile_argsStandardScheme extends StandardScheme<completeFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, completeFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // OPTIONS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.options = new CompleteFileTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, completeFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.options != null) { oprot.writeFieldBegin(OPTIONS_FIELD_DESC); struct.options.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class completeFile_argsTupleSchemeFactory implements SchemeFactory { public completeFile_argsTupleScheme getScheme() { return new completeFile_argsTupleScheme(); } } private static class completeFile_argsTupleScheme extends TupleScheme<completeFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, completeFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetOptions()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetOptions()) { struct.options.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, completeFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.options = new CompleteFileTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } } } } public static class completeFile_result implements org.apache.thrift.TBase<completeFile_result, completeFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<completeFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("completeFile_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new completeFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new completeFile_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(completeFile_result.class, metaDataMap); } public completeFile_result() { } public completeFile_result( alluxio.thrift.AlluxioTException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public completeFile_result(completeFile_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public completeFile_result deepCopy() { return new completeFile_result(this); } @Override public void clear() { this.e = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public completeFile_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof completeFile_result) return this.equals((completeFile_result)that); return false; } public boolean equals(completeFile_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(completeFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("completeFile_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class completeFile_resultStandardSchemeFactory implements SchemeFactory { public completeFile_resultStandardScheme getScheme() { return new completeFile_resultStandardScheme(); } } private static class completeFile_resultStandardScheme extends StandardScheme<completeFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, completeFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, completeFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class completeFile_resultTupleSchemeFactory implements SchemeFactory { public completeFile_resultTupleScheme getScheme() { return new completeFile_resultTupleScheme(); } } private static class completeFile_resultTupleScheme extends TupleScheme<completeFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, completeFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, completeFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class createDirectory_args implements org.apache.thrift.TBase<createDirectory_args, createDirectory_args._Fields>, java.io.Serializable, Cloneable, Comparable<createDirectory_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createDirectory_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new createDirectory_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new createDirectory_argsTupleSchemeFactory()); } private String path; // required private CreateDirectoryTOptions options; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the directory */ PATH((short)1, "path"), /** * the method options */ OPTIONS((short)2, "options"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // OPTIONS return OPTIONS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CreateDirectoryTOptions.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createDirectory_args.class, metaDataMap); } public createDirectory_args() { } public createDirectory_args( String path, CreateDirectoryTOptions options) { this(); this.path = path; this.options = options; } /** * Performs a deep copy on <i>other</i>. */ public createDirectory_args(createDirectory_args other) { if (other.isSetPath()) { this.path = other.path; } if (other.isSetOptions()) { this.options = new CreateDirectoryTOptions(other.options); } } public createDirectory_args deepCopy() { return new createDirectory_args(this); } @Override public void clear() { this.path = null; this.options = null; } /** * the path of the directory */ public String getPath() { return this.path; } /** * the path of the directory */ public createDirectory_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } /** * the method options */ public CreateDirectoryTOptions getOptions() { return this.options; } /** * the method options */ public createDirectory_args setOptions(CreateDirectoryTOptions options) { this.options = options; return this; } public void unsetOptions() { this.options = null; } /** Returns true if field options is set (has been assigned a value) and false otherwise */ public boolean isSetOptions() { return this.options != null; } public void setOptionsIsSet(boolean value) { if (!value) { this.options = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case OPTIONS: if (value == null) { unsetOptions(); } else { setOptions((CreateDirectoryTOptions)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case OPTIONS: return getOptions(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case OPTIONS: return isSetOptions(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof createDirectory_args) return this.equals((createDirectory_args)that); return false; } public boolean equals(createDirectory_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_options = true && this.isSetOptions(); boolean that_present_options = true && that.isSetOptions(); if (this_present_options || that_present_options) { if (!(this_present_options && that_present_options)) return false; if (!this.options.equals(that.options)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_options = true && (isSetOptions()); list.add(present_options); if (present_options) list.add(options); return list.hashCode(); } @Override public int compareTo(createDirectory_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions()); if (lastComparison != 0) { return lastComparison; } if (isSetOptions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("createDirectory_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("options:"); if (this.options == null) { sb.append("null"); } else { sb.append(this.options); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (options != null) { options.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class createDirectory_argsStandardSchemeFactory implements SchemeFactory { public createDirectory_argsStandardScheme getScheme() { return new createDirectory_argsStandardScheme(); } } private static class createDirectory_argsStandardScheme extends StandardScheme<createDirectory_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, createDirectory_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // OPTIONS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.options = new CreateDirectoryTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, createDirectory_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.options != null) { oprot.writeFieldBegin(OPTIONS_FIELD_DESC); struct.options.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class createDirectory_argsTupleSchemeFactory implements SchemeFactory { public createDirectory_argsTupleScheme getScheme() { return new createDirectory_argsTupleScheme(); } } private static class createDirectory_argsTupleScheme extends TupleScheme<createDirectory_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, createDirectory_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetOptions()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetOptions()) { struct.options.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, createDirectory_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.options = new CreateDirectoryTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } } } } public static class createDirectory_result implements org.apache.thrift.TBase<createDirectory_result, createDirectory_result._Fields>, java.io.Serializable, Cloneable, Comparable<createDirectory_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createDirectory_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField IOE_FIELD_DESC = new org.apache.thrift.protocol.TField("ioe", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new createDirectory_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new createDirectory_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required private alluxio.thrift.ThriftIOException ioe; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"), IOE((short)2, "ioe"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; case 2: // IOE return IOE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.IOE, new org.apache.thrift.meta_data.FieldMetaData("ioe", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createDirectory_result.class, metaDataMap); } public createDirectory_result() { } public createDirectory_result( alluxio.thrift.AlluxioTException e, alluxio.thrift.ThriftIOException ioe) { this(); this.e = e; this.ioe = ioe; } /** * Performs a deep copy on <i>other</i>. */ public createDirectory_result(createDirectory_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } if (other.isSetIoe()) { this.ioe = new alluxio.thrift.ThriftIOException(other.ioe); } } public createDirectory_result deepCopy() { return new createDirectory_result(this); } @Override public void clear() { this.e = null; this.ioe = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public createDirectory_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public alluxio.thrift.ThriftIOException getIoe() { return this.ioe; } public createDirectory_result setIoe(alluxio.thrift.ThriftIOException ioe) { this.ioe = ioe; return this; } public void unsetIoe() { this.ioe = null; } /** Returns true if field ioe is set (has been assigned a value) and false otherwise */ public boolean isSetIoe() { return this.ioe != null; } public void setIoeIsSet(boolean value) { if (!value) { this.ioe = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; case IOE: if (value == null) { unsetIoe(); } else { setIoe((alluxio.thrift.ThriftIOException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); case IOE: return getIoe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); case IOE: return isSetIoe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof createDirectory_result) return this.equals((createDirectory_result)that); return false; } public boolean equals(createDirectory_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } boolean this_present_ioe = true && this.isSetIoe(); boolean that_present_ioe = true && that.isSetIoe(); if (this_present_ioe || that_present_ioe) { if (!(this_present_ioe && that_present_ioe)) return false; if (!this.ioe.equals(that.ioe)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); boolean present_ioe = true && (isSetIoe()); list.add(present_ioe); if (present_ioe) list.add(ioe); return list.hashCode(); } @Override public int compareTo(createDirectory_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoe()).compareTo(other.isSetIoe()); if (lastComparison != 0) { return lastComparison; } if (isSetIoe()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioe, other.ioe); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("createDirectory_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; if (!first) sb.append(", "); sb.append("ioe:"); if (this.ioe == null) { sb.append("null"); } else { sb.append(this.ioe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class createDirectory_resultStandardSchemeFactory implements SchemeFactory { public createDirectory_resultStandardScheme getScheme() { return new createDirectory_resultStandardScheme(); } } private static class createDirectory_resultStandardScheme extends StandardScheme<createDirectory_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, createDirectory_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IOE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, createDirectory_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } if (struct.ioe != null) { oprot.writeFieldBegin(IOE_FIELD_DESC); struct.ioe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class createDirectory_resultTupleSchemeFactory implements SchemeFactory { public createDirectory_resultTupleScheme getScheme() { return new createDirectory_resultTupleScheme(); } } private static class createDirectory_resultTupleScheme extends TupleScheme<createDirectory_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, createDirectory_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } if (struct.isSetIoe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetE()) { struct.e.write(oprot); } if (struct.isSetIoe()) { struct.ioe.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, createDirectory_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } if (incoming.get(1)) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } } } } public static class createFile_args implements org.apache.thrift.TBase<createFile_args, createFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<createFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createFile_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new createFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new createFile_argsTupleSchemeFactory()); } private String path; // required private CreateFileTOptions options; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file */ PATH((short)1, "path"), /** * the options for creating the file */ OPTIONS((short)2, "options"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // OPTIONS return OPTIONS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CreateFileTOptions.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createFile_args.class, metaDataMap); } public createFile_args() { } public createFile_args( String path, CreateFileTOptions options) { this(); this.path = path; this.options = options; } /** * Performs a deep copy on <i>other</i>. */ public createFile_args(createFile_args other) { if (other.isSetPath()) { this.path = other.path; } if (other.isSetOptions()) { this.options = new CreateFileTOptions(other.options); } } public createFile_args deepCopy() { return new createFile_args(this); } @Override public void clear() { this.path = null; this.options = null; } /** * the path of the file */ public String getPath() { return this.path; } /** * the path of the file */ public createFile_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } /** * the options for creating the file */ public CreateFileTOptions getOptions() { return this.options; } /** * the options for creating the file */ public createFile_args setOptions(CreateFileTOptions options) { this.options = options; return this; } public void unsetOptions() { this.options = null; } /** Returns true if field options is set (has been assigned a value) and false otherwise */ public boolean isSetOptions() { return this.options != null; } public void setOptionsIsSet(boolean value) { if (!value) { this.options = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case OPTIONS: if (value == null) { unsetOptions(); } else { setOptions((CreateFileTOptions)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case OPTIONS: return getOptions(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case OPTIONS: return isSetOptions(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof createFile_args) return this.equals((createFile_args)that); return false; } public boolean equals(createFile_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_options = true && this.isSetOptions(); boolean that_present_options = true && that.isSetOptions(); if (this_present_options || that_present_options) { if (!(this_present_options && that_present_options)) return false; if (!this.options.equals(that.options)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_options = true && (isSetOptions()); list.add(present_options); if (present_options) list.add(options); return list.hashCode(); } @Override public int compareTo(createFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions()); if (lastComparison != 0) { return lastComparison; } if (isSetOptions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("createFile_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("options:"); if (this.options == null) { sb.append("null"); } else { sb.append(this.options); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (options != null) { options.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class createFile_argsStandardSchemeFactory implements SchemeFactory { public createFile_argsStandardScheme getScheme() { return new createFile_argsStandardScheme(); } } private static class createFile_argsStandardScheme extends StandardScheme<createFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, createFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // OPTIONS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.options = new CreateFileTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, createFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.options != null) { oprot.writeFieldBegin(OPTIONS_FIELD_DESC); struct.options.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class createFile_argsTupleSchemeFactory implements SchemeFactory { public createFile_argsTupleScheme getScheme() { return new createFile_argsTupleScheme(); } } private static class createFile_argsTupleScheme extends TupleScheme<createFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, createFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetOptions()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetOptions()) { struct.options.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, createFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.options = new CreateFileTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } } } } public static class createFile_result implements org.apache.thrift.TBase<createFile_result, createFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<createFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createFile_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField IOE_FIELD_DESC = new org.apache.thrift.protocol.TField("ioe", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new createFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new createFile_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required private alluxio.thrift.ThriftIOException ioe; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"), IOE((short)2, "ioe"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; case 2: // IOE return IOE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.IOE, new org.apache.thrift.meta_data.FieldMetaData("ioe", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createFile_result.class, metaDataMap); } public createFile_result() { } public createFile_result( alluxio.thrift.AlluxioTException e, alluxio.thrift.ThriftIOException ioe) { this(); this.e = e; this.ioe = ioe; } /** * Performs a deep copy on <i>other</i>. */ public createFile_result(createFile_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } if (other.isSetIoe()) { this.ioe = new alluxio.thrift.ThriftIOException(other.ioe); } } public createFile_result deepCopy() { return new createFile_result(this); } @Override public void clear() { this.e = null; this.ioe = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public createFile_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public alluxio.thrift.ThriftIOException getIoe() { return this.ioe; } public createFile_result setIoe(alluxio.thrift.ThriftIOException ioe) { this.ioe = ioe; return this; } public void unsetIoe() { this.ioe = null; } /** Returns true if field ioe is set (has been assigned a value) and false otherwise */ public boolean isSetIoe() { return this.ioe != null; } public void setIoeIsSet(boolean value) { if (!value) { this.ioe = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; case IOE: if (value == null) { unsetIoe(); } else { setIoe((alluxio.thrift.ThriftIOException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); case IOE: return getIoe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); case IOE: return isSetIoe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof createFile_result) return this.equals((createFile_result)that); return false; } public boolean equals(createFile_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } boolean this_present_ioe = true && this.isSetIoe(); boolean that_present_ioe = true && that.isSetIoe(); if (this_present_ioe || that_present_ioe) { if (!(this_present_ioe && that_present_ioe)) return false; if (!this.ioe.equals(that.ioe)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); boolean present_ioe = true && (isSetIoe()); list.add(present_ioe); if (present_ioe) list.add(ioe); return list.hashCode(); } @Override public int compareTo(createFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoe()).compareTo(other.isSetIoe()); if (lastComparison != 0) { return lastComparison; } if (isSetIoe()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioe, other.ioe); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("createFile_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; if (!first) sb.append(", "); sb.append("ioe:"); if (this.ioe == null) { sb.append("null"); } else { sb.append(this.ioe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class createFile_resultStandardSchemeFactory implements SchemeFactory { public createFile_resultStandardScheme getScheme() { return new createFile_resultStandardScheme(); } } private static class createFile_resultStandardScheme extends StandardScheme<createFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, createFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IOE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, createFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } if (struct.ioe != null) { oprot.writeFieldBegin(IOE_FIELD_DESC); struct.ioe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class createFile_resultTupleSchemeFactory implements SchemeFactory { public createFile_resultTupleScheme getScheme() { return new createFile_resultTupleScheme(); } } private static class createFile_resultTupleScheme extends TupleScheme<createFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, createFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } if (struct.isSetIoe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetE()) { struct.e.write(oprot); } if (struct.isSetIoe()) { struct.ioe.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, createFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } if (incoming.get(1)) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } } } } public static class free_args implements org.apache.thrift.TBase<free_args, free_args._Fields>, java.io.Serializable, Cloneable, Comparable<free_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("free_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new free_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new free_argsTupleSchemeFactory()); } private String path; // required private boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file or directory */ PATH((short)1, "path"), /** * whether to free recursively */ RECURSIVE((short)2, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __RECURSIVE_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(free_args.class, metaDataMap); } public free_args() { } public free_args( String path, boolean recursive) { this(); this.path = path; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public free_args(free_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } this.recursive = other.recursive; } public free_args deepCopy() { return new free_args(this); } @Override public void clear() { this.path = null; setRecursiveIsSet(false); this.recursive = false; } /** * the path of the file or directory */ public String getPath() { return this.path; } /** * the path of the file or directory */ public free_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } /** * whether to free recursively */ public boolean isRecursive() { return this.recursive; } /** * whether to free recursively */ public free_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case RECURSIVE: return isRecursive(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof free_args) return this.equals((free_args)that); return false; } public boolean equals(free_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_recursive = true; list.add(present_recursive); if (present_recursive) list.add(recursive); return list.hashCode(); } @Override public int compareTo(free_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("free_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class free_argsStandardSchemeFactory implements SchemeFactory { public free_argsStandardScheme getScheme() { return new free_argsStandardScheme(); } } private static class free_argsStandardScheme extends StandardScheme<free_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, free_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, free_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class free_argsTupleSchemeFactory implements SchemeFactory { public free_argsTupleScheme getScheme() { return new free_argsTupleScheme(); } } private static class free_argsTupleScheme extends TupleScheme<free_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, free_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetRecursive()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, free_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class free_result implements org.apache.thrift.TBase<free_result, free_result._Fields>, java.io.Serializable, Cloneable, Comparable<free_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("free_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new free_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new free_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(free_result.class, metaDataMap); } public free_result() { } public free_result( alluxio.thrift.AlluxioTException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public free_result(free_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public free_result deepCopy() { return new free_result(this); } @Override public void clear() { this.e = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public free_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof free_result) return this.equals((free_result)that); return false; } public boolean equals(free_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(free_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("free_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class free_resultStandardSchemeFactory implements SchemeFactory { public free_resultStandardScheme getScheme() { return new free_resultStandardScheme(); } } private static class free_resultStandardScheme extends StandardScheme<free_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, free_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, free_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class free_resultTupleSchemeFactory implements SchemeFactory { public free_resultTupleScheme getScheme() { return new free_resultTupleScheme(); } } private static class free_resultTupleScheme extends TupleScheme<free_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, free_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, free_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class getFileBlockInfoList_args implements org.apache.thrift.TBase<getFileBlockInfoList_args, getFileBlockInfoList_args._Fields>, java.io.Serializable, Cloneable, Comparable<getFileBlockInfoList_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFileBlockInfoList_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getFileBlockInfoList_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getFileBlockInfoList_argsTupleSchemeFactory()); } private String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file */ PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFileBlockInfoList_args.class, metaDataMap); } public getFileBlockInfoList_args() { } public getFileBlockInfoList_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public getFileBlockInfoList_args(getFileBlockInfoList_args other) { if (other.isSetPath()) { this.path = other.path; } } public getFileBlockInfoList_args deepCopy() { return new getFileBlockInfoList_args(this); } @Override public void clear() { this.path = null; } /** * the path of the file */ public String getPath() { return this.path; } /** * the path of the file */ public getFileBlockInfoList_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getFileBlockInfoList_args) return this.equals((getFileBlockInfoList_args)that); return false; } public boolean equals(getFileBlockInfoList_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); return list.hashCode(); } @Override public int compareTo(getFileBlockInfoList_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getFileBlockInfoList_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getFileBlockInfoList_argsStandardSchemeFactory implements SchemeFactory { public getFileBlockInfoList_argsStandardScheme getScheme() { return new getFileBlockInfoList_argsStandardScheme(); } } private static class getFileBlockInfoList_argsStandardScheme extends StandardScheme<getFileBlockInfoList_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getFileBlockInfoList_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getFileBlockInfoList_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getFileBlockInfoList_argsTupleSchemeFactory implements SchemeFactory { public getFileBlockInfoList_argsTupleScheme getScheme() { return new getFileBlockInfoList_argsTupleScheme(); } } private static class getFileBlockInfoList_argsTupleScheme extends TupleScheme<getFileBlockInfoList_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getFileBlockInfoList_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getFileBlockInfoList_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class getFileBlockInfoList_result implements org.apache.thrift.TBase<getFileBlockInfoList_result, getFileBlockInfoList_result._Fields>, java.io.Serializable, Cloneable, Comparable<getFileBlockInfoList_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFileBlockInfoList_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getFileBlockInfoList_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getFileBlockInfoList_resultTupleSchemeFactory()); } private List<FileBlockInfo> success; // required private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FileBlockInfo.class)))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFileBlockInfoList_result.class, metaDataMap); } public getFileBlockInfoList_result() { } public getFileBlockInfoList_result( List<FileBlockInfo> success, alluxio.thrift.AlluxioTException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public getFileBlockInfoList_result(getFileBlockInfoList_result other) { if (other.isSetSuccess()) { List<FileBlockInfo> __this__success = new ArrayList<FileBlockInfo>(other.success.size()); for (FileBlockInfo other_element : other.success) { __this__success.add(new FileBlockInfo(other_element)); } this.success = __this__success; } if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public getFileBlockInfoList_result deepCopy() { return new getFileBlockInfoList_result(this); } @Override public void clear() { this.success = null; this.e = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<FileBlockInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(FileBlockInfo elem) { if (this.success == null) { this.success = new ArrayList<FileBlockInfo>(); } this.success.add(elem); } public List<FileBlockInfo> getSuccess() { return this.success; } public getFileBlockInfoList_result setSuccess(List<FileBlockInfo> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public alluxio.thrift.AlluxioTException getE() { return this.e; } public getFileBlockInfoList_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<FileBlockInfo>)value); } break; case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getFileBlockInfoList_result) return this.equals((getFileBlockInfoList_result)that); return false; } public boolean equals(getFileBlockInfoList_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(getFileBlockInfoList_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getFileBlockInfoList_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getFileBlockInfoList_resultStandardSchemeFactory implements SchemeFactory { public getFileBlockInfoList_resultStandardScheme getScheme() { return new getFileBlockInfoList_resultStandardScheme(); } } private static class getFileBlockInfoList_resultStandardScheme extends StandardScheme<getFileBlockInfoList_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getFileBlockInfoList_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list50 = iprot.readListBegin(); struct.success = new ArrayList<FileBlockInfo>(_list50.size); FileBlockInfo _elem51; for (int _i52 = 0; _i52 < _list50.size; ++_i52) { _elem51 = new FileBlockInfo(); _elem51.read(iprot); struct.success.add(_elem51); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getFileBlockInfoList_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (FileBlockInfo _iter53 : struct.success) { _iter53.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getFileBlockInfoList_resultTupleSchemeFactory implements SchemeFactory { public getFileBlockInfoList_resultTupleScheme getScheme() { return new getFileBlockInfoList_resultTupleScheme(); } } private static class getFileBlockInfoList_resultTupleScheme extends TupleScheme<getFileBlockInfoList_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getFileBlockInfoList_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (FileBlockInfo _iter54 : struct.success) { _iter54.write(oprot); } } } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getFileBlockInfoList_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list55 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<FileBlockInfo>(_list55.size); FileBlockInfo _elem56; for (int _i57 = 0; _i57 < _list55.size; ++_i57) { _elem56 = new FileBlockInfo(); _elem56.read(iprot); struct.success.add(_elem56); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class getStatus_args implements org.apache.thrift.TBase<getStatus_args, getStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<getStatus_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getStatus_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getStatus_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getStatus_argsTupleSchemeFactory()); } private String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file or directory */ PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getStatus_args.class, metaDataMap); } public getStatus_args() { } public getStatus_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public getStatus_args(getStatus_args other) { if (other.isSetPath()) { this.path = other.path; } } public getStatus_args deepCopy() { return new getStatus_args(this); } @Override public void clear() { this.path = null; } /** * the path of the file or directory */ public String getPath() { return this.path; } /** * the path of the file or directory */ public getStatus_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getStatus_args) return this.equals((getStatus_args)that); return false; } public boolean equals(getStatus_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); return list.hashCode(); } @Override public int compareTo(getStatus_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getStatus_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getStatus_argsStandardSchemeFactory implements SchemeFactory { public getStatus_argsStandardScheme getScheme() { return new getStatus_argsStandardScheme(); } } private static class getStatus_argsStandardScheme extends StandardScheme<getStatus_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getStatus_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getStatus_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getStatus_argsTupleSchemeFactory implements SchemeFactory { public getStatus_argsTupleScheme getScheme() { return new getStatus_argsTupleScheme(); } } private static class getStatus_argsTupleScheme extends TupleScheme<getStatus_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getStatus_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getStatus_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class getStatus_result implements org.apache.thrift.TBase<getStatus_result, getStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<getStatus_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getStatus_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getStatus_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getStatus_resultTupleSchemeFactory()); } private FileInfo success; // required private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FileInfo.class))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getStatus_result.class, metaDataMap); } public getStatus_result() { } public getStatus_result( FileInfo success, alluxio.thrift.AlluxioTException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public getStatus_result(getStatus_result other) { if (other.isSetSuccess()) { this.success = new FileInfo(other.success); } if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public getStatus_result deepCopy() { return new getStatus_result(this); } @Override public void clear() { this.success = null; this.e = null; } public FileInfo getSuccess() { return this.success; } public getStatus_result setSuccess(FileInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public alluxio.thrift.AlluxioTException getE() { return this.e; } public getStatus_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((FileInfo)value); } break; case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getStatus_result) return this.equals((getStatus_result)that); return false; } public boolean equals(getStatus_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(getStatus_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getStatus_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getStatus_resultStandardSchemeFactory implements SchemeFactory { public getStatus_resultStandardScheme getScheme() { return new getStatus_resultStandardScheme(); } } private static class getStatus_resultStandardScheme extends StandardScheme<getStatus_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getStatus_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new FileInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getStatus_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getStatus_resultTupleSchemeFactory implements SchemeFactory { public getStatus_resultTupleScheme getScheme() { return new getStatus_resultTupleScheme(); } } private static class getStatus_resultTupleScheme extends TupleScheme<getStatus_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new FileInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class getStatusInternal_args implements org.apache.thrift.TBase<getStatusInternal_args, getStatusInternal_args._Fields>, java.io.Serializable, Cloneable, Comparable<getStatusInternal_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getStatusInternal_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I64, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getStatusInternal_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getStatusInternal_argsTupleSchemeFactory()); } private long fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the id of the file or directory */ FILE_ID((short)1, "fileId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getStatusInternal_args.class, metaDataMap); } public getStatusInternal_args() { } public getStatusInternal_args( long fileId) { this(); this.fileId = fileId; setFileIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public getStatusInternal_args(getStatusInternal_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } public getStatusInternal_args deepCopy() { return new getStatusInternal_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; } /** * the id of the file or directory */ public long getFileId() { return this.fileId; } /** * the id of the file or directory */ public getStatusInternal_args setFileId(long fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return getFileId(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getStatusInternal_args) return this.equals((getStatusInternal_args)that); return false; } public boolean equals(getStatusInternal_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_fileId = true; list.add(present_fileId); if (present_fileId) list.add(fileId); return list.hashCode(); } @Override public int compareTo(getStatusInternal_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getStatusInternal_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getStatusInternal_argsStandardSchemeFactory implements SchemeFactory { public getStatusInternal_argsStandardScheme getScheme() { return new getStatusInternal_argsStandardScheme(); } } private static class getStatusInternal_argsStandardScheme extends StandardScheme<getStatusInternal_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getStatusInternal_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.fileId = iprot.readI64(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getStatusInternal_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI64(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getStatusInternal_argsTupleSchemeFactory implements SchemeFactory { public getStatusInternal_argsTupleScheme getScheme() { return new getStatusInternal_argsTupleScheme(); } } private static class getStatusInternal_argsTupleScheme extends TupleScheme<getStatusInternal_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getStatusInternal_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetFileId()) { oprot.writeI64(struct.fileId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getStatusInternal_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fileId = iprot.readI64(); struct.setFileIdIsSet(true); } } } } public static class getStatusInternal_result implements org.apache.thrift.TBase<getStatusInternal_result, getStatusInternal_result._Fields>, java.io.Serializable, Cloneable, Comparable<getStatusInternal_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getStatusInternal_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getStatusInternal_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getStatusInternal_resultTupleSchemeFactory()); } private FileInfo success; // required private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FileInfo.class))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getStatusInternal_result.class, metaDataMap); } public getStatusInternal_result() { } public getStatusInternal_result( FileInfo success, alluxio.thrift.AlluxioTException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public getStatusInternal_result(getStatusInternal_result other) { if (other.isSetSuccess()) { this.success = new FileInfo(other.success); } if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public getStatusInternal_result deepCopy() { return new getStatusInternal_result(this); } @Override public void clear() { this.success = null; this.e = null; } public FileInfo getSuccess() { return this.success; } public getStatusInternal_result setSuccess(FileInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public alluxio.thrift.AlluxioTException getE() { return this.e; } public getStatusInternal_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((FileInfo)value); } break; case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getStatusInternal_result) return this.equals((getStatusInternal_result)that); return false; } public boolean equals(getStatusInternal_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(getStatusInternal_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getStatusInternal_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getStatusInternal_resultStandardSchemeFactory implements SchemeFactory { public getStatusInternal_resultStandardScheme getScheme() { return new getStatusInternal_resultStandardScheme(); } } private static class getStatusInternal_resultStandardScheme extends StandardScheme<getStatusInternal_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getStatusInternal_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new FileInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getStatusInternal_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getStatusInternal_resultTupleSchemeFactory implements SchemeFactory { public getStatusInternal_resultTupleScheme getScheme() { return new getStatusInternal_resultTupleScheme(); } } private static class getStatusInternal_resultTupleScheme extends TupleScheme<getStatusInternal_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getStatusInternal_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getStatusInternal_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new FileInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class getNewBlockIdForFile_args implements org.apache.thrift.TBase<getNewBlockIdForFile_args, getNewBlockIdForFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<getNewBlockIdForFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNewBlockIdForFile_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getNewBlockIdForFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getNewBlockIdForFile_argsTupleSchemeFactory()); } private String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file */ PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNewBlockIdForFile_args.class, metaDataMap); } public getNewBlockIdForFile_args() { } public getNewBlockIdForFile_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public getNewBlockIdForFile_args(getNewBlockIdForFile_args other) { if (other.isSetPath()) { this.path = other.path; } } public getNewBlockIdForFile_args deepCopy() { return new getNewBlockIdForFile_args(this); } @Override public void clear() { this.path = null; } /** * the path of the file */ public String getPath() { return this.path; } /** * the path of the file */ public getNewBlockIdForFile_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getNewBlockIdForFile_args) return this.equals((getNewBlockIdForFile_args)that); return false; } public boolean equals(getNewBlockIdForFile_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); return list.hashCode(); } @Override public int compareTo(getNewBlockIdForFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getNewBlockIdForFile_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getNewBlockIdForFile_argsStandardSchemeFactory implements SchemeFactory { public getNewBlockIdForFile_argsStandardScheme getScheme() { return new getNewBlockIdForFile_argsStandardScheme(); } } private static class getNewBlockIdForFile_argsStandardScheme extends StandardScheme<getNewBlockIdForFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getNewBlockIdForFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getNewBlockIdForFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getNewBlockIdForFile_argsTupleSchemeFactory implements SchemeFactory { public getNewBlockIdForFile_argsTupleScheme getScheme() { return new getNewBlockIdForFile_argsTupleScheme(); } } private static class getNewBlockIdForFile_argsTupleScheme extends TupleScheme<getNewBlockIdForFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getNewBlockIdForFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getNewBlockIdForFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class getNewBlockIdForFile_result implements org.apache.thrift.TBase<getNewBlockIdForFile_result, getNewBlockIdForFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<getNewBlockIdForFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNewBlockIdForFile_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getNewBlockIdForFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getNewBlockIdForFile_resultTupleSchemeFactory()); } private long success; // required private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNewBlockIdForFile_result.class, metaDataMap); } public getNewBlockIdForFile_result() { } public getNewBlockIdForFile_result( long success, alluxio.thrift.AlluxioTException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public getNewBlockIdForFile_result(getNewBlockIdForFile_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public getNewBlockIdForFile_result deepCopy() { return new getNewBlockIdForFile_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public long getSuccess() { return this.success; } public getNewBlockIdForFile_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public alluxio.thrift.AlluxioTException getE() { return this.e; } public getNewBlockIdForFile_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getNewBlockIdForFile_result) return this.equals((getNewBlockIdForFile_result)that); return false; } public boolean equals(getNewBlockIdForFile_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true; list.add(present_success); if (present_success) list.add(success); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(getNewBlockIdForFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getNewBlockIdForFile_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getNewBlockIdForFile_resultStandardSchemeFactory implements SchemeFactory { public getNewBlockIdForFile_resultStandardScheme getScheme() { return new getNewBlockIdForFile_resultStandardScheme(); } } private static class getNewBlockIdForFile_resultStandardScheme extends StandardScheme<getNewBlockIdForFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getNewBlockIdForFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getNewBlockIdForFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getNewBlockIdForFile_resultTupleSchemeFactory implements SchemeFactory { public getNewBlockIdForFile_resultTupleScheme getScheme() { return new getNewBlockIdForFile_resultTupleScheme(); } } private static class getNewBlockIdForFile_resultTupleScheme extends TupleScheme<getNewBlockIdForFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getNewBlockIdForFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getNewBlockIdForFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class getUfsAddress_args implements org.apache.thrift.TBase<getUfsAddress_args, getUfsAddress_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUfsAddress_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUfsAddress_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getUfsAddress_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getUfsAddress_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUfsAddress_args.class, metaDataMap); } public getUfsAddress_args() { } /** * Performs a deep copy on <i>other</i>. */ public getUfsAddress_args(getUfsAddress_args other) { } public getUfsAddress_args deepCopy() { return new getUfsAddress_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getUfsAddress_args) return this.equals((getUfsAddress_args)that); return false; } public boolean equals(getUfsAddress_args that) { if (that == null) return false; return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); return list.hashCode(); } @Override public int compareTo(getUfsAddress_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getUfsAddress_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getUfsAddress_argsStandardSchemeFactory implements SchemeFactory { public getUfsAddress_argsStandardScheme getScheme() { return new getUfsAddress_argsStandardScheme(); } } private static class getUfsAddress_argsStandardScheme extends StandardScheme<getUfsAddress_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getUfsAddress_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getUfsAddress_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getUfsAddress_argsTupleSchemeFactory implements SchemeFactory { public getUfsAddress_argsTupleScheme getScheme() { return new getUfsAddress_argsTupleScheme(); } } private static class getUfsAddress_argsTupleScheme extends TupleScheme<getUfsAddress_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getUfsAddress_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getUfsAddress_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class getUfsAddress_result implements org.apache.thrift.TBase<getUfsAddress_result, getUfsAddress_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUfsAddress_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUfsAddress_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getUfsAddress_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getUfsAddress_resultTupleSchemeFactory()); } private String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUfsAddress_result.class, metaDataMap); } public getUfsAddress_result() { } public getUfsAddress_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getUfsAddress_result(getUfsAddress_result other) { if (other.isSetSuccess()) { this.success = other.success; } } public getUfsAddress_result deepCopy() { return new getUfsAddress_result(this); } @Override public void clear() { this.success = null; } public String getSuccess() { return this.success; } public getUfsAddress_result setSuccess(String success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getUfsAddress_result) return this.equals((getUfsAddress_result)that); return false; } public boolean equals(getUfsAddress_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(getUfsAddress_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getUfsAddress_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getUfsAddress_resultStandardSchemeFactory implements SchemeFactory { public getUfsAddress_resultStandardScheme getScheme() { return new getUfsAddress_resultStandardScheme(); } } private static class getUfsAddress_resultStandardScheme extends StandardScheme<getUfsAddress_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getUfsAddress_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getUfsAddress_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getUfsAddress_resultTupleSchemeFactory implements SchemeFactory { public getUfsAddress_resultTupleScheme getScheme() { return new getUfsAddress_resultTupleScheme(); } } private static class getUfsAddress_resultTupleScheme extends TupleScheme<getUfsAddress_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getUfsAddress_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getUfsAddress_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } } } } public static class listStatus_args implements org.apache.thrift.TBase<listStatus_args, listStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<listStatus_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("listStatus_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new listStatus_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new listStatus_argsTupleSchemeFactory()); } private String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file or directory */ PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(listStatus_args.class, metaDataMap); } public listStatus_args() { } public listStatus_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public listStatus_args(listStatus_args other) { if (other.isSetPath()) { this.path = other.path; } } public listStatus_args deepCopy() { return new listStatus_args(this); } @Override public void clear() { this.path = null; } /** * the path of the file or directory */ public String getPath() { return this.path; } /** * the path of the file or directory */ public listStatus_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof listStatus_args) return this.equals((listStatus_args)that); return false; } public boolean equals(listStatus_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); return list.hashCode(); } @Override public int compareTo(listStatus_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("listStatus_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class listStatus_argsStandardSchemeFactory implements SchemeFactory { public listStatus_argsStandardScheme getScheme() { return new listStatus_argsStandardScheme(); } } private static class listStatus_argsStandardScheme extends StandardScheme<listStatus_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, listStatus_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, listStatus_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class listStatus_argsTupleSchemeFactory implements SchemeFactory { public listStatus_argsTupleScheme getScheme() { return new listStatus_argsTupleScheme(); } } private static class listStatus_argsTupleScheme extends TupleScheme<listStatus_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, listStatus_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, listStatus_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class listStatus_result implements org.apache.thrift.TBase<listStatus_result, listStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<listStatus_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("listStatus_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new listStatus_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new listStatus_resultTupleSchemeFactory()); } private List<FileInfo> success; // required private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FileInfo.class)))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(listStatus_result.class, metaDataMap); } public listStatus_result() { } public listStatus_result( List<FileInfo> success, alluxio.thrift.AlluxioTException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public listStatus_result(listStatus_result other) { if (other.isSetSuccess()) { List<FileInfo> __this__success = new ArrayList<FileInfo>(other.success.size()); for (FileInfo other_element : other.success) { __this__success.add(new FileInfo(other_element)); } this.success = __this__success; } if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public listStatus_result deepCopy() { return new listStatus_result(this); } @Override public void clear() { this.success = null; this.e = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<FileInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(FileInfo elem) { if (this.success == null) { this.success = new ArrayList<FileInfo>(); } this.success.add(elem); } public List<FileInfo> getSuccess() { return this.success; } public listStatus_result setSuccess(List<FileInfo> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public alluxio.thrift.AlluxioTException getE() { return this.e; } public listStatus_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<FileInfo>)value); } break; case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof listStatus_result) return this.equals((listStatus_result)that); return false; } public boolean equals(listStatus_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(listStatus_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("listStatus_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class listStatus_resultStandardSchemeFactory implements SchemeFactory { public listStatus_resultStandardScheme getScheme() { return new listStatus_resultStandardScheme(); } } private static class listStatus_resultStandardScheme extends StandardScheme<listStatus_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, listStatus_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list58 = iprot.readListBegin(); struct.success = new ArrayList<FileInfo>(_list58.size); FileInfo _elem59; for (int _i60 = 0; _i60 < _list58.size; ++_i60) { _elem59 = new FileInfo(); _elem59.read(iprot); struct.success.add(_elem59); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, listStatus_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (FileInfo _iter61 : struct.success) { _iter61.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class listStatus_resultTupleSchemeFactory implements SchemeFactory { public listStatus_resultTupleScheme getScheme() { return new listStatus_resultTupleScheme(); } } private static class listStatus_resultTupleScheme extends TupleScheme<listStatus_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, listStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (FileInfo _iter62 : struct.success) { _iter62.write(oprot); } } } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, listStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list63 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<FileInfo>(_list63.size); FileInfo _elem64; for (int _i65 = 0; _i65 < _list63.size; ++_i65) { _elem64 = new FileInfo(); _elem64.read(iprot); struct.success.add(_elem64); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class loadMetadata_args implements org.apache.thrift.TBase<loadMetadata_args, loadMetadata_args._Fields>, java.io.Serializable, Cloneable, Comparable<loadMetadata_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("loadMetadata_args"); private static final org.apache.thrift.protocol.TField UFS_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("ufsPath", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new loadMetadata_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new loadMetadata_argsTupleSchemeFactory()); } private String ufsPath; // required private boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the under file system */ UFS_PATH((short)1, "ufsPath"), /** * whether to load meta data recursively */ RECURSIVE((short)2, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // UFS_PATH return UFS_PATH; case 2: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __RECURSIVE_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.UFS_PATH, new org.apache.thrift.meta_data.FieldMetaData("ufsPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(loadMetadata_args.class, metaDataMap); } public loadMetadata_args() { } public loadMetadata_args( String ufsPath, boolean recursive) { this(); this.ufsPath = ufsPath; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public loadMetadata_args(loadMetadata_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetUfsPath()) { this.ufsPath = other.ufsPath; } this.recursive = other.recursive; } public loadMetadata_args deepCopy() { return new loadMetadata_args(this); } @Override public void clear() { this.ufsPath = null; setRecursiveIsSet(false); this.recursive = false; } /** * the path of the under file system */ public String getUfsPath() { return this.ufsPath; } /** * the path of the under file system */ public loadMetadata_args setUfsPath(String ufsPath) { this.ufsPath = ufsPath; return this; } public void unsetUfsPath() { this.ufsPath = null; } /** Returns true if field ufsPath is set (has been assigned a value) and false otherwise */ public boolean isSetUfsPath() { return this.ufsPath != null; } public void setUfsPathIsSet(boolean value) { if (!value) { this.ufsPath = null; } } /** * whether to load meta data recursively */ public boolean isRecursive() { return this.recursive; } /** * whether to load meta data recursively */ public loadMetadata_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case UFS_PATH: if (value == null) { unsetUfsPath(); } else { setUfsPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case UFS_PATH: return getUfsPath(); case RECURSIVE: return isRecursive(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case UFS_PATH: return isSetUfsPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof loadMetadata_args) return this.equals((loadMetadata_args)that); return false; } public boolean equals(loadMetadata_args that) { if (that == null) return false; boolean this_present_ufsPath = true && this.isSetUfsPath(); boolean that_present_ufsPath = true && that.isSetUfsPath(); if (this_present_ufsPath || that_present_ufsPath) { if (!(this_present_ufsPath && that_present_ufsPath)) return false; if (!this.ufsPath.equals(that.ufsPath)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_ufsPath = true && (isSetUfsPath()); list.add(present_ufsPath); if (present_ufsPath) list.add(ufsPath); boolean present_recursive = true; list.add(present_recursive); if (present_recursive) list.add(recursive); return list.hashCode(); } @Override public int compareTo(loadMetadata_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetUfsPath()).compareTo(other.isSetUfsPath()); if (lastComparison != 0) { return lastComparison; } if (isSetUfsPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ufsPath, other.ufsPath); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("loadMetadata_args("); boolean first = true; sb.append("ufsPath:"); if (this.ufsPath == null) { sb.append("null"); } else { sb.append(this.ufsPath); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class loadMetadata_argsStandardSchemeFactory implements SchemeFactory { public loadMetadata_argsStandardScheme getScheme() { return new loadMetadata_argsStandardScheme(); } } private static class loadMetadata_argsStandardScheme extends StandardScheme<loadMetadata_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, loadMetadata_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // UFS_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.ufsPath = iprot.readString(); struct.setUfsPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, loadMetadata_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.ufsPath != null) { oprot.writeFieldBegin(UFS_PATH_FIELD_DESC); oprot.writeString(struct.ufsPath); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class loadMetadata_argsTupleSchemeFactory implements SchemeFactory { public loadMetadata_argsTupleScheme getScheme() { return new loadMetadata_argsTupleScheme(); } } private static class loadMetadata_argsTupleScheme extends TupleScheme<loadMetadata_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, loadMetadata_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetUfsPath()) { optionals.set(0); } if (struct.isSetRecursive()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetUfsPath()) { oprot.writeString(struct.ufsPath); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, loadMetadata_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.ufsPath = iprot.readString(); struct.setUfsPathIsSet(true); } if (incoming.get(1)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class loadMetadata_result implements org.apache.thrift.TBase<loadMetadata_result, loadMetadata_result._Fields>, java.io.Serializable, Cloneable, Comparable<loadMetadata_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("loadMetadata_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField IOE_FIELD_DESC = new org.apache.thrift.protocol.TField("ioe", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new loadMetadata_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new loadMetadata_resultTupleSchemeFactory()); } private long success; // required private alluxio.thrift.AlluxioTException e; // required private alluxio.thrift.ThriftIOException ioe; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"), IOE((short)2, "ioe"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; case 2: // IOE return IOE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.IOE, new org.apache.thrift.meta_data.FieldMetaData("ioe", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(loadMetadata_result.class, metaDataMap); } public loadMetadata_result() { } public loadMetadata_result( long success, alluxio.thrift.AlluxioTException e, alluxio.thrift.ThriftIOException ioe) { this(); this.success = success; setSuccessIsSet(true); this.e = e; this.ioe = ioe; } /** * Performs a deep copy on <i>other</i>. */ public loadMetadata_result(loadMetadata_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } if (other.isSetIoe()) { this.ioe = new alluxio.thrift.ThriftIOException(other.ioe); } } public loadMetadata_result deepCopy() { return new loadMetadata_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; this.ioe = null; } public long getSuccess() { return this.success; } public loadMetadata_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public alluxio.thrift.AlluxioTException getE() { return this.e; } public loadMetadata_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public alluxio.thrift.ThriftIOException getIoe() { return this.ioe; } public loadMetadata_result setIoe(alluxio.thrift.ThriftIOException ioe) { this.ioe = ioe; return this; } public void unsetIoe() { this.ioe = null; } /** Returns true if field ioe is set (has been assigned a value) and false otherwise */ public boolean isSetIoe() { return this.ioe != null; } public void setIoeIsSet(boolean value) { if (!value) { this.ioe = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; case IOE: if (value == null) { unsetIoe(); } else { setIoe((alluxio.thrift.ThriftIOException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); case IOE: return getIoe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); case IOE: return isSetIoe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof loadMetadata_result) return this.equals((loadMetadata_result)that); return false; } public boolean equals(loadMetadata_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } boolean this_present_ioe = true && this.isSetIoe(); boolean that_present_ioe = true && that.isSetIoe(); if (this_present_ioe || that_present_ioe) { if (!(this_present_ioe && that_present_ioe)) return false; if (!this.ioe.equals(that.ioe)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true; list.add(present_success); if (present_success) list.add(success); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); boolean present_ioe = true && (isSetIoe()); list.add(present_ioe); if (present_ioe) list.add(ioe); return list.hashCode(); } @Override public int compareTo(loadMetadata_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoe()).compareTo(other.isSetIoe()); if (lastComparison != 0) { return lastComparison; } if (isSetIoe()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioe, other.ioe); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("loadMetadata_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; if (!first) sb.append(", "); sb.append("ioe:"); if (this.ioe == null) { sb.append("null"); } else { sb.append(this.ioe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class loadMetadata_resultStandardSchemeFactory implements SchemeFactory { public loadMetadata_resultStandardScheme getScheme() { return new loadMetadata_resultStandardScheme(); } } private static class loadMetadata_resultStandardScheme extends StandardScheme<loadMetadata_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, loadMetadata_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IOE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, loadMetadata_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } if (struct.ioe != null) { oprot.writeFieldBegin(IOE_FIELD_DESC); struct.ioe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class loadMetadata_resultTupleSchemeFactory implements SchemeFactory { public loadMetadata_resultTupleScheme getScheme() { return new loadMetadata_resultTupleScheme(); } } private static class loadMetadata_resultTupleScheme extends TupleScheme<loadMetadata_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, loadMetadata_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } if (struct.isSetIoe()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } if (struct.isSetIoe()) { struct.ioe.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, loadMetadata_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } if (incoming.get(2)) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } } } } public static class mount_args implements org.apache.thrift.TBase<mount_args, mount_args._Fields>, java.io.Serializable, Cloneable, Comparable<mount_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mount_args"); private static final org.apache.thrift.protocol.TField ALLUXIO_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("alluxioPath", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField UFS_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("ufsPath", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new mount_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new mount_argsTupleSchemeFactory()); } private String alluxioPath; // required private String ufsPath; // required private MountTOptions options; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of alluxio mount point */ ALLUXIO_PATH((short)1, "alluxioPath"), /** * the path of the under file system */ UFS_PATH((short)2, "ufsPath"), /** * the options for creating the mount point */ OPTIONS((short)3, "options"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // ALLUXIO_PATH return ALLUXIO_PATH; case 2: // UFS_PATH return UFS_PATH; case 3: // OPTIONS return OPTIONS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.ALLUXIO_PATH, new org.apache.thrift.meta_data.FieldMetaData("alluxioPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.UFS_PATH, new org.apache.thrift.meta_data.FieldMetaData("ufsPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MountTOptions.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mount_args.class, metaDataMap); } public mount_args() { } public mount_args( String alluxioPath, String ufsPath, MountTOptions options) { this(); this.alluxioPath = alluxioPath; this.ufsPath = ufsPath; this.options = options; } /** * Performs a deep copy on <i>other</i>. */ public mount_args(mount_args other) { if (other.isSetAlluxioPath()) { this.alluxioPath = other.alluxioPath; } if (other.isSetUfsPath()) { this.ufsPath = other.ufsPath; } if (other.isSetOptions()) { this.options = new MountTOptions(other.options); } } public mount_args deepCopy() { return new mount_args(this); } @Override public void clear() { this.alluxioPath = null; this.ufsPath = null; this.options = null; } /** * the path of alluxio mount point */ public String getAlluxioPath() { return this.alluxioPath; } /** * the path of alluxio mount point */ public mount_args setAlluxioPath(String alluxioPath) { this.alluxioPath = alluxioPath; return this; } public void unsetAlluxioPath() { this.alluxioPath = null; } /** Returns true if field alluxioPath is set (has been assigned a value) and false otherwise */ public boolean isSetAlluxioPath() { return this.alluxioPath != null; } public void setAlluxioPathIsSet(boolean value) { if (!value) { this.alluxioPath = null; } } /** * the path of the under file system */ public String getUfsPath() { return this.ufsPath; } /** * the path of the under file system */ public mount_args setUfsPath(String ufsPath) { this.ufsPath = ufsPath; return this; } public void unsetUfsPath() { this.ufsPath = null; } /** Returns true if field ufsPath is set (has been assigned a value) and false otherwise */ public boolean isSetUfsPath() { return this.ufsPath != null; } public void setUfsPathIsSet(boolean value) { if (!value) { this.ufsPath = null; } } /** * the options for creating the mount point */ public MountTOptions getOptions() { return this.options; } /** * the options for creating the mount point */ public mount_args setOptions(MountTOptions options) { this.options = options; return this; } public void unsetOptions() { this.options = null; } /** Returns true if field options is set (has been assigned a value) and false otherwise */ public boolean isSetOptions() { return this.options != null; } public void setOptionsIsSet(boolean value) { if (!value) { this.options = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case ALLUXIO_PATH: if (value == null) { unsetAlluxioPath(); } else { setAlluxioPath((String)value); } break; case UFS_PATH: if (value == null) { unsetUfsPath(); } else { setUfsPath((String)value); } break; case OPTIONS: if (value == null) { unsetOptions(); } else { setOptions((MountTOptions)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case ALLUXIO_PATH: return getAlluxioPath(); case UFS_PATH: return getUfsPath(); case OPTIONS: return getOptions(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case ALLUXIO_PATH: return isSetAlluxioPath(); case UFS_PATH: return isSetUfsPath(); case OPTIONS: return isSetOptions(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof mount_args) return this.equals((mount_args)that); return false; } public boolean equals(mount_args that) { if (that == null) return false; boolean this_present_alluxioPath = true && this.isSetAlluxioPath(); boolean that_present_alluxioPath = true && that.isSetAlluxioPath(); if (this_present_alluxioPath || that_present_alluxioPath) { if (!(this_present_alluxioPath && that_present_alluxioPath)) return false; if (!this.alluxioPath.equals(that.alluxioPath)) return false; } boolean this_present_ufsPath = true && this.isSetUfsPath(); boolean that_present_ufsPath = true && that.isSetUfsPath(); if (this_present_ufsPath || that_present_ufsPath) { if (!(this_present_ufsPath && that_present_ufsPath)) return false; if (!this.ufsPath.equals(that.ufsPath)) return false; } boolean this_present_options = true && this.isSetOptions(); boolean that_present_options = true && that.isSetOptions(); if (this_present_options || that_present_options) { if (!(this_present_options && that_present_options)) return false; if (!this.options.equals(that.options)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_alluxioPath = true && (isSetAlluxioPath()); list.add(present_alluxioPath); if (present_alluxioPath) list.add(alluxioPath); boolean present_ufsPath = true && (isSetUfsPath()); list.add(present_ufsPath); if (present_ufsPath) list.add(ufsPath); boolean present_options = true && (isSetOptions()); list.add(present_options); if (present_options) list.add(options); return list.hashCode(); } @Override public int compareTo(mount_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetAlluxioPath()).compareTo(other.isSetAlluxioPath()); if (lastComparison != 0) { return lastComparison; } if (isSetAlluxioPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.alluxioPath, other.alluxioPath); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUfsPath()).compareTo(other.isSetUfsPath()); if (lastComparison != 0) { return lastComparison; } if (isSetUfsPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ufsPath, other.ufsPath); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions()); if (lastComparison != 0) { return lastComparison; } if (isSetOptions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("mount_args("); boolean first = true; sb.append("alluxioPath:"); if (this.alluxioPath == null) { sb.append("null"); } else { sb.append(this.alluxioPath); } first = false; if (!first) sb.append(", "); sb.append("ufsPath:"); if (this.ufsPath == null) { sb.append("null"); } else { sb.append(this.ufsPath); } first = false; if (!first) sb.append(", "); sb.append("options:"); if (this.options == null) { sb.append("null"); } else { sb.append(this.options); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (options != null) { options.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class mount_argsStandardSchemeFactory implements SchemeFactory { public mount_argsStandardScheme getScheme() { return new mount_argsStandardScheme(); } } private static class mount_argsStandardScheme extends StandardScheme<mount_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, mount_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // ALLUXIO_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.alluxioPath = iprot.readString(); struct.setAlluxioPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // UFS_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.ufsPath = iprot.readString(); struct.setUfsPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // OPTIONS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.options = new MountTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, mount_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.alluxioPath != null) { oprot.writeFieldBegin(ALLUXIO_PATH_FIELD_DESC); oprot.writeString(struct.alluxioPath); oprot.writeFieldEnd(); } if (struct.ufsPath != null) { oprot.writeFieldBegin(UFS_PATH_FIELD_DESC); oprot.writeString(struct.ufsPath); oprot.writeFieldEnd(); } if (struct.options != null) { oprot.writeFieldBegin(OPTIONS_FIELD_DESC); struct.options.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class mount_argsTupleSchemeFactory implements SchemeFactory { public mount_argsTupleScheme getScheme() { return new mount_argsTupleScheme(); } } private static class mount_argsTupleScheme extends TupleScheme<mount_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, mount_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetAlluxioPath()) { optionals.set(0); } if (struct.isSetUfsPath()) { optionals.set(1); } if (struct.isSetOptions()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetAlluxioPath()) { oprot.writeString(struct.alluxioPath); } if (struct.isSetUfsPath()) { oprot.writeString(struct.ufsPath); } if (struct.isSetOptions()) { struct.options.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, mount_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.alluxioPath = iprot.readString(); struct.setAlluxioPathIsSet(true); } if (incoming.get(1)) { struct.ufsPath = iprot.readString(); struct.setUfsPathIsSet(true); } if (incoming.get(2)) { struct.options = new MountTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } } } } public static class mount_result implements org.apache.thrift.TBase<mount_result, mount_result._Fields>, java.io.Serializable, Cloneable, Comparable<mount_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("mount_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField IOE_FIELD_DESC = new org.apache.thrift.protocol.TField("ioe", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new mount_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new mount_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required private alluxio.thrift.ThriftIOException ioe; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"), IOE((short)2, "ioe"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; case 2: // IOE return IOE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.IOE, new org.apache.thrift.meta_data.FieldMetaData("ioe", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(mount_result.class, metaDataMap); } public mount_result() { } public mount_result( alluxio.thrift.AlluxioTException e, alluxio.thrift.ThriftIOException ioe) { this(); this.e = e; this.ioe = ioe; } /** * Performs a deep copy on <i>other</i>. */ public mount_result(mount_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } if (other.isSetIoe()) { this.ioe = new alluxio.thrift.ThriftIOException(other.ioe); } } public mount_result deepCopy() { return new mount_result(this); } @Override public void clear() { this.e = null; this.ioe = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public mount_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public alluxio.thrift.ThriftIOException getIoe() { return this.ioe; } public mount_result setIoe(alluxio.thrift.ThriftIOException ioe) { this.ioe = ioe; return this; } public void unsetIoe() { this.ioe = null; } /** Returns true if field ioe is set (has been assigned a value) and false otherwise */ public boolean isSetIoe() { return this.ioe != null; } public void setIoeIsSet(boolean value) { if (!value) { this.ioe = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; case IOE: if (value == null) { unsetIoe(); } else { setIoe((alluxio.thrift.ThriftIOException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); case IOE: return getIoe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); case IOE: return isSetIoe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof mount_result) return this.equals((mount_result)that); return false; } public boolean equals(mount_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } boolean this_present_ioe = true && this.isSetIoe(); boolean that_present_ioe = true && that.isSetIoe(); if (this_present_ioe || that_present_ioe) { if (!(this_present_ioe && that_present_ioe)) return false; if (!this.ioe.equals(that.ioe)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); boolean present_ioe = true && (isSetIoe()); list.add(present_ioe); if (present_ioe) list.add(ioe); return list.hashCode(); } @Override public int compareTo(mount_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoe()).compareTo(other.isSetIoe()); if (lastComparison != 0) { return lastComparison; } if (isSetIoe()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioe, other.ioe); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("mount_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; if (!first) sb.append(", "); sb.append("ioe:"); if (this.ioe == null) { sb.append("null"); } else { sb.append(this.ioe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class mount_resultStandardSchemeFactory implements SchemeFactory { public mount_resultStandardScheme getScheme() { return new mount_resultStandardScheme(); } } private static class mount_resultStandardScheme extends StandardScheme<mount_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, mount_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IOE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, mount_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } if (struct.ioe != null) { oprot.writeFieldBegin(IOE_FIELD_DESC); struct.ioe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class mount_resultTupleSchemeFactory implements SchemeFactory { public mount_resultTupleScheme getScheme() { return new mount_resultTupleScheme(); } } private static class mount_resultTupleScheme extends TupleScheme<mount_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, mount_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } if (struct.isSetIoe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetE()) { struct.e.write(oprot); } if (struct.isSetIoe()) { struct.ioe.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, mount_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } if (incoming.get(1)) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } } } } public static class remove_args implements org.apache.thrift.TBase<remove_args, remove_args._Fields>, java.io.Serializable, Cloneable, Comparable<remove_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("remove_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new remove_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new remove_argsTupleSchemeFactory()); } private String path; // required private boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file or directory */ PATH((short)1, "path"), /** * whether to remove recursively */ RECURSIVE((short)2, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __RECURSIVE_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(remove_args.class, metaDataMap); } public remove_args() { } public remove_args( String path, boolean recursive) { this(); this.path = path; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public remove_args(remove_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } this.recursive = other.recursive; } public remove_args deepCopy() { return new remove_args(this); } @Override public void clear() { this.path = null; setRecursiveIsSet(false); this.recursive = false; } /** * the path of the file or directory */ public String getPath() { return this.path; } /** * the path of the file or directory */ public remove_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } /** * whether to remove recursively */ public boolean isRecursive() { return this.recursive; } /** * whether to remove recursively */ public remove_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case RECURSIVE: return isRecursive(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof remove_args) return this.equals((remove_args)that); return false; } public boolean equals(remove_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_recursive = true; list.add(present_recursive); if (present_recursive) list.add(recursive); return list.hashCode(); } @Override public int compareTo(remove_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("remove_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class remove_argsStandardSchemeFactory implements SchemeFactory { public remove_argsStandardScheme getScheme() { return new remove_argsStandardScheme(); } } private static class remove_argsStandardScheme extends StandardScheme<remove_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, remove_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, remove_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class remove_argsTupleSchemeFactory implements SchemeFactory { public remove_argsTupleScheme getScheme() { return new remove_argsTupleScheme(); } } private static class remove_argsTupleScheme extends TupleScheme<remove_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, remove_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetRecursive()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, remove_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class remove_result implements org.apache.thrift.TBase<remove_result, remove_result._Fields>, java.io.Serializable, Cloneable, Comparable<remove_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("remove_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new remove_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new remove_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(remove_result.class, metaDataMap); } public remove_result() { } public remove_result( alluxio.thrift.AlluxioTException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public remove_result(remove_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public remove_result deepCopy() { return new remove_result(this); } @Override public void clear() { this.e = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public remove_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof remove_result) return this.equals((remove_result)that); return false; } public boolean equals(remove_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(remove_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("remove_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class remove_resultStandardSchemeFactory implements SchemeFactory { public remove_resultStandardScheme getScheme() { return new remove_resultStandardScheme(); } } private static class remove_resultStandardScheme extends StandardScheme<remove_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, remove_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, remove_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class remove_resultTupleSchemeFactory implements SchemeFactory { public remove_resultTupleScheme getScheme() { return new remove_resultTupleScheme(); } } private static class remove_resultTupleScheme extends TupleScheme<remove_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, remove_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, remove_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class rename_args implements org.apache.thrift.TBase<rename_args, rename_args._Fields>, java.io.Serializable, Cloneable, Comparable<rename_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rename_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField DST_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("dstPath", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new rename_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new rename_argsTupleSchemeFactory()); } private String path; // required private String dstPath; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file or directory */ PATH((short)1, "path"), /** * the desinationpath of the file */ DST_PATH((short)2, "dstPath"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // DST_PATH return DST_PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DST_PATH, new org.apache.thrift.meta_data.FieldMetaData("dstPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rename_args.class, metaDataMap); } public rename_args() { } public rename_args( String path, String dstPath) { this(); this.path = path; this.dstPath = dstPath; } /** * Performs a deep copy on <i>other</i>. */ public rename_args(rename_args other) { if (other.isSetPath()) { this.path = other.path; } if (other.isSetDstPath()) { this.dstPath = other.dstPath; } } public rename_args deepCopy() { return new rename_args(this); } @Override public void clear() { this.path = null; this.dstPath = null; } /** * the path of the file or directory */ public String getPath() { return this.path; } /** * the path of the file or directory */ public rename_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } /** * the desinationpath of the file */ public String getDstPath() { return this.dstPath; } /** * the desinationpath of the file */ public rename_args setDstPath(String dstPath) { this.dstPath = dstPath; return this; } public void unsetDstPath() { this.dstPath = null; } /** Returns true if field dstPath is set (has been assigned a value) and false otherwise */ public boolean isSetDstPath() { return this.dstPath != null; } public void setDstPathIsSet(boolean value) { if (!value) { this.dstPath = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case DST_PATH: if (value == null) { unsetDstPath(); } else { setDstPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case DST_PATH: return getDstPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case DST_PATH: return isSetDstPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof rename_args) return this.equals((rename_args)that); return false; } public boolean equals(rename_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_dstPath = true && this.isSetDstPath(); boolean that_present_dstPath = true && that.isSetDstPath(); if (this_present_dstPath || that_present_dstPath) { if (!(this_present_dstPath && that_present_dstPath)) return false; if (!this.dstPath.equals(that.dstPath)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_dstPath = true && (isSetDstPath()); list.add(present_dstPath); if (present_dstPath) list.add(dstPath); return list.hashCode(); } @Override public int compareTo(rename_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDstPath()).compareTo(other.isSetDstPath()); if (lastComparison != 0) { return lastComparison; } if (isSetDstPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dstPath, other.dstPath); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("rename_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("dstPath:"); if (this.dstPath == null) { sb.append("null"); } else { sb.append(this.dstPath); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class rename_argsStandardSchemeFactory implements SchemeFactory { public rename_argsStandardScheme getScheme() { return new rename_argsStandardScheme(); } } private static class rename_argsStandardScheme extends StandardScheme<rename_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, rename_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DST_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dstPath = iprot.readString(); struct.setDstPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, rename_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.dstPath != null) { oprot.writeFieldBegin(DST_PATH_FIELD_DESC); oprot.writeString(struct.dstPath); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class rename_argsTupleSchemeFactory implements SchemeFactory { public rename_argsTupleScheme getScheme() { return new rename_argsTupleScheme(); } } private static class rename_argsTupleScheme extends TupleScheme<rename_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, rename_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetDstPath()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetDstPath()) { oprot.writeString(struct.dstPath); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, rename_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.dstPath = iprot.readString(); struct.setDstPathIsSet(true); } } } } public static class rename_result implements org.apache.thrift.TBase<rename_result, rename_result._Fields>, java.io.Serializable, Cloneable, Comparable<rename_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rename_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField IOE_FIELD_DESC = new org.apache.thrift.protocol.TField("ioe", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new rename_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new rename_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required private alluxio.thrift.ThriftIOException ioe; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"), IOE((short)2, "ioe"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; case 2: // IOE return IOE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.IOE, new org.apache.thrift.meta_data.FieldMetaData("ioe", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rename_result.class, metaDataMap); } public rename_result() { } public rename_result( alluxio.thrift.AlluxioTException e, alluxio.thrift.ThriftIOException ioe) { this(); this.e = e; this.ioe = ioe; } /** * Performs a deep copy on <i>other</i>. */ public rename_result(rename_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } if (other.isSetIoe()) { this.ioe = new alluxio.thrift.ThriftIOException(other.ioe); } } public rename_result deepCopy() { return new rename_result(this); } @Override public void clear() { this.e = null; this.ioe = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public rename_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public alluxio.thrift.ThriftIOException getIoe() { return this.ioe; } public rename_result setIoe(alluxio.thrift.ThriftIOException ioe) { this.ioe = ioe; return this; } public void unsetIoe() { this.ioe = null; } /** Returns true if field ioe is set (has been assigned a value) and false otherwise */ public boolean isSetIoe() { return this.ioe != null; } public void setIoeIsSet(boolean value) { if (!value) { this.ioe = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; case IOE: if (value == null) { unsetIoe(); } else { setIoe((alluxio.thrift.ThriftIOException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); case IOE: return getIoe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); case IOE: return isSetIoe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof rename_result) return this.equals((rename_result)that); return false; } public boolean equals(rename_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } boolean this_present_ioe = true && this.isSetIoe(); boolean that_present_ioe = true && that.isSetIoe(); if (this_present_ioe || that_present_ioe) { if (!(this_present_ioe && that_present_ioe)) return false; if (!this.ioe.equals(that.ioe)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); boolean present_ioe = true && (isSetIoe()); list.add(present_ioe); if (present_ioe) list.add(ioe); return list.hashCode(); } @Override public int compareTo(rename_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoe()).compareTo(other.isSetIoe()); if (lastComparison != 0) { return lastComparison; } if (isSetIoe()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioe, other.ioe); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("rename_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; if (!first) sb.append(", "); sb.append("ioe:"); if (this.ioe == null) { sb.append("null"); } else { sb.append(this.ioe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class rename_resultStandardSchemeFactory implements SchemeFactory { public rename_resultStandardScheme getScheme() { return new rename_resultStandardScheme(); } } private static class rename_resultStandardScheme extends StandardScheme<rename_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, rename_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IOE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, rename_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } if (struct.ioe != null) { oprot.writeFieldBegin(IOE_FIELD_DESC); struct.ioe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class rename_resultTupleSchemeFactory implements SchemeFactory { public rename_resultTupleScheme getScheme() { return new rename_resultTupleScheme(); } } private static class rename_resultTupleScheme extends TupleScheme<rename_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, rename_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } if (struct.isSetIoe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetE()) { struct.e.write(oprot); } if (struct.isSetIoe()) { struct.ioe.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, rename_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } if (incoming.get(1)) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } } } } public static class setAttribute_args implements org.apache.thrift.TBase<setAttribute_args, setAttribute_args._Fields>, java.io.Serializable, Cloneable, Comparable<setAttribute_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setAttribute_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new setAttribute_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new setAttribute_argsTupleSchemeFactory()); } private String path; // required private SetAttributeTOptions options; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file or directory */ PATH((short)1, "path"), /** * the method options */ OPTIONS((short)2, "options"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // OPTIONS return OPTIONS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SetAttributeTOptions.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setAttribute_args.class, metaDataMap); } public setAttribute_args() { } public setAttribute_args( String path, SetAttributeTOptions options) { this(); this.path = path; this.options = options; } /** * Performs a deep copy on <i>other</i>. */ public setAttribute_args(setAttribute_args other) { if (other.isSetPath()) { this.path = other.path; } if (other.isSetOptions()) { this.options = new SetAttributeTOptions(other.options); } } public setAttribute_args deepCopy() { return new setAttribute_args(this); } @Override public void clear() { this.path = null; this.options = null; } /** * the path of the file or directory */ public String getPath() { return this.path; } /** * the path of the file or directory */ public setAttribute_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } /** * the method options */ public SetAttributeTOptions getOptions() { return this.options; } /** * the method options */ public setAttribute_args setOptions(SetAttributeTOptions options) { this.options = options; return this; } public void unsetOptions() { this.options = null; } /** Returns true if field options is set (has been assigned a value) and false otherwise */ public boolean isSetOptions() { return this.options != null; } public void setOptionsIsSet(boolean value) { if (!value) { this.options = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case OPTIONS: if (value == null) { unsetOptions(); } else { setOptions((SetAttributeTOptions)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case OPTIONS: return getOptions(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case OPTIONS: return isSetOptions(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof setAttribute_args) return this.equals((setAttribute_args)that); return false; } public boolean equals(setAttribute_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_options = true && this.isSetOptions(); boolean that_present_options = true && that.isSetOptions(); if (this_present_options || that_present_options) { if (!(this_present_options && that_present_options)) return false; if (!this.options.equals(that.options)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_options = true && (isSetOptions()); list.add(present_options); if (present_options) list.add(options); return list.hashCode(); } @Override public int compareTo(setAttribute_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions()); if (lastComparison != 0) { return lastComparison; } if (isSetOptions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("setAttribute_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("options:"); if (this.options == null) { sb.append("null"); } else { sb.append(this.options); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (options != null) { options.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class setAttribute_argsStandardSchemeFactory implements SchemeFactory { public setAttribute_argsStandardScheme getScheme() { return new setAttribute_argsStandardScheme(); } } private static class setAttribute_argsStandardScheme extends StandardScheme<setAttribute_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, setAttribute_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // OPTIONS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.options = new SetAttributeTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, setAttribute_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.options != null) { oprot.writeFieldBegin(OPTIONS_FIELD_DESC); struct.options.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class setAttribute_argsTupleSchemeFactory implements SchemeFactory { public setAttribute_argsTupleScheme getScheme() { return new setAttribute_argsTupleScheme(); } } private static class setAttribute_argsTupleScheme extends TupleScheme<setAttribute_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, setAttribute_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetOptions()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetOptions()) { struct.options.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, setAttribute_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.options = new SetAttributeTOptions(); struct.options.read(iprot); struct.setOptionsIsSet(true); } } } } public static class setAttribute_result implements org.apache.thrift.TBase<setAttribute_result, setAttribute_result._Fields>, java.io.Serializable, Cloneable, Comparable<setAttribute_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setAttribute_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new setAttribute_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new setAttribute_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setAttribute_result.class, metaDataMap); } public setAttribute_result() { } public setAttribute_result( alluxio.thrift.AlluxioTException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public setAttribute_result(setAttribute_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public setAttribute_result deepCopy() { return new setAttribute_result(this); } @Override public void clear() { this.e = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public setAttribute_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof setAttribute_result) return this.equals((setAttribute_result)that); return false; } public boolean equals(setAttribute_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(setAttribute_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("setAttribute_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class setAttribute_resultStandardSchemeFactory implements SchemeFactory { public setAttribute_resultStandardScheme getScheme() { return new setAttribute_resultStandardScheme(); } } private static class setAttribute_resultStandardScheme extends StandardScheme<setAttribute_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, setAttribute_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, setAttribute_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class setAttribute_resultTupleSchemeFactory implements SchemeFactory { public setAttribute_resultTupleScheme getScheme() { return new setAttribute_resultTupleScheme(); } } private static class setAttribute_resultTupleScheme extends TupleScheme<setAttribute_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, setAttribute_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, setAttribute_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class scheduleAsyncPersist_args implements org.apache.thrift.TBase<scheduleAsyncPersist_args, scheduleAsyncPersist_args._Fields>, java.io.Serializable, Cloneable, Comparable<scheduleAsyncPersist_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scheduleAsyncPersist_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new scheduleAsyncPersist_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new scheduleAsyncPersist_argsTupleSchemeFactory()); } private String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the file */ PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scheduleAsyncPersist_args.class, metaDataMap); } public scheduleAsyncPersist_args() { } public scheduleAsyncPersist_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public scheduleAsyncPersist_args(scheduleAsyncPersist_args other) { if (other.isSetPath()) { this.path = other.path; } } public scheduleAsyncPersist_args deepCopy() { return new scheduleAsyncPersist_args(this); } @Override public void clear() { this.path = null; } /** * the path of the file */ public String getPath() { return this.path; } /** * the path of the file */ public scheduleAsyncPersist_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof scheduleAsyncPersist_args) return this.equals((scheduleAsyncPersist_args)that); return false; } public boolean equals(scheduleAsyncPersist_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); return list.hashCode(); } @Override public int compareTo(scheduleAsyncPersist_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("scheduleAsyncPersist_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class scheduleAsyncPersist_argsStandardSchemeFactory implements SchemeFactory { public scheduleAsyncPersist_argsStandardScheme getScheme() { return new scheduleAsyncPersist_argsStandardScheme(); } } private static class scheduleAsyncPersist_argsStandardScheme extends StandardScheme<scheduleAsyncPersist_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, scheduleAsyncPersist_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, scheduleAsyncPersist_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class scheduleAsyncPersist_argsTupleSchemeFactory implements SchemeFactory { public scheduleAsyncPersist_argsTupleScheme getScheme() { return new scheduleAsyncPersist_argsTupleScheme(); } } private static class scheduleAsyncPersist_argsTupleScheme extends TupleScheme<scheduleAsyncPersist_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, scheduleAsyncPersist_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, scheduleAsyncPersist_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class scheduleAsyncPersist_result implements org.apache.thrift.TBase<scheduleAsyncPersist_result, scheduleAsyncPersist_result._Fields>, java.io.Serializable, Cloneable, Comparable<scheduleAsyncPersist_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scheduleAsyncPersist_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new scheduleAsyncPersist_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new scheduleAsyncPersist_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scheduleAsyncPersist_result.class, metaDataMap); } public scheduleAsyncPersist_result() { } public scheduleAsyncPersist_result( alluxio.thrift.AlluxioTException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public scheduleAsyncPersist_result(scheduleAsyncPersist_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } } public scheduleAsyncPersist_result deepCopy() { return new scheduleAsyncPersist_result(this); } @Override public void clear() { this.e = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public scheduleAsyncPersist_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof scheduleAsyncPersist_result) return this.equals((scheduleAsyncPersist_result)that); return false; } public boolean equals(scheduleAsyncPersist_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); return list.hashCode(); } @Override public int compareTo(scheduleAsyncPersist_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("scheduleAsyncPersist_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class scheduleAsyncPersist_resultStandardSchemeFactory implements SchemeFactory { public scheduleAsyncPersist_resultStandardScheme getScheme() { return new scheduleAsyncPersist_resultStandardScheme(); } } private static class scheduleAsyncPersist_resultStandardScheme extends StandardScheme<scheduleAsyncPersist_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, scheduleAsyncPersist_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, scheduleAsyncPersist_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class scheduleAsyncPersist_resultTupleSchemeFactory implements SchemeFactory { public scheduleAsyncPersist_resultTupleScheme getScheme() { return new scheduleAsyncPersist_resultTupleScheme(); } } private static class scheduleAsyncPersist_resultTupleScheme extends TupleScheme<scheduleAsyncPersist_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, scheduleAsyncPersist_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, scheduleAsyncPersist_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class unmount_args implements org.apache.thrift.TBase<unmount_args, unmount_args._Fields>, java.io.Serializable, Cloneable, Comparable<unmount_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unmount_args"); private static final org.apache.thrift.protocol.TField ALLUXIO_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("alluxioPath", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new unmount_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new unmount_argsTupleSchemeFactory()); } private String alluxioPath; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the path of the alluxio mount point */ ALLUXIO_PATH((short)1, "alluxioPath"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // ALLUXIO_PATH return ALLUXIO_PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.ALLUXIO_PATH, new org.apache.thrift.meta_data.FieldMetaData("alluxioPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unmount_args.class, metaDataMap); } public unmount_args() { } public unmount_args( String alluxioPath) { this(); this.alluxioPath = alluxioPath; } /** * Performs a deep copy on <i>other</i>. */ public unmount_args(unmount_args other) { if (other.isSetAlluxioPath()) { this.alluxioPath = other.alluxioPath; } } public unmount_args deepCopy() { return new unmount_args(this); } @Override public void clear() { this.alluxioPath = null; } /** * the path of the alluxio mount point */ public String getAlluxioPath() { return this.alluxioPath; } /** * the path of the alluxio mount point */ public unmount_args setAlluxioPath(String alluxioPath) { this.alluxioPath = alluxioPath; return this; } public void unsetAlluxioPath() { this.alluxioPath = null; } /** Returns true if field alluxioPath is set (has been assigned a value) and false otherwise */ public boolean isSetAlluxioPath() { return this.alluxioPath != null; } public void setAlluxioPathIsSet(boolean value) { if (!value) { this.alluxioPath = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case ALLUXIO_PATH: if (value == null) { unsetAlluxioPath(); } else { setAlluxioPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case ALLUXIO_PATH: return getAlluxioPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case ALLUXIO_PATH: return isSetAlluxioPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof unmount_args) return this.equals((unmount_args)that); return false; } public boolean equals(unmount_args that) { if (that == null) return false; boolean this_present_alluxioPath = true && this.isSetAlluxioPath(); boolean that_present_alluxioPath = true && that.isSetAlluxioPath(); if (this_present_alluxioPath || that_present_alluxioPath) { if (!(this_present_alluxioPath && that_present_alluxioPath)) return false; if (!this.alluxioPath.equals(that.alluxioPath)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_alluxioPath = true && (isSetAlluxioPath()); list.add(present_alluxioPath); if (present_alluxioPath) list.add(alluxioPath); return list.hashCode(); } @Override public int compareTo(unmount_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetAlluxioPath()).compareTo(other.isSetAlluxioPath()); if (lastComparison != 0) { return lastComparison; } if (isSetAlluxioPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.alluxioPath, other.alluxioPath); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("unmount_args("); boolean first = true; sb.append("alluxioPath:"); if (this.alluxioPath == null) { sb.append("null"); } else { sb.append(this.alluxioPath); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class unmount_argsStandardSchemeFactory implements SchemeFactory { public unmount_argsStandardScheme getScheme() { return new unmount_argsStandardScheme(); } } private static class unmount_argsStandardScheme extends StandardScheme<unmount_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, unmount_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // ALLUXIO_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.alluxioPath = iprot.readString(); struct.setAlluxioPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, unmount_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.alluxioPath != null) { oprot.writeFieldBegin(ALLUXIO_PATH_FIELD_DESC); oprot.writeString(struct.alluxioPath); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class unmount_argsTupleSchemeFactory implements SchemeFactory { public unmount_argsTupleScheme getScheme() { return new unmount_argsTupleScheme(); } } private static class unmount_argsTupleScheme extends TupleScheme<unmount_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, unmount_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetAlluxioPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetAlluxioPath()) { oprot.writeString(struct.alluxioPath); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, unmount_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.alluxioPath = iprot.readString(); struct.setAlluxioPathIsSet(true); } } } } public static class unmount_result implements org.apache.thrift.TBase<unmount_result, unmount_result._Fields>, java.io.Serializable, Cloneable, Comparable<unmount_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unmount_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField IOE_FIELD_DESC = new org.apache.thrift.protocol.TField("ioe", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new unmount_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new unmount_resultTupleSchemeFactory()); } private alluxio.thrift.AlluxioTException e; // required private alluxio.thrift.ThriftIOException ioe; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"), IOE((short)2, "ioe"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; case 2: // IOE return IOE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.IOE, new org.apache.thrift.meta_data.FieldMetaData("ioe", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unmount_result.class, metaDataMap); } public unmount_result() { } public unmount_result( alluxio.thrift.AlluxioTException e, alluxio.thrift.ThriftIOException ioe) { this(); this.e = e; this.ioe = ioe; } /** * Performs a deep copy on <i>other</i>. */ public unmount_result(unmount_result other) { if (other.isSetE()) { this.e = new alluxio.thrift.AlluxioTException(other.e); } if (other.isSetIoe()) { this.ioe = new alluxio.thrift.ThriftIOException(other.ioe); } } public unmount_result deepCopy() { return new unmount_result(this); } @Override public void clear() { this.e = null; this.ioe = null; } public alluxio.thrift.AlluxioTException getE() { return this.e; } public unmount_result setE(alluxio.thrift.AlluxioTException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public alluxio.thrift.ThriftIOException getIoe() { return this.ioe; } public unmount_result setIoe(alluxio.thrift.ThriftIOException ioe) { this.ioe = ioe; return this; } public void unsetIoe() { this.ioe = null; } /** Returns true if field ioe is set (has been assigned a value) and false otherwise */ public boolean isSetIoe() { return this.ioe != null; } public void setIoeIsSet(boolean value) { if (!value) { this.ioe = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((alluxio.thrift.AlluxioTException)value); } break; case IOE: if (value == null) { unsetIoe(); } else { setIoe((alluxio.thrift.ThriftIOException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); case IOE: return getIoe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); case IOE: return isSetIoe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof unmount_result) return this.equals((unmount_result)that); return false; } public boolean equals(unmount_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } boolean this_present_ioe = true && this.isSetIoe(); boolean that_present_ioe = true && that.isSetIoe(); if (this_present_ioe || that_present_ioe) { if (!(this_present_ioe && that_present_ioe)) return false; if (!this.ioe.equals(that.ioe)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_e = true && (isSetE()); list.add(present_e); if (present_e) list.add(e); boolean present_ioe = true && (isSetIoe()); list.add(present_ioe); if (present_ioe) list.add(ioe); return list.hashCode(); } @Override public int compareTo(unmount_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoe()).compareTo(other.isSetIoe()); if (lastComparison != 0) { return lastComparison; } if (isSetIoe()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioe, other.ioe); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("unmount_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; if (!first) sb.append(", "); sb.append("ioe:"); if (this.ioe == null) { sb.append("null"); } else { sb.append(this.ioe); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class unmount_resultStandardSchemeFactory implements SchemeFactory { public unmount_resultStandardScheme getScheme() { return new unmount_resultStandardScheme(); } } private static class unmount_resultStandardScheme extends StandardScheme<unmount_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, unmount_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // IOE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, unmount_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } if (struct.ioe != null) { oprot.writeFieldBegin(IOE_FIELD_DESC); struct.ioe.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class unmount_resultTupleSchemeFactory implements SchemeFactory { public unmount_resultTupleScheme getScheme() { return new unmount_resultTupleScheme(); } } private static class unmount_resultTupleScheme extends TupleScheme<unmount_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, unmount_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } if (struct.isSetIoe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetE()) { struct.e.write(oprot); } if (struct.isSetIoe()) { struct.ioe.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, unmount_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.e = new alluxio.thrift.AlluxioTException(); struct.e.read(iprot); struct.setEIsSet(true); } if (incoming.get(1)) { struct.ioe = new alluxio.thrift.ThriftIOException(); struct.ioe.read(iprot); struct.setIoeIsSet(true); } } } } }
33.306017
346
0.636151
cf055c05b3d0993fcfe1b9abb3c3675bcef5c62b
2,109
/* Copyright 2014-2016 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.moe.natjgen.helper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; public class MOEICompilationUnit { /** * Logger for this class */ private static final Logger LOG = LoggerFactory.getLogger(MOEICompilationUnit.class); private String source; private String location; public void save() { Writer out = null; try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(location), "UTF-8")); } catch (FileNotFoundException e) { LOG.error("Unable save" + location, e); } catch (UnsupportedEncodingException e) { LOG.error("Unable save" + location, e); } try { out.write(source); } catch (IOException e) { LOG.error("Unable save java file", e); } finally { try { if (out != null) { out.close(); } } catch (IOException e) { LOG.error("Unable close Writer", e); } } } public void setSource(String newSource) { this.source = newSource; } public String getSource() { return source; } public void setLocation(String path) { this.location = path; } }
27.038462
102
0.645804
bad88aafc51e3c5b72d6df47391df7123b21d999
10,123
/* * This file was automatically generated by EvoSuite * Sat Jan 18 19:39:17 GMT 2020 */ import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; 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, useJEE = true) public class Coordinate_ESTest extends Coordinate_ESTest_scaffolding { @Test(timeout = 4000) public void test00() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); Coordinate coordinate1 = new Coordinate(0.0, 480.2722264874395); int int0 = coordinate0.compareTo(coordinate1); assertEquals(0.0, coordinate1.getLatitude(), 0.01); assertEquals(480.2722264874395, coordinate1.getLongitude(), 0.01); assertEquals(0, int0); } @Test(timeout = 4000) public void test01() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); double double0 = coordinate0.getLongitude(); assertEquals(0.0, double0, 0.01); assertEquals(0.0, coordinate0.getLatitude(), 0.01); } @Test(timeout = 4000) public void test02() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 682.67); double double0 = coordinate0.getLongitude(); assertEquals(0.0, coordinate0.getLatitude(), 0.01); assertEquals(682.67, double0, 0.01); } @Test(timeout = 4000) public void test03() throws Throwable { Coordinate coordinate0 = new Coordinate(767.381817943984, 1.0); double double0 = coordinate0.getLatitude(); assertEquals(767.381817943984, double0, 0.01); assertEquals(1.0, coordinate0.getLongitude(), 0.01); } @Test(timeout = 4000) public void test04() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); coordinate0.setLatitude((-1.0)); double double0 = coordinate0.getLatitude(); assertEquals((-1.0), double0, 0.01); } @Test(timeout = 4000) public void test05() throws Throwable { Coordinate coordinate0 = new Coordinate(2362.8184455374, 0.0); Coordinate coordinate1 = new Coordinate(711.102269431129, 711.102269431129); double double0 = coordinate1.getDistancia(coordinate0); assertEquals(711.102269431129, coordinate1.getLongitude(), 0.01); assertEquals(1490.8051142993233, double0, 0.01); assertEquals(711.102269431129, coordinate1.getLatitude(), 0.01); } @Test(timeout = 4000) public void test06() throws Throwable { Coordinate coordinate0 = new Coordinate(711.102269431129, 711.102269431129); Coordinate coordinate1 = coordinate0.clone(); assertEquals(711.102269431129, coordinate1.getLatitude(), 0.01); assertTrue(coordinate1.equals((Object)coordinate0)); assertEquals(711.102269431129, coordinate1.getLongitude(), 0.01); } @Test(timeout = 4000) public void test07() throws Throwable { Coordinate coordinate0 = new Coordinate(2362.8184455374, 0.0); Coordinate coordinate1 = coordinate0.clone(); assertEquals(2362.8184455374, coordinate1.getLatitude(), 0.01); assertTrue(coordinate1.equals((Object)coordinate0)); assertEquals(0.0, coordinate1.getLongitude(), 0.01); } @Test(timeout = 4000) public void test08() throws Throwable { Coordinate coordinate0 = new Coordinate((-656.32688), (-656.32688)); Coordinate coordinate1 = coordinate0.clone(); assertTrue(coordinate1.equals((Object)coordinate0)); assertEquals((-656.32688), coordinate0.getLongitude(), 0.01); assertEquals((-656.32688), coordinate1.getLatitude(), 0.01); } @Test(timeout = 4000) public void test09() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); // Undeclared exception! try { coordinate0.getDistancia((Coordinate) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("Coordinate", e); } } @Test(timeout = 4000) public void test10() throws Throwable { Coordinate coordinate0 = new Coordinate(1000.0, 1000.0); // Undeclared exception! try { coordinate0.compareTo((Coordinate) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("Coordinate", e); } } @Test(timeout = 4000) public void test11() throws Throwable { Coordinate coordinate0 = null; try { coordinate0 = new Coordinate((Coordinate) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("Coordinate", e); } } @Test(timeout = 4000) public void test12() throws Throwable { Coordinate coordinate0 = new Coordinate((-321.18), (-321.18)); double double0 = coordinate0.getLongitude(); assertEquals((-321.18), double0, 0.01); assertEquals((-321.18), coordinate0.getLatitude(), 0.01); } @Test(timeout = 4000) public void test13() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); Coordinate coordinate1 = new Coordinate(coordinate0); boolean boolean0 = coordinate1.equals(coordinate0); assertTrue(boolean0); assertEquals(0.0, coordinate1.getLatitude(), 0.01); assertEquals(0.0, coordinate1.getLongitude(), 0.01); } @Test(timeout = 4000) public void test14() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); double double0 = coordinate0.getDistancia(coordinate0); assertEquals(0.0, double0, 0.01); assertEquals(0.0, coordinate0.getLatitude(), 0.01); assertEquals(0.0, coordinate0.getLongitude(), 0.01); } @Test(timeout = 4000) public void test15() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); double double0 = coordinate0.getLatitude(); assertEquals(0.0, double0, 0.01); assertEquals(0.0, coordinate0.getLongitude(), 0.01); } @Test(timeout = 4000) public void test16() throws Throwable { Coordinate coordinate0 = new Coordinate((-13.654308149693243), (-13.654308149693243)); boolean boolean0 = coordinate0.equals("-13.654308, -13.654308"); assertEquals((-13.654308149693243), coordinate0.getLatitude(), 0.01); assertEquals((-13.654308149693243), coordinate0.getLongitude(), 0.01); assertFalse(boolean0); } @Test(timeout = 4000) public void test17() throws Throwable { Coordinate coordinate0 = new Coordinate(2362.8184455374, 0.0); Coordinate coordinate1 = new Coordinate(711.102269431129, 711.102269431129); int int0 = coordinate0.compareTo(coordinate1); assertEquals(711.102269431129, coordinate1.getLongitude(), 0.01); assertEquals(711.102269431129, coordinate1.getLatitude(), 0.01); assertEquals((-1), int0); } @Test(timeout = 4000) public void test18() throws Throwable { Coordinate coordinate0 = new Coordinate((-13.654308149693243), (-13.654308149693243)); coordinate0.setLongitude(180.0); assertEquals(180.0, coordinate0.getLongitude(), 0.01); } @Test(timeout = 4000) public void test19() throws Throwable { Coordinate coordinate0 = new Coordinate(848.384507578, 848.384507578); // Undeclared exception! try { coordinate0.setLongitude(848.384507578); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The parameter did not pass validation as defined by the CoordinateManager class // verifyException("Coordinate", e); } } @Test(timeout = 4000) public void test20() throws Throwable { Coordinate coordinate0 = new Coordinate(3027.016716077, 3027.016716077); // Undeclared exception! try { coordinate0.setLatitude((-3978.0)); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The parameter did not pass validation as defined by the CoordinateManager class // verifyException("Coordinate", e); } } @Test(timeout = 4000) public void test21() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); String string0 = coordinate0.toString(); assertEquals("0, 0", string0); } @Test(timeout = 4000) public void test22() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); coordinate0.clone(); assertEquals(0.0, coordinate0.getLatitude(), 0.01); assertEquals(0.0, coordinate0.getLongitude(), 0.01); } @Test(timeout = 4000) public void test23() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); String string0 = coordinate0.getLongitudeAsString(); assertEquals("0", string0); assertEquals(0.0, coordinate0.getLatitude(), 0.01); } @Test(timeout = 4000) public void test24() throws Throwable { Coordinate coordinate0 = new Coordinate(0.0, 0.0); String string0 = coordinate0.getLatitudeAsString(); assertEquals("0", string0); assertEquals(0.0, coordinate0.getLongitude(), 0.01); } @Test(timeout = 4000) public void test25() throws Throwable { Coordinate coordinate0 = new Coordinate((-13.654308149693243), (-13.654308149693243)); int int0 = coordinate0.compareTo(coordinate0); assertEquals((-13.654308149693243), coordinate0.getLatitude(), 0.01); assertEquals((-13.654308149693243), coordinate0.getLongitude(), 0.01); assertEquals(0, int0); } }
36.677536
176
0.669663
25a2ba3faabbe2d5e291bf66f2a51d27b86e1f2e
902
package org.blueshard.olymp.files; public class ServerFiles { public static class etc { public static final String dir = "/srv/etc/"; public static final String register_codes = dir + "register_codes"; public static final String versions = dir + "versions.conf"; public static class update { public static final String dir = "/srv/etc/update/"; public static final String TheosUI_jar = dir + "update.jar"; } } public static class logs { public static final String dir = "/srv/logs/"; public static final String main_log = dir + "main.log"; } public static class user_files { public static final String dir = "/srv/user_files/"; public final String user_files_dir; public user_files(String UUID) { user_files_dir = dir + UUID + "/"; } } }
22.55
75
0.608647
57d28ab101438a75d9c7e749eeff6772e887b282
543
/** Notice of modification as required by the LGPL * This file was modified by Gemstone Systems Inc. on * $Date$ **/ package com.gemstone.org.jgroups.blocks; import com.gemstone.org.jgroups.ChannelException; /** * This exception is thrown when voting listener cannot vote on the * specified decree. * * @author Roman Rokytskyy ([email protected]) */ public class VoteException extends ChannelException { private static final long serialVersionUID = -741925330540432706L; public VoteException(String msg) { super(msg); } }
27.15
67
0.747698
d48ac047d7a884c90b6f336978266d5698e42e7a
10,329
begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1 begin_comment comment|/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ end_comment begin_package package|package name|org operator|. name|apache operator|. name|cxf operator|. name|jaxrs operator|. name|ext operator|. name|search package|; end_package begin_import import|import name|java operator|. name|util operator|. name|Date import|; end_import begin_import import|import name|java operator|. name|util operator|. name|Set import|; end_import begin_import import|import name|org operator|. name|junit operator|. name|Ignore import|; end_import begin_import import|import name|org operator|. name|junit operator|. name|Test import|; end_import begin_import import|import static name|org operator|. name|junit operator|. name|Assert operator|. name|assertEquals import|; end_import begin_import import|import static name|org operator|. name|junit operator|. name|Assert operator|. name|assertTrue import|; end_import begin_class specifier|public class|class name|BeanspectorTest block|{ annotation|@ name|Test specifier|public name|void name|testSimpleBean parameter_list|() throws|throws name|SearchParseException block|{ name|Beanspector argument_list|< name|SimpleBean argument_list|> name|bean init|= operator|new name|Beanspector argument_list|<> argument_list|( operator|new name|SimpleBean argument_list|() argument_list|) decl_stmt|; name|Set argument_list|< name|String argument_list|> name|getters init|= name|bean operator|. name|getGettersNames argument_list|() decl_stmt|; name|assertEquals argument_list|( literal|3 argument_list|, name|getters operator|. name|size argument_list|() argument_list|) expr_stmt|; name|assertTrue argument_list|( name|getters operator|. name|contains argument_list|( literal|"class" argument_list|) argument_list|) expr_stmt|; name|assertTrue argument_list|( name|getters operator|. name|contains argument_list|( literal|"a" argument_list|) argument_list|) expr_stmt|; name|assertTrue argument_list|( name|getters operator|. name|contains argument_list|( literal|"promised" argument_list|) argument_list|) expr_stmt|; name|Set argument_list|< name|String argument_list|> name|setters init|= name|bean operator|. name|getSettersNames argument_list|() decl_stmt|; name|assertEquals argument_list|( literal|2 argument_list|, name|setters operator|. name|size argument_list|() argument_list|) expr_stmt|; name|assertTrue argument_list|( name|setters operator|. name|contains argument_list|( literal|"a" argument_list|) argument_list|) expr_stmt|; name|assertTrue argument_list|( name|setters operator|. name|contains argument_list|( literal|"fluent" argument_list|) argument_list|) expr_stmt|; block|} annotation|@ name|Test specifier|public name|void name|testOverriddenBeans1 parameter_list|() throws|throws name|SearchParseException block|{ name|Beanspector argument_list|< name|OverriddenBean argument_list|> name|bean init|= operator|new name|Beanspector argument_list|< name|OverriddenBean argument_list|> argument_list|( operator|new name|OverriddenBean argument_list|() argument_list|) decl_stmt|; name|Set argument_list|< name|String argument_list|> name|getters init|= name|bean operator|. name|getGettersNames argument_list|() decl_stmt|; name|assertEquals argument_list|( literal|2 argument_list|, name|getters operator|. name|size argument_list|() argument_list|) expr_stmt|; name|assertTrue argument_list|( name|getters operator|. name|contains argument_list|( literal|"class" argument_list|) argument_list|) expr_stmt|; name|assertTrue argument_list|( name|getters operator|. name|contains argument_list|( literal|"simplebean" argument_list|) argument_list|) expr_stmt|; name|Set argument_list|< name|String argument_list|> name|setters init|= name|bean operator|. name|getSettersNames argument_list|() decl_stmt|; name|assertEquals argument_list|( literal|1 argument_list|, name|setters operator|. name|size argument_list|() argument_list|) expr_stmt|; name|assertTrue argument_list|( name|setters operator|. name|contains argument_list|( literal|"simplebean" argument_list|) argument_list|) expr_stmt|; block|} annotation|@ name|Test specifier|public name|void name|testOverriddenBeans2 parameter_list|() throws|throws name|SearchParseException block|{ name|Beanspector argument_list|< name|AntoherOverriddenBean argument_list|> name|bean init|= operator|new name|Beanspector argument_list|< name|AntoherOverriddenBean argument_list|> argument_list|( operator|new name|AntoherOverriddenBean argument_list|() argument_list|) decl_stmt|; name|Set argument_list|< name|String argument_list|> name|getters init|= name|bean operator|. name|getGettersNames argument_list|() decl_stmt|; name|assertEquals argument_list|( literal|2 argument_list|, name|getters operator|. name|size argument_list|() argument_list|) expr_stmt|; name|assertTrue argument_list|( name|getters operator|. name|contains argument_list|( literal|"class" argument_list|) argument_list|) expr_stmt|; name|assertTrue argument_list|( name|getters operator|. name|contains argument_list|( literal|"simplebean" argument_list|) argument_list|) expr_stmt|; name|Set argument_list|< name|String argument_list|> name|setters init|= name|bean operator|. name|getSettersNames argument_list|() decl_stmt|; name|assertEquals argument_list|( literal|1 argument_list|, name|setters operator|. name|size argument_list|() argument_list|) expr_stmt|; name|assertTrue argument_list|( name|setters operator|. name|contains argument_list|( literal|"simplebean" argument_list|) argument_list|) expr_stmt|; block|} annotation|@ name|Test argument_list|( name|expected operator|= name|IllegalArgumentException operator|. name|class argument_list|) specifier|public name|void name|testMismatchedOverriddenBeans parameter_list|() throws|throws name|SearchParseException block|{ operator|new name|Beanspector argument_list|< name|MismatchedOverriddenBean argument_list|> argument_list|( operator|new name|MismatchedOverriddenBean argument_list|() argument_list|) expr_stmt|; block|} annotation|@ name|Test argument_list|( name|expected operator|= name|IllegalArgumentException operator|. name|class argument_list|) specifier|public name|void name|testMismatchedAccessorTypes parameter_list|() throws|throws name|SearchParseException block|{ operator|new name|Beanspector argument_list|< name|MismatchedTypes argument_list|> argument_list|( name|MismatchedTypes operator|. name|class argument_list|) expr_stmt|; block|} annotation|@ name|Ignore specifier|static class|class name|MismatchedTypes block|{ specifier|public name|Date name|getFoo parameter_list|() block|{ return|return literal|null return|; block|} specifier|public name|void name|setFoo parameter_list|( name|String name|val parameter_list|) block|{ } block|} annotation|@ name|Ignore specifier|static class|class name|SimpleBean block|{ specifier|public name|boolean name|isPromised parameter_list|() block|{ return|return literal|true return|; block|} specifier|public name|String name|getA parameter_list|() block|{ return|return literal|"a" return|; block|} specifier|public name|void name|setA parameter_list|( name|String name|val parameter_list|) block|{ } specifier|public name|SimpleBean name|setFluent parameter_list|( name|String name|val parameter_list|) block|{ return|return name|this return|; block|} block|} annotation|@ name|Ignore specifier|static class|class name|OverriddenSimpleBean extends|extends name|SimpleBean block|{ name|OverriddenSimpleBean parameter_list|() block|{ } name|OverriddenSimpleBean parameter_list|( name|SimpleBean name|arg parameter_list|) block|{ } block|} annotation|@ name|Ignore specifier|static class|class name|AnotherBean block|{ specifier|protected name|SimpleBean name|simpleBean decl_stmt|; specifier|public name|SimpleBean name|getSimpleBean parameter_list|() block|{ return|return name|simpleBean return|; block|} specifier|public name|void name|setSimpleBean parameter_list|( name|SimpleBean name|simpleBean parameter_list|) block|{ name|this operator|. name|simpleBean operator|= name|simpleBean expr_stmt|; block|} block|} annotation|@ name|Ignore specifier|static class|class name|OverriddenBean extends|extends name|AnotherBean block|{ annotation|@ name|Override specifier|public name|OverriddenSimpleBean name|getSimpleBean parameter_list|() block|{ return|return operator|new name|OverriddenSimpleBean argument_list|( name|simpleBean argument_list|) return|; block|} specifier|public name|void name|setSimpleBean parameter_list|( name|OverriddenSimpleBean name|simpleBean parameter_list|) block|{ name|this operator|. name|simpleBean operator|= name|simpleBean expr_stmt|; block|} block|} annotation|@ name|Ignore specifier|static class|class name|AntoherOverriddenBean extends|extends name|AnotherBean block|{ annotation|@ name|Override specifier|public name|OverriddenSimpleBean name|getSimpleBean parameter_list|() block|{ return|return operator|new name|OverriddenSimpleBean argument_list|( name|simpleBean argument_list|) return|; block|} block|} annotation|@ name|Ignore specifier|static class|class name|MismatchedOverriddenBean extends|extends name|AnotherBean block|{ annotation|@ name|Override specifier|public name|OverriddenSimpleBean name|getSimpleBean parameter_list|() block|{ return|return operator|new name|OverriddenSimpleBean argument_list|( name|simpleBean argument_list|) return|; block|} specifier|public name|void name|setSimpleBean parameter_list|( name|String name|simpleBean parameter_list|) block|{ } block|} block|} end_class end_unit
15.100877
810
0.811405
a1f57f6258ef8a0a4bac37f4087884d8ae2fb170
477
package cn.learn.learn.command.demo01; /** * design-pattern-runoob-cn.learn.learn.command.demo01 * * @author : WXF * @date : 2018年-06月-30日 */ public class Stock { private String name = "ABC"; private int quantity = 10; public void buy(){ System.out.println("stock [name:" + name + ",quantity:" + quantity + "] bought"); } public void shell(){ System.out.println("stock [name:" + name + ",quantity:" + quantity + "] sold"); } }
20.73913
89
0.595388
727c3be2d99b4d4a215c76fd09d181d38667e098
2,908
package uk.gov.hmcts.reform.em.test; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import static org.mockito.Mockito.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.mockito.junit.MockitoJUnitRunner; import uk.gov.hmcts.reform.em.test.idam.DeleteUserApi; import uk.gov.hmcts.reform.em.test.idam.IdamHelper; import uk.gov.hmcts.reform.em.test.idam.OpenIdConfiguration; import uk.gov.hmcts.reform.em.test.idam.OpenIdUserApi; import uk.gov.hmcts.reform.em.test.idam.client.models.OpenIdAuthUserRequest; import uk.gov.hmcts.reform.em.test.idam.client.models.OpenIdAuthUserResponse; import uk.gov.hmcts.reform.idam.client.IdamClient; import uk.gov.hmcts.reform.idam.client.IdamTestApi; import uk.gov.hmcts.reform.idam.client.models.UserDetails; import java.util.stream.Collectors; import java.util.stream.Stream; @RunWith(MockitoJUnitRunner.class) public class IdamHelperTest { @Mock IdamClient idamClient; @Mock IdamTestApi idamTestApi; @Mock DeleteUserApi deleteUserApi; @Mock OpenIdUserApi openIdUserApi; @Mock OpenIdConfiguration openIdConfiguration; @Mock OpenIdAuthUserRequest openIdAuthUserRequest; @Mock OpenIdAuthUserResponse openIdAuthUserResponse; @InjectMocks private IdamHelper idamHelper; @Test public void testCreateUser() { idamHelper.createUser("x", Stream.of("x").collect(Collectors.toList())); verify(deleteUserApi, times(1)).deleteUser("x"); verify(idamTestApi, times(1)).createUser(any()); } @Test public void testGetUserId() { UserDetails userDetailsMock = mock(UserDetails.class); when(userDetailsMock.getId()).thenReturn("id"); when(openIdAuthUserResponse.getAccessToken()).thenReturn("b"); when(openIdUserApi.authenticateUser(any())).thenReturn(openIdAuthUserResponse); when(idamClient.getUserDetails("Bearer b")).thenReturn(userDetailsMock); assertThat(idamHelper.getUserId("x")).isEqualTo("id"); } @Test public void testDeleteUser() { idamHelper.deleteUser("x"); verify(deleteUserApi, times(1)).deleteUser("x"); } @Test public void testAuthenticateUser() { when(openIdAuthUserResponse.getAccessToken()).thenReturn("b"); when(openIdUserApi.authenticateUser(any())).thenReturn(openIdAuthUserResponse); assertThat(idamHelper.authenticateUser("x")).isEqualTo("Bearer b"); assertThat(idamHelper.authenticateUser("x")).isEqualTo("Bearer b"); assertThat(idamHelper.authenticateUser("x")).isEqualTo("Bearer b"); verify(openIdUserApi, times(1)).authenticateUser(any()); } }
32.311111
87
0.736589
11bd5e0bf5a7105679eac3916843a873d72b2617
7,453
package com.testquack.maven.mojo; import com.testquack.beans.Launch; import com.testquack.beans.LaunchStatus; import com.testquack.beans.LaunchTestCase; import com.testquack.beans.LaunchTestCaseTree; import com.testquack.maven.client.QuackClient; import com.testquack.maven.client.QuackClietnUtils; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.plugins.surefire.report.ReportTestCase; import org.apache.maven.plugins.surefire.report.ReportTestSuite; import org.apache.maven.plugins.surefire.report.SurefireReportParser; import org.apache.maven.reporting.MavenReportException; import java.io.File; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; import static com.testquack.beans.LaunchStatus.BROKEN; import static com.testquack.beans.LaunchStatus.FAILED; import static org.apache.maven.plugins.annotations.LifecyclePhase.TEST; import static ru.greatbit.utils.string.StringUtils.getMd5String; @Mojo(name = "junit-results-import", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true, defaultPhase = TEST) public class QuackJunitResultsImport extends AbstractMojo{ @Parameter(property = "junitXmlPath", defaultValue = "${project.build.directory}/surefire-reports") File junitXmlResource; @Parameter(property = "quackProject",name = "quackProject", required = true) private String quackProject; @Parameter(property = "apiToken", name = "apiToken", required = true) private String apiToken; @Parameter(property = "apiEndpoint", name = "apiEndpoint", required = true) private String apiEndpoint; @Parameter(property = "apiTimeout", name = "apiTimeout", defaultValue = "60000") private long apiTimeout; @Parameter(property = "launchNamePrefix", name = "launchNamePrefix", defaultValue = "Junit Import") private String launchNamePrefix; private final Map<String, LaunchTestCase> testcasesByAlias = new HashMap<>(); @Override public void execute() throws MojoExecutionException, MojoFailureException { if (!junitXmlResource.isDirectory()) { throw new MojoExecutionException(junitXmlResource + " is not a directory"); } getLog().debug("Checking test results in " + junitXmlResource); List<File> reportDirectories = collectReportDirectoriesRecursively(junitXmlResource); SurefireReportParser parser = new SurefireReportParser(reportDirectories, Locale.getDefault()); List<ReportTestSuite> testSuites; try { testSuites = parser.parseXMLReportFiles(); /////////////////// getLog().info("/////////////////// Got testsuites " + testSuites.stream().map(ReportTestSuite::getName)); /////////////////// } catch (MavenReportException e) { throw new MojoExecutionException("Could not parse XML reports", e); } if (testSuites.isEmpty()) { getLog().warn("XML reports not found in " + junitXmlResource); } // Tests might be parametrised. // If a single parameter fails - all test is considered to fail. testSuites.stream(). flatMap(testSuite -> testSuite.getTestCases().stream()). filter(Objects::nonNull). forEach(reportTestCase -> { String alias = getAlias(reportTestCase); LaunchTestCase testCaseToStore = convertTestcase(reportTestCase); LaunchTestCase preservedTestcase = testcasesByAlias.get(alias); if (preservedTestcase == null || (!isFailed(preservedTestcase) && isFailed(testCaseToStore))){ testcasesByAlias.put(alias, testCaseToStore); } }); List<LaunchTestCase> launchTestCases = new ArrayList<>(testcasesByAlias.values()); Launch launch = (Launch) new Launch().withName(launchNamePrefix + " " + new Date()); launch.setTestCaseTree(new LaunchTestCaseTree().withTestCases(launchTestCases)); getLog().info("Starting launch import to QuAck"); QuackClient client = QuackClietnUtils.getClient(apiToken, apiEndpoint, apiTimeout); try { client.createLaunch(quackProject, launch).execute(); } catch (IOException e) { getLog().error("Unable to import launch to QuAck", e); throw new RuntimeException(e); } } private boolean isFailed(LaunchTestCase preservedTestcase) { return preservedTestcase.getLaunchStatus() == FAILED || preservedTestcase.getLaunchStatus() == BROKEN; } private String getAlias(ReportTestCase reportTestCase) { String fullNameNoParameters = reportTestCase.getFullName().split("\\[")[0]; try { return getMd5String(fullNameNoParameters); } catch (NoSuchAlgorithmException e) { getLog().warn("Unable to create testcase alias", e); return null; } } private LaunchTestCase convertTestcase(ReportTestCase reportTestCase) { /////////////////// getLog().info("/////////////////// Converting report testcase " + reportTestCase.getFullName()); /////////////////// return (LaunchTestCase) new LaunchTestCase(). withDuration(new Float(reportTestCase.getTime()).longValue()). withLaunchStatus(convertStatus(reportTestCase)). withFailureMessage(reportTestCase.getFailureMessage()). withFailureTrace(reportTestCase.getFailureDetail()). withAlias(getAlias(reportTestCase)); } private LaunchStatus convertStatus(ReportTestCase reportTestCase) { if (reportTestCase.getFailureType() == null){ return LaunchStatus.PASSED; } switch(reportTestCase.getFailureType()) { case "skipped": return LaunchStatus.SKIPPED; default: return FAILED; } } static List<File> collectReportDirectoriesRecursively(final File rootDirectory) throws MojoExecutionException { if (rootDirectory == null) { throw new MojoExecutionException("No valid directory provided"); } if (!rootDirectory.exists()) { throw new MojoExecutionException("Directory " + rootDirectory + " does not exist"); } if (!rootDirectory.isDirectory()) { throw new MojoExecutionException("Directory " + rootDirectory + " is no directory"); } List<File> ret = new ArrayList<>(); ret.add(rootDirectory); for (File child : rootDirectory.listFiles()) { if (child.isDirectory()) { ret.addAll(collectReportDirectoriesRecursively(child)); } } return ret; } private void logLines(List<String> lines) { for (String line : lines) { getLog().info(line); } getLog().info(""); } }
40.286486
129
0.662149
60b1eb869835a1778d52695971348ce36397afe5
341
package uk.ac.kent.eda.jb956.sensorlibrary.data; /** * Copyright (c) 2017, Jon Baker <[email protected]> * School of Engineering and Digital Arts, University of Kent */ public class PositionsData extends SensorData { public float X; public float Y; public PositionsData(int sensorType) { super(sensorType); } }
22.733333
61
0.70088
12290babffbac9e37c8dfc4f2977c3c264c25527
372
package tiams.comparator; import java.util.Comparator; import tiams.model.Menu; /** * 菜单排序 * * @author nonkr * */ public class MenuComparator implements Comparator<Menu> { public int compare(Menu o1, Menu o2) { int i1 = o1.getSeq() != null ? o1.getSeq().intValue() : -1; int i2 = o2.getSeq() != null ? o2.getSeq().intValue() : -1; return i1 - i2; } }
16.173913
61
0.634409
db299d692530592c001c005bf92a1362a2146997
2,846
package org.example.translator.impl; import org.example.domain.dto.AccountTransactionDto; import org.example.domain.dto.AccountTypeDto; import org.example.domain.persistance.AccountTransaction; import org.example.repo.persistence.AccountTransactionRepository; import org.example.translator.AccountTransactionTranslator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; @Component public class AccountTransactionTranslatorImpl implements AccountTransactionTranslator { private final AccountTransactionRepository accountTransactionRepository; @Autowired public AccountTransactionTranslatorImpl(AccountTransactionRepository accountTransactionRepository) { this.accountTransactionRepository = accountTransactionRepository; } //THrow exceptions according to what went wrong @Override public List<AccountTransactionDto> getAllAccountTransaction(){ List<AccountTransactionDto> accountTransactionDtos = new ArrayList<>(); try{ for (AccountTransaction accountTransaction : accountTransactionRepository.findAll()) { accountTransactionDtos.add(new AccountTransactionDto(accountTransaction)); } } catch (Exception e) { //logg our exceptions to check out and investigate throw new RuntimeException("Unable to read from DB", e); } return accountTransactionDtos; } // @Override // public List<AccountTransactionDto> getAllAccountTransaction() { // return null; // } @Override public AccountTransactionDto create(AccountTransactionDto accountTransactionDto){ try { AccountTransaction accountTransaction = accountTransactionRepository.save(accountTransactionDto.getAccountTransaction()); return new AccountTransactionDto(accountTransaction); }catch ( Exception e){ throw new RuntimeException("Unable to save to the DB", e); } } @Override public AccountTransactionDto getAccountTransactionByMemberId(Long memberId){ try { AccountTransaction accountTransaction = accountTransactionRepository.getAccountTransactionByMemberId(memberId); return new AccountTransactionDto(accountTransaction); }catch ( Exception e){ throw new RuntimeException("Unable to save to the DB", e); } } @Override public AccountTransactionDto getAccountTransactionDtoByMemberId(Long memberId){ try { //return accountTransactionRepository.getAccountTransactionDtoByMemberId(Long memberId); return null; }catch ( Exception e){ throw new RuntimeException("Unable to save to the DB", e); } } }
37.946667
133
0.728039
ed1afb62adf7253bc09eb3aba2919e3737a8efe9
295
package com.yangzg.chapter06; import org.junit.Test; import static org.junit.Assert.assertEquals; /** * Created by Sam on 2019/6/17. */ public class Main { @Test public void test1() { Fu fu = new Zi(); System.out.println(fu.a); assertEquals(1, fu.a); } }
17.352941
44
0.610169
31840d0ca6121ff522c3d8846d8fae408c5dffbf
25,162
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.druid.client.cache; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.primitives.Ints; import com.google.inject.Binder; import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.name.Names; import net.spy.memcached.BroadcastOpFactory; import net.spy.memcached.CASResponse; import net.spy.memcached.CASValue; import net.spy.memcached.CachedData; import net.spy.memcached.ConnectionObserver; import net.spy.memcached.MemcachedClientIF; import net.spy.memcached.MemcachedNode; import net.spy.memcached.NodeLocator; import net.spy.memcached.internal.BulkFuture; import net.spy.memcached.internal.BulkGetCompletionListener; import net.spy.memcached.internal.OperationFuture; import net.spy.memcached.ops.OperationStatus; import net.spy.memcached.transcoders.SerializingTranscoder; import net.spy.memcached.transcoders.Transcoder; import org.apache.druid.collections.StupidResourceHolder; import org.apache.druid.guice.GuiceInjectors; import org.apache.druid.guice.JsonConfigProvider; import org.apache.druid.guice.ManageLifecycle; import org.apache.druid.initialization.Initialization; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.lifecycle.Lifecycle; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.java.util.emitter.core.Emitter; import org.apache.druid.java.util.emitter.core.Event; import org.apache.druid.java.util.emitter.service.ServiceEmitter; import org.apache.druid.java.util.metrics.AbstractMonitor; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.net.SocketAddress; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; /** */ public class MemcachedCacheTest { private static final Logger log = new Logger(MemcachedCacheTest.class); private static final byte[] HI = StringUtils.toUtf8("hiiiiiiiiiiiiiiiiiii"); private static final byte[] HO = StringUtils.toUtf8("hooooooooooooooooooo"); protected static final AbstractMonitor NOOP_MONITOR = new AbstractMonitor() { @Override public boolean doMonitor(ServiceEmitter emitter) { return false; } }; private MemcachedCache cache; private final MemcachedCacheConfig memcachedCacheConfig = new MemcachedCacheConfig() { @Override public String getMemcachedPrefix() { return "druid-memcached-test"; } @Override public int getTimeout() { return 10; } @Override public int getExpiration() { return 3600; } @Override public String getHosts() { return "localhost:9999"; } }; @Before public void setUp() { cache = new MemcachedCache( Suppliers.ofInstance( StupidResourceHolder.create(new MockMemcachedClient()) ), memcachedCacheConfig, NOOP_MONITOR ); } @Test public void testBasicInjection() throws Exception { final MemcachedCacheConfig config = new MemcachedCacheConfig() { @Override public String getHosts() { return "127.0.0.1:22"; } }; Injector injector = Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.of( new Module() { @Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/test/memcached"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); binder.bind(MemcachedCacheConfig.class).toInstance(config); binder.bind(Cache.class).toProvider(MemcachedProviderWithConfig.class).in(ManageLifecycle.class); } } ) ); Lifecycle lifecycle = injector.getInstance(Lifecycle.class); lifecycle.start(); try { Cache cache = injector.getInstance(Cache.class); Assert.assertEquals(MemcachedCache.class, cache.getClass()); } finally { lifecycle.stop(); } } @Test public void testSimpleInjection() { final String uuid = UUID.randomUUID().toString(); System.setProperty(uuid + ".type", "memcached"); System.setProperty(uuid + ".hosts", "localhost"); final Injector injector = Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/test/memcached"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); binder.bind(Cache.class).toProvider(CacheProvider.class); JsonConfigProvider.bind(binder, uuid, CacheProvider.class); } } ) ); final CacheProvider memcachedCacheProvider = injector.getInstance(CacheProvider.class); Assert.assertNotNull(memcachedCacheProvider); Assert.assertEquals(MemcachedCacheProvider.class, memcachedCacheProvider.getClass()); } @Test public void testMonitor() throws Exception { final MemcachedCache cache = MemcachedCache.create(memcachedCacheConfig); final Emitter emitter = EasyMock.createNiceMock(Emitter.class); final Collection<Event> events = new ArrayList<>(); final ServiceEmitter serviceEmitter = new ServiceEmitter("service", "host", emitter) { @Override public void emit(Event event) { events.add(event); } }; while (events.isEmpty()) { Thread.sleep(memcachedCacheConfig.getTimeout()); cache.doMonitor(serviceEmitter); } Assert.assertFalse(events.isEmpty()); ObjectMapper mapper = new DefaultObjectMapper(); for (Event event : events) { log.debug("Found event `%s`", mapper.writeValueAsString(event.toMap())); } } @Test public void testSanity() { Assert.assertNull(cache.get(new Cache.NamedKey("a", HI))); put(cache, "a", HI, 1); Assert.assertEquals(1, get(cache, "a", HI)); Assert.assertNull(cache.get(new Cache.NamedKey("the", HI))); put(cache, "the", HI, 2); Assert.assertEquals(1, get(cache, "a", HI)); Assert.assertEquals(2, get(cache, "the", HI)); put(cache, "the", HO, 10); Assert.assertEquals(1, get(cache, "a", HI)); Assert.assertNull(cache.get(new Cache.NamedKey("a", HO))); Assert.assertEquals(2, get(cache, "the", HI)); Assert.assertEquals(10, get(cache, "the", HO)); cache.close("the"); Assert.assertEquals(1, get(cache, "a", HI)); Assert.assertNull(cache.get(new Cache.NamedKey("a", HO))); cache.close("a"); } @Test public void testGetBulk() { Assert.assertNull(cache.get(new Cache.NamedKey("the", HI))); put(cache, "the", HI, 2); put(cache, "the", HO, 10); Cache.NamedKey key1 = new Cache.NamedKey("the", HI); Cache.NamedKey key2 = new Cache.NamedKey("the", HO); Map<Cache.NamedKey, byte[]> result = cache.getBulk( Lists.newArrayList( key1, key2 ) ); Assert.assertEquals(2, Ints.fromByteArray(result.get(key1))); Assert.assertEquals(10, Ints.fromByteArray(result.get(key2))); } public void put(Cache cache, String namespace, byte[] key, Integer value) { cache.put(new Cache.NamedKey(namespace, key), Ints.toByteArray(value)); } public int get(Cache cache, String namespace, byte[] key) { return Ints.fromByteArray(cache.get(new Cache.NamedKey(namespace, key))); } } class MemcachedProviderWithConfig extends MemcachedCacheProvider { private final MemcachedCacheConfig config; @Inject public MemcachedProviderWithConfig(MemcachedCacheConfig config) { this.config = config; } @Override public Cache get() { return MemcachedCache.create(config); } } class MockMemcachedClient implements MemcachedClientIF { private final ConcurrentMap<String, CachedData> theMap = new ConcurrentHashMap<String, CachedData>(); private final SerializingTranscoder transcoder; public MockMemcachedClient() { transcoder = new LZ4Transcoder(); transcoder.setCompressionThreshold(0); } @Override public Collection<SocketAddress> getAvailableServers() { throw new UnsupportedOperationException("not implemented"); } @Override public Collection<SocketAddress> getUnavailableServers() { throw new UnsupportedOperationException("not implemented"); } @Override public Transcoder<Object> getTranscoder() { throw new UnsupportedOperationException("not implemented"); } @Override public NodeLocator getNodeLocator() { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Boolean> append(long cas, String key, Object val) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Boolean> append(String s, Object o) { return null; } @Override public <T> Future<Boolean> append(long cas, String key, T val, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Future<Boolean> append( String s, T t, Transcoder<T> tTranscoder ) { return null; } @Override public Future<Boolean> prepend(long cas, String key, Object val) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Boolean> prepend(String s, Object o) { return null; } @Override public <T> Future<Boolean> prepend(long cas, String key, T val, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Future<Boolean> prepend( String s, T t, Transcoder<T> tTranscoder ) { return null; } @Override public <T> Future<CASResponse> asyncCAS(String key, long casId, T value, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<CASResponse> asyncCAS(String key, long casId, Object value) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<CASResponse> asyncCAS( String s, long l, int i, Object o ) { return null; } @Override public <T> OperationFuture<CASResponse> asyncCAS( String s, long l, int i, T t, Transcoder<T> tTranscoder ) { return null; } @Override public <T> CASResponse cas(String key, long casId, int exp, T value, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public CASResponse cas(String key, long casId, Object value) { throw new UnsupportedOperationException("not implemented"); } @Override public CASResponse cas(String s, long l, int i, Object o) { return null; } @Override public <T> CASResponse cas( String s, long l, T t, Transcoder<T> tTranscoder ) { return null; } @Override public <T> Future<Boolean> add(String key, int exp, T o, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Boolean> add(String key, int exp, Object o) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Future<Boolean> set(String key, int exp, T o, Transcoder<T> tc) { theMap.put(key, tc.encode(o)); return new Future<Boolean>() { @Override public boolean cancel(boolean b) { return false; } @Override public boolean isCancelled() { return false; } @Override public boolean isDone() { return true; } @Override public Boolean get() { return true; } @Override public Boolean get(long l, TimeUnit timeUnit) { return true; } }; } @Override public Future<Boolean> set(String key, int exp, Object o) { return set(key, exp, o, transcoder); } @Override public <T> Future<Boolean> replace(String key, int exp, T o, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Boolean> replace(String key, int exp, Object o) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Future<T> asyncGet(String key, final Transcoder<T> tc) { CachedData data = theMap.get(key); final T theValue = data != null ? tc.decode(data) : null; return new Future<T>() { @Override public boolean cancel(boolean b) { return false; } @Override public boolean isCancelled() { return false; } @Override public boolean isDone() { return true; } @Override public T get() { return theValue; } @Override public T get(long l, TimeUnit timeUnit) { return theValue; } }; } @Override public Future<Object> asyncGet(String key) { return asyncGet(key, transcoder); } @Override public Future<CASValue<Object>> asyncGetAndTouch(String key, int exp) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Future<CASValue<T>> asyncGetAndTouch(String key, int exp, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public CASValue<Object> getAndTouch(String key, int exp) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> CASValue<T> getAndTouch(String key, int exp, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Future<CASValue<T>> asyncGets(String key, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<CASValue<Object>> asyncGets(String key) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> CASValue<T> gets(String key, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public CASValue<Object> gets(String key) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> T get(String key, Transcoder<T> tc) { CachedData data = theMap.get(key); return data != null ? tc.decode(data) : null; } @Override public Object get(String key) { return get(key, transcoder); } @Override public <T> BulkFuture<Map<String, T>> asyncGetBulk(Iterator<String> keys, Iterator<Transcoder<T>> tcs) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> BulkFuture<Map<String, T>> asyncGetBulk(Collection<String> keys, Iterator<Transcoder<T>> tcs) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> BulkFuture<Map<String, T>> asyncGetBulk(final Iterator<String> keys, final Transcoder<T> tc) { return new BulkFuture<Map<String, T>>() { @Override public boolean isTimeout() { return false; } @Override public Map<String, T> getSome(long timeout, TimeUnit unit) { return get(); } @Override public OperationStatus getStatus() { return null; } @Override public Future<Map<String, T>> addListener(BulkGetCompletionListener bulkGetCompletionListener) { return null; } @Override public Future<Map<String, T>> removeListener(BulkGetCompletionListener bulkGetCompletionListener) { return null; } @Override public boolean cancel(boolean b) { return false; } @Override public boolean isCancelled() { return false; } @Override public boolean isDone() { return true; } @Override public Map<String, T> get() { Map<String, T> retVal = Maps.newHashMap(); while (keys.hasNext()) { String key = keys.next(); CachedData data = theMap.get(key); retVal.put(key, data != null ? tc.decode(data) : null); } return retVal; } @Override public Map<String, T> get(long l, TimeUnit timeUnit) { return get(); } }; } @Override public <T> BulkFuture<Map<String, T>> asyncGetBulk(Collection<String> keys, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public BulkFuture<Map<String, Object>> asyncGetBulk(Iterator<String> keys) { throw new UnsupportedOperationException("not implemented"); } @Override public BulkFuture<Map<String, Object>> asyncGetBulk(final Collection<String> keys) { return asyncGetBulk(keys.iterator(), transcoder); } @Override public <T> BulkFuture<Map<String, T>> asyncGetBulk(Transcoder<T> tc, String... keys) { throw new UnsupportedOperationException("not implemented"); } @Override public BulkFuture<Map<String, Object>> asyncGetBulk(String... keys) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Map<String, T> getBulk(Iterator<String> keys, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Map<String, T> getBulk(Collection<String> keys, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public Map<String, Object> getBulk(Iterator<String> keys) { throw new UnsupportedOperationException("not implemented"); } @Override public Map<String, Object> getBulk(Collection<String> keys) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Map<String, T> getBulk(Transcoder<T> tc, String... keys) { throw new UnsupportedOperationException("not implemented"); } @Override public Map<String, Object> getBulk(String... keys) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Future<Boolean> touch(String key, int exp, Transcoder<T> tc) { throw new UnsupportedOperationException("not implemented"); } @Override public <T> Future<Boolean> touch(String key, int exp) { throw new UnsupportedOperationException("not implemented"); } @Override public Map<SocketAddress, String> getVersions() { throw new UnsupportedOperationException("not implemented"); } @Override public Map<SocketAddress, Map<String, String>> getStats() { throw new UnsupportedOperationException("not implemented"); } @Override public Map<SocketAddress, Map<String, String>> getStats(String prefix) { throw new UnsupportedOperationException("not implemented"); } @Override public long incr(String key, long by) { throw new UnsupportedOperationException("not implemented"); } @Override public long incr(String key, int by) { throw new UnsupportedOperationException("not implemented"); } @Override public long decr(String key, long by) { throw new UnsupportedOperationException("not implemented"); } @Override public long decr(String key, int by) { throw new UnsupportedOperationException("not implemented"); } @Override public long incr(String key, long by, long def, int exp) { throw new UnsupportedOperationException("not implemented"); } @Override public long incr(String key, int by, long def, int exp) { throw new UnsupportedOperationException("not implemented"); } @Override public long decr(String key, long by, long def, int exp) { throw new UnsupportedOperationException("not implemented"); } @Override public long decr(String key, int by, long def, int exp) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Long> asyncIncr(String s, long l, long l2, int i) { return null; } @Override public Future<Long> asyncIncr(String s, int i, long l, int i2) { return null; } @Override public Future<Long> asyncDecr(String s, long l, long l2, int i) { return null; } @Override public Future<Long> asyncDecr(String s, int i, long l, int i2) { return null; } @Override public Future<Long> asyncIncr(String key, long by) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Long> asyncIncr(String key, int by) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Long> asyncDecr(String key, long by) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Long> asyncDecr(String key, int by) { throw new UnsupportedOperationException("not implemented"); } @Override public long incr(String key, long by, long def) { throw new UnsupportedOperationException("not implemented"); } @Override public long incr(String key, int by, long def) { throw new UnsupportedOperationException("not implemented"); } @Override public long decr(String key, long by, long def) { throw new UnsupportedOperationException("not implemented"); } @Override public long decr(String key, int by, long def) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Long> asyncIncr(String s, long l, long l2) { return null; } @Override public Future<Long> asyncIncr(String s, int i, long l) { return null; } @Override public Future<Long> asyncDecr(String s, long l, long l2) { return null; } @Override public Future<Long> asyncDecr(String s, int i, long l) { return null; } @Override public Future<Boolean> delete(String key) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Boolean> delete(String s, long l) { return null; } @Override public Future<Boolean> flush(int delay) { throw new UnsupportedOperationException("not implemented"); } @Override public Future<Boolean> flush() { throw new UnsupportedOperationException("not implemented"); } @Override public void shutdown() { throw new UnsupportedOperationException("not implemented"); } @Override public boolean shutdown(long timeout, TimeUnit unit) { throw new UnsupportedOperationException("not implemented"); } @Override public boolean waitForQueues(long timeout, TimeUnit unit) { throw new UnsupportedOperationException("not implemented"); } @Override public boolean addObserver(ConnectionObserver obs) { throw new UnsupportedOperationException("not implemented"); } @Override public boolean removeObserver(ConnectionObserver obs) { throw new UnsupportedOperationException("not implemented"); } @Override public CountDownLatch broadcastOp(BroadcastOpFactory broadcastOpFactory) { return null; } @Override public CountDownLatch broadcastOp( BroadcastOpFactory broadcastOpFactory, Collection<MemcachedNode> memcachedNodes ) { return null; } @Override public Set<String> listSaslMechanisms() { throw new UnsupportedOperationException("not implemented"); } }
24.668627
113
0.681464
456895dd969082e43e7464726cb9856b21385207
983
package com.adrninistrator.javacg.dto; import java.util.Map; /** * @author adrninistrator * @date 2021/6/25 * @description: */ public class ExtendsClassMethodInfo { private boolean abstractClass; private String superClassName; private Map<String, MethodAttribute> methodAttributeMap; public boolean isAbstractClass() { return abstractClass; } public void setAbstractClass(boolean abstractClass) { this.abstractClass = abstractClass; } public String getSuperClassName() { return superClassName; } public void setSuperClassName(String superClassName) { this.superClassName = superClassName; } public Map<String, MethodAttribute> getMethodAttributeMap() { return methodAttributeMap; } public void setMethodAttributeMap(Map<String, MethodAttribute> methodAttributeMap) { this.methodAttributeMap = methodAttributeMap; } }
22.860465
89
0.678535
eec773d4100b98022444f6c5c11cb382705a7edb
2,153
package org.ayo.rx.sample; import io.reactivex.Flowable; import io.reactivex.MaybeObserver; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; /** * Created by Administrator on 2017/2/14 0014. */ public class Rx_firstElement extends BaseRxDemo { @Override protected String getTitle() { return "take"; } @Override protected String getImageName() { return "firstElement"; } @Override protected String getCodeNormal() { return "Flowable.just(1L)\n" + " .firstElement()"; } private Disposable task; protected void runOk(){ /* - empty - 直接调用complete */ Flowable.just(1L) .firstElement() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) // .subscribe(new Consumer<Long>() { // @Override // public void accept(Long s) throws Exception { // notifyy(s + ""); // } // }, new Consumer<Throwable>() { // @Override // public void accept(Throwable throwable) throws Exception { // notifyy("出错:" + throwable.getMessage()); // } // }); .subscribe(new MaybeObserver<Long>() { @Override public void onSubscribe(Disposable d) { task = d; } @Override public void onSuccess(Long value) { notifyy(value + ""); } @Override public void onError(Throwable e) { notifyy("出错:" + e.getMessage()); } @Override public void onComplete() { notifyy("onComplete!@@!"); } }); } protected void runError(){ } @Override protected void onDestroy2() { super.onDestroy2(); if(task != null) task.dispose(); } }
24.465909
80
0.499303
b91152c44bc9ae758070e3c5b579818827b415d8
14,094
package org.hcjf.layers.query.functions; import org.hcjf.errors.HCJFRuntimeException; import org.hcjf.properties.SystemProperties; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.*; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; import java.time.zone.ZoneOffsetTransition; import java.util.*; /** * @author javaito */ public class DateQueryFunctionLayer extends BaseQueryFunctionLayer implements QueryFunctionLayerInterface { private static final String NOW = "now"; private static final String GET_YEAR = "getYear"; private static final String GET_MONTH = "getMonth"; private static final String GET_MONTH_NUMBER = "getMonthNumber"; private static final String GET_DAY_OF_MONTH = "getDayOfMonth"; private static final String GET_DAY_OF_WEEK = "getDayOfWeek"; private static final String GET_DAY_OF_YEAR = "getDayOfYear"; private static final String GET_HOUR = "getHour"; private static final String GET_MINUTE = "getMinute"; private static final String GET_SECOND = "getSecond"; private static final String GET_MILLISECOND_UNIX_EPOCH = "getMillisecondUnixEpoch"; private static final String GET_NANO = "getNano"; private static final String PLUS_YEARS = "plusYears"; private static final String PLUS_MONTHS = "plusMonths"; private static final String PLUS_DAYS = "plusDays"; private static final String PLUS_HOURS = "plusHours"; private static final String PLUS_MINUTES = "plusMinutes"; private static final String PLUS_SECONDS = "plusSeconds"; private static final String MINUS_YEARS = "minusYears"; private static final String MINUS_MONTHS = "minusMonths"; private static final String MINUS_DAYS = "minusDays"; private static final String MINUS_HOURS = "minusHours"; private static final String MINUS_MINUTES = "minusMinutes"; private static final String MINUS_SECONDS = "minusSeconds"; private static final String PERIOD_IN_NANOS = "periodInNanos"; private static final String PERIOD_IN_MILLISECONDS = "periodInMilliseconds"; private static final String PERIOD_IN_SECONDS = "periodInSeconds"; private static final String PERIOD_IN_MINUTES = "periodInMinutes"; private static final String PERIOD_IN_HOURS = "periodInHours"; private static final String PERIOD_IN_DAYS = "periodInDays"; private static final String DATE_TRANSITION = "dateTransition"; private static final String DATE_FORMAT = "dateFormat"; private static final String PARSE_DATE = "parseDate"; private static final String TO_DATE = "toDate"; private final Map<String,DateTimeFormatter> dateTimeFormatterCache; public DateQueryFunctionLayer() { super(SystemProperties.get(SystemProperties.Query.Function.DATE_FUNCTION_NAME)); this.dateTimeFormatterCache = new HashMap<>(); addFunctionName(NOW); addFunctionName(GET_YEAR); addFunctionName(GET_MONTH); addFunctionName(GET_MONTH_NUMBER); addFunctionName(GET_DAY_OF_MONTH); addFunctionName(GET_DAY_OF_WEEK); addFunctionName(GET_DAY_OF_YEAR); addFunctionName(GET_HOUR); addFunctionName(GET_MINUTE); addFunctionName(GET_SECOND); addFunctionName(GET_MILLISECOND_UNIX_EPOCH); addFunctionName(GET_NANO); addFunctionName(PLUS_YEARS); addFunctionName(PLUS_MONTHS); addFunctionName(PLUS_DAYS); addFunctionName(PLUS_HOURS); addFunctionName(PLUS_MINUTES); addFunctionName(PLUS_SECONDS); addFunctionName(MINUS_YEARS); addFunctionName(MINUS_MONTHS); addFunctionName(MINUS_DAYS); addFunctionName(MINUS_HOURS); addFunctionName(MINUS_MINUTES); addFunctionName(MINUS_SECONDS); addFunctionName(PERIOD_IN_NANOS); addFunctionName(PERIOD_IN_MILLISECONDS); addFunctionName(PERIOD_IN_SECONDS); addFunctionName(PERIOD_IN_MINUTES); addFunctionName(PERIOD_IN_HOURS); addFunctionName(PERIOD_IN_DAYS); addFunctionName(DATE_TRANSITION); addFunctionName(DATE_FORMAT); addFunctionName(PARSE_DATE); addFunctionName(TO_DATE); } @Override public Object evaluate(String functionName, Object... parameters) { Object result; switch (functionName) { case NOW: { if(parameters.length == 0) { result = Date.from(ZonedDateTime.now().toInstant()); } else if(parameters.length == 1) { ZoneId zoneId = ZoneId.of((String)parameters[0]); result = toDate(ZonedDateTime.now(zoneId)); } else { throw new HCJFRuntimeException("Illegal parameters length, now() or now((String)zoneId)"); } break; } case GET_YEAR: result = getZonedDateTimeFromDate(parameters).getYear(); break; case GET_MONTH: result = getZonedDateTimeFromDate(parameters).getMonth(); break; case GET_MONTH_NUMBER: result = getZonedDateTimeFromDate(parameters).getMonthValue(); break; case GET_DAY_OF_MONTH: result = getZonedDateTimeFromDate(parameters).getDayOfMonth(); break; case GET_DAY_OF_WEEK: result = getZonedDateTimeFromDate(parameters).getDayOfWeek(); break; case GET_DAY_OF_YEAR: result = getZonedDateTimeFromDate(parameters).getDayOfYear(); break; case GET_HOUR: result = getZonedDateTimeFromDate(parameters).getHour(); break; case GET_MINUTE: result = getZonedDateTimeFromDate(parameters).getMinute(); break; case GET_SECOND: result = getZonedDateTimeFromDate(parameters).getSecond(); break; case GET_NANO: result = getZonedDateTimeFromDate(parameters).getNano(); break; case GET_MILLISECOND_UNIX_EPOCH: result = Date.from(getZonedDateTimeFromDate(parameters).toInstant()).getTime(); break; case PLUS_YEARS: result = getZonedDateTimeFromDate(1, parameters).plusYears(((Long)parameters[parameters.length - 1])); break; case PLUS_MONTHS: result = getZonedDateTimeFromDate(1, parameters).plusMonths(((Long)parameters[parameters.length - 1])); break; case PLUS_DAYS: result = getZonedDateTimeFromDate(1, parameters).plusDays(((Long)parameters[parameters.length - 1])); break; case PLUS_HOURS: result = getZonedDateTimeFromDate(1, parameters).plusHours(((Long)parameters[parameters.length - 1])); break; case PLUS_MINUTES: result = getZonedDateTimeFromDate(1, parameters).plusMinutes(((Long)parameters[parameters.length - 1])); break; case PLUS_SECONDS: result = getZonedDateTimeFromDate(1, parameters).plusSeconds(((Long)parameters[parameters.length - 1])); break; case MINUS_YEARS: result = getZonedDateTimeFromDate(1, parameters).minusYears(((Long)parameters[parameters.length - 1])); break; case MINUS_MONTHS: result = getZonedDateTimeFromDate(1, parameters).minusMonths(((Long)parameters[parameters.length - 1])); break; case MINUS_DAYS: result = getZonedDateTimeFromDate(1, parameters).minusDays(((Long)parameters[parameters.length - 1])); break; case MINUS_HOURS: result = getZonedDateTimeFromDate(1, parameters).minusHours(((Long)parameters[parameters.length - 1])); break; case MINUS_MINUTES: result = getZonedDateTimeFromDate(1, parameters).minusMinutes(((Long)parameters[parameters.length - 1])); break; case MINUS_SECONDS: result = getZonedDateTimeFromDate(1, parameters).minusSeconds(((Long)parameters[parameters.length - 1])); break; case PERIOD_IN_NANOS: result = getDuration(parameters).toNanos(); break; case PERIOD_IN_MILLISECONDS: result = getDuration(parameters).toMillis(); break; case PERIOD_IN_SECONDS: result = getDuration(parameters).toMillis() / 1000; break; case PERIOD_IN_MINUTES: result = getDuration(parameters).toMinutes(); break; case PERIOD_IN_HOURS: result = getDuration(parameters).toHours(); break; case PERIOD_IN_DAYS: result = getDuration(parameters).toDays(); break; case TO_DATE: { Object param = getParameter(0, parameters); result = toDate(param); break; } case PARSE_DATE: { if(parameters.length >= 2) { try { result = new SimpleDateFormat((String) parameters[0]).parse((String) parameters[1]); } catch (Exception ex){ throw new HCJFRuntimeException("Date parse fail", ex); } } else { throw new HCJFRuntimeException("Illegal parameters length, parseDate((String)pattern, (String)vale)"); } break; } case DATE_FORMAT: { if(parameters.length >= 2) { String pattern = (String) parameters[parameters.length-1]; ZonedDateTime zonedDateTime = getZonedDateTimeFromDate(1, parameters); result = getDateFormatter(pattern).format(zonedDateTime); } else { throw new HCJFRuntimeException("Illegal parameters length"); } break; } case DATE_TRANSITION: { result = getZonedDateTimeFromDate(0, parameters); break; } default: throw new HCJFRuntimeException("Date function not found: %s", functionName); } return result; } private synchronized DateTimeFormatter getDateFormatter(String pattern) { DateTimeFormatter formatter = this.dateTimeFormatterCache.get(pattern); if(formatter == null) { formatter = DateTimeFormatter.ofPattern(pattern); this.dateTimeFormatterCache.put(pattern, formatter); } return formatter; } private Date toDate(Object value) { Date result; if(value instanceof Number) { result = new Date(((Number) value).longValue()); } else if(value instanceof ZonedDateTime) { ZonedDateTime zonedDateTime = (ZonedDateTime) value; Long timestamp = zonedDateTime.toInstant().toEpochMilli(); Long offset = ((ZonedDateTime) value).getOffset().getLong(ChronoField.OFFSET_SECONDS) * 1000; result = new Date(timestamp + offset); } else if(value instanceof TemporalAccessor) { result = Date.from(Instant.from((TemporalAccessor)value)); } else if(value instanceof Date) { result = (Date) value; } else { throw new HCJFRuntimeException("Illegal argument for 'toDate' function"); } return result; } private ZonedDateTime getZonedDateTimeFromDate(int skipping, Object... parameters) { Object[] subSet = new Object[parameters.length - skipping]; System.arraycopy(parameters, 0, subSet, 0, subSet.length); return getZonedDateTimeFromDate(subSet); } private ZonedDateTime getZonedDateTimeFromDate(Object... parameters) { Object firstParam; Instant instant; ZoneId firstZone = null; ZoneId secondZone = null; if(parameters.length == 1) { firstParam = getParameter(0, parameters); } else if(parameters.length == 2) { firstParam = getParameter(0, parameters); firstZone = ZoneId.of(getParameter(1, parameters)); } else if(parameters.length == 3) { firstParam = getParameter(0, parameters); firstZone = ZoneId.of(getParameter(1, parameters)); secondZone = ZoneId.of(getParameter(2, parameters)); } else { throw new HCJFRuntimeException("Illegal number of arguments"); } if(firstParam instanceof Date) { instant = ((Date) firstParam).toInstant(); } else if(firstParam instanceof TemporalAccessor) { instant = Instant.from((TemporalAccessor)firstParam); } else { throw new HCJFRuntimeException("Illegal argument"); } return getZonedDateTimeFromInstant(instant, firstZone, secondZone); } private ZonedDateTime getZonedDateTimeFromInstant(Instant instant, ZoneId firstZone, ZoneId secondZone) { ZonedDateTime result; if (firstZone == null) { result = ZonedDateTime.ofInstant(instant, ZoneId.systemDefault()); } else if (firstZone != null && secondZone == null) { result = ZonedDateTime.ofInstant(instant, firstZone); } else { Instant now = Instant.now(); ZoneOffset zoneOffsetFrom = firstZone.getRules().getOffset(now); ZoneOffset zoneOffsetTo = secondZone.getRules().getOffset(now); //Fixing instance instance in order to set zero nano of seconds Instant fixedInstant = instant.minusNanos(instant.getNano()); ZoneOffsetTransition transition = ZoneOffsetTransition.of( LocalDateTime.ofInstant(fixedInstant, ZoneId.systemDefault()), zoneOffsetFrom, zoneOffsetTo); result = ZonedDateTime.ofInstant(transition.getDateTimeBefore(), transition.getOffsetBefore(), secondZone); } return result; } private Duration getDuration(Object... parameters) { Duration result; if(parameters.length == 1) { result = Duration.between(((Date)getParameter(0, parameters)).toInstant(), Instant.now()); } else if(parameters.length == 2) { result = Duration.between(((Date)getParameter(0, parameters)).toInstant(), ((Date)getParameter(1, parameters)).toInstant()); } else { throw new HCJFRuntimeException("Illegal parameters length"); } return result; } }
51.816176
144
0.666028
c350b24a7d7f4c86aa3cc6b95b25c31ab81b50c1
623
package com.ggar.altair.dao; import com.ggar.altair.model.intermediate.UrlTag; import com.magc.sensecane.framework.dao.CachedDao; import com.magc.sensecane.framework.database.connection.pool.ConnectionPool; public class UrlTagsDao extends CachedDao<UrlTag> { public UrlTagsDao(ConnectionPool pool) { super(pool, UrlTag.class); } public UrlTagsDao(ConnectionPool pool, Class<UrlTag> clazz) { super(pool, clazz); } @Override public UrlTag createInstance(String... p) { return new UrlTag( Integer.parseInt(p[0]), Integer.parseInt(p[1]), Integer.parseInt(p[2]) ); } }
23.074074
77
0.711075
f9162a69b9904d1f4710db4d17b2dcd78d55a7ab
1,008
package nl.rostykerei.cci.ch01.q04; import nl.rostykerei.cci.common.AbstractFactoryTest; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public abstract class PalindromePermutationAbstractTest extends AbstractFactoryTest<PalindromePermutation> { @Test public void testTrue() { assertTrue(testInstance.isPalindromePermutation("abcxcba")); assertTrue(testInstance.isPalindromePermutation("tacocat")); assertTrue(testInstance.isPalindromePermutation("xxxyyyxxx")); assertTrue(testInstance.isPalindromePermutation("aabxb")); assertTrue(testInstance.isPalindromePermutation("a")); assertTrue(testInstance.isPalindromePermutation("xx")); } @Test public void testFalse() { assertFalse(testInstance.isPalindromePermutation("axxb")); assertFalse(testInstance.isPalindromePermutation("abcd")); assertFalse(testInstance.isPalindromePermutation("ab")); } }
36
108
0.752976
a7e462982dad92d8c7c3fb9ce7a81d1911c3b81d
5,367
package org.zalando.sprocwrapper.globalvaluetransformer; import com.google.common.base.Strings; import org.reflections.Reflections; import org.reflections.scanners.SubTypesScanner; import org.reflections.scanners.TypeAnnotationsScanner; import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; import org.reflections.util.FilterBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.zalando.sprocwrapper.globalvaluetransformer.annotation.GlobalValueTransformer; import org.zalando.typemapper.core.ValueTransformer; import org.zalando.typemapper.core.fieldMapper.GlobalValueTransformerRegistry; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; public class GlobalValueTransformerLoader { private static final Logger LOG = LoggerFactory.getLogger(GlobalValueTransformerLoader.class); private static final String GLOBAL_VALUE_TRANSFORMER_SEARCH_NAMESPACE = "global.value.transformer.search.namespace"; private static final String NAMESPACE_SEPARATOR = ";"; private static String namespaceToScan = "org.zalando"; private static boolean scannedClasspath = false; public static synchronized ValueTransformer<?, ?> getValueTransformerForClass(final Class<?> genericType) throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { // did we already scanned the classpath for global value transformers? if (!scannedClasspath) { // last to get the namespace from the system environment String myNameSpaceToScan = null; try { myNameSpaceToScan = System.getenv(GLOBAL_VALUE_TRANSFORMER_SEARCH_NAMESPACE); } catch (final Exception e) { // ignore - e.g. if a security manager exists and permissions are denied. } if (Strings.isNullOrEmpty(myNameSpaceToScan)) { // last to use the given namespace myNameSpaceToScan = namespaceToScan; } final Set<String> namespaces = parseNamespaces(myNameSpaceToScan); namespaces.add(namespaceToScan); LOG.debug("Scan the following packages for {}: {}", GlobalValueTransformer.class.getSimpleName(), namespaces); final Set<Class<?>> typesAnnotatedWith = loadAnnotatedTypes(namespaces); for (final Class<?> foundGlobalValueTransformer : typesAnnotatedWith) { final Class<?> valueTransformerReturnType; try { valueTransformerReturnType = ValueTransformerUtils.getUnmarshalFromDbClass( foundGlobalValueTransformer); GlobalValueTransformerRegistry.register(valueTransformerReturnType, (ValueTransformer<?, ?>) foundGlobalValueTransformer.getDeclaredConstructor() .newInstance()); } catch (final RuntimeException e) { LOG.error("Failed to add global transformer [{}] to global registry.", foundGlobalValueTransformer, e); continue; } LOG.debug("Global Value Transformer [{}] for type [{}] registered.", foundGlobalValueTransformer.getSimpleName(), valueTransformerReturnType.getSimpleName()); } scannedClasspath = true; } return GlobalValueTransformerRegistry.getValueTransformerForClass(genericType); } private static Set<Class<?>> loadAnnotatedTypes(Set<String> namespacesToScan) { final Predicate<String> filter = input -> GlobalValueTransformer.class.getCanonicalName().equals(input); final Set<Class<?>> result = new HashSet<>(); for (String namespace : namespacesToScan) { final Reflections reflections = new Reflections( new ConfigurationBuilder() .filterInputsBy(new FilterBuilder.Include(FilterBuilder.prefix(namespace))) .setUrls(ClasspathHelper.forPackage(namespace)) .setScanners(new TypeAnnotationsScanner().filterResultsBy(filter), new SubTypesScanner()) ); result.addAll(reflections.getTypesAnnotatedWith(GlobalValueTransformer.class)); } return result; } /** * Use this static function to set the namespace to scan. * * @param newNamespace the new namespace to be searched for * {@link org.zalando.sprocwrapper.globalvaluetransformer.annotation.GlobalValueTransformer} */ public static void changeNamespaceToScan(final String newNamespace) { namespaceToScan = newNamespace; scannedClasspath = false; } static Set<String> parseNamespaces(String inputString) { return Arrays.stream(inputString.split(NAMESPACE_SEPARATOR)) .map(String::trim) .filter(ns -> !Strings.isNullOrEmpty(ns)) .collect(Collectors.toSet()); } }
46.267241
120
0.660704
46c6217739169038f5a137a0ff5dc15337c7783d
2,028
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.management.sql.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.management.sql.ServerConnectionType; import com.fasterxml.jackson.annotation.JsonProperty; /** The ServerConnectionPolicy model. */ @JsonFlatten @Fluent public class ServerConnectionPolicyInner extends ProxyResource { /* * Metadata used for the Azure portal experience. */ @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) private String kind; /* * Resource location. */ @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * The server connection type. */ @JsonProperty(value = "properties.connectionType") private ServerConnectionType connectionType; /** * Get the kind property: Metadata used for the Azure portal experience. * * @return the kind value. */ public String kind() { return this.kind; } /** * Get the location property: Resource location. * * @return the location value. */ public String location() { return this.location; } /** * Get the connectionType property: The server connection type. * * @return the connectionType value. */ public ServerConnectionType connectionType() { return this.connectionType; } /** * Set the connectionType property: The server connection type. * * @param connectionType the connectionType value to set. * @return the ServerConnectionPolicyInner object itself. */ public ServerConnectionPolicyInner withConnectionType(ServerConnectionType connectionType) { this.connectionType = connectionType; return this; } }
27.780822
96
0.688363