repo_name
stringlengths
6
101
path
stringlengths
4
300
text
stringlengths
7
1.31M
woshidaniu-com/niutal
niutal-component-wjdc-parent/niutal-component-wjdc-ext/src/main/java/com/woshidaniu/wjdc/dao/daointerface/IWjdjztDao.java
/** * <p>Copyright (R) 2014 我是大牛软件股份有限公司。<p> */ package com.woshidaniu.wjdc.dao.daointerface; import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import com.woshidaniu.wjdc.dao.entites.WjdjztModel; @Repository("wjdjztDao") public interface IWjdjztDao { List<Map<String,String>> getPagedDjztList(WjdjztModel model); int getDjztListCount(WjdjztModel model); List<Map<String,String>> getDjztList(WjdjztModel model); List<Map<String, String>> getStflMapList(@Param("wjid")String wjid); List<Map<String, String>> getStflfz(@Param("wjid")String wjid); int getWjCount(@Param("wjid")String wjid); List<Map<String, String>> getYffWjList(); }
Fraser-Greenlee/transformer-vae
transformer_vae/tokenizer_train.py
''' Train a BPE on a given Huggingface dataset. ''' import os from tqdm import tqdm from dataclasses import dataclass, field from datasets import load_dataset from tokenizers import ByteLevelBPETokenizer, CharBPETokenizer from transformers import HfArgumentParser TOKENIZERS = { 'byte': ByteLevelBPETokenizer, 'char': CharBPETokenizer } TMP_FILE = 'secret_tmp_dataset_file_delete_me.txt' @dataclass class TokenizerArguments: dataset: str = field( metadata={"help": "Dataset name."} ) name: str = field( metadata={"help": "Name of your new tokenizer, defaults to dataset + type."}, default='' ) dataset_col: str = field( default='text', metadata={"help": "Column to train on."} ) dataset_seg: str = field( default='train', metadata={"help": "Dataset segment to train on."} ) type: str = field( default='byte', metadata={"help": f"Type of tokenizer to train. ({TOKENIZERS.keys()})"} ) special_tokens: str = field( default='</s> <pad>', metadata={"help": "Tokenizer special tokens (seperate with spaces)."} ) vocab_size: int = field( default=32128, metadata={"help": "Max vocab size."} ) min_frequency: int = field( default=2, metadata={"help": "Min token frequency."} ) def main(): args = HfArgumentParser(TokenizerArguments).parse_args_into_dataclasses()[0] dataset = load_dataset(args.dataset) txt = [] for r in tqdm(dataset[args.dataset_seg], desc='writing dataset to temp file'): txt.append(r[args.dataset_col]) with open(TMP_FILE, 'w') as f: f.write('\n'.join(txt)) tokenizer = TOKENIZERS[args.type]() tokenizer.train( TMP_FILE, vocab_size=args.vocab_size, min_frequency=args.min_frequency, special_tokens=args.special_tokens.split() ) name = args.name if args.name else f'tkn_{args.dataset.split("/")[::-1][0]}_{args.type}' tkn_dir = f'tokenizers/{name}' if not os.path.exists(tkn_dir): os.mkdir(tkn_dir) tokenizer.save_model(tkn_dir) print('### Show performance') for i, r in enumerate(dataset[args.dataset_seg]): txt = r[args.dataset_col] token_ids = tokenizer.encode(txt).ids if i == 0: print('real:') print(txt) print('tokenizer decode( encode( txt ) ):') print(tokenizer.decode(token_ids)) print('list tokens:') print('", "'.join([tokenizer.decode([tkn_id]) for tkn_id in token_ids])) if i < 10: print('raw len: ', len(txt)) print('split len:', len(txt.split())) print('tokenized len:', len(token_ids)) else: break if __name__ == '__main__': main()
BearerPipelineTest/daml
ledger/ledger-api-bench-tool/src/main/scala/com/daml/ledger/api/benchtool/services/CommandService.scala
<reponame>BearerPipelineTest/daml<gh_stars>0 // Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.daml.ledger.api.benchtool.services import com.daml.ledger.api.benchtool.AuthorizationHelper import com.daml.ledger.api.v1.command_service._ import com.daml.ledger.api.v1.commands.Commands import com.google.protobuf.empty.Empty import io.grpc.Channel import org.slf4j.LoggerFactory import scala.concurrent.{ExecutionContext, Future} import scala.util.control.NonFatal class CommandService(channel: Channel, authorizationToken: Option[String]) { private val logger = LoggerFactory.getLogger(getClass) private val service: CommandServiceGrpc.CommandServiceStub = AuthorizationHelper.maybeAuthedService(authorizationToken)(CommandServiceGrpc.stub(channel)) def submitAndWait(commands: Commands)(implicit ec: ExecutionContext): Future[Empty] = service .submitAndWait(new SubmitAndWaitRequest(Some(commands))) .recoverWith { case NonFatal(ex) => Future.failed { logger.error(s"Command submission error. Details: ${ex.getLocalizedMessage}", ex) ex } } }
modelingcovid/covidmodel
lib/controls.js
import {addDays, daysToMonths, today} from './date'; import {formatNumber, formatPercent, formatShortCalendarDate} from './format'; export const stateLabels = { AL: 'Alabama', AK: 'Alaska', AS: 'American Samoa', AZ: 'Arizona', AR: 'Arkansas', CA: 'California', CO: 'Colorado', CT: 'Connecticut', DE: 'Delaware', DC: 'District Of Columbia', FM: 'Federated States Of Micronesia', FL: 'Florida', GA: 'Georgia', GU: 'Guam', HI: 'Hawaii', ID: 'Idaho', IL: 'Illinois', IN: 'Indiana', IA: 'Iowa', KS: 'Kansas', KY: 'Kentucky', LA: 'Louisiana', ME: 'Maine', MH: 'Marshall Islands', MD: 'Maryland', MA: 'Massachusetts', MI: 'Michigan', MN: 'Minnesota', MS: 'Mississippi', MO: 'Missouri', MT: 'Montana', NE: 'Nebraska', NV: 'Nevada', NH: 'New Hampshire', NJ: 'New Jersey', NM: 'New Mexico', NY: 'New York', NC: 'North Carolina', ND: 'North Dakota', MP: 'Northern Mariana Islands', OH: 'Ohio', OK: 'Oklahoma', OR: 'Oregon', PW: 'Palau', PA: 'Pennsylvania', PR: 'Puerto Rico', RI: 'Rhode Island', SC: 'South Carolina', SD: 'South Dakota', TN: 'Tennessee', TX: 'Texas', UT: 'Utah', VT: 'Vermont', VI: 'Virgin Islands', VA: 'Virginia', WA: 'Washington', WV: 'West Virginia', WI: 'Wisconsin', WY: 'Wyoming', }; export const stateCodes = {}; for (let [code, name] of Object.entries(stateLabels)) { stateCodes[name] = code; } export const states = Object.keys(stateLabels); export function getRelativeDistancing(distancingLevel, currentDistancingLevel) { if (distancingLevel === 1) { return 'none'; } if (distancingLevel === currentDistancingLevel) { return 'current'; } if (distancingLevel < currentDistancingLevel) { // I know this looks weird, distancing level is inverted. return 'increase'; } if (distancingLevel > currentDistancingLevel) { // I know this looks weird, distancing level is inverted. return 'decrease'; } return 'unknown'; } export function getDistancingDate(distancingDays, offset = 0) { return addDays(today, distancingDays + offset); } export function createFormatDistancingDuration(verbosity) { return function formatDistancingDuration({distancingDays, id}) { const isTerse = verbosity === 'terse'; if (id === 'scenario7') { const endDate = formatShortCalendarDate( getDistancingDate(distancingDays) ); switch (verbosity) { case 'verbose': return `until ${new Date(Date.now() + 12096e5).toLocaleDateString( 'en-US', { month: 'long', day: 'numeric', } )}, gradually decrease until ${endDate}`; case 'terse': return endDate; default: return `until ${new Date(Date.now() + 12096e5).toLocaleDateString( 'en-US', { month: 'long', day: 'numeric', } )},\ndecreasing until ${endDate}`; } } if (distancingDays > 365) { return 'indefinitely'; } const months = daysToMonths(distancingDays); if (months >= 2) { const monthStr = `${formatNumber(months)} months`; return isTerse ? monthStr : `for ${monthStr}`; } const dateStr = formatShortCalendarDate(addDays(today, distancingDays)); return isTerse ? dateStr : `until ${dateStr}`; }; } export const formatDistancingDuration = createFormatDistancingDuration( 'regular' ); export const formatDistancingDurationTerse = createFormatDistancingDuration( 'terse' ); export const formatDistancingDurationVerbose = createFormatDistancingDuration( 'verbose' ); export function getScenarioLabel( {id, distancingDays, distancingLevel, name}, currentDistancingLevel ) { const duration = formatDistancingDurationVerbose({distancingDays, id}); switch (getRelativeDistancing(distancingLevel, currentDistancingLevel)) { case 'none': return 'Return to normal with no distancing'; case 'current': return `Continue distancing at current levels ${duration}`; case 'increase': return `Increase distancing to ${name} levels ${duration}`; case 'decrease': return `Decrease distancing to ${name} levels ${duration}`; default: return ''; } } export function formatLongScenario( {id, distancingDays, distancingLevel}, currentDistancingLevel ) { const duration = formatDistancingDurationVerbose({distancingDays, id}); const amount = formatPercent(1 - distancingLevel); switch (getRelativeDistancing(distancingLevel, currentDistancingLevel)) { case 'none': return 'the distancing level returns to normal'; case 'current': return `the current distancing level continues ${duration}`; case 'increase': return `the distancing level increases to ${amount} ${duration}`; case 'decrease': return `the distancing level decreases to ${amount} ${duration}`; default: return ''; } } export function formatDistancingLevel({distancingLevel}) { return formatPercent(1 - distancingLevel); } export function formatScenarioName({name}) { return name; } export function formatScenario(scenario) { const {id, distancingDays, distancingLevel} = scenario; if (distancingLevel === 1) { return 'Return to normal'; } const duration = formatDistancingDuration(scenario); const amount = formatDistancingLevel(scenario); return `${amount} distancing ${duration}`; }
tied/innovation-funding-service
ifs-resources/src/main/java/org/innovateuk/ifs/questionnaire/resource/QuestionnaireTextOutcomeResource.java
<filename>ifs-resources/src/main/java/org/innovateuk/ifs/questionnaire/resource/QuestionnaireTextOutcomeResource.java package org.innovateuk.ifs.questionnaire.resource; public class QuestionnaireTextOutcomeResource { private Long id; private String text; private QuestionnaireDecisionImplementation implementation; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getText() { return text; } public void setText(String text) { this.text = text; } public QuestionnaireDecisionImplementation getImplementation() { return implementation; } public void setImplementation(QuestionnaireDecisionImplementation implementation) { this.implementation = implementation; } }
jonathanedgecombe/anvil
api-client/src/main/java/com/wyverngame/anvil/api/client/event/UpdateFaceEvent.java
package com.wyverngame.anvil.api.client.event; import com.wyverngame.anvil.api.event.Event; public final class UpdateFaceEvent extends Event<Void> { private final long target; private final long newFace; public UpdateFaceEvent(long target, long newFace) { this.target = target; this.newFace = newFace; } public long getTarget() { return target; } public long getNewFace() { return newFace; } }
indefinitelee/Learning
KnightMoves.js
function minKnightMoves(x, y) { let q = [[0, 0]]; let steps = 0; let visited = new Set(); visited.add(`${0}-${0}`); x = Math.abs(x); y = Math.abs(y); let directions = [ [-2, 1], [-1, 2], [-1, -2], [-2, -1], [2, 1], [1, 2], [1, -2], [2, -1]]; while( q.length > 0 ) { let length = q.length; for( let i = 0; i < length; i++ ) { let [x1, y1] = q.shift(); if (x1 === x && y1 === y) { return steps; } directions.map((direction) => { let [xd, yd] = direction xd += x1 yd += y1 //test code // lkimits board to top right quadrant and -2 allows one step out of that area if (!visited.has(`${xd}-${yd}`) && xd >=-2 && yd >=-2){ q.push([xd,yd]) visited.add(`${xd}-${yd}`) } }) } steps++ console.log(steps) } return steps; } minKnightMoves(3,3)
projectPiki/pikmin2
src/JSystem/JKR/JKRCompArchive.cpp
#include "types.h" /* Generated from dpostproc .section .rodata # 0x804732E0 - 0x8049E220 .global lbl_804735C8 lbl_804735C8: .4byte 0x4A4B5243 .4byte 0x6F6D7041 .4byte 0x72636869 .4byte 0x76652E63 .4byte 0x70700000 .global lbl_804735DC lbl_804735DC: .4byte 0x696C6C65 .4byte 0x67616C20 .4byte 0x61726368 .4byte 0x6976652E .4byte 0x00000000 .global lbl_804735F0 lbl_804735F0: .4byte 0x696C6C65 .4byte 0x67616C20 .4byte 0x7265736F .4byte 0x75726365 .4byte 0x2E000000 .4byte 0x00000000 .section .data, "wa" # 0x8049E220 - 0x804EFC20 .global __vt__14JKRCompArchive __vt__14JKRCompArchive: .4byte 0 .4byte 0 .4byte __dt__14JKRCompArchiveFv .4byte unmount__13JKRFileLoaderFv .4byte becomeCurrent__10JKRArchiveFPCc .4byte getResource__10JKRArchiveFPCc .4byte getResource__10JKRArchiveFUlPCc .4byte readResource__10JKRArchiveFPvUlPCc .4byte readResource__10JKRArchiveFPvUlUlPCc .4byte removeResourceAll__14JKRCompArchiveFv .4byte removeResource__14JKRCompArchiveFPv .4byte detachResource__10JKRArchiveFPv .4byte getResSize__10JKRArchiveCFPCv .4byte countFile__10JKRArchiveCFPCc .4byte getFirstFile__10JKRArchiveCFPCc .4byte getExpandedResSize__14JKRCompArchiveCFPCv .4byte fetchResource__14JKRCompArchiveFPQ210JKRArchive12SDIFileEntryPUl .4byte fetchResource__14JKRCompArchiveFPvUlPQ210JKRArchive12SDIFileEntryPUl .4byte setExpandSize__10JKRArchiveFPQ210JKRArchive12SDIFileEntryUl .4byte getExpandSize__10JKRArchiveCFPQ210JKRArchive12SDIFileEntry .section .sdata2, "a" # 0x80516360 - 0x80520E40 .global lbl_805164E8 lbl_805164E8: .4byte 0x25730000 .4byte 0x00000000 */ /* * --INFO-- * Address: 8001BBB8 * Size: 0000B0 */ JKRCompArchive::JKRCompArchive(long, JKRArchive::EMountDirection) { /* stwu r1, -0x20(r1) mflr r0 stw r0, 0x24(r1) stw r31, 0x1c(r1) mr r31, r5 li r5, 4 stw r30, 0x18(r1) mr r30, r4 stw r29, 0x14(r1) mr r29, r3 bl __ct__10JKRArchiveFlQ210JKRArchive10EMountMode lis r4, __vt__14JKRCompArchive@ha mr r3, r29 addi r0, r4, __vt__14JKRCompArchive@l mr r4, r30 stw r0, 0(r29) stw r31, 0x60(r29) bl open__14JKRCompArchiveFl clrlwi. r0, r3, 0x18 bne lbl_8001BC10 mr r3, r29 b lbl_8001BC4C lbl_8001BC10: lis r4, 0x52415243@ha lis r3, sVolumeList__13JKRFileLoader@ha addi r0, r4, 0x52415243@l stw r0, 0x2c(r29) addi r4, r29, 0x18 addi r3, r3, sVolumeList__13JKRFileLoader@l lwz r5, 0x48(r29) lwz r6, 0x54(r29) lwz r0, 4(r5) add r0, r6, r0 stw r0, 0x28(r29) bl prepend__10JSUPtrListFP10JSUPtrLink li r0, 1 mr r3, r29 stb r0, 0x30(r29) lbl_8001BC4C: lwz r0, 0x24(r1) lwz r31, 0x1c(r1) lwz r30, 0x18(r1) lwz r29, 0x14(r1) mtlr r0 addi r1, r1, 0x20 blr */ } /* * --INFO-- * Address: 8001BC68 * Size: 000150 */ JKRCompArchive::~JKRCompArchive() { /* stwu r1, -0x20(r1) mflr r0 stw r0, 0x24(r1) stw r31, 0x1c(r1) mr r31, r4 stw r30, 0x18(r1) or. r30, r3, r3 stw r29, 0x14(r1) stw r28, 0x10(r1) beq lbl_8001BD94 lis r3, __vt__14JKRCompArchive@ha addi r0, r3, __vt__14JKRCompArchive@l stw r0, 0(r30) lwz r0, 0x44(r30) cmplwi r0, 0 beq lbl_8001BCFC lwz r29, 0x4c(r30) li r28, 0 b lbl_8001BCDC lbl_8001BCB4: lwz r0, 4(r29) rlwinm. r0, r0, 8, 0x1b, 0x1b bne lbl_8001BCD4 lwz r3, 0x10(r29) cmplwi r3, 0 beq lbl_8001BCD4 lwz r4, 0x38(r30) bl free__7JKRHeapFPvP7JKRHeap lbl_8001BCD4: addi r29, r29, 0x14 addi r28, r28, 1 lbl_8001BCDC: lwz r3, 0x44(r30) lwz r0, 8(r3) cmplw r28, r0 blt lbl_8001BCB4 lwz r4, 0x38(r30) bl free__7JKRHeapFPvP7JKRHeap li r0, 0 stw r0, 0x44(r30) lbl_8001BCFC: lwz r3, 0x68(r30) cmplwi r3, 0 beq lbl_8001BD20 beq lbl_8001BD20 lwz r12, 0(r3) li r4, 1 lwz r12, 8(r12) mtctr r12 bctrl lbl_8001BD20: lwz r3, 0x50(r30) cmplwi r3, 0 beq lbl_8001BD3C li r4, 0 bl free__7JKRHeapFPvP7JKRHeap li r0, 0 stw r0, 0x50(r30) lbl_8001BD3C: lwz r3, 0x70(r30) cmplwi r3, 0 beq lbl_8001BD60 beq lbl_8001BD60 lwz r12, 0(r3) li r4, 1 lwz r12, 8(r12) mtctr r12 bctrl lbl_8001BD60: lis r3, sVolumeList__13JKRFileLoader@ha addi r4, r30, 0x18 addi r3, r3, sVolumeList__13JKRFileLoader@l bl remove__10JSUPtrListFP10JSUPtrLink li r0, 0 mr r3, r30 stb r0, 0x30(r30) li r4, 0 bl __dt__10JKRArchiveFv extsh. r0, r31 ble lbl_8001BD94 mr r3, r30 bl __dl__FPv lbl_8001BD94: lwz r0, 0x24(r1) mr r3, r30 lwz r31, 0x1c(r1) lwz r30, 0x18(r1) lwz r29, 0x14(r1) lwz r28, 0x10(r1) mtlr r0 addi r1, r1, 0x20 blr */ } /* * --INFO-- * Address: 8001BDB8 * Size: 00057C */ void JKRCompArchive::open(long) { /* stwu r1, -0x30(r1) mflr r0 li r5, 0 stw r0, 0x34(r1) li r0, 0 stmw r25, 0x14(r1) mr r31, r3 mr r27, r4 stw r0, 0x44(r3) li r3, 0xf8 stw r0, 0x64(r31) stw r0, 0x68(r31) stw r0, 0x6c(r31) stw r0, 0x74(r31) stw r0, 0x78(r31) stw r0, 0x7c(r31) stw r0, 0x48(r31) stw r0, 0x4c(r31) stw r0, 0x54(r31) lwz r4, sSystemHeap__7JKRHeap@sda21(r13) bl __nw__FUlP7JKRHeapi or. r0, r3, r3 beq lbl_8001BE20 mr r4, r27 bl __ct__10JKRDvdFileFl mr r0, r3 lbl_8001BE20: stw r0, 0x70(r31) lwz r0, 0x70(r31) cmplwi r0, 0 bne lbl_8001BE40 li r0, 0 li r3, 0 stb r0, 0x3c(r31) b lbl_8001C320 lbl_8001BE40: lwz r3, sSystemHeap__7JKRHeap@sda21(r13) li r4, 0x20 li r5, -32 bl alloc__7JKRHeapFUli or. r29, r3, r3 bne lbl_8001BE64 li r0, 0 stb r0, 0x3c(r31) b lbl_8001C2D0 lbl_8001BE64: li r0, 0 mr r3, r27 stw r0, 8(r1) mr r4, r29 addi r10, r31, 0x5c li r5, 1 li r6, 0x20 li r7, 0 li r8, 1 li r9, 0 bl loadToMainRAM__12JKRDvdRipperFlPUc15JKRExpandSwitchUlP7JKRHeapQ212JKRDvdRipper15EAllocDirectionUlPiPUl mr r3, r29 li r4, 0x20 bl DCInvalidateRange lwz r0, 0x14(r29) stw r0, 0x74(r31) lwz r0, 0x18(r29) stw r0, 0x78(r31) lwz r0, 0x5c(r31) cmpwi r0, 1 beq lbl_8001C014 bge lbl_8001BEC8 cmpwi r0, 0 bge lbl_8001BED0 b lbl_8001C21C lbl_8001BEC8: cmpwi r0, 3 bge lbl_8001C21C lbl_8001BED0: lwz r0, 0x60(r31) li r4, -32 cmpwi r0, 1 bne lbl_8001BEE4 li r4, 0x20 lbl_8001BEE4: lwz r3, 0xc(r29) mr r30, r4 lwz r0, 0x74(r31) lwz r5, 0x38(r31) add r3, r3, r0 bl alloc__7JKRHeapFUliP7JKRHeap stw r3, 0x44(r31) lwz r4, 0x44(r31) cmplwi r4, 0 bne lbl_8001BF18 li r0, 0 stb r0, 0x3c(r31) b lbl_8001C21C lbl_8001BF18: li r0, 0 mr r3, r27 stw r0, 8(r1) li r5, 1 li r7, 0 li r8, 1 lwz r6, 0xc(r29) li r9, 0x20 lwz r0, 0x74(r31) li r10, 0 add r6, r6, r0 bl loadToMainRAM__12JKRDvdRipperFlPUc15JKRExpandSwitchUlP7JKRHeapQ212JKRDvdRipper15EAllocDirectionUlPiPUl lwz r4, 0xc(r29) lwz r0, 0x74(r31) lwz r3, 0x44(r31) add r4, r4, r0 bl DCInvalidateRange lwz r3, 0x44(r31) lwz r0, 0xc(r29) add r0, r3, r0 stw r0, 0x64(r31) lwz r4, 0x78(r31) cmplwi r4, 0 beq lbl_8001BFD0 lwz r3, sAramObject__7JKRAram@sda21(r13) li r5, 0 lwz r3, 0x94(r3) bl alloc__11JKRAramHeapFUlQ211JKRAramHeap10EAllocMode stw r3, 0x68(r31) lwz r9, 0x68(r31) cmplwi r9, 0 bne lbl_8001BFA4 li r0, 0 stb r0, 0x3c(r31) b lbl_8001C21C lbl_8001BFA4: lwz r4, 0x74(r31) mr r3, r27 lwz r0, 0xc(r29) li r5, 1 lwz r8, 8(r29) li r7, 0 add r6, r0, r4 lwz r4, 0x14(r9) add r6, r8, r6 li r8, 0 bl loadToAram__16JKRDvdAramRipperFlUl15JKRExpandSwitchUlUlPUl lbl_8001BFD0: lwz r3, 0x44(r31) lwz r0, 4(r3) add r0, r3, r0 stw r0, 0x48(r31) lwz r3, 0x44(r31) lwz r0, 0xc(r3) add r0, r3, r0 stw r0, 0x4c(r31) lwz r3, 0x44(r31) lwz r0, 0x14(r3) add r0, r3, r0 stw r0, 0x54(r31) lwz r3, 8(r29) lwz r0, 0xc(r29) add r0, r3, r0 stw r0, 0x6c(r31) b lbl_8001C21C lbl_8001C014: lwz r3, 0x70(r31) lwz r12, 0(r3) lwz r12, 0x1c(r12) mtctr r12 bctrl lwz r0, 0x60(r31) addi r3, r3, 0x1f rlwinm r25, r3, 0, 0, 0x1a li r30, -32 cmpwi r0, 1 bne lbl_8001C044 li r30, 0x20 lbl_8001C044: neg r26, r30 lwz r3, sSystemHeap__7JKRHeap@sda21(r13) mr r4, r25 mr r5, r26 bl alloc__7JKRHeapFUli or. r28, r3, r3 bne lbl_8001C06C li r0, 0 stb r0, 0x3c(r31) b lbl_8001C1DC lbl_8001C06C: li r0, 0 mr r3, r27 stw r0, 8(r1) mr r4, r28 mr r6, r25 li r5, 2 li r7, 0 li r8, 1 li r9, 0 li r10, 0 bl loadToMainRAM__12JKRDvdRipperFlPUc15JKRExpandSwitchUlP7JKRHeapQ212JKRDvdRipper15EAllocDirectionUlPiPUl mr r3, r28 mr r4, r25 bl DCInvalidateRange lbz r0, 5(r28) mr r4, r26 lbz r3, 4(r28) slwi r0, r0, 0x10 lbz r6, 6(r28) rlwimi r0, r3, 0x18, 0, 7 lbz r7, 7(r28) rlwimi r0, r6, 8, 0x10, 0x17 lwz r5, 0x38(r31) or r3, r7, r0 addi r0, r3, 0x1f rlwinm r25, r0, 0, 0, 0x1a mr r3, r25 bl alloc__7JKRHeapFUliP7JKRHeap or. r27, r3, r3 bne lbl_8001C0F0 li r0, 0 stb r0, 0x3c(r31) b lbl_8001C1DC lbl_8001C0F0: mr r29, r27 mr r3, r28 mr r4, r27 mr r5, r25 li r6, 0 bl orderSync__9JKRDecompFPUcPUcUlUl lwz r3, sSystemHeap__7JKRHeap@sda21(r13) mr r4, r28 bl free__7JKRHeapFPv lwz r3, 0xc(r29) mr r4, r30 lwz r0, 0x74(r31) lwz r5, 0x38(r31) add r3, r3, r0 bl alloc__7JKRHeapFUliP7JKRHeap stw r3, 0x44(r31) lwz r3, 0x44(r31) cmplwi r3, 0 bne lbl_8001C148 li r0, 0 stb r0, 0x3c(r31) b lbl_8001C1DC lbl_8001C148: lwz r5, 0xc(r29) addi r4, r29, 0x20 lwz r0, 0x74(r31) add r5, r5, r0 bl copyMemory__7JKRHeapFPvPvUl lwz r3, 0x44(r31) lwz r0, 0xc(r29) add r0, r3, r0 stw r0, 0x64(r31) lwz r4, 0x78(r31) cmplwi r4, 0 beq lbl_8001C1DC lwz r3, sAramObject__7JKRAram@sda21(r13) li r5, 0 lwz r3, 0x94(r3) bl alloc__11JKRAramHeapFUlQ211JKRAramHeap10EAllocMode stw r3, 0x68(r31) lwz r5, 0x68(r31) cmplwi r5, 0 bne lbl_8001C1A4 li r0, 0 stb r0, 0x3c(r31) b lbl_8001C1DC lbl_8001C1A4: lwz r4, 8(r29) li r6, 0 lwz r3, 0xc(r29) li r7, 0 lwz r0, 0x74(r31) li r8, 0 add r3, r4, r3 lwz r4, 0x14(r5) add r3, r3, r0 lwz r5, 0x78(r31) add r3, r27, r3 li r9, -1 li r10, 0 bl mainRamToAram__7JKRAramFPUcUlUl15JKRExpandSwitchUlP7JKRHeapiPUl lbl_8001C1DC: lwz r3, 0x44(r31) lwz r0, 4(r3) add r0, r3, r0 stw r0, 0x48(r31) lwz r3, 0x44(r31) lwz r0, 0xc(r3) add r0, r3, r0 stw r0, 0x4c(r31) lwz r3, 0x44(r31) lwz r0, 0x14(r3) add r0, r3, r0 stw r0, 0x54(r31) lwz r3, 8(r29) lwz r0, 0xc(r29) add r0, r3, r0 stw r0, 0x6c(r31) lbl_8001C21C: li r0, 0 li r4, 0 stw r0, 0x50(r31) lwz r3, 0x44(r31) lwz r5, 0x4c(r31) lwz r0, 8(r3) mtctr r0 cmplwi r0, 0 ble lbl_8001C26C lbl_8001C240: lwz r3, 4(r5) rlwinm. r0, r3, 8, 0x1f, 0x1f srwi r3, r3, 0x18 beq lbl_8001C264 rlwinm. r0, r3, 0, 0x1b, 0x1b bne lbl_8001C264 rlwinm r0, r3, 0, 0x1d, 0x1d or r0, r4, r0 clrlwi r4, r0, 0x18 lbl_8001C264: addi r5, r5, 0x14 bdnz lbl_8001C240 lbl_8001C26C: clrlwi. r0, r4, 0x18 beq lbl_8001C2D0 mr r3, r30 bl abs lwz r4, 0x44(r31) lwz r5, 0x38(r31) lwz r0, 8(r4) mr r4, r3 slwi r3, r0, 2 bl alloc__7JKRHeapFUliP7JKRHeap stw r3, 0x50(r31) lwz r3, 0x50(r31) cmplwi r3, 0 bne lbl_8001C2BC lwz r3, sSystemHeap__7JKRHeap@sda21(r13) lwz r4, 0x44(r31) bl free__7JKRHeapFPv li r0, 0 stb r0, 0x3c(r31) b lbl_8001C2D0 lbl_8001C2BC: lwz r5, 0x44(r31) li r4, 0 lwz r0, 8(r5) slwi r5, r0, 2 bl memset lbl_8001C2D0: cmplwi r29, 0 beq lbl_8001C2E4 lwz r3, sSystemHeap__7JKRHeap@sda21(r13) mr r4, r29 bl free__7JKRHeapFPv lbl_8001C2E4: lbz r0, 0x3c(r31) cmplwi r0, 0 bne lbl_8001C31C lwz r3, 0x70(r31) cmplwi r3, 0 beq lbl_8001C314 beq lbl_8001C314 lwz r12, 0(r3) li r4, 1 lwz r12, 8(r12) mtctr r12 bctrl lbl_8001C314: li r3, 0 b lbl_8001C320 lbl_8001C31C: li r3, 1 lbl_8001C320: lmw r25, 0x14(r1) lwz r0, 0x34(r1) mtlr r0 addi r1, r1, 0x30 blr */ } /* * --INFO-- * Address: 8001C334 * Size: 000190 */ void JKRCompArchive::fetchResource(JKRArchive::SDIFileEntry*, unsigned long*) { /* stwu r1, -0x30(r1) mflr r0 stw r0, 0x34(r1) stw r31, 0x2c(r1) stw r30, 0x28(r1) mr r30, r5 stw r29, 0x24(r1) mr r29, r4 stw r28, 0x20(r1) mr r28, r3 lwz r3, 4(r4) lwz r5, 0xc(r4) rlwinm. r0, r3, 8, 0x1d, 0x1d srwi r3, r3, 0x18 mr r4, r5 bne lbl_8001C37C li r31, 0 b lbl_8001C390 lbl_8001C37C: rlwinm. r0, r3, 0, 0x18, 0x18 beq lbl_8001C38C li r31, 2 b lbl_8001C390 lbl_8001C38C: li r31, 1 lbl_8001C390: cmplwi r30, 0 bne lbl_8001C39C addi r30, r1, 0x10 lbl_8001C39C: lwz r0, 0x10(r29) cmplwi r0, 0 bne lbl_8001C494 rlwinm. r0, r3, 0, 0x1b, 0x1b beq lbl_8001C3C8 lwz r3, 0x64(r28) lwz r0, 8(r29) add r0, r3, r0 stw r0, 0x10(r29) stw r4, 0(r30) b lbl_8001C4A0 lbl_8001C3C8: rlwinm. r0, r3, 0, 0x1a, 0x1a beq lbl_8001C42C lwz r3, 0x68(r28) mr r6, r31 lwz r5, 8(r29) addi r7, r1, 0xc lwz r0, 0x14(r3) lwz r3, 0x74(r28) add r0, r5, r0 lwz r5, 0x38(r28) subf r3, r3, r0 bl fetchResource_subroutine__14JKRAramArchiveFUlUlP7JKRHeapiPPUc stw r3, 0(r30) cmpwi r31, 2 lwz r0, 0xc(r1) stw r0, 0x10(r29) bne lbl_8001C4A0 mr r3, r28 mr r4, r29 lwz r12, 0(r28) lwz r5, 0(r30) lwz r12, 0x48(r12) mtctr r12 bctrl b lbl_8001C4A0 lbl_8001C42C: rlwinm. r0, r3, 0, 0x19, 0x19 beq lbl_8001C4A0 lwz r4, 0x6c(r28) mr r7, r31 lwz r0, 8(r29) addi r9, r1, 8 lwz r3, 0x40(r28) lwz r6, 0x38(r28) add r4, r4, r0 lwz r8, 0x5c(r28) bl fetchResource_subroutine__13JKRDvdArchiveFlUlUlP7JKRHeapiiPPUc cmplwi r30, 0 beq lbl_8001C464 stw r3, 0(r30) lbl_8001C464: lwz r0, 8(r1) cmpwi r31, 2 stw r0, 0x10(r29) bne lbl_8001C4A0 mr r3, r28 mr r4, r29 lwz r12, 0(r28) lwz r5, 0(r30) lwz r12, 0x48(r12) mtctr r12 bctrl b lbl_8001C4A0 lbl_8001C494: cmplwi r30, 0 beq lbl_8001C4A0 stw r5, 0(r30) lbl_8001C4A0: lwz r0, 0x34(r1) lwz r31, 0x2c(r1) lwz r3, 0x10(r29) lwz r30, 0x28(r1) lwz r29, 0x24(r1) lwz r28, 0x20(r1) mtlr r0 addi r1, r1, 0x30 blr */ } /* * --INFO-- * Address: 8001C4C4 * Size: 000194 */ void JKRCompArchive::fetchResource(void*, unsigned long, JKRArchive::SDIFileEntry*, unsigned long*) { /* .loc_0x0: stwu r1, -0x20(r1) mflr r0 mr r9, r3 stw r0, 0x24(r1) stmw r26, 0x8(r1) mr r30, r6 mr r28, r4 mr r29, r5 mr r31, r7 li r27, 0 lwz r3, 0x4(r6) lwz r26, 0xC(r6) rlwinm. r0,r3,8,29,29 rlwinm r3,r3,8,24,31 addi r0, r26, 0x1F rlwinm r4,r0,0,0,26 bne- .loc_0x4C li r7, 0 b .loc_0x60 .loc_0x4C: rlwinm. r0,r3,0,24,24 beq- .loc_0x5C li r7, 0x2 b .loc_0x60 .loc_0x5C: li r7, 0x1 .loc_0x60: lwz r0, 0x10(r30) cmplwi r0, 0 beq- .loc_0xBC cmpwi r7, 0x2 bne- .loc_0x98 mr r3, r9 mr r4, r30 lwz r12, 0x0(r9) lwz r12, 0x4C(r12) mtctr r12 bctrl cmplwi r3, 0 beq- .loc_0x98 mr r26, r3 .loc_0x98: cmplw r26, r29 ble- .loc_0xA4 mr r26, r29 .loc_0xA4: lwz r4, 0x10(r30) mr r3, r28 mr r5, r26 bl 0x7850 mr r27, r26 b .loc_0x170 .loc_0xBC: rlwinm. r0,r3,0,27,27 beq- .loc_0xE4 lwz r3, 0x64(r9) mr r5, r28 lwz r0, 0x8(r30) rlwinm r6,r29,0,0,26 add r3, r3, r0 bl 0x8670 mr r27, r3 b .loc_0x170 .loc_0xE4: rlwinm. r0,r3,0,26,26 beq- .loc_0x118 lwz r3, 0x68(r9) mr r5, r28 lwz r8, 0x8(r30) rlwinm r6,r29,0,0,26 lwz r0, 0x14(r3) lwz r3, 0x74(r9) add r0, r8, r0 sub r3, r0, r3 bl -0x34C8 mr r27, r3 b .loc_0x170 .loc_0x118: rlwinm. r0,r3,0,25,25 beq- .loc_0x150 lwz r10, 0x6C(r9) mr r5, r4 lwz r0, 0x8(r30) mr r6, r28 lwz r3, 0x40(r9) mr r8, r7 lwz r9, 0x5C(r9) add r4, r10, r0 rlwinm r7,r29,0,0,26 bl 0x2620 mr r27, r3 b .loc_0x170 .loc_0x150: lis r3, 0x8047 lis r5, 0x8047 addi r6, r5, 0x35DC li r4, 0x308 addi r3, r3, 0x35C8 subi r5, r2, 0x7E78 crclr 6, 0x6 bl 0xE010 .loc_0x170: cmplwi r31, 0 beq- .loc_0x17C stw r27, 0x0(r31) .loc_0x17C: mr r3, r28 lmw r26, 0x8(r1) lwz r0, 0x24(r1) mtlr r0 addi r1, r1, 0x20 blr */ } /* * --INFO-- * Address: 8001C658 * Size: 0000A4 */ void JKRCompArchive::removeResourceAll() { /* stwu r1, -0x20(r1) mflr r0 stw r0, 0x24(r1) stw r31, 0x1c(r1) stw r30, 0x18(r1) stw r29, 0x14(r1) stw r28, 0x10(r1) mr r28, r3 lwz r0, 0x44(r3) cmplwi r0, 0 beq lbl_8001C6DC lbz r0, 0x3c(r28) cmplwi r0, 1 beq lbl_8001C6DC lwz r30, 0x4c(r28) li r29, 0 li r31, 0 b lbl_8001C6CC lbl_8001C6A0: lwz r3, 0x10(r30) lwz r0, 4(r30) cmplwi r3, 0 srwi r0, r0, 0x18 beq lbl_8001C6C8 rlwinm. r0, r0, 0, 0x1b, 0x1b bne lbl_8001C6C4 lwz r4, 0x38(r28) bl free__7JKRHeapFPvP7JKRHeap lbl_8001C6C4: stw r31, 0x10(r30) lbl_8001C6C8: addi r29, r29, 1 lbl_8001C6CC: lwz r3, 0x44(r28) lwz r0, 8(r3) cmplw r29, r0 blt lbl_8001C6A0 lbl_8001C6DC: lwz r0, 0x24(r1) lwz r31, 0x1c(r1) lwz r30, 0x18(r1) lwz r29, 0x14(r1) lwz r28, 0x10(r1) mtlr r0 addi r1, r1, 0x20 blr */ } /* * --INFO-- * Address: 8001C6FC * Size: 000074 */ void JKRCompArchive::removeResource(void*) { /* stwu r1, -0x20(r1) mflr r0 stw r0, 0x24(r1) stw r31, 0x1c(r1) stw r30, 0x18(r1) mr r30, r4 stw r29, 0x14(r1) mr r29, r3 bl findPtrResource__10JKRArchiveCFPCv or. r31, r3, r3 bne lbl_8001C730 li r3, 0 b lbl_8001C754 lbl_8001C730: lwz r0, 4(r31) rlwinm. r0, r0, 8, 0x1b, 0x1b bne lbl_8001C748 lwz r4, 0x38(r29) mr r3, r30 bl free__7JKRHeapFPvP7JKRHeap lbl_8001C748: li r0, 0 li r3, 1 stw r0, 0x10(r31) lbl_8001C754: lwz r0, 0x24(r1) lwz r31, 0x1c(r1) lwz r30, 0x18(r1) lwz r29, 0x14(r1) mtlr r0 addi r1, r1, 0x20 blr */ } /* * --INFO-- * Address: 8001C770 * Size: 0001C4 */ void JKRCompArchive::getExpandedResSize(const void*) const { /* stwu r1, -0x60(r1) mflr r0 stw r0, 0x64(r1) lwz r0, 0x50(r3) stw r31, 0x5c(r1) cmplwi r0, 0 stw r30, 0x58(r1) mr r30, r4 stw r29, 0x54(r1) mr r29, r3 bne lbl_8001C7B0 lwz r12, 0(r3) lwz r12, 0x30(r12) mtctr r12 bctrl b lbl_8001C918 lbl_8001C7B0: bl findPtrResource__10JKRArchiveCFPCv or. r31, r3, r3 bne lbl_8001C7C4 li r3, -1 b lbl_8001C918 lbl_8001C7C4: lwz r3, 4(r31) rlwinm. r0, r3, 8, 0x1d, 0x1d srwi r4, r3, 0x18 bne lbl_8001C7F0 mr r3, r29 mr r4, r30 lwz r12, 0(r29) lwz r12, 0x30(r12) mtctr r12 bctrl b lbl_8001C918 lbl_8001C7F0: rlwinm. r0, r4, 0, 0x1b, 0x1b beq lbl_8001C81C lbz r0, 5(r30) lbz r3, 4(r30) slwi r0, r0, 0x10 lbz r4, 6(r30) rlwimi r0, r3, 0x18, 0, 7 lbz r5, 7(r30) rlwimi r0, r4, 8, 0x10, 0x17 or r3, r5, r0 b lbl_8001C918 lbl_8001C81C: rlwinm. r0, r4, 0, 0x1a, 0x1a addi r3, r1, 0x2f rlwinm r30, r3, 0, 0, 0x1a beq lbl_8001C86C lwz r3, 0x68(r29) mr r4, r30 lwz r9, 8(r31) li r5, 0x20 lwz r0, 0x14(r3) li r6, 0 li r7, 0 li r8, 0 add r3, r9, r0 li r9, -1 li r10, 0 bl aramToMainRam__7JKRAramFUlPUcUl15JKRExpandSwitchUlP7JKRHeapiPUl mr r3, r30 li r4, 0x20 bl DCInvalidateRange b lbl_8001C8D8 lbl_8001C86C: rlwinm. r0, r4, 0, 0x19, 0x19 beq lbl_8001C8B8 li r0, 0 lwz r9, 0x6c(r29) stw r0, 8(r1) mr r4, r30 lwz r3, 0x40(r29) li r5, 2 lwz r0, 8(r31) li r6, 0x20 li r7, 0 li r8, 1 add r9, r9, r0 li r10, 0 bl loadToMainRAM__12JKRDvdRipperFlPUc15JKRExpandSwitchUlP7JKRHeapQ212JKRDvdRipper15EAllocDirectionUlPiPUl mr r3, r30 li r4, 0x20 bl DCInvalidateRange b lbl_8001C8D8 lbl_8001C8B8: lis r3, lbl_804735C8@ha lis r5, lbl_804735F0@ha addi r6, r5, lbl_804735F0@l li r4, 0x3af addi r3, r3, lbl_804735C8@l addi r5, r2, lbl_805164E8@sda21 crclr 6 bl panic_f__12JUTExceptionFPCciPCce lbl_8001C8D8: lbz r0, 5(r30) mr r3, r29 lwz r12, 0(r29) mr r4, r31 lbz r5, 4(r30) slwi r0, r0, 0x10 lbz r6, 6(r30) rlwimi r0, r5, 0x18, 0, 7 lbz r5, 7(r30) rlwimi r0, r6, 8, 0x10, 0x17 lwz r12, 0x48(r12) or r29, r5, r0 mr r5, r29 mtctr r12 bctrl mr r3, r29 lbl_8001C918: lwz r0, 0x64(r1) lwz r31, 0x5c(r1) lwz r30, 0x58(r1) lwz r29, 0x54(r1) mtlr r0 addi r1, r1, 0x60 blr */ }
interference-project/interference
src/main/java/su/interference/sql/JoinCondition.java
<gh_stars>10-100 /** The MIT License (MIT) Copyright (c) 2010-2019 head systems, ltd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package su.interference.sql; import su.interference.sqlexception.InvalidCondition; import su.interference.core.Types; /** * @author <NAME> * @since 1.0 */ public class JoinCondition extends Condition { private final SQLColumn conditionColumnRight; private int id; public JoinCondition(SQLColumn cc, int c, SQLColumn rc, NestedCondition nc) throws InvalidCondition { super(cc,c,nc); if (!Types.sqlCheck(cc.getColumn().getType().getName(), rc.getColumn().getType().getName())) { throw new InvalidCondition(); } this.conditionColumnRight = rc; } public SQLColumn getConditionColumnRight() { return conditionColumnRight; } public int getId() { return id; } public void setId(int id) { this.id = id; } }
layeredapps/dashboard
src/www/api/user/set-session-ended.js
<filename>src/www/api/user/set-session-ended.js const dashboard = require('../../../../index.js') module.exports = { patch: async (req) => { if (!req.query || !req.query.sessionid) { throw new Error('invalid-sessionid') } const session = await global.api.user.Session.get(req) if (!session) { throw new Error('invalid-sessionid') } if (session.ended) { throw new Error('invalid-session') } if (session.accountid !== req.account.accountid) { throw new Error('invalid-account') } await dashboard.Storage.Session.update({ endedAt: new Date() }, { where: { sessionid: req.query.sessionid, appid: req.appid || global.appid } }) await dashboard.StorageCache.remove(req.query.sessionid) return global.api.user.Session.get(req) } }
dmgerman/zephyrd3
drivers/serial/uart_mcux.c
<filename>drivers/serial/uart_mcux.c DECL|base|member|UART_Type *base; DECL|baud_rate|member|u32_t baud_rate; DECL|callback|member|uart_irq_callback_user_data_t callback; DECL|cb_data|member|void *cb_data; DECL|clock_name|member|char *clock_name; DECL|clock_subsys|member|clock_control_subsys_t clock_subsys; DECL|irq_config_func|member|void (*irq_config_func)(struct device *dev); DECL|uart_mcux_0_config|variable|uart_mcux_0_config DECL|uart_mcux_0_data|variable|uart_mcux_0_data DECL|uart_mcux_1_config|variable|uart_mcux_1_config DECL|uart_mcux_1_data|variable|uart_mcux_1_data DECL|uart_mcux_2_config|variable|uart_mcux_2_config DECL|uart_mcux_2_data|variable|uart_mcux_2_data DECL|uart_mcux_3_config|variable|uart_mcux_3_config DECL|uart_mcux_3_data|variable|uart_mcux_3_data DECL|uart_mcux_4_config|variable|uart_mcux_4_config DECL|uart_mcux_4_data|variable|uart_mcux_4_data DECL|uart_mcux_5_config|variable|uart_mcux_5_config DECL|uart_mcux_5_data|variable|uart_mcux_5_data DECL|uart_mcux_config_func_0|function|static void uart_mcux_config_func_0(struct device *dev) DECL|uart_mcux_config_func_1|function|static void uart_mcux_config_func_1(struct device *dev) DECL|uart_mcux_config_func_2|function|static void uart_mcux_config_func_2(struct device *dev) DECL|uart_mcux_config_func_3|function|static void uart_mcux_config_func_3(struct device *dev) DECL|uart_mcux_config_func_4|function|static void uart_mcux_config_func_4(struct device *dev) DECL|uart_mcux_config_func_5|function|static void uart_mcux_config_func_5(struct device *dev) DECL|uart_mcux_config|struct|struct uart_mcux_config { DECL|uart_mcux_data|struct|struct uart_mcux_data { DECL|uart_mcux_driver_api|variable|uart_mcux_driver_api DECL|uart_mcux_err_check|function|static int uart_mcux_err_check(struct device *dev) DECL|uart_mcux_fifo_fill|function|static int uart_mcux_fifo_fill(struct device *dev, const u8_t *tx_data, int len) DECL|uart_mcux_fifo_read|function|static int uart_mcux_fifo_read(struct device *dev, u8_t *rx_data, const int len) DECL|uart_mcux_init|function|static int uart_mcux_init(struct device *dev) DECL|uart_mcux_irq_callback_set|function|static void uart_mcux_irq_callback_set(struct device *dev, uart_irq_callback_user_data_t cb, void *cb_data) DECL|uart_mcux_irq_err_disable|function|static void uart_mcux_irq_err_disable(struct device *dev) DECL|uart_mcux_irq_err_enable|function|static void uart_mcux_irq_err_enable(struct device *dev) DECL|uart_mcux_irq_is_pending|function|static int uart_mcux_irq_is_pending(struct device *dev) DECL|uart_mcux_irq_rx_disable|function|static void uart_mcux_irq_rx_disable(struct device *dev) DECL|uart_mcux_irq_rx_enable|function|static void uart_mcux_irq_rx_enable(struct device *dev) DECL|uart_mcux_irq_rx_full|function|static int uart_mcux_irq_rx_full(struct device *dev) DECL|uart_mcux_irq_rx_ready|function|static int uart_mcux_irq_rx_ready(struct device *dev) DECL|uart_mcux_irq_tx_complete|function|static int uart_mcux_irq_tx_complete(struct device *dev) DECL|uart_mcux_irq_tx_disable|function|static void uart_mcux_irq_tx_disable(struct device *dev) DECL|uart_mcux_irq_tx_enable|function|static void uart_mcux_irq_tx_enable(struct device *dev) DECL|uart_mcux_irq_tx_ready|function|static int uart_mcux_irq_tx_ready(struct device *dev) DECL|uart_mcux_irq_update|function|static int uart_mcux_irq_update(struct device *dev) DECL|uart_mcux_isr|function|static void uart_mcux_isr(void *arg) DECL|uart_mcux_poll_in|function|static int uart_mcux_poll_in(struct device *dev, unsigned char *c) DECL|uart_mcux_poll_out|function|static unsigned char uart_mcux_poll_out(struct device *dev, unsigned char c)
microsoftgraph/msgraph-beta-sdk-go
models/managedtenants/management_action_status.go
package managedtenants import ( "errors" ) // Provides operations to manage the tenantRelationship singleton. type ManagementActionStatus int const ( TOADDRESS_MANAGEMENTACTIONSTATUS ManagementActionStatus = iota COMPLETED_MANAGEMENTACTIONSTATUS ERROR_MANAGEMENTACTIONSTATUS TIMEOUT_MANAGEMENTACTIONSTATUS INPROGRESS_MANAGEMENTACTIONSTATUS PLANNED_MANAGEMENTACTIONSTATUS RESOLVEDBY3RDPARTY_MANAGEMENTACTIONSTATUS RESOLVEDTHROUGHALTERNATEMITIGATION_MANAGEMENTACTIONSTATUS RISKACCEPTED_MANAGEMENTACTIONSTATUS UNKNOWNFUTUREVALUE_MANAGEMENTACTIONSTATUS ) func (i ManagementActionStatus) String() string { return []string{"toAddress", "completed", "error", "timeOut", "inProgress", "planned", "resolvedBy3rdParty", "resolvedThroughAlternateMitigation", "riskAccepted", "unknownFutureValue"}[i] } func ParseManagementActionStatus(v string) (interface{}, error) { result := TOADDRESS_MANAGEMENTACTIONSTATUS switch v { case "toAddress": result = TOADDRESS_MANAGEMENTACTIONSTATUS case "completed": result = COMPLETED_MANAGEMENTACTIONSTATUS case "error": result = ERROR_MANAGEMENTACTIONSTATUS case "timeOut": result = TIMEOUT_MANAGEMENTACTIONSTATUS case "inProgress": result = INPROGRESS_MANAGEMENTACTIONSTATUS case "planned": result = PLANNED_MANAGEMENTACTIONSTATUS case "resolvedBy3rdParty": result = RESOLVEDBY3RDPARTY_MANAGEMENTACTIONSTATUS case "resolvedThroughAlternateMitigation": result = RESOLVEDTHROUGHALTERNATEMITIGATION_MANAGEMENTACTIONSTATUS case "riskAccepted": result = RISKACCEPTED_MANAGEMENTACTIONSTATUS case "unknownFutureValue": result = UNKNOWNFUTUREVALUE_MANAGEMENTACTIONSTATUS default: return 0, errors.New("Unknown ManagementActionStatus value: " + v) } return &result, nil } func SerializeManagementActionStatus(values []ManagementActionStatus) []string { result := make([]string, len(values)) for i, v := range values { result[i] = v.String() } return result }
littlecurl/AppProjects
AndroidDatabaseDemo/app/src/main/java/cn/edu/heuet/demo/MainActivity.java
<reponame>littlecurl/AppProjects<filename>AndroidDatabaseDemo/app/src/main/java/cn/edu/heuet/demo/MainActivity.java<gh_stars>100-1000 package cn.edu.heuet.demo; import android.content.Intent; import android.os.Bundle; import android.view.View; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import cn.edu.heuet.demo.databinding.ActivityMainBinding; import cn.edu.heuet.demo.litepal.LitePalActivity; import cn.edu.heuet.demo.mysql.MySQLActivity; import cn.edu.heuet.demo.room.RoomActivity; import cn.edu.heuet.demo.sqlite.SQLiteActivity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.activity_main); ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main); binding.btSqlite.setOnClickListener(v -> startActivity(new Intent(MainActivity.this, SQLiteActivity.class))); binding.btRoom.setOnClickListener(v -> startActivity(new Intent(MainActivity.this, RoomActivity.class))); binding.btLitepal.setOnClickListener(v -> startActivity(new Intent(MainActivity.this, LitePalActivity.class))); binding.btMysql.setOnClickListener(v -> startActivity(new Intent(MainActivity.this, MySQLActivity.class))); } }
Hydrorastaman/PDFOut-SDK
kernel/include/font/CIDSystemInfoDictionary.h
#pragma once #include <object/ObjectDictionary.h> #include <font/CMapName.h> namespace kernel{ namespace font{ enum CIDSystemInfoDictionaryKey{ CIDSystemInfoDictionaryKeyRegistry, // Required CIDSystemInfoDictionaryKeyOrdering, // Required CIDSystemInfoDictionaryKeySupplement // Required }; class CIDSystemInfoDictionary : public ObjectDictionary{ public: explicit CIDSystemInfoDictionary(CMapName cmap = CMapName_Identity_H); ~CIDSystemInfoDictionary(void) {} void addKey(CIDSystemInfoDictionaryKey key, std::unique_ptr<Object> value); private: static std::unordered_map<CIDSystemInfoDictionaryKey, std::pair<std::string, uint32_t>> mCIDSystemInfoDictionaryMap; private: CIDSystemInfoDictionary(CIDSystemInfoDictionary const &) = delete; CIDSystemInfoDictionary &operator=(CIDSystemInfoDictionary const &) = delete; }; }}
cwaldron97/bitcoin-s
core-test/src/test/scala/org/bitcoins/core/serializers/p2p/messages/RawAddrMessageSerializerTest.scala
package org.bitcoins.core.serializers.p2p.messages import org.bitcoins.core.number.UInt64 import org.bitcoins.core.protocol.CompactSizeUInt import org.scalatest.{FlatSpec, MustMatchers} class RawAddrMessageSerializerTest extends FlatSpec with MustMatchers { //from this bitcoin developer guide example //https://bitcoin.org/en/developer-reference#addr val addressCount = "01" val time = "d91f4854" val services = "0100000000000000" val address = "00000000000000000000ffffc0000233" val port = "208d" val hex = addressCount + time + services + address + port "RawAddrMessageSerializer" must "read a AddrMessage from a hex string" in { val addrMessage = RawAddrMessageSerializer.read(hex) addrMessage.ipCount must be(CompactSizeUInt(UInt64.one, 1)) addrMessage.addresses.size must be(1) } it must "write a Addr message and get its original hex back" in { val addrMessage = RawAddrMessageSerializer.read(hex) RawAddrMessageSerializer.write(addrMessage).toHex must be(hex) } }
Srinivasan47/iOS-scroll
js/analytics.js
(function() { $('#mainWrapper').off('click.analytics').on('click.analytics', '[wg-analytics^="on"]', function(e) { var analyticsName = $.trim(this.getAttribute('wg-analytics').split('|')[1]), params = { 'userId' : $('.avatar-name').attr('studentId') }; console.log('@wg-analytics:'); console.log('eventType: '+e.type); console.log('eventName: '+analyticsName); console.log('params: '); console.log(params); }); }());
upb-uc4/University-Credits-4.0
product_code/admission_service/impl/src/main/scala/de/upb/cs/uc4/admission/impl/AdmissionServiceImpl.scala
<filename>product_code/admission_service/impl/src/main/scala/de/upb/cs/uc4/admission/impl/AdmissionServiceImpl.scala<gh_stars>1-10 package de.upb.cs.uc4.admission.impl import akka.cluster.sharding.typed.scaladsl.{ ClusterSharding, EntityRef } import akka.stream.Materializer import akka.util.Timeout import akka.{ Done, NotUsed } import com.lightbend.lagom.scaladsl.api.ServiceCall import com.lightbend.lagom.scaladsl.api.transport.{ MessageProtocol, RequestHeader, ResponseHeader } import com.lightbend.lagom.scaladsl.server.ServerServiceCall import com.typesafe.config.Config import de.upb.cs.uc4.admission.api.AdmissionService import de.upb.cs.uc4.admission.impl.actor.{ AdmissionBehaviour, AdmissionsWrapper } import de.upb.cs.uc4.admission.impl.commands.{ GetCourseAdmissions, GetExamAdmissions, GetProposalForAddAdmission, GetProposalForDropAdmission } import de.upb.cs.uc4.admission.model.{ AbstractAdmission, CourseAdmission, DropAdmission, ExamAdmission } import de.upb.cs.uc4.authentication.model.AuthenticationRole import de.upb.cs.uc4.certificate.api.CertificateService import de.upb.cs.uc4.course.api.CourseService import de.upb.cs.uc4.exam.api.ExamService import de.upb.cs.uc4.examreg.api.ExamregService import de.upb.cs.uc4.hyperledger.api.model.{ JsonHyperledgerVersion, UnsignedProposal } import de.upb.cs.uc4.hyperledger.impl.commands.HyperledgerBaseCommand import de.upb.cs.uc4.hyperledger.impl.{ HyperledgerUtils, ProposalWrapper } import de.upb.cs.uc4.matriculation.api.MatriculationService import de.upb.cs.uc4.operation.api.OperationService import de.upb.cs.uc4.operation.model.JsonOperationId import de.upb.cs.uc4.shared.client.exceptions._ import de.upb.cs.uc4.shared.server.ServiceCallFactory._ import org.slf4j.{ Logger, LoggerFactory } import play.api.Environment import scala.concurrent.duration._ import scala.concurrent.{ Await, ExecutionContext, Future, TimeoutException } /** Implementation of the MatriculationService */ class AdmissionServiceImpl( clusterSharding: ClusterSharding, matriculationService: MatriculationService, examregService: ExamregService, courseService: CourseService, certificateService: CertificateService, operationService: OperationService, examService: ExamService, override val environment: Environment )(implicit ec: ExecutionContext, override val config: Config, materializer: Materializer) extends AdmissionService { /** Looks up the entity for the given ID */ private def entityRef: EntityRef[HyperledgerBaseCommand] = clusterSharding.entityRefFor(AdmissionBehaviour.typeKey, AdmissionBehaviour.entityId) implicit val timeout: Timeout = Timeout(config.getInt("uc4.timeouts.hyperledger").milliseconds) lazy val validationTimeout: FiniteDuration = config.getInt("uc4.timeouts.validation").milliseconds private final val log: Logger = LoggerFactory.getLogger(classOf[AdmissionServiceImpl]) /** Returns course admissions */ override def getCourseAdmissions(username: Option[String], courseId: Option[String], moduleId: Option[String]): ServiceCall[NotUsed, Seq[CourseAdmission]] = identifiedAuthenticated(AuthenticationRole.All: _*) { (authUser, role) => ServerServiceCall { (header, _) => val future = role match { case AuthenticationRole.Admin => Future.successful(Done) case AuthenticationRole.Student if username.isDefined && username.get.trim == authUser => Future.successful(Done) case AuthenticationRole.Student => throw UC4Exception.OwnerMismatch case AuthenticationRole.Lecturer if courseId.isDefined => courseService.findCourseByCourseId(courseId.get).handleRequestHeader(addAuthenticationHeader(header)).invoke().map { course => if (course.lecturerId != authUser) { throw UC4Exception.OwnerMismatch } Done } case _ => throw UC4Exception.NotEnoughPrivileges } val enrollmentFuture = if (username.isDefined) { certificateService.getEnrollmentIds(username).handleRequestHeader(addAuthenticationHeader(header)).invoke() .map(pairSeq => pairSeq.find(pair => pair.username == username.get)).map { case Some(pair) => Some(pair.enrollmentId) case None => throw UC4Exception.NotFound } } else { Future.successful(None) } future.flatMap { _ => enrollmentFuture.flatMap { enrollmentId => entityRef.askWithStatus[AdmissionsWrapper](replyTo => GetCourseAdmissions(enrollmentId, courseId, moduleId, replyTo)).map { admissionsWrapper: AdmissionsWrapper => admissionsWrapper.admissions.map { _.asInstanceOf[CourseAdmission] } }.map { courseAdmissions => createETagHeader(header, courseAdmissions) }.recover(handleException("Get course admission")) } } } } /** Returns exam admissions */ override def getExamAdmissions(username: Option[String], admissionIds: Option[String], examIds: Option[String]): ServiceCall[NotUsed, Seq[ExamAdmission]] = identifiedAuthenticated(AuthenticationRole.All: _*) { (authUser, role) => ServerServiceCall { (header, _) => val authErrorFuture = role match { case AuthenticationRole.Lecturer => if (examIds.isEmpty) { throw UC4Exception.OwnerMismatch } else { certificateService.getEnrollmentIds(Some(authUser)).handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { usernameEnrollmentIdPairSeq => val authEnrollmentId = usernameEnrollmentIdPairSeq.head.enrollmentId examService.getExams(examIds, None, None, None, None, None, None).handleRequestHeader(addAuthenticationHeader(header)).invoke().map { exams => if (exams.forall(exam => exam.lecturerEnrollmentId == authEnrollmentId)) { Done } else { throw UC4Exception.OwnerMismatch } } } } case AuthenticationRole.Student if username.isEmpty || username.get.trim != authUser => throw UC4Exception.OwnerMismatch case _ => Future.successful(Done) } authErrorFuture.flatMap { _ => val optEnrollmentId = username match { case Some(username) => certificateService.getEnrollmentIds(Some(username)).handleRequestHeader(addAuthenticationHeader(header)).invoke() .map(pairSeq => pairSeq.find(pair => pair.username == username)).map { case Some(pair) => Some(pair.enrollmentId) case None => throw UC4Exception.NotFound } case None => Future.successful(None) } optEnrollmentId.flatMap { id => entityRef.askWithStatus[AdmissionsWrapper](replyTo => GetExamAdmissions(id, admissionIds.map(_.trim.split(",")), examIds.map(_.trim.split(",")), replyTo)).map { admissions => (ResponseHeader(200, MessageProtocol.empty, List()), admissions.admissions.map(_.asInstanceOf[ExamAdmission])) }.recover(handleException("getExamAdmission proposal failed")) } } } } /** Gets a proposal for adding a course admission */ override def getProposalAddAdmission: ServiceCall[AbstractAdmission, UnsignedProposal] = identifiedAuthenticated(AuthenticationRole.Student) { (authUser, _) => { ServerServiceCall { (header, admissionRaw) => val admissionTrimmed = admissionRaw.trim val validationList = try { Await.result(admissionTrimmed.validateOnCreation, validationTimeout) } catch { case _: TimeoutException => throw UC4Exception.ValidationTimeout case e: Exception => throw UC4Exception.InternalServerError("Validation Error", e.getMessage) } certificateService.getEnrollmentIds(Some(authUser)).handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { usernameEnrollmentIdPairSeq => val admission = admissionTrimmed.copyAdmission(enrollmentId = usernameEnrollmentIdPairSeq.head.enrollmentId) admission match { case courseAdmission: CourseAdmission => getProposalAddCourseAdmission(authUser, header, validationList, courseAdmission) case examAdmission: ExamAdmission => getProposalAddExamAdmission(authUser, header, validationList, examAdmission) } } } } } private def getProposalAddCourseAdmission(authUser: String, header: RequestHeader, validationOnCreateList: Seq[SimpleError], courseAdmission: CourseAdmission): Future[(ResponseHeader, UnsignedProposal)] = { var validationList = validationOnCreateList certificateService.getEnrollmentIds(Some(authUser)).handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { usernameEnrollmentIdPairSeq => val authEnrollmentId = usernameEnrollmentIdPairSeq.head.enrollmentId val courseAdmissionFinalized = courseAdmission.copy(enrollmentId = authEnrollmentId) courseService.findCourseByCourseId(courseAdmissionFinalized.courseId).handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { course => if (!course.moduleIds.contains(courseAdmissionFinalized.moduleId)) { validationList :+= SimpleError("moduleId", "CourseId can not be attributed to module with the given moduleId.") validationList :+= SimpleError("courseId", "The module with the given moduleId can not be attributed to the course with the given courseId.") } matriculationService.getMatriculationData(authUser).handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { data => examregService.getExaminationRegulations(Some(data.matriculationStatus.map(_.fieldOfStudy).mkString(",")), Some(true)) .handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { regulations => if (!regulations.flatMap(_.modules).map(_.id).contains(courseAdmissionFinalized.moduleId) && !validationList.map(_.name).contains("moduleId")) { validationList :+= SimpleError("moduleId", "The given moduleId can not be attributed to an active exam regulation.") } if (validationList.nonEmpty) { throw new UC4NonCriticalException(422, DetailedError(ErrorType.Validation, validationList)) } else { certificateService.getCertificate(authUser).handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { certificate => entityRef.askWithStatus[ProposalWrapper](replyTo => GetProposalForAddAdmission(certificate.certificate, courseAdmissionFinalized, replyTo)).map { proposalWrapper => operationService.addToWatchList(authUser).handleRequestHeader(addAuthenticationHeader(header)).invoke(JsonOperationId(proposalWrapper.operationId)) .recover { case ex: UC4Exception if ex.possibleErrorResponse.`type` == ErrorType.OwnerMismatch => case throwable: Throwable => log.error("Exception in addToWatchlist addCourseAdmission", throwable) } (ResponseHeader(200, MessageProtocol.empty, List()), createTimedUnsignedProposal(proposalWrapper.proposal)) }.recover(handleException("Creation of add courseAdmission proposal failed")) } } } } } } } private def getProposalAddExamAdmission(authUser: String, header: RequestHeader, validationList: Seq[SimpleError], examAdmission: ExamAdmission): Future[(ResponseHeader, UnsignedProposal)] = { if (validationList.nonEmpty) { throw new UC4NonCriticalException(422, DetailedError(ErrorType.Validation, validationList)) } else { certificateService.getCertificate(authUser).handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { certificate => entityRef.askWithStatus[ProposalWrapper](replyTo => GetProposalForAddAdmission(certificate.certificate, examAdmission, replyTo)).map { proposalWrapper => operationService.addToWatchList(authUser).handleRequestHeader(addAuthenticationHeader(header)).invoke(JsonOperationId(proposalWrapper.operationId)) .recover { case ex: UC4Exception if ex.possibleErrorResponse.`type` == ErrorType.OwnerMismatch => case throwable: Throwable => log.error("Exception in addToWatchlist addExamAdmission", throwable) } (ResponseHeader(200, MessageProtocol.empty, List()), createTimedUnsignedProposal(proposalWrapper.proposal)) }.recover(handleException("Creation of add examAdmission proposal failed")) } } } /** Gets a proposal for dropping a admission */ override def getProposalDropAdmission: ServiceCall[DropAdmission, UnsignedProposal] = identifiedAuthenticated(AuthenticationRole.Student) { (authUser, _) => ServerServiceCall { (header, dropAdmissionRaw) => { val dropAdmission = dropAdmissionRaw.trim val validationList = try { Await.result(dropAdmission.validateOnCreation, validationTimeout) } catch { case _: TimeoutException => throw UC4Exception.ValidationTimeout case e: Exception => throw UC4Exception.InternalServerError("Validation Error", e.getMessage) } if (validationList.nonEmpty) { throw new UC4NonCriticalException(422, DetailedError(ErrorType.Validation, validationList)) } certificateService.getCertificate(authUser).handleRequestHeader(addAuthenticationHeader(header)).invoke().flatMap { certificate => entityRef.askWithStatus[ProposalWrapper](replyTo => GetProposalForDropAdmission(certificate.certificate, dropAdmission, replyTo)).map { proposalWrapper => operationService.addToWatchList(authUser).handleRequestHeader(addAuthenticationHeader(header)).invoke(JsonOperationId(proposalWrapper.operationId)) .recover { case ex: UC4Exception if ex.possibleErrorResponse.`type` == ErrorType.OwnerMismatch => case throwable: Throwable => log.error("Exception in addToWatchlist dropAdmission", throwable) } (ResponseHeader(200, MessageProtocol.empty, List()), createTimedUnsignedProposal(proposalWrapper.proposal)) }.recover(handleException("Creation of drop Admission proposal failed")) } } } } /** Allows GET */ override def allowedGet: ServiceCall[NotUsed, Done] = allowedMethodsCustom("GET") /** Allows POST */ override def allowedPost: ServiceCall[NotUsed, Done] = allowedMethodsCustom("POST") /** This Methods needs to allow a GET-Method */ override def allowVersionNumber: ServiceCall[NotUsed, Done] = allowedMethodsCustom("GET") /** Get the version of the Hyperledger API and the version of the chaincode the service uses */ override def getHlfVersions: ServiceCall[NotUsed, JsonHyperledgerVersion] = ServiceCall { _ => HyperledgerUtils.VersionUtil.createHyperledgerVersionResponse(entityRef) } }
Alok255/hackerrank
practice/algorithms/implementation/cavity_map/CavityMap.scala
<filename>practice/algorithms/implementation/cavity_map/CavityMap.scala<gh_stars>100-1000 import scala.io.Source object CavityMap extends App { val lines = Source.stdin.getLines().toList val n = lines.head.toInt val map = lines.tail.mkString val innerIndexes = map.indices.filter( i => i > n && i < n * (n - 1) - 1 && Set(Range(1, n - 1, 1) :_*).contains(i % n)) val cavitiesIndexes = innerIndexes.filter(isCavity(map, _, n)).toSet println(map.indices.map(toCavity(map, cavitiesIndexes, _)) .mkString.grouped(n).mkString("\n")) def neighbours(index: Int, n: Int): List[Int] = { List(index - 1, index + 1, index - n, index + n) } def isCavity(map: String, index: Int, n: Int): Boolean = { val depth = Character.digit(map.charAt(index), 10) neighbours(index, n).forall(i => Character.digit(map.charAt(i), 10) < depth) } def toCavity(map: String, cavities: Set[Int], index: Int) = { if(cavities.contains(index)) 'X' else map.charAt(index) } }
strategicallynicole/oaky
src/pages/about.js
<reponame>strategicallynicole/oaky /** * @description : * @author : * @group : * @created : 02/07/2021 - 18:56:32 * * MODIFICATION LOG * - Version : 1.0.0 * - Date : 02/07/2021 * - Author : * - Modification : **/ import React from 'react' import PropTypes from 'prop-types' import { graphql } from 'gatsby' import { Helmet } from 'react-helmet' import Layout from '../components/layout' import { MetaData } from '../components/common/meta' import Meeting from '../components/Meeting' import Alarmed from '../components/Illustrations/Schedule' import Quiz from '../components/Quiz' import Definition from '../components/Definition' import BusinessMan from '../components/Illustrations/Businessman' import Title from '../components/Titles/h1.js' import Model from "../components/Strategy/model" import FAQ from "../components/FAQ" /** * Single page (/:slug) * * This file renders a single page and loads all the content. * */ `use strict` const About = ({ location }) => ( <> <Layout> <MetaData location={location} type="page" /> <section className="w-full lg:px-30 lg:mx-28"> <div className="ml-10"> <Title className="pt-10 lg:px-10 wow slideInLeft" bgtext="Do You Like Us? Yes/No (circle one)" titletext="About Us" /></div> <div className="flex flex-wrap overflow-hidden"> <div className="w-full gap-1 mt-10 overflow-hidden sm:w-full md:w-1/3 lg:w-1/3 xl:w-1/3 " > <Definition /> </div> <div className="z-10 w-full overflow-hidden lg:gap-1 lg:ml-20 lg:mr-20 sm:w-full md:w-1/2 lg:w-1/2 xl:w-1/2 " > <BusinessMan /> </div> </div> {/* The main page content */} </section> <section id="Model" className="w-full px-0 py-10 xl:px-10 lg:px-10 md:px-10"><Model /></section> <section id="FAQ" className="w-full px-10 lg:px-28 wow slideInRight" data-wow-delay="1s"> <FAQ /></section> <section className="w-full px-10 lg:px-28 wow slideInRight" data-wow-delay="1s"> <Quiz /></section> <section className="w-full lg:px-28 wow slideInRight" data-wow-delay="1s"> </section> </Layout> </> ) export default About
Snowapril/VFS
VFS/RenderPass/ReflectiveShadowMapPass.h
<gh_stars>1-10 // Author : <NAME> (snowapril) #if !defined(VFS_REFLECTIVE_SHADOW_MAP_PASS_H) #define VFS_REFLECTIVE_SHADOW_MAP_PASS_H #include <RenderPass/RenderPassBase.h> #include <DirectionalLight.h> namespace vfs { class GLTFScene; class ReflectiveShadowMapPass : public RenderPassBase { public: explicit ReflectiveShadowMapPass() = default; explicit ReflectiveShadowMapPass(CommandPoolPtr cmdPool, VkExtent2D resolution); ~ReflectiveShadowMapPass(); public: ReflectiveShadowMapPass& createAttachments (void); ReflectiveShadowMapPass& createRenderPass (void); ReflectiveShadowMapPass& setDirectionalLight (std::unique_ptr<DirectionalLight>&& dirLight); ReflectiveShadowMapPass& createPipeline (const DescriptorSetLayoutPtr& globalDescLayout); void drawGUI(void) override; inline const FramebufferAttachment& getDepthAttachment(void) const { assert(_attachments.empty() == false); return _attachments.front(); } private: void onBeginRenderPass (const FrameLayout* frameLayout) override; void onEndRenderPass (const FrameLayout* frameLayout) override; void onUpdate (const FrameLayout* frameLayout) override; private: std::unique_ptr<DirectionalLight> _directionalLight; FramebufferPtr _framebuffer; VkExtent2D _shadowMapResolution { 0, 0 }; SamplerPtr _rsmSampler { nullptr }; BufferPtr _viewProjBuffer { nullptr }; DescriptorSetPtr _descriptorSet { nullptr }; DescriptorPoolPtr _descriptorPool { nullptr }; DescriptorSetLayoutPtr _descriptorLayout { nullptr }; }; }; #endif
databeast/whatnot
mutex/deadlock.go
package mutex import ( "bufio" "bytes" "fmt" "github.com/petermattis/goid" "io/ioutil" "runtime" "sync" "time" ) const deadlockdumpheader = "POTENTIAL DEADLOCK:" // THIS IS THE THING THAT DOES DEADLOCK ANALYSIS func deadlockcheck(lockFn func(), ptr interface{}) { if Opts.Disable { lockFn() return } preLock(4, ptr) if Opts.DeadlockTimeout <= 0 { lockFn() } else { // Begin goroutine to monitor potential Deadlock state ch := make(chan struct{}) go func() { for { t := time.NewTimer(Opts.DeadlockTimeout) defer t.Stop() // This runs after the closure finishes, but it's OK. select { case <-t.C: lo.mu.Lock() prev, ok := lo.cur[ptr] if !ok { lo.mu.Unlock() break // Nobody seems to be holding the deadlockcheck, try again. } Opts.mu.Lock() fmt.Fprintln(Opts.LogBuf, deadlockdumpheader) fmt.Fprintln(Opts.LogBuf, "Previous place where the lock was grabbed") fmt.Fprintf(Opts.LogBuf, "goroutine %v lock %p\n", prev.gid, ptr) dumpDeadlock(Opts.LogBuf, prev.stack) fmt.Fprintln(Opts.LogBuf, "Have been trying to lock it again for more than", Opts.DeadlockTimeout) fmt.Fprintf(Opts.LogBuf, "goroutine %v lock %p\n", goid.Get(), ptr) dumpDeadlock(Opts.LogBuf, callers(2)) stacks := stacks() grs := bytes.Split(stacks, []byte("\n\n")) for _, g := range grs { if goid.ExtractGID(g) == prev.gid { fmt.Fprintln(Opts.LogBuf, "Here is what goroutine", prev.gid, "doing now") Opts.LogBuf.Write(g) fmt.Fprintln(Opts.LogBuf) } } lo.other(ptr) if Opts.PrintAllCurrentGoroutines { fmt.Fprintln(Opts.LogBuf, "All current goroutines:") Opts.LogBuf.Write(stacks) } fmt.Fprintln(Opts.LogBuf) if buf, ok := Opts.LogBuf.(*bufio.Writer); ok { buf.Flush() } Opts.mu.Unlock() lo.mu.Unlock() Opts.OnPotentialDeadlock() <-ch return case <-ch: return } } }() lockFn() postLock(4, ptr) close(ch) return } postLock(4, ptr) } type stackGID struct { stack []uintptr gid int64 } type beforeAfter struct { before interface{} after interface{} } type ss struct { before []uintptr after []uintptr } func (l *lockOrder) preLock(skip int, p interface{}) { if Opts.DisableDeadlockDetection { return } stack := callers(skip) gid := goid.Get() l.mu.Lock() for b, bs := range l.cur { if b == p { if bs.gid == gid { Opts.mu.Lock() fmt.Fprintln(Opts.LogBuf, deadlockdumpheader, "Recursive locking:") fmt.Fprintf(Opts.LogBuf, "current goroutine %d deadlockcheck %p\n", gid, b) dumpDeadlock(Opts.LogBuf, stack) fmt.Fprintln(Opts.LogBuf, "Previous place where the deadlockcheck was grabbed (same goroutine)") dumpDeadlock(Opts.LogBuf, bs.stack) l.other(p) if buf, ok := Opts.LogBuf.(*bufio.Writer); ok { buf.Flush() } Opts.mu.Unlock() Opts.OnPotentialDeadlock() } continue } if bs.gid != gid { // We want locks taken in the same goroutine only. continue } if s, ok := l.order[beforeAfter{p, b}]; ok { Opts.mu.Lock() fmt.Fprintln(Opts.LogBuf, deadlockdumpheader, "Inconsistent locking. saw this ordering in one goroutine:") fmt.Fprintln(Opts.LogBuf, "happened before") dumpDeadlock(Opts.LogBuf, s.before) fmt.Fprintln(Opts.LogBuf, "happened after") dumpDeadlock(Opts.LogBuf, s.after) fmt.Fprintln(Opts.LogBuf, "in another goroutine: happened before") dumpDeadlock(Opts.LogBuf, bs.stack) fmt.Fprintln(Opts.LogBuf, "happened after") dumpDeadlock(Opts.LogBuf, stack) l.other(p) fmt.Fprintln(Opts.LogBuf) if buf, ok := Opts.LogBuf.(*bufio.Writer); ok { buf.Flush() } Opts.mu.Unlock() Opts.OnPotentialDeadlock() } l.order[beforeAfter{b, p}] = ss{bs.stack, stack} if len(l.order) == Opts.MaxMapSize { // Reset the map to keep memory footprint bounded. l.order = map[beforeAfter]ss{} } } l.mu.Unlock() } func callers(skip int) []uintptr { s := make([]uintptr, 50) // Most relevant context seem to appear near the top of the stack. return s[:runtime.Callers(2+skip, s)] } var fileSources struct { sync.Mutex lines map[string][][]byte } // Reads souce file lines from disk if not cached already. func getSourceLines(file string) [][]byte { fileSources.Lock() defer fileSources.Unlock() if fileSources.lines == nil { fileSources.lines = map[string][][]byte{} } if lines, ok := fileSources.lines[file]; ok { return lines } text, _ := ioutil.ReadFile(file) fileSources.lines[file] = bytes.Split(text, []byte{'\n'}) return fileSources.lines[file] } func code(file string, line int) string { lines := getSourceLines(file) // lines are 1 based. if line >= len(lines) || line <= 0 { return "???" } return "{ " + string(bytes.TrimSpace(lines[line-1])) + " }" } // Stacktraces for all goroutines. func stacks() []byte { buf := make([]byte, 1024*16) for { n := runtime.Stack(buf, true) if n < len(buf) { return buf[:n] } buf = make([]byte, 2*len(buf)) } }
MistressAlison/OrangeJuiceTheSpire
OrangeJuiceTheSpire/src/main/java/Moonworks/cards/IndiscriminateFireSupport.java
<gh_stars>1-10 package Moonworks.cards; import Moonworks.OrangeJuiceMod; import Moonworks.actions.IndiscriminateFireSupportAction; import Moonworks.cardModifiers.NormaDynvarModifier; import Moonworks.cards.abstractCards.AbstractNormaAttentiveCard; import Moonworks.characters.TheStarBreaker; import basemod.helpers.CardModifierManager; import com.megacrit.cardcrawl.actions.AbstractGameAction; import com.megacrit.cardcrawl.cards.status.Dazed; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.monsters.AbstractMonster; import static Moonworks.OrangeJuiceMod.makeCardPath; public class IndiscriminateFireSupport extends AbstractNormaAttentiveCard { /* * Wiki-page: https://github.com/daviscook477/BaseMod/wiki/Custom-Cards * * In-Progress Form At the start of your turn, play a TOUCH. */ // TEXT DECLARATION public static final String ID = OrangeJuiceMod.makeID(IndiscriminateFireSupport.class.getSimpleName()); public static final String IMG = makeCardPath("IndiscriminateFireSupport.png"); //private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID); //public static final String UPGRADE_DESCRIPTION = cardStrings.UPGRADE_DESCRIPTION; // /TEXT DECLARATION/ // STAT DECLARATION private static final CardRarity RARITY = CardRarity.COMMON; private static final CardTarget TARGET = CardTarget.ALL_ENEMY; private static final CardType TYPE = CardType.ATTACK; public static final CardColor COLOR = TheStarBreaker.Enums.COLOR_WHITE_ICE; private static final int COST = -1; private static final int DAMAGE = 7; private static final int UPGRADE_PLUS_DAMAGE = 3; private static final int DAZED = 2; private static final int UPGRADE_PLUS_DAZED = 1; private static final Integer[] NORMA_LEVELS = {2}; // /STAT DECLARATION/ public IndiscriminateFireSupport() { super(ID, IMG, COST, TYPE, COLOR, RARITY, TARGET, NORMA_LEVELS); this.damage = this.baseDamage = DAMAGE; this.invertedNumber = this.baseInvertedNumber = DAZED; this.isMultiDamage = true; this.cardsToPreview = new Dazed(); //this.tags.add(BaseModCardTags.FORM); //Tag your strike, defend and form cards so that they work correctly. CardModifierManager.addModifier(this, new NormaDynvarModifier(NormaDynvarModifier.DYNVARMODS.INVERTEDMOD, -1, NORMA_LEVELS[0], EXTENDED_DESCRIPTION[0])); } @Override public float getTitleFontSize() { return 21F; } // Actions the card should do. @Override public void use(AbstractPlayer p, AbstractMonster m) { this.addToBot(new IndiscriminateFireSupportAction(p, multiDamage, damageTypeForTurn, invertedNumber, AbstractGameAction.AttackEffect.FIRE, freeToPlayOnce, energyOnUse)); } //Upgraded stats. @Override public void upgrade() { if (!upgraded) { upgradeName(); upgradeDamage(UPGRADE_PLUS_DAMAGE); initializeDescription(); } } }
wu87988622/ohara
ohara-common/src/main/java/oharastream/ohara/common/annotations/Optional.java
<gh_stars>1-10 /* * Copyright 2019 is-land * * 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 oharastream.ohara.common.annotations; /** * There are many builder in ohara. Normally some methods, which used to assign value to member, are * not required. For example, the value can be generated automatically. This annotation is used to * "hint" developer that the methods which can be "ignored" in production purpose. */ public @interface Optional { String value() default "This method or member is not required to call or use"; }
m-ahmadi/exref
fb/moment.js/basic.js
<filename>fb/moment.js/basic.js moment().format(); // "2014-09-08T08:02:17-05:00" (ISO 8601, no fractional seconds) moment().format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm" moment().format("ddd, hA"); // "Sun, 3PM" moment('gibberish').format('YYYY MM DD'); // "Invalid date"
thednp/shorter-js
src/strings/scrollHeight.js
<reponame>thednp/shorter-js /** * A global namespace for `scrollHeight` property. * @type {string} */ const scrollHeight = 'scrollHeight'; export default scrollHeight;
JaredRiceSr/GoAsteroid
parser/file_test.go
package parser import ( "fmt" "testing" "github.com/benchlab/bvmUtils" ) func TestEmptyContract(t *testing.T) { p, errs := ParseFile("../samples/tests/empty.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestConstructorContract(t *testing.T) { p, errs := ParseFile("../samples/tests/constructors.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestFuncsContract(t *testing.T) { p, errs := ParseFile("../samples/tests/funcs.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestClassesContract(t *testing.T) { p, errs := ParseFile("../samples/tests/classes.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestInterfacesContract(t *testing.T) { p, errs := ParseFile("../samples/tests/interfaces.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, fmt.Sprintln(errs)) } func TestEventsContract(t *testing.T) { p, errs := ParseFile("../samples/tests/events.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestEnumsContract(t *testing.T) { p, errs := ParseFile("../samples/tests/enums.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestTypesContract(t *testing.T) { p, errs := ParseFile("../samples/tests/types.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestNestedModifiersContract(t *testing.T) { p, errs := ParseFile("../samples/tests/nested_modifiers.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestCommentsContract(t *testing.T) { p, errs := ParseFile("../samples/tests/comments.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestGroupsContract(t *testing.T) { p, errs := ParseFile("../samples/tests/groups.grd") bvmUtils.Assert(t, p != nil, "parser should not be nil") bvmUtils.Assert(t, errs == nil, errs.Format()) } func TestSampleClass(t *testing.T) { _, errs := ParseFile("../samples/class.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleContract(t *testing.T) { _, errs := ParseFile("../samples/contracts.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleLoops(t *testing.T) { _, errs := ParseFile("../samples/loops.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleSwitching(t *testing.T) { _, errs := ParseFile("../samples/switching.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleTypes(t *testing.T) { _, errs := ParseFile("../samples/types.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleIterator(t *testing.T) { _, errs := ParseFile("../samples/iterator.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleKV(t *testing.T) { _, errs := ParseFile("../samples/kv.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleAccessRestriction(t *testing.T) { _, errs := ParseFile("../samples/common_patterns/access_restriction.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleRichest(t *testing.T) { _, errs := ParseFile("../samples/common_patterns/richest.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) } func TestSampleStateMachine(t *testing.T) { _, errs := ParseFile("../samples/common_patterns/state_machine.grd") bvmUtils.AssertNow(t, len(errs) == 0, errs.Format()) }
Song-Li/TAJS
test/src/dk/brics/tajs/test/nativeobjects/JSObject_defineProperty_test.java
<reponame>Song-Li/TAJS<filename>test/src/dk/brics/tajs/test/nativeobjects/JSObject_defineProperty_test.java package dk.brics.tajs.test.nativeobjects; import dk.brics.tajs.Main; import dk.brics.tajs.options.Options; import dk.brics.tajs.test.Misc; import dk.brics.tajs.util.AnalysisResultException; import org.junit.Before; import org.junit.Test; public class JSObject_defineProperty_test { @Before public void before() { Main.reset(); Options.get().enableTest(); } @Test public void callable() { Misc.runSource( "var o = {};", "Object.defineProperty(o, 'p', {});"); } @Test public void data() { Misc.runSource( "var o = {};", "Object.defineProperty(o, 'p', {value: 42});"); } @Test public void accessor() { Misc.runSource( "var o = {};", "Object.defineProperty(o, 'p', {get: function(){ return 42; }});"); } @Test public void dataAndAccessor() { Misc.runSource( // Should throw definite TypeError: // "TypeError:Invalid property.A property cannot both have accessors and be writable or have a value" "var o = {};", "try{", " Object.defineProperty(o, 'p', {value: 42, get: function(){return 42;}});", " TAJS_assert(false);", "}catch(e){}"); } @Test public void value() { Misc.runSource( "var o1 = {};", "Object.defineProperty(o1, 'p', {value: 42});", "TAJS_assert(o1.p === 42);", // default undefined "var o2 = {};", "Object.defineProperty(o2, 'p', {});", "TAJS_assert(o2.hasOwnProperty('p'));", "TAJS_assert(o2.p === undefined);"); } @Test public void enumerable() { Misc.runSource( "var o1 = {};", "Object.defineProperty(o1, 'p', {enumerable: true});", "TAJS_assert(Object.keys(o1).length === 1);", "var o2 = {};", "Object.defineProperty(o2, 'p', {enumerable: false});", "TAJS_assert(Object.keys(o2).length === 0);", // default false "var o3 = {};", "Object.defineProperty(o3, 'p', {enumerable: false});", "TAJS_assert(Object.keys(o3).length === 0);"); } @Test public void writable() { Misc.runSource( "var o1 = {};", "Object.defineProperty(o1, 'p', {writable: true});", "o1.p = 42;", "TAJS_assert(o1.p === 42);", "var o2 = {};", "Object.defineProperty(o2, 'p', {writable: false});", "o2.p = 42;", "TAJS_assert(o2.p === undefined);", // default false "var o3 = {};", "Object.defineProperty(o3, 'p', {writable: false});", "o3.p = 42;", "TAJS_assert(o3.p === undefined);"); } @Test public void configurable1() { Misc.runSource("var o1 = {};", "Object.defineProperty(o1, 'p', {configurable: true, writable: true});", "o1.p = 42;", "TAJS_assert(o1.p === 42);", "delete o1.p", "TAJS_assert(o1.hasOwnProperty('p') === false);"); } @Test public void configurable2() { Misc.runSource("var o2 = {};", "Object.defineProperty(o2, 'p', {configurable: false, writable: true});", "o2.p = 42;", "TAJS_assert(o2.p === 42);", "delete o2.p", "TAJS_assert(o2.p === 42);"); } @Test public void configurable3() { Misc.runSource(// default false "var o3 = {};", "Object.defineProperty(o3, 'p', {configurable: false, writable: true});", "o3.p = 42;", "TAJS_assert(o3.p === 42);", "delete o3.p", "TAJS_assert(o3.p === 42);"); } @Test(expected = AnalysisResultException.class) // TODO: GitHub #291 public void configurable4() { Misc.runSource( "var o4 = {};", "Object.defineProperty(o4, 'p', {configurable: false});", "var threwException = false;", "try{", " Object.defineProperty(o4, 'p', {value: 42});", // different " TAJS_assert(false);", "}catch(e){", " threwException = true;", "}", "TAJS_assert(threwException);"); } @Test public void nonConfigurable1() { Misc.runSource( "var o = {};", "Object.defineProperty(o, 'p', {configurable: false});", // OK to redefine with same attributes "Object.defineProperty(o, 'p', {configurable: false});", "Object.defineProperty(o, 'p', {writable: false});", // NOT OK to redefine with other attributes "Object.defineProperty(o, 'p', {writable: true});" // (fails soundness testing) // TODO: GitHub #291 ); } @Test public void nonConfigurable2() { Misc.runSource( "var o = {};", "Object.defineProperty(o, 'p', {configurable: false});", // OK to delete "delete o.p;" ); } @Test public void configurable5() { Misc.runSource("var o5 = {};", "Object.defineProperty(o5, 'p', {configurable: false});", "try{", " Object.defineProperty(o5, 'p', {configurable: false});", // same "}catch(e){", " TAJS_assert(false);", "}"); } @Test public void getter() { Misc.runSource( "var o = {};", "Object.defineProperty(o, 'p', {get: function(){return 42;}});", "TAJS_assert(o.p === 42);"); } @Test public void setter() { Misc.runSource( "var o = {};", "var x;", "Object.defineProperty(o, 'p', {set: function(v){x = v;}});", "o.p = 42;", "TAJS_assert(x === 42);"); } @Test public void getter_setter() { Misc.runSource( "var o = {};", "var x;", "Object.defineProperty(o, 'p', {get: function(){return 42;}, set: function(v){x = v;}});", "o.p = 87;", "TAJS_assertEquals(87, x);", "TAJS_assertEquals(42, o.p);"); } @Test public void setter_getter() { Misc.runSource( "var o = {};", "var x;", "Object.defineProperty(o, 'p', {set: function(v){x = v;}, get: function(){return 42;}});", "o.p = 87;", "TAJS_assertEquals(87, x);", "TAJS_assertEquals(42, o.p);"); } }
yamanakahirofumi/RogueInJava
src/main/java/org/hiro/Main2.java
package org.hiro; import org.hiro.character.Player; import org.hiro.output.Display; public class Main2 { /* * my_exit: * Leave the process properly */ static void my_exit(int st) { Mach_dep.resetltchars(); System.exit(st); } /* * leave: * Leave quickly, but curteously */ static void leave(int sig) { // static char[] buf= new[ BUFSIZ]; // NOOP(sig); // setbuf(stdout, buf); /* throw away pending output */ if (!Display.isendwin()) { Display.mvcur(0, Display.COLS - 1, Display.LINES - 1, 0); Display.endwin(); } // putchar('\n'); my_exit(0); } /* * quit: * Have player make certain, then exit. */ public static void quit(Player player, int sig) { // NOOP(sig); /* * Reset the signal in case we got here via an interrupt */ if (!Global.q_comm) { Global.mpos = 0; } int oy; int ox; // getyx(curscr, oy, ox); IOUtil.msg("really quit?"); if (IOUtil.readchar() == 'y') { // signal(SIGINT, leave); Display.clear(); Display.mvprintw(Display.LINES - 2, 0, "You quit with %d gold pieces", String.valueOf(Global.purse)); Display.move(Display.LINES - 1, 0); Display.refresh(); Rip.writelog(Global.purse, 1, 0); Rip.score(Global.purse, 1, 0); // printf("[Press return to exit]\n"); // fflush(null); // getchar(); my_exit(0); } else { Display.move(0, 0); Display.clrtoeol(); IOUtil.status(player); // Display.move(oy, ox); Display.refresh(); Global.mpos = 0; Global.count = 0; Global.to_death = false; } } }
cknow/validatorjs
packages/test/src/types/undefined-types.js
<reponame>cknow/validatorjs export const undefinedTypes = [ undefined ];
mtaimoorkhan/jml4sec
BM/OpenJMLUI/runtime/org/jmlspecs/unfinished/JMLEqualsSetEnumerator.java
<gh_stars>0 // @(#)$Id: JMLSetEnumerator.java-generic,v 1.32 2005/12/24 21:20:31 chalin Exp $ // Copyright (C) 2005 Iowa State University // // This file is part of the runtime library of the Java Modeling Language. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either version 2.1, // of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with JML; see the file LesserGPL.txt. If not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA // 02110-1301 USA. package org.jmlspecs.unfinished; import java.util.Enumeration; /** An enumerator for sets of objects. * * @version $Revision: 1.32 $ * @author <NAME>, with help from <NAME>, <NAME>, * and others. * @see JMLEnumeration * @see JMLObjectType * @see JMLEqualsSet * @see JMLEnumerationToIterator */ // FIXME: adapt this file to non-null-by-default and remove the following modifier. /*@ nullable_by_default @*/ public class JMLEqualsSetEnumerator<E> implements JMLEnumeration, JMLObjectType { /** The elements that have not yet been returned by nextElement. */ //@ public model JMLEqualsSet uniteratedElems; in objectState; //@ public invariant uniteratedElems != null; /** The list representing the elements that have not yet been * returned by this enumerator. */ protected JMLListEqualsNode<E> currentNode; //@ in uniteratedElems; //@ protected represents uniteratedElems <- new JMLEqualsSet(currentNode); //@ protected invariant moreElements <==> currentNode != null; //@ public invariant elementType <: \type(Object); /*@ public invariant @ !uniteratedElems.isEmpty() @ ==> uniteratedElems.elementType <: elementType; @*/ //@ public constraint returnsNull == \old(returnsNull); /*@ public invariant @ !returnsNull @ ==> uniteratedElems.isEmpty() || !uniteratedElems.containsNull; @*/ /** Initialize this with the given set. */ /*@ normal_behavior @ requires s != null; @ assignable uniteratedElems; @ modifies moreElements, elementType, returnsNull, owner; @ ensures uniteratedElems.equals(s); @ ensures owner == null; @ ensures elementType == s.elementType; @ ensures returnsNull == s.containsNull; @*/ JMLEqualsSetEnumerator(/*@ non_null @*/ JMLEqualsSet<E> s) { //@ set owner = null; //@ set elementType = s.elementType; //@ set returnsNull = s.containsNull; currentNode = s.the_list; } /** Tells whether this enumerator has more uniterated elements. */ /*@ also @ public normal_behavior @ ensures \result == !uniteratedElems.isEmpty(); @*/ public /*@ pure @*/ boolean hasMoreElements() { return currentNode != null; } /** Return the next element in this, if there is one. * @exception JMLNoSuchElementException when this is empty. */ /*@ also @ public normal_behavior @ requires hasMoreElements(); @ assignable uniteratedElems, moreElements; @ ensures @ (\result == null @ ==> \old(uniteratedElems).has(null) @ && uniteratedElems.equals(\old(uniteratedElems) @ .remove(null))) @ && (\result != null @ ==> \old(uniteratedElems).has(\result) @ && uniteratedElems.equals(\old(uniteratedElems) @ .remove(\result))); @ also @ public exceptional_behavior @ requires !hasMoreElements(); @ assignable \nothing; @ signals_only JMLNoSuchElementException; @*/ public Object nextElement() throws JMLNoSuchElementException { if (currentNode != null) { Object retValue = currentNode.val; //@ assume retValue != null ==> \typeof(retValue) <: elementType; //@ assume retValue == null ==> returnsNull; currentNode = currentNode.next; return retValue; } else { throw new JMLNoSuchElementException("Tried to .nextElement() " + "with JMLEqualsSet " + "Enumerator `off the end'"); } } /** Return a clone of this enumerator. */ public /*@ non_null @*/ Object clone() { return new JMLEqualsSetEnumerator<E>(new JMLEqualsSet<E>(currentNode)); } //@ nowarn Post; /** Return true just when this enumerator has the same state as * the given argument. */ public /*@ pure @*/ boolean equals(/*@ nullable @*/ Object oth) { if (oth == null || !(oth instanceof JMLEqualsSetEnumerator)) { return false; } else { JMLEqualsSetEnumerator<E> js = (JMLEqualsSetEnumerator<E>) oth; if (currentNode == null) { return js.currentNode == null; } else { return currentNode.equals(js.currentNode); } } } /** Return a hash code for this enumerator. */ public int hashCode() { return currentNode == null ? 0 : currentNode.hashCode(); } }
samyvic/OS-Project
Read Only/gdb-7.12.1/sim/cris/cris-sim.h
/* Collection of junk for CRIS. Copyright (C) 2004-2017 Free Software Foundation, Inc. Contributed by Axis Communications. This file is part of the GNU simulators. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* For other arch:s, this file is described as a "collection of junk", so let's collect some nice junk of our own. Keep it; it might be useful some day! */ #ifndef CRIS_SIM_H #define CRIS_SIM_H typedef struct { /* Whether the branch for the current insn was taken. Placed first here, in hope it'll get closer to the main simulator data. */ USI branch_taken; /* PC of the insn of the branch. */ USI old_pc; /* Static cycle count for all insns executed so far, including non-context-specific stall cycles, for example when adding to PC. */ unsigned64 basic_cycle_count; /* Stall cycles for unaligned access of memory operands. FIXME: Should or should not include unaligned [PC+] operands? */ unsigned64 unaligned_mem_dword_count; /* Context-specific stall cycles. */ unsigned64 memsrc_stall_count; unsigned64 memraw_stall_count; unsigned64 movemsrc_stall_count; unsigned64 movemaddr_stall_count; unsigned64 movemdst_stall_count; unsigned64 mulsrc_stall_count; unsigned64 jumpsrc_stall_count; unsigned64 branch_stall_count; unsigned64 jumptarget_stall_count; /* What kind of target-specific trace to perform. */ int flags; /* Just the basic cycle count. */ #define FLAG_CRIS_MISC_PROFILE_SIMPLE 1 /* Show unaligned accesses. */ #define FLAG_CRIS_MISC_PROFILE_UNALIGNED 2 /* Show schedulable entities. */ #define FLAG_CRIS_MISC_PROFILE_SCHEDULABLE 4 /* Show everything. */ #define FLAG_CRIS_MISC_PROFILE_ALL \ (FLAG_CRIS_MISC_PROFILE_SIMPLE \ | FLAG_CRIS_MISC_PROFILE_UNALIGNED \ | FLAG_CRIS_MISC_PROFILE_SCHEDULABLE) /* Emit trace of each insn, xsim style. */ #define FLAG_CRIS_MISC_PROFILE_XSIM_TRACE 8 #define N_CRISV32_BRANCH_PREDICTORS 256 unsigned char branch_predictors[N_CRISV32_BRANCH_PREDICTORS]; } CRIS_MISC_PROFILE; /* Handler prototypes for functions called from the CGEN description. */ extern USI cris_bmod_handler (SIM_CPU *, UINT, USI); extern void cris_flush_simulator_decode_cache (SIM_CPU *, USI); extern USI crisv10f_break_handler (SIM_CPU *, USI, USI); extern USI crisv32f_break_handler (SIM_CPU *, USI, USI); extern USI cris_break_13_handler (SIM_CPU *, USI, USI, USI, USI, USI, USI, USI, USI); extern char cris_have_900000xxif; enum cris_unknown_syscall_action_type { CRIS_USYSC_MSG_STOP, CRIS_USYSC_MSG_ENOSYS, CRIS_USYSC_QUIET_ENOSYS }; extern enum cris_unknown_syscall_action_type cris_unknown_syscall_action; enum cris_interrupt_type { CRIS_INT_NMI, CRIS_INT_RESET, CRIS_INT_INT }; extern int crisv10deliver_interrupt (SIM_CPU *, enum cris_interrupt_type, unsigned int); extern int crisv32deliver_interrupt (SIM_CPU *, enum cris_interrupt_type, unsigned int); /* Using GNU syntax (not C99) so we can compile this on RH 6.2 (egcs-1.1.2/gcc-2.91.66). */ #define cris_trace_printf(SD, CPU, FMT...) \ do \ { \ if (TRACE_FILE (STATE_TRACE_DATA (SD)) != NULL) \ fprintf (TRACE_FILE (CPU_TRACE_DATA (CPU)), FMT); \ else \ sim_io_printf (SD, FMT); \ } \ while (0) #if WITH_PROFILE_MODEL_P #define crisv32f_branch_taken(cpu, oldpc, newpc, taken) \ do \ { \ CPU_CRIS_MISC_PROFILE (cpu)->old_pc = oldpc; \ CPU_CRIS_MISC_PROFILE (cpu)->branch_taken = taken; \ } \ while (0) #else #define crisv32f_branch_taken(cpu, oldpc, newpc, taken) #endif #define crisv10f_branch_taken(cpu, oldpc, newpc, taken) #define crisv32f_read_supr(cpu, index) \ (cgen_rtx_error (current_cpu, \ "Read of support register is unimplemented"), \ 0) #define crisv32f_write_supr(cpu, index, val) \ cgen_rtx_error (current_cpu, \ "Write to support register is unimplemented") \ #define crisv32f_rfg_handler(cpu, pc) \ cgen_rtx_error (current_cpu, "RFG isn't implemented") #define crisv32f_halt_handler(cpu, pc) \ (cgen_rtx_error (current_cpu, "HALT isn't implemented"), 0) #define crisv32f_fidxi_handler(cpu, pc, indx) \ (cgen_rtx_error (current_cpu, "FIDXI isn't implemented"), 0) #define crisv32f_ftagi_handler(cpu, pc, indx) \ (cgen_rtx_error (current_cpu, "FTAGI isn't implemented"), 0) #define crisv32f_fidxd_handler(cpu, pc, indx) \ (cgen_rtx_error (current_cpu, "FIDXD isn't implemented"), 0) #define crisv32f_ftagd_handler(cpu, pc, indx) \ (cgen_rtx_error (current_cpu, "FTAGD isn't implemented"), 0) /* We have nothing special to do when interrupts or NMI are enabled after having been disabled, so empty macros are enough for these hooks. */ #define crisv32f_interrupts_enabled(cpu) #define crisv32f_nmi_enabled(cpu) /* Better warn for this case here, because everything needed is somewhere within the CPU. Compare to trying to use interrupts and NMI, which would fail earlier, when trying to make nonexistent external components generate those exceptions. */ #define crisv32f_single_step_enabled(cpu) \ ((crisv32f_h_qbit_get (cpu) != 0 \ || (crisv32f_h_sr_get (cpu, H_SR_SPC) & ~1) != 0) \ ? (cgen_rtx_error (cpu, \ "single-stepping isn't implemented"), 0) \ : 0) /* We don't need to track the value of the PID register here. */ #define crisv32f_write_pid_handler(cpu, val) /* Neither do we need to know of transitions to user mode. */ #define crisv32f_usermode_enabled(cpu) /* House-keeping exported from traps.c */ extern void cris_set_callbacks (host_callback *); /* FIXME: Add more junk. */ #endif
smbc-digital/iag-webapp
src/StockportWebapp/wwwroot/assets/javascript/stockportgov/cludo.js
define(["jquery", "cludo"], function ($, cludo) { var init = function () { var cludoSettings = { customerId: 112, engineId: 1144, type: 'standardOverlay', hideSearchFilters: true, initSearchBoxText: '', searchInputs: ["cludo-search-form", "cludo-search-mobile-form", "cludo-search-hero-form"], theme: { themeColor: '#055c58', themeBannerColor: { textColor: '#ffffff', backgroundColor: '#055c58' }, borderRadius: 10 }, language: 'en' }; CludoSearch = new Cludo(cludoSettings); CludoSearch.init(); }; return { Init: init } });
Andrei15193/Laboratoare-Facultate
Semestrul4/AOP/L1/aop1/persistence/file/AllMarksInFile.java
<gh_stars>1-10 package aop1.persistence.file; import java.io.EOFException; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.LinkedList; import java.util.List; import org.apache.log4j.Level; import aop1.Application; import aop1.domain.Mark; import aop1.domain.Student; import aop1.persistence.AllMarks; import aop1.persistence.RepositoryException; import aop1.utils.AppendingObjectOutputStream; import aop1.utils.Utils; public class AllMarksInFile implements AllMarks { public AllMarksInFile(final String fileName) { Application.logger.log(Level.INFO, "AllMarksInFile.AllMarksInFile(" + fileName + " :String)"); this.fileName = fileName; } @Override public Mark[] from(final Student student) throws RepositoryException { Application.logger.log(Level.INFO, "AllMarksInFile.from(" + student + " :Student)"); Mark mark; boolean eof = false; ObjectInputStream input = null; List<Mark> marks = new LinkedList<Mark>(); try { input = new ObjectInputStream(new FileInputStream(this.fileName)); do try { mark = (Mark)input.readObject(); if (student.equals(mark.getStudent())) marks.add(mark); } catch (EOFException e) { eof = true; } while (!eof); } catch (ClassNotFoundException e) { new RepositoryException("Corrupted data file", e); } catch (IOException e) { new RepositoryException("Data file inaccessible", e); } finally { Utils.closeStream(input); } return marks.toArray(new Mark[marks.size()]); } @Override public void nowInclude(final Mark mark) throws RepositoryException { Application.logger.log(Level.INFO, "AllMarksInFile.nowInclude(" + mark + " :Mark)"); ObjectOutputStream output = null; try { if (Utils.checkIfFileExists(this.fileName)) output = new AppendingObjectOutputStream(new FileOutputStream( this.fileName, true)); else output = new ObjectOutputStream(new FileOutputStream( this.fileName)); output.writeObject(mark); } catch (IOException e) { throw new RepositoryException("Data file inaccessible.", e); } finally { Utils.closeStream(output); } } private final String fileName; }
comex/libogc
wiiuse/wiiboard.c
<filename>wiiuse/wiiboard.c /* * wiiuse * * Written By: * <NAME> < para > * Email: < thepara (--AT--) g m a i l [--DOT--] com > * * Copyright 2006-2007 * * This file is part of wiiuse. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * $Header: /cvsroot/devkitpro/libogc/wiiuse/wiiboard.c,v 1.6 2008/05/26 19:24:53 shagkur Exp $ * */ /** * @file * @brief Wiiboard expansion device. */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #ifdef WIN32 #include <Winsock2.h> #endif #include "definitions.h" #include "wiiuse_internal.h" #include "dynamics.h" #include "events.h" #include "wiiboard.h" #include "io.h" /** * @brief Handle the handshake data from the wiiboard. * * @param wb A pointer to a wii_board_t structure. * @param data The data read in from the device. * @param len The length of the data block, in bytes. * * @return Returns 1 if handshake was successful, 0 if not. */ int wii_board_handshake(struct wiimote_t* wm, struct wii_board_t* wb, ubyte* data, uword len) { int offset = 0; if (data[offset]==0xff) { if (data[offset+16]==0xff) { WIIUSE_DEBUG("Wii Balance Board handshake appears invalid, trying again."); wiiuse_read_data(wm, data, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN, wiiuse_handshake_expansion); return 0; } offset += 16; } wb->ctr[0] = (data[offset+4]<<8)|data[offset+5]; wb->cbr[0] = (data[offset+6]<<8)|data[offset+7]; wb->ctl[0] = (data[offset+8]<<8)|data[offset+9]; wb->cbl[0] = (data[offset+10]<<8)|data[offset+11]; wb->ctr[1] = (data[offset+12]<<8)|data[offset+13]; wb->cbr[1] = (data[offset+14]<<8)|data[offset+15]; wb->ctl[1] = (data[offset+16]<<8)|data[offset+17]; wb->cbl[1] = (data[offset+18]<<8)|data[offset+19]; wb->ctr[2] = (data[offset+20]<<8)|data[offset+21]; wb->cbr[2] = (data[offset+22]<<8)|data[offset+23]; wb->ctl[2] = (data[offset+24]<<8)|data[offset+25]; wb->cbl[2] = (data[offset+26]<<8)|data[offset+27]; /* handshake done */ wm->event = WIIUSE_WII_BOARD_INSERTED; wm->exp.type = EXP_WII_BOARD; return 1; } /** * @brief The wii board disconnected. * * @param cc A pointer to a classic_ctrl_t structure. */ void wii_board_disconnected(struct wii_board_t* wb) { memset(wb, 0, sizeof(struct wii_board_t)); } /** * @brief Handle wii board event. * * @param wb A pointer to a wii_board_t structure. * @param msg The message specified in the event packet. */ void wii_board_event(struct wii_board_t* wb, ubyte* msg) { wb->rtr = (msg[0]<<8)|msg[1]; wb->rbr = (msg[2]<<8)|msg[3]; wb->rtl = (msg[4]<<8)|msg[5]; wb->rbl = (msg[6]<<8)|msg[7]; }
mdwhatcott/advent-of-code
go/2019/day07/iter.go
<reponame>mdwhatcott/advent-of-code<filename>go/2019/day07/iter.go package advent // python's itertools to the rescue! // // import itertools // itertools.permutations(range(5), 5) // var phaseCombinations = [][]int{ {0, 1, 2, 3, 4}, {0, 1, 2, 4, 3}, {0, 1, 3, 2, 4}, {0, 1, 3, 4, 2}, {0, 1, 4, 2, 3}, {0, 1, 4, 3, 2}, {0, 2, 1, 3, 4}, {0, 2, 1, 4, 3}, {0, 2, 3, 1, 4}, {0, 2, 3, 4, 1}, {0, 2, 4, 1, 3}, {0, 2, 4, 3, 1}, {0, 3, 1, 2, 4}, {0, 3, 1, 4, 2}, {0, 3, 2, 1, 4}, {0, 3, 2, 4, 1}, {0, 3, 4, 1, 2}, {0, 3, 4, 2, 1}, {0, 4, 1, 2, 3}, {0, 4, 1, 3, 2}, {0, 4, 2, 1, 3}, {0, 4, 2, 3, 1}, {0, 4, 3, 1, 2}, {0, 4, 3, 2, 1}, {1, 0, 2, 3, 4}, {1, 0, 2, 4, 3}, {1, 0, 3, 2, 4}, {1, 0, 3, 4, 2}, {1, 0, 4, 2, 3}, {1, 0, 4, 3, 2}, {1, 2, 0, 3, 4}, {1, 2, 0, 4, 3}, {1, 2, 3, 0, 4}, {1, 2, 3, 4, 0}, {1, 2, 4, 0, 3}, {1, 2, 4, 3, 0}, {1, 3, 0, 2, 4}, {1, 3, 0, 4, 2}, {1, 3, 2, 0, 4}, {1, 3, 2, 4, 0}, {1, 3, 4, 0, 2}, {1, 3, 4, 2, 0}, {1, 4, 0, 2, 3}, {1, 4, 0, 3, 2}, {1, 4, 2, 0, 3}, {1, 4, 2, 3, 0}, {1, 4, 3, 0, 2}, {1, 4, 3, 2, 0}, {2, 0, 1, 3, 4}, {2, 0, 1, 4, 3}, {2, 0, 3, 1, 4}, {2, 0, 3, 4, 1}, {2, 0, 4, 1, 3}, {2, 0, 4, 3, 1}, {2, 1, 0, 3, 4}, {2, 1, 0, 4, 3}, {2, 1, 3, 0, 4}, {2, 1, 3, 4, 0}, {2, 1, 4, 0, 3}, {2, 1, 4, 3, 0}, {2, 3, 0, 1, 4}, {2, 3, 0, 4, 1}, {2, 3, 1, 0, 4}, {2, 3, 1, 4, 0}, {2, 3, 4, 0, 1}, {2, 3, 4, 1, 0}, {2, 4, 0, 1, 3}, {2, 4, 0, 3, 1}, {2, 4, 1, 0, 3}, {2, 4, 1, 3, 0}, {2, 4, 3, 0, 1}, {2, 4, 3, 1, 0}, {3, 0, 1, 2, 4}, {3, 0, 1, 4, 2}, {3, 0, 2, 1, 4}, {3, 0, 2, 4, 1}, {3, 0, 4, 1, 2}, {3, 0, 4, 2, 1}, {3, 1, 0, 2, 4}, {3, 1, 0, 4, 2}, {3, 1, 2, 0, 4}, {3, 1, 2, 4, 0}, {3, 1, 4, 0, 2}, {3, 1, 4, 2, 0}, {3, 2, 0, 1, 4}, {3, 2, 0, 4, 1}, {3, 2, 1, 0, 4}, {3, 2, 1, 4, 0}, {3, 2, 4, 0, 1}, {3, 2, 4, 1, 0}, {3, 4, 0, 1, 2}, {3, 4, 0, 2, 1}, {3, 4, 1, 0, 2}, {3, 4, 1, 2, 0}, {3, 4, 2, 0, 1}, {3, 4, 2, 1, 0}, {4, 0, 1, 2, 3}, {4, 0, 1, 3, 2}, {4, 0, 2, 1, 3}, {4, 0, 2, 3, 1}, {4, 0, 3, 1, 2}, {4, 0, 3, 2, 1}, {4, 1, 0, 2, 3}, {4, 1, 0, 3, 2}, {4, 1, 2, 0, 3}, {4, 1, 2, 3, 0}, {4, 1, 3, 0, 2}, {4, 1, 3, 2, 0}, {4, 2, 0, 1, 3}, {4, 2, 0, 3, 1}, {4, 2, 1, 0, 3}, {4, 2, 1, 3, 0}, {4, 2, 3, 0, 1}, {4, 2, 3, 1, 0}, {4, 3, 0, 1, 2}, {4, 3, 0, 2, 1}, {4, 3, 1, 0, 2}, {4, 3, 1, 2, 0}, {4, 3, 2, 0, 1}, {4, 3, 2, 1, 0}, } var phaseCombinations2 = [][]int{ {5, 6, 7, 8, 9}, {5, 6, 7, 9, 8}, {5, 6, 8, 7, 9}, {5, 6, 8, 9, 7}, {5, 6, 9, 7, 8}, {5, 6, 9, 8, 7}, {5, 7, 6, 8, 9}, {5, 7, 6, 9, 8}, {5, 7, 8, 6, 9}, {5, 7, 8, 9, 6}, {5, 7, 9, 6, 8}, {5, 7, 9, 8, 6}, {5, 8, 6, 7, 9}, {5, 8, 6, 9, 7}, {5, 8, 7, 6, 9}, {5, 8, 7, 9, 6}, {5, 8, 9, 6, 7}, {5, 8, 9, 7, 6}, {5, 9, 6, 7, 8}, {5, 9, 6, 8, 7}, {5, 9, 7, 6, 8}, {5, 9, 7, 8, 6}, {5, 9, 8, 6, 7}, {5, 9, 8, 7, 6}, {6, 5, 7, 8, 9}, {6, 5, 7, 9, 8}, {6, 5, 8, 7, 9}, {6, 5, 8, 9, 7}, {6, 5, 9, 7, 8}, {6, 5, 9, 8, 7}, {6, 7, 5, 8, 9}, {6, 7, 5, 9, 8}, {6, 7, 8, 5, 9}, {6, 7, 8, 9, 5}, {6, 7, 9, 5, 8}, {6, 7, 9, 8, 5}, {6, 8, 5, 7, 9}, {6, 8, 5, 9, 7}, {6, 8, 7, 5, 9}, {6, 8, 7, 9, 5}, {6, 8, 9, 5, 7}, {6, 8, 9, 7, 5}, {6, 9, 5, 7, 8}, {6, 9, 5, 8, 7}, {6, 9, 7, 5, 8}, {6, 9, 7, 8, 5}, {6, 9, 8, 5, 7}, {6, 9, 8, 7, 5}, {7, 5, 6, 8, 9}, {7, 5, 6, 9, 8}, {7, 5, 8, 6, 9}, {7, 5, 8, 9, 6}, {7, 5, 9, 6, 8}, {7, 5, 9, 8, 6}, {7, 6, 5, 8, 9}, {7, 6, 5, 9, 8}, {7, 6, 8, 5, 9}, {7, 6, 8, 9, 5}, {7, 6, 9, 5, 8}, {7, 6, 9, 8, 5}, {7, 8, 5, 6, 9}, {7, 8, 5, 9, 6}, {7, 8, 6, 5, 9}, {7, 8, 6, 9, 5}, {7, 8, 9, 5, 6}, {7, 8, 9, 6, 5}, {7, 9, 5, 6, 8}, {7, 9, 5, 8, 6}, {7, 9, 6, 5, 8}, {7, 9, 6, 8, 5}, {7, 9, 8, 5, 6}, {7, 9, 8, 6, 5}, {8, 5, 6, 7, 9}, {8, 5, 6, 9, 7}, {8, 5, 7, 6, 9}, {8, 5, 7, 9, 6}, {8, 5, 9, 6, 7}, {8, 5, 9, 7, 6}, {8, 6, 5, 7, 9}, {8, 6, 5, 9, 7}, {8, 6, 7, 5, 9}, {8, 6, 7, 9, 5}, {8, 6, 9, 5, 7}, {8, 6, 9, 7, 5}, {8, 7, 5, 6, 9}, {8, 7, 5, 9, 6}, {8, 7, 6, 5, 9}, {8, 7, 6, 9, 5}, {8, 7, 9, 5, 6}, {8, 7, 9, 6, 5}, {8, 9, 5, 6, 7}, {8, 9, 5, 7, 6}, {8, 9, 6, 5, 7}, {8, 9, 6, 7, 5}, {8, 9, 7, 5, 6}, {8, 9, 7, 6, 5}, {9, 5, 6, 7, 8}, {9, 5, 6, 8, 7}, {9, 5, 7, 6, 8}, {9, 5, 7, 8, 6}, {9, 5, 8, 6, 7}, {9, 5, 8, 7, 6}, {9, 6, 5, 7, 8}, {9, 6, 5, 8, 7}, {9, 6, 7, 5, 8}, {9, 6, 7, 8, 5}, {9, 6, 8, 5, 7}, {9, 6, 8, 7, 5}, {9, 7, 5, 6, 8}, {9, 7, 5, 8, 6}, {9, 7, 6, 5, 8}, {9, 7, 6, 8, 5}, {9, 7, 8, 5, 6}, {9, 7, 8, 6, 5}, {9, 8, 5, 6, 7}, {9, 8, 5, 7, 6}, {9, 8, 6, 5, 7}, {9, 8, 6, 7, 5}, {9, 8, 7, 5, 6}, {9, 8, 7, 6, 5}, }
sniperkit/colly
plugins/data/transform/optimus/sources/csv/csv.go
<reponame>sniperkit/colly package csv import ( "encoding/csv" "fmt" "io" "sync" "gopkg.in/Clever/optimus.v3" ) type table struct { err error rows chan optimus.Row m sync.Mutex stopped bool } func (t *table) start(reader *csv.Reader) { defer t.Stop() defer close(t.rows) headers, err := reader.Read() if err != nil { if perr, ok := err.(*csv.ParseError); ok { // Modifies the underlying err perr.Err = fmt.Errorf("%s. %s", perr.Err, "This can happen when the CSV is malformed, or when the wrong delimiter is used") } t.handleErr(err) return } reader.FieldsPerRecord = len(headers) for { t.m.Lock() stopped := t.stopped t.m.Unlock() if stopped { break } line, err := reader.Read() if err != nil { t.handleErr(err) return } t.rows <- convertLineToRow(line, headers) } } func (t *table) Rows() <-chan optimus.Row { return t.rows } func (t *table) Err() error { return t.err } func (t *table) Stop() { t.m.Lock() t.stopped = true t.m.Unlock() } func (t *table) handleErr(err error) { if err != io.EOF { t.err = err } } func convertLineToRow(line []string, headers []string) optimus.Row { row := optimus.Row{} for i, header := range headers { row[header] = line[i] } return row } // New returns a new Table that scans over the rows of a CSV. func New(in io.Reader) optimus.Table { return NewWithCsvReader(csv.NewReader(in)) } // NewWithCsvReader returns a new Table that scans over the rows from the csv reader. func NewWithCsvReader(reader *csv.Reader) optimus.Table { table := &table{ rows: make(chan optimus.Row), } go table.start(reader) return table }
vitei/Usa
Engine/Scene/Model/ModelEffectComponents.h
/**************************************************************************** // Usagi Engine, Copyright © Vitei, Inc. 2016 *****************************************************************************/ #ifndef __FADE_RUNTIEM_COMPONENT__ #define __FADE_RUNTIEM_COMPONENT__ #include "Engine/Framework/GameComponents.h" namespace usg { struct FadeComponentRuntimeData { static const uint32 MaxSimultaneousFades = 8; uint32 uCurrentFades; struct FadeData { uint32 uId; float fCurrentFade; float fTimer; float fDeltaFade; float fTargetFade; void Reset() { uId = 0; fCurrentFade = 1; } }; FadeData* pFadeData; void Reset(); float GetFadeMultiplier(uint32 uId) const; void RemoveFade(uint32 uId); FadeData& GetFadeData(uint32 uId); void SetFade(uint32 uId, float fTargetFade, float fFadeTime); void Update(float fDelta); float GetCurrentFade() const { float fFade = 1.0f; for (uint32 i = 0; i < uCurrentFades; i++) { fFade *= pFadeData[i].fCurrentFade; } return fFade; } }; template<> struct RuntimeData<usg::FadeComponent> : public FadeComponentRuntimeData { }; } #endif
fangjinuo/langx
langx-java/src/main/java/com/jn/langx/util/struct/ThreadLocalHolder.java
package com.jn.langx.util.struct; import com.jn.langx.util.Emptys; import com.jn.langx.util.function.Supplier0; public class ThreadLocalHolder<V> implements ValueHolder<V> { private ThreadLocal<V> local; public ThreadLocalHolder() { this((V) null); } public ThreadLocalHolder(final Supplier0<V> supplier) { this.local = new ThreadLocal<V>() { @Override protected V initialValue() { return supplier == null ? null : supplier.get(); } }; } public ThreadLocalHolder(final V value) { this(new Supplier0<V>() { @Override public V get() { return value; } }); } @Override public void set(V v) { local.set(v); } @Override public V get() { return local.get(); } public void reset() { local.remove(); } @Override public boolean isEmpty() { return Emptys.isEmpty(get()); } @Override public boolean isNull() { return get() == null; } @Override public void setHash(int hash) { // NOOP } @Override public int getHash() { Object v = get(); if (v == null) { return 0; } return v.hashCode(); } }
bianapis/sd-customer-campaign-execution-v2
src/main/java/org/bian/dto/BQExecutionInitiateOutputModelCustomerCampaignProcedureInstanceRecord.java
package org.bian.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.bian.dto.BQExecutionInitiateOutputModelCustomerCampaignProcedureInstanceRecordCustomerCampaignProcedureResult; import org.bian.dto.CRCustomerCampaignProcedureInitiateInputModelCustomerCampaignProcedureInstanceRecordDateType; import org.bian.dto.CRCustomerCampaignProcedureInitiateOutputModelCustomerCampaignProcedureInstanceRecordCustomerCampaignConsumablesInventory; import javax.validation.Valid; /** * BQExecutionInitiateOutputModelCustomerCampaignProcedureInstanceRecord */ public class BQExecutionInitiateOutputModelCustomerCampaignProcedureInstanceRecord { private String customerCampaignType = null; private String customerCampaignDescription = null; private String employeeBusinessUnitReference = null; private String customerCampaignProcedureSetup = null; private String customerCampaignProcedureVersionNumber = null; private String customerCampaignSchedule = null; private CRCustomerCampaignProcedureInitiateOutputModelCustomerCampaignProcedureInstanceRecordCustomerCampaignConsumablesInventory customerCampaignConsumablesInventory = null; private CRCustomerCampaignProcedureInitiateInputModelCustomerCampaignProcedureInstanceRecordDateType dateType = null; private BQExecutionInitiateOutputModelCustomerCampaignProcedureInstanceRecordCustomerCampaignProcedureResult customerCampaignProcedureResult = null; /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Text general-info: The type or category of customer campaign (e.g. cross-sell, up-sell, retention) * @return customerCampaignType **/ public String getCustomerCampaignType() { return customerCampaignType; } public void setCustomerCampaignType(String customerCampaignType) { this.customerCampaignType = customerCampaignType; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Text general-info: A description of the campaign that clarifies the intended context/use of the campaign, the mechanisms employed and the intended/anticipated response/impact * @return customerCampaignDescription **/ public String getCustomerCampaignDescription() { return customerCampaignDescription; } public void setCustomerCampaignDescription(String customerCampaignDescription) { this.customerCampaignDescription = customerCampaignDescription; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the business unit responsible for the campaign execution * @return employeeBusinessUnitReference **/ public String getEmployeeBusinessUnitReference() { return employeeBusinessUnitReference; } public void setEmployeeBusinessUnitReference(String employeeBusinessUnitReference) { this.employeeBusinessUnitReference = employeeBusinessUnitReference; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Text general-info: Details of the deployment set-up/configuration of the campaign for reference * @return customerCampaignProcedureSetup **/ public String getCustomerCampaignProcedureSetup() { return customerCampaignProcedureSetup; } public void setCustomerCampaignProcedureSetup(String customerCampaignProcedureSetup) { this.customerCampaignProcedureSetup = customerCampaignProcedureSetup; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Text general-info: The customer campaign version number used in the event * @return customerCampaignProcedureVersionNumber **/ public String getCustomerCampaignProcedureVersionNumber() { return customerCampaignProcedureVersionNumber; } public void setCustomerCampaignProcedureVersionNumber(String customerCampaignProcedureVersionNumber) { this.customerCampaignProcedureVersionNumber = customerCampaignProcedureVersionNumber; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Text general-info: The campaign processing schedule, covering candidate selection, execution, flow-up and analysis activities. Note this can be an ongoing campaign where worksteps continue in parallel * @return customerCampaignSchedule **/ public String getCustomerCampaignSchedule() { return customerCampaignSchedule; } public void setCustomerCampaignSchedule(String customerCampaignSchedule) { this.customerCampaignSchedule = customerCampaignSchedule; } /** * Get customerCampaignConsumablesInventory * @return customerCampaignConsumablesInventory **/ public CRCustomerCampaignProcedureInitiateOutputModelCustomerCampaignProcedureInstanceRecordCustomerCampaignConsumablesInventory getCustomerCampaignConsumablesInventory() { return customerCampaignConsumablesInventory; } public void setCustomerCampaignConsumablesInventory(CRCustomerCampaignProcedureInitiateOutputModelCustomerCampaignProcedureInstanceRecordCustomerCampaignConsumablesInventory customerCampaignConsumablesInventory) { this.customerCampaignConsumablesInventory = customerCampaignConsumablesInventory; } /** * Get dateType * @return dateType **/ public CRCustomerCampaignProcedureInitiateInputModelCustomerCampaignProcedureInstanceRecordDateType getDateType() { return dateType; } public void setDateType(CRCustomerCampaignProcedureInitiateInputModelCustomerCampaignProcedureInstanceRecordDateType dateType) { this.dateType = dateType; } /** * Get customerCampaignProcedureResult * @return customerCampaignProcedureResult **/ public BQExecutionInitiateOutputModelCustomerCampaignProcedureInstanceRecordCustomerCampaignProcedureResult getCustomerCampaignProcedureResult() { return customerCampaignProcedureResult; } public void setCustomerCampaignProcedureResult(BQExecutionInitiateOutputModelCustomerCampaignProcedureInstanceRecordCustomerCampaignProcedureResult customerCampaignProcedureResult) { this.customerCampaignProcedureResult = customerCampaignProcedureResult; } }
ephes/django-cast
tests/test_post_published.py
<reponame>ephes/django-cast import pytest from datetime import timedelta from django.urls import reverse from django.utils import timezone from cast.models import Post class TestPublished: pytestmark = pytest.mark.django_db def test_get_only_published_entries(self, client, unpublished_post): bp = unpublished_post feed_url = reverse("cast:latest_entries_feed", kwargs={"slug": bp.blog.slug}) r = client.get(feed_url) assert r.status_code == 200 content = r.content.decode("utf-8") assert "xml" in content assert bp.title not in content def test_get_post_detail_not_published_not_auth(self, client, unpublished_post): post = unpublished_post slugs = {"blog_slug": post.blog.slug, "slug": post.slug} detail_url = reverse("cast:post_detail", kwargs=slugs) r = client.get(detail_url) assert r.status_code == 404 content = r.content.decode("utf-8") assert post.title not in content def test_get_post_detail_not_published_authenticated( self, client, unpublished_post ): post = unpublished_post slugs = {"blog_slug": post.blog.slug, "slug": post.slug} detail_url = reverse("cast:post_detail", kwargs=slugs) r = client.login(username=post.author.username, password="password") r = client.get(detail_url) assert r.status_code == 200 content = r.content.decode("utf-8") assert "html" in content assert post.title in content def test_get_post_not_published_not_authenticated(self, client, unpublished_post): post = unpublished_post blog_url = reverse("cast:post_list", kwargs={"slug": post.blog.slug}) r = client.get(blog_url) assert r.status_code == 200 content = r.content.decode("utf-8") assert "html" in content assert post.title not in content def test_get_post_not_published_authenticated(self, client, unpublished_post): post = unpublished_post blog_url = reverse("cast:post_list", kwargs={"slug": post.blog.slug}) r = client.login(username=post.author.username, password="password") r = client.get(blog_url) assert r.status_code == 200 content = r.content.decode("utf-8") assert "html" in content assert post.title in content def test_published_manager_pub_date_null(self, post): assert Post.published.count() == 1 post.pub_date = None post.save() assert Post.objects.count() == 1 assert Post.published.count() == 0 def test_published_manager_future_pubdate(self, post): assert Post.published.count() == 1 post.pub_date = timezone.now() + timedelta(seconds=10) post.save() assert Post.objects.count() == 1 assert Post.published.count() == 0 post.pub_date = timezone.now() post.save() assert Post.objects.count() == 1 assert Post.published.count() == 1
baratharon/graal-erl
graal-erl/com.oracle.truffle.erl/src/com/oracle/truffle/erl/nodes/local/ErlLocalVariableNode.java
/* * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * The Universal Permissive License (UPL), Version 1.0 * * Subject to the condition set forth below, permission is hereby granted to any * person obtaining a copy of this software, associated documentation and/or * data (collectively the "Software"), free of charge and under any and all * copyright rights in the Software, and any and all patent rights owned or * freely licensable by each licensor hereunder covering either (i) the * unmodified Software as contributed to or provided by such licensor, or (ii) * the Larger Works (as defined below), to deal in both * * (a) the Software, and * * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if * one is included with the Software each a "Larger Work" to which the Software * is contributed by such licensors), * * without restriction, including without limitation the rights to copy, create * derivative works of, display, perform, and distribute the Software and make, * use, sell, offer for sale, import, export, have made, and have sold the * Software and the Larger Work(s), and to sublicense the foregoing rights on * either these or other terms. * * This license is subject to the following condition: * * The above copyright notice and either this complete permission notice or at a * minimum a reference to the UPL must be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package com.oracle.truffle.erl.nodes.local; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.dsl.NodeField; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.frame.FrameSlot; import com.oracle.truffle.api.frame.FrameSlotKind; import com.oracle.truffle.api.frame.FrameSlotTypeException; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.source.SourceSection; import com.oracle.truffle.erl.nodes.ErlExpressionNode; /** * Node to read a local variable from a function's {@link VirtualFrame frame}. The Truffle frame API * allows to store primitive values of all Java primitive types, and Object values. This means that * all SL types that are objects are handled by the {@link #readObject} method. When a local * variable changes its type, the frame access method throws an {@link FrameSlotTypeException}, * which causes not rewriting. The rewriting code is generated by the Truffle DSL. */ @NodeField(name = "slot", type = FrameSlot.class) public abstract class ErlLocalVariableNode extends ErlExpressionNode { @CompilationFinal private boolean isBound = false; public ErlLocalVariableNode(SourceSection src) { super(src); } /** * Returns the descriptor of the accessed local variable. The implementation of this method is * created by the Truffle DSL based on the {@link NodeField} annotation on the class. */ protected abstract FrameSlot getSlot(); public void setBound() { if (isBound) { return; } CompilerDirectives.transferToInterpreterAndInvalidate(); isBound = true; } @Override public Object match(VirtualFrame frame, Object match) { assert null != match; if (!isBound) { if (getSlot().getKind() != FrameSlotKind.Object) { if (match instanceof Long) { getSlot().setKind(FrameSlotKind.Long); frame.setLong(getSlot(), (long) match); } else if (match instanceof Boolean) { getSlot().setKind(FrameSlotKind.Boolean); frame.setBoolean(getSlot(), (boolean) match); } else if (match instanceof Double) { getSlot().setKind(FrameSlotKind.Double); frame.setDouble(getSlot(), (double) match); } else { getSlot().setKind(FrameSlotKind.Object); frame.setObject(getSlot(), match); } } else { frame.setObject(getSlot(), match); } return match; } return super.match(frame, match); } @Specialization(rewriteOn = FrameSlotTypeException.class) protected long readLong(VirtualFrame frame) throws FrameSlotTypeException { return frame.getLong(getSlot()); } @Specialization(rewriteOn = FrameSlotTypeException.class) protected boolean readBoolean(VirtualFrame frame) throws FrameSlotTypeException { return frame.getBoolean(getSlot()); } @Specialization(rewriteOn = FrameSlotTypeException.class) protected Object readDouble(VirtualFrame frame) throws FrameSlotTypeException { return frame.getDouble(getSlot()); } @Specialization(rewriteOn = FrameSlotTypeException.class) protected Object readObject(VirtualFrame frame) throws FrameSlotTypeException { return frame.getObject(getSlot()); } /** * This is the generic case that always succeeds. Since we already have another specialization * with the same signature above, we need to order them explicitly with the order attribute. */ @Specialization(contains = {"readLong", "readBoolean", "readDouble", "readObject"}) protected Object read(VirtualFrame frame) { return frame.getValue(getSlot()); } }
kettlebell/ergo
src/test/scala/org/ergoplatform/nodeView/viewholder/ErgoNodeViewHolderSpec.scala
<gh_stars>0 package org.ergoplatform.nodeView.viewholder import java.io.File import org.ergoplatform.ErgoBoxCandidate import org.ergoplatform.modifiers.ErgoFullBlock import org.ergoplatform.nodeView.history.ErgoHistory import org.ergoplatform.nodeView.state.StateType.Utxo import org.ergoplatform.nodeView.state._ import org.ergoplatform.nodeView.state.wrapped.WrappedUtxoState import org.ergoplatform.settings.{Algos, Constants, ErgoSettings} import org.ergoplatform.utils.{ErgoPropertyTest, HistoryTestHelpers, NodeViewTestConfig, NodeViewTestOps, TestCase} import org.ergoplatform.nodeView.ErgoNodeViewHolder.ReceivableMessages._ import org.ergoplatform.network.ErgoNodeViewSynchronizer.ReceivableMessages._ import org.ergoplatform.nodeView.ErgoNodeViewHolder import org.ergoplatform.nodeView.ErgoNodeViewHolder.ReceivableMessages.ChainProgress import scorex.crypto.authds.{ADKey, SerializedAdProof} import scorex.testkit.utils.NoShrink import scorex.util.{ModifierId, bytesToId} class ErgoNodeViewHolderSpec extends ErgoPropertyTest with HistoryTestHelpers with NodeViewTestOps with NoShrink { private val t0 = TestCase("check chain is healthy") { fixture => val (us, bh) = createUtxoState(parameters) val block = validFullBlock(None, us, bh) val history = generateHistory(true, StateType.Utxo, false, 2) // too big chain update delay val notAcceptableDelay = System.currentTimeMillis() - (initSettings.nodeSettings.acceptableChainUpdateDelay.toMillis + 100) val invalidProgress = ChainProgress(block, 2, 3, notAcceptableDelay) ErgoNodeViewHolder.checkChainIsHealthy(invalidProgress, history, timeProvider, initSettings).isInstanceOf[ChainIsStuck] shouldBe true // acceptable chain update delay val acceptableDelay = System.currentTimeMillis() - 5 val validProgress = ChainProgress(block, 2, 3, acceptableDelay) ErgoNodeViewHolder.checkChainIsHealthy(validProgress, history, timeProvider, initSettings) shouldBe ChainIsHealthy } private val t1 = TestCase("check genesis state") { fixture => import fixture._ getCurrentState.rootHash shouldBe getGenesisStateDigest } private val t2 = TestCase("check history after genesis") { fixture => import fixture._ getBestHeaderOpt shouldBe None } private val t3 = TestCase("apply valid block header") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val block = validFullBlock(None, us, bh) getBestHeaderOpt shouldBe None getHistoryHeight shouldBe ErgoHistory.EmptyHistoryHeight subscribeEvents(classOf[SyntacticallySuccessfulModifier]) //sending header nodeViewHolderRef ! LocallyGeneratedModifier(block.header) expectMsgType[SyntacticallySuccessfulModifier] getHistoryHeight shouldBe ErgoHistory.GenesisHeight getHeightOf(block.header.id) shouldBe Some(ErgoHistory.GenesisHeight) getLastHeadersLength(10) shouldBe 1 getBestHeaderOpt shouldBe Some(block.header) } private val t4 = TestCase("apply valid block as genesis") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val genesis = validFullBlock(parentOpt = None, us, bh) subscribeEvents(classOf[SyntacticallySuccessfulModifier]) nodeViewHolderRef ! LocallyGeneratedModifier(genesis.header) expectMsgType[SyntacticallySuccessfulModifier] if (verifyTransactions) { nodeViewHolderRef ! LocallyGeneratedModifier(genesis.blockTransactions) expectMsgType[SyntacticallySuccessfulModifier] nodeViewHolderRef ! LocallyGeneratedModifier(genesis.adProofs.value) expectMsgType[SyntacticallySuccessfulModifier] nodeViewHolderRef ! LocallyGeneratedModifier(genesis.extension) expectMsgType[SyntacticallySuccessfulModifier] getBestFullBlockOpt shouldBe Some(genesis) } } private val t5 = TestCase("apply full blocks after genesis") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val genesis = validFullBlock(parentOpt = None, us, bh) val wusAfterGenesis = WrappedUtxoState(us, bh, stateConstants, parameters).applyModifier(genesis) { mod => nodeViewHolderRef ! mod }.get applyBlock(genesis) shouldBe 'success val block = validFullBlock(Some(genesis), wusAfterGenesis) applyBlock(block) shouldBe 'success if (verifyTransactions) { getBestFullBlockOpt shouldBe Some(block) } getBestHeaderOpt shouldBe Some(block.header) getHistoryHeight shouldBe block.header.height getLastHeadersLength(10) shouldBe 2 } private val t6 = TestCase("add transaction to memory pool") { fixture => import fixture._ if (stateType == Utxo) { val (us, bh) = createUtxoState(parameters) val genesis = validFullBlock(parentOpt = None, us, bh) applyBlock(genesis) shouldBe 'success val boxes = ErgoState.newBoxes(genesis.transactions).find(_.ergoTree == Constants.TrueLeaf) boxes.nonEmpty shouldBe true val tx = validTransactionFromBoxes(boxes.toIndexedSeq) subscribeEvents(classOf[FailedTransaction]) nodeViewHolderRef ! LocallyGeneratedTransaction(tx) expectNoMsg() getPoolSize shouldBe 1 } } private val t7 = TestCase("apply statefully invalid full block") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val genesis = validFullBlock(parentOpt = None, us, bh) val wusAfterGenesis = WrappedUtxoState(us, bh, stateConstants, parameters).applyModifier(genesis) { mod => nodeViewHolderRef ! mod }.get // TODO looks like another bug is still present here, see https://github.com/ergoplatform/ergo/issues/309 if (verifyTransactions) { applyBlock(genesis) shouldBe 'success val block = validFullBlock(Some(genesis), wusAfterGenesis) val wusAfterBlock = wusAfterGenesis.applyModifier(block)(mod => nodeViewHolderRef ! mod).get applyBlock(block) shouldBe 'success getBestHeaderOpt shouldBe Some(block.header) if (verifyTransactions) { getRootHash shouldBe Algos.encode(wusAfterBlock.rootHash) } getBestHeaderOpt shouldBe Some(block.header) val brokenBlock = generateInvalidFullBlock(Some(block), wusAfterBlock) applyBlock(brokenBlock) shouldBe 'success val brokenBlock2 = generateInvalidFullBlock(Some(block), wusAfterBlock) brokenBlock2.header should not be brokenBlock.header applyBlock(brokenBlock2) shouldBe 'success getBestFullBlockOpt shouldBe Some(block) getRootHash shouldBe Algos.encode(wusAfterBlock.rootHash) getBestHeaderOpt shouldBe Some(block.header) } } /** * Generates statefuly invalid full block (contains invalid transactions). */ private def generateInvalidFullBlock(parentBlockOpt: Option[ErgoFullBlock], parentState: WrappedUtxoState) = { val validInterlinks = nipopowAlgos.updateInterlinks(parentBlockOpt.map(_.header), parentBlockOpt.map(_.extension)) val extensionIn = nipopowAlgos.interlinksToExtension(validInterlinks).toExtension(modifierIdGen.sample.get) val brokenBlockIn = validFullBlock(parentBlockOpt, parentState) val headTx = brokenBlockIn.blockTransactions.txs.head val wrongBoxId: ADKey = ADKey !@@ Algos.hash("wrong input") val newInput = headTx.inputs.head.copy(boxId = wrongBoxId) val brokenTransactionsIn = brokenBlockIn.blockTransactions .copy(txs = headTx.copy(inputs = newInput +: headTx.inputs.tail) +: brokenBlockIn.blockTransactions.txs.tail) val brokenHeader = brokenBlockIn.header .copy(transactionsRoot = brokenTransactionsIn.digest, extensionRoot = extensionIn.digest) val brokenTransactions = brokenTransactionsIn.copy(headerId = brokenHeader.id) val brokenProofs = brokenBlockIn.adProofs.value.copy(headerId = brokenHeader.id) val extension = extensionIn.copy(headerId = brokenHeader.id) ErgoFullBlock(brokenHeader, brokenTransactions, extension, Some(brokenProofs)) } private val t8 = TestCase("switching for a better chain") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val genesis = validFullBlock(parentOpt = None, us, bh) val wusAfterGenesis = WrappedUtxoState(us, bh, stateConstants, parameters).applyModifier(genesis) { mod => nodeViewHolderRef ! mod }.get applyBlock(genesis) shouldBe 'success getRootHash shouldBe Algos.encode(wusAfterGenesis.rootHash) val chain1block1 = validFullBlock(Some(genesis), wusAfterGenesis) val expectedBestFullBlockOpt = if (verifyTransactions) Some(chain1block1) else None applyBlock(chain1block1) shouldBe 'success getBestFullBlockOpt shouldBe expectedBestFullBlockOpt getBestHeaderOpt shouldBe Some(chain1block1.header) val chain2block1 = validFullBlock(Some(genesis), wusAfterGenesis) applyBlock(chain2block1) shouldBe 'success getBestFullBlockOpt shouldBe expectedBestFullBlockOpt getBestHeaderOpt shouldBe Some(chain1block1.header) val wusChain2Block1 = wusAfterGenesis.applyModifier(chain2block1)(mod => nodeViewHolderRef ! mod).get val chain2block2 = validFullBlock(Some(chain2block1), wusChain2Block1) chain2block1.header.stateRoot shouldEqual wusChain2Block1.rootHash applyBlock(chain2block2) shouldBe 'success if (verifyTransactions) { getBestFullBlockEncodedId shouldBe Some(chain2block2.header.encodedId) } getBestHeaderOpt shouldBe Some(chain2block2.header) getRootHash shouldBe Algos.encode(chain2block2.header.stateRoot) } private val t9 = TestCase("UTXO state should generate adProofs and put them in history") { fixture => import fixture._ if (stateType == StateType.Utxo) { val (us, bh) = createUtxoState(parameters) val genesis = validFullBlock(parentOpt = None, us, bh) nodeViewHolderRef ! LocallyGeneratedModifier(genesis.header) nodeViewHolderRef ! LocallyGeneratedModifier(genesis.blockTransactions) nodeViewHolderRef ! LocallyGeneratedModifier(genesis.extension) getBestFullBlockOpt shouldBe Some(genesis) getModifierById(genesis.adProofs.value.id) shouldBe genesis.adProofs } } private val t10 = TestCase("NodeViewHolder start from inconsistent state") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val genesis = validFullBlock(parentOpt = None, us, bh) val wusAfterGenesis = WrappedUtxoState(us, bh, stateConstants, parameters).applyModifier(genesis) { mod => nodeViewHolderRef ! mod }.get applyBlock(genesis) shouldBe 'success val block1 = validFullBlock(Some(genesis), wusAfterGenesis) applyBlock(block1) shouldBe 'success getBestFullBlockOpt shouldBe Some(block1) getRootHash shouldBe Algos.encode(block1.header.stateRoot) stopNodeViewHolder() val stateDir = new File(s"${nodeViewDir.getAbsolutePath}/state") this.deleteRecursive(stateDir) startNodeViewHolder() getRootHash shouldBe Algos.encode(block1.header.stateRoot) } private val t11 = TestCase("apply payload in incorrect order (excluding extension)") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val genesis = validFullBlock(parentOpt = None, us, bh) val wusAfterGenesis = WrappedUtxoState(us, bh, stateConstants, parameters).applyModifier(genesis) { mod => nodeViewHolderRef ! mod }.get applyBlock(genesis) shouldBe 'success getRootHash shouldBe Algos.encode(wusAfterGenesis.rootHash) val chain2block1 = validFullBlock(Some(genesis), wusAfterGenesis) val wusChain2Block1 = wusAfterGenesis.applyModifier(chain2block1)(mod => nodeViewHolderRef ! mod).get val chain2block2 = validFullBlock(Some(chain2block1), wusChain2Block1) subscribeEvents(classOf[RecoverableFailedModification]) subscribeEvents(classOf[SyntacticallySuccessfulModifier]) nodeViewHolderRef ! LocallyGeneratedModifier(chain2block1.header) expectMsgType[SyntacticallySuccessfulModifier] applyBlock(chain2block2, excludeExt = true) shouldBe 'success getBestHeaderOpt shouldBe Some(chain2block2.header) getBestFullBlockEncodedId shouldBe Some(genesis.header.encodedId) applyPayload(chain2block1, excludeExt = true) shouldBe 'success getBestHeaderEncodedId shouldBe Some(chain2block2.header.encodedId) } private val t12 = TestCase("Do not apply txs with wrong header id") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val block = validFullBlock(None, us, bh) getBestHeaderOpt shouldBe None getHistoryHeight shouldBe ErgoHistory.EmptyHistoryHeight subscribeEvents(classOf[RecoverableFailedModification]) subscribeEvents(classOf[SyntacticallySuccessfulModifier]) subscribeEvents(classOf[SyntacticallyFailedModification]) //sending header nodeViewHolderRef ! LocallyGeneratedModifier(block.header) expectMsgType[SyntacticallySuccessfulModifier] val currentHeight = getHistoryHeight currentHeight shouldBe ErgoHistory.GenesisHeight getHeightOf(block.header.id) shouldBe Some(ErgoHistory.GenesisHeight) val randomId = modifierIdGen.sample.value val recoverableTxs = block.blockTransactions.copy(headerId = randomId) val invalidTxsWithWrongOutputs = { val txs = block.blockTransactions.transactions val tx = txs.head val wrongOutputs = tx.outputCandidates.map(o => new ErgoBoxCandidate(o.value + 10L, o.ergoTree, currentHeight, o.additionalTokens, o.additionalRegisters) ) val wrongTxs = tx.copy(outputCandidates = wrongOutputs) +: txs.tail block.blockTransactions.copy(txs = wrongTxs) } val invalidTxsWithWrongInputs = { val txs = block.blockTransactions.transactions val tx = txs.head val wrongInputs = tx.inputs.map { input => input.copy(boxId = ADKey @@ input.boxId.reverse) } val wrongTxs = tx.copy(inputs = wrongInputs) +: txs.tail block.blockTransactions.copy(txs = wrongTxs) } nodeViewHolderRef ! LocallyGeneratedModifier(recoverableTxs) expectMsgType[RecoverableFailedModification] nodeViewHolderRef ! LocallyGeneratedModifier(invalidTxsWithWrongOutputs) expectMsgType[SyntacticallyFailedModification] nodeViewHolderRef ! LocallyGeneratedModifier(invalidTxsWithWrongInputs) expectMsgType[SyntacticallyFailedModification] nodeViewHolderRef ! LocallyGeneratedModifier(block.blockTransactions) expectMsgType[SyntacticallySuccessfulModifier] } private val t13 = TestCase("Do not apply wrong adProofs") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val block = validFullBlock(None, us, bh) getBestHeaderOpt shouldBe None getHistoryHeight shouldBe ErgoHistory.EmptyHistoryHeight subscribeEvents(classOf[RecoverableFailedModification]) subscribeEvents(classOf[SyntacticallySuccessfulModifier]) subscribeEvents(classOf[SyntacticallyFailedModification]) //sending header nodeViewHolderRef ! LocallyGeneratedModifier(block.header) expectMsgType[SyntacticallySuccessfulModifier] val randomId = modifierIdGen.sample.value val wrongProofsBytes = SerializedAdProof @@ block.adProofs.value.proofBytes.reverse val wrongProofs1 = block.adProofs.map(_.copy(headerId = randomId)) val wrongProofs2 = block.adProofs.map(_.copy(proofBytes = wrongProofsBytes)) nodeViewHolderRef ! LocallyGeneratedModifier(wrongProofs1.value) expectMsgType[RecoverableFailedModification] nodeViewHolderRef ! LocallyGeneratedModifier(wrongProofs2.value) expectMsgType[SyntacticallyFailedModification] nodeViewHolderRef ! LocallyGeneratedModifier(block.adProofs.value) expectMsgType[SyntacticallySuccessfulModifier] } private val t14 = TestCase("do not apply genesis block header if " + "it's not equal to genesisId from config") { fixture => import fixture._ updateConfig(genesisIdConfig(modifierIdGen.sample)) val (us, bh) = createUtxoState(parameters) val block = validFullBlock(None, us, bh) getBestHeaderOpt shouldBe None getHistoryHeight shouldBe ErgoHistory.EmptyHistoryHeight subscribeEvents(classOf[RecoverableFailedModification]) subscribeEvents(classOf[SyntacticallySuccessfulModifier]) subscribeEvents(classOf[SyntacticallyFailedModification]) //sending header nodeViewHolderRef ! LocallyGeneratedModifier(block.header) expectMsgType[SyntacticallyFailedModification] getBestHeaderOpt shouldBe None getHistoryHeight shouldBe ErgoHistory.EmptyHistoryHeight } private val t15 = TestCase("apply genesis block header if it's equal to genesisId from config") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val block = validFullBlock(None, us, bh) updateConfig(genesisIdConfig(Some(block.header.id))) getBestHeaderOpt shouldBe None getHistoryHeight shouldBe ErgoHistory.EmptyHistoryHeight subscribeEvents(classOf[RecoverableFailedModification]) subscribeEvents(classOf[SyntacticallySuccessfulModifier]) subscribeEvents(classOf[SyntacticallyFailedModification]) nodeViewHolderRef ! LocallyGeneratedModifier(block.header) expectMsgType[SyntacticallySuccessfulModifier] getHistoryHeight shouldBe ErgoHistory.GenesisHeight getHeightOf(block.header.id) shouldBe Some(ErgoHistory.GenesisHeight) } private val t16 = TestCase("apply forks that include genesis block") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val wusGenesis = WrappedUtxoState(us, bh, stateConstants, parameters) val chain1block1 = validFullBlock(parentOpt = None, us, bh) val expectedBestFullBlockOpt = if (verifyTransactions) Some(chain1block1) else None applyBlock(chain1block1) shouldBe 'success getBestFullBlockOpt shouldBe expectedBestFullBlockOpt getBestHeaderOpt shouldBe Some(chain1block1.header) val chain2block1 = validFullBlock(parentOpt = None, us, bh) applyBlock(chain2block1) shouldBe 'success getBestFullBlockOpt shouldBe expectedBestFullBlockOpt getBestHeaderOpt shouldBe Some(chain1block1.header) val wusChain2Block1 = wusGenesis.applyModifier(chain2block1)(mod => nodeViewHolderRef ! mod).get val chain2block2 = validFullBlock(Some(chain2block1), wusChain2Block1) chain2block1.header.stateRoot shouldEqual wusChain2Block1.rootHash applyBlock(chain2block2) shouldBe 'success if (verifyTransactions) { getBestFullBlockEncodedId shouldBe Some(chain2block2.header.encodedId) } getBestHeaderOpt shouldBe Some(chain2block2.header) getRootHash shouldBe Algos.encode(chain2block2.header.stateRoot) } private val t17 = TestCase("apply invalid genesis header") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val header = validFullBlock(None, us, bh).header.copy(parentId = bytesToId(Array.fill(32)(9: Byte))) getBestHeaderOpt shouldBe None getHistoryHeight shouldBe ErgoHistory.EmptyHistoryHeight subscribeEvents(classOf[RecoverableFailedModification]) subscribeEvents(classOf[SyntacticallySuccessfulModifier]) subscribeEvents(classOf[SyntacticallyFailedModification]) nodeViewHolderRef ! LocallyGeneratedModifier(header) expectMsgType[SyntacticallyFailedModification] getHistoryHeight shouldBe ErgoHistory.EmptyHistoryHeight getHeightOf(header.id) shouldBe None } private val t18 = TestCase("apply syntactically invalid genesis block") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val validBlock = validFullBlock(parentOpt = None, us, bh) val invalidBlock = validBlock.copy(header = validBlock.header.copy(parentId = bytesToId(Array.fill(32)(9: Byte)))) applyBlock(invalidBlock) shouldBe 'failure getBestFullBlockOpt shouldBe None getBestHeaderOpt shouldBe None } private val t19 = TestCase("apply semantically invalid genesis block") { fixture => import fixture._ val (us, bh) = createUtxoState(parameters) val wusGenesis = WrappedUtxoState(us, bh, stateConstants, parameters) val invalidBlock = generateInvalidFullBlock(None, wusGenesis) if (verifyTransactions) { val initDigest = getCurrentState.rootHash applyBlock(invalidBlock) shouldBe 'success getBestFullBlockOpt shouldBe None getBestHeaderOpt shouldBe None getCurrentState.rootHash shouldEqual initDigest } } val cases: List[TestCase] = List(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) NodeViewTestConfig.allConfigs.foreach { c => cases.foreach { t => property(s"${t.name} - $c") { t.run(parameters, c) } } } val verifyingTxCases: List[TestCase] = List(t10, t11, t12, t13) NodeViewTestConfig.verifyTxConfigs.foreach { c => verifyingTxCases.foreach { t => property(s"${t.name} - $c") { t.run(parameters, c) } } } val genesisIdTestCases = List(t14, t15, t16, t17, t18, t19) def genesisIdConfig(expectedGenesisIdOpt: Option[ModifierId])(protoSettings: ErgoSettings): ErgoSettings = { protoSettings.copy(chainSettings = protoSettings.chainSettings.copy(genesisId = expectedGenesisIdOpt)) } genesisIdTestCases.foreach { t => property(t.name) { t.run(parameters, NodeViewTestConfig(StateType.Digest, verifyTransactions = true, popowBootstrap = true)) } } }
yonzkon/EwokOS
kernel/src/kmessage.c
#include <kmessage.h> #include <string.h> #include <proc.h> #include <mm/kmalloc.h> static int _pkgIDCount = 0; int ksend(int id, int pid, PackageT* pkg) { if(pkg == NULL) { return -1; } ProcessT* toProc = procGet(pid); if(toProc == NULL) { return -1; } KMessageT* msg = kmalloc(sizeof(KMessageT)); if(msg == NULL) { return -1; } uint32_t pkgSize = getPackageSize(pkg); msg->pkg = (PackageT*)kmalloc(pkgSize); if(msg->pkg == NULL) { kmfree(msg); return -1; } if(id < 0) pkg->id = _pkgIDCount++; else pkg->id = id; pkg->pid = _currentProcess->pid; memcpy(msg->pkg, pkg, pkgSize); msg->next = NULL; msg->prev = NULL; if(toProc->messageQueue.head == NULL) { toProc->messageQueue.head = toProc->messageQueue.tail = msg; } else { toProc->messageQueue.tail->next = msg; msg->prev = toProc->messageQueue.tail; toProc->messageQueue.tail = msg; } return pkg->id; } PackageT* krecv(int id) { MessageQueueT* queue = &(_currentProcess->messageQueue); KMessageT* msg = queue->head; while(msg != NULL) { if(id < 0 || id == msg->pkg->id) break; msg = msg->next; } if(msg == NULL) return NULL; uint32_t pkgSize = getPackageSize(msg->pkg); PackageT* ret = (PackageT*)trunkMalloc(&_currentProcess->mallocMan, pkgSize); if(ret == NULL) return NULL; memcpy(ret, msg->pkg, pkgSize); /*free message in queue*/ if(msg->prev != NULL) msg->prev->next = msg->next; else queue->head = msg->next; if(msg->next != NULL) msg->next->prev = msg->prev; else queue->tail = msg->prev; kmfree(msg->pkg); kmfree(msg); return ret; } void clearMessageQueue(MessageQueueT* queue) { KMessageT* msg = queue->head; while(msg != NULL) { KMessageT* fr = msg; msg = msg->next; kmfree(fr->pkg); kmfree(fr); } queue->head = 0; queue->tail = 0; }
hernandito/nzbhydra2-1
other/github-release-plugin/src/main/java/org/nzbhydra/github/mavenreleaseplugin/PrecheckMojo.java
package org.nzbhydra.github.mavenreleaseplugin; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; @SuppressWarnings("unchecked") @Mojo(name = "precheck", requiresOnline = true, //Obviously inheritByDefault = false, aggregator = true //Only call for parent POM ) public class PrecheckMojo extends ReleaseMojo { @Override public void execute() throws MojoExecutionException { getChangelogVersionEntry(); //Throws an exception of not oK executePrechecks(); } }
damavis/damavis-spark
damavis-spark-core/src/test/scala/com/damavis/spark/utils/SparkTestSupport.scala
package com.damavis.spark.utils import scala.util.Try trait SparkTestSupport { def checkExceptionOfType[T <: Throwable](tryResult: Try[_], exClass: Class[T], pattern: String): Unit = { assert(tryResult.isFailure) try { throw tryResult.failed.get } catch { case ex: Throwable => assert(ex.getClass == exClass) assert(ex.getMessage.contains(pattern)) } } }
irhamzh/bri-superteam
src/modules/generalAffair/pengelolaanKendaraan/kendaraan/pajakKendaraan/actions.js
import Service from '../../../../../config/services' import { AlertMessage } from '../../../../../helpers' import { CREATE_PAJAK_KENDARAAN_LOADING, CREATE_PAJAK_KENDARAAN_SUCCESS, CREATE_PAJAK_KENDARAAN_ERROR, UPDATE_PAJAK_KENDARAAN_LOADING, UPDATE_PAJAK_KENDARAAN_SUCCESS, UPDATE_PAJAK_KENDARAAN_ERROR, DELETE_PAJAK_KENDARAAN_LOADING, DELETE_PAJAK_KENDARAAN_SUCCESS, DELETE_PAJAK_KENDARAAN_ERROR, } from './types' export const createGAPajakKendaraan = (formData, refresh) => async (dispatch) => { let ObjError = '' const paramsResponse = {} try { dispatch({ type: CREATE_PAJAK_KENDARAAN_LOADING, isLoading: true }) // Call API const res = await Service.createGAPajakKendaraan(formData) dispatch({ type: CREATE_PAJAK_KENDARAAN_SUCCESS, isLoading: false }) paramsResponse.title = 'Created' paramsResponse.text = res.data.message AlertMessage.success(paramsResponse).then(() => { if (refresh) { refresh() } else { window.location.reload() } }) } catch (err) { ObjError = err.response && err.response.data.message dispatch({ type: CREATE_PAJAK_KENDARAAN_ERROR, payload: ObjError, isLoading: false, }) AlertMessage.error(err) } } export const updateGAPajakKendaraan = (formData, id, refresh) => async (dispatch) => { let ObjError = '' const paramsResponse = {} try { dispatch({ type: UPDATE_PAJAK_KENDARAAN_LOADING, isLoading: true }) // Call API const res = await Service.updateGAPajakKendaraan(formData, id) dispatch({ type: UPDATE_PAJAK_KENDARAAN_SUCCESS, isLoading: false }) paramsResponse.title = 'Success' paramsResponse.text = res.data.message AlertMessage.success(paramsResponse).then(() => { if (refresh) { refresh() } else { window.location.reload() } }) } catch (err) { ObjError = err.response && err.response.data.message dispatch({ type: UPDATE_PAJAK_KENDARAAN_ERROR, payload: ObjError, isLoading: false, }) AlertMessage.error(err) } } export const deleteGAPajakKendaraan = (id, refresh) => async (dispatch) => { let ObjError = '' const paramsResponse = {} try { dispatch({ type: DELETE_PAJAK_KENDARAAN_LOADING, isLoading: true }) // Call API const res = await Service.deleteGAPajakKendaraan(id) dispatch({ type: DELETE_PAJAK_KENDARAAN_SUCCESS, isLoading: false }) paramsResponse.title = 'Success' paramsResponse.text = res.data.message AlertMessage.success(paramsResponse).then(() => { if (refresh) { refresh() } else { window.location.reload() } }) } catch (err) { ObjError = err.response && err.response.data.message dispatch({ type: DELETE_PAJAK_KENDARAAN_ERROR, payload: ObjError, isLoading: false, }) AlertMessage.error(err) } }
ncbray/pystream
bin/util/application/errorhandler.py
# Copyright 2011 <NAME> # # 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. from . import compilerexceptions from util.debug.blame import traceBlame class ErrorScopeManager(object): __slots__ = 'handler' def __init__(self, handler): self.handler = handler def __enter__(self): self.handler._push() def __exit__(self, type, value, tb): self.handler._pop() class ShowStatusManager(object): __slots__ = 'handler' def __init__(self, handler): self.handler = handler def __enter__(self): pass def __exit__(self, type, value, tb): self.handler.flush() if type is not None: print print "Compilation Aborted -", self.handler.statusString() else: print print "Compilation Successful -", self.handler.statusString() return type is compilerexceptions.CompilerAbort class ErrorHandler(object): def __init__(self): self.stack = [] self.errorCount = 0 self.warningCount = 0 self.defered = True self.buffer = [] self.showBlame = False def blame(self): if self.showBlame: return traceBlame(3, 5) else: return None def error(self, classification, message, trace): blame = self.blame() if self.defered: self.buffer.append((classification, message, trace, blame)) else: self.displayError(classification, message, trace, blame) self.errorCount += 1 def warn(self, classification, message, trace): blame = self.blame() if self.defered: self.buffer.append((classification, message, trace, blame)) else: self.displayError(classification, message, trace, blame) self.warningCount += 1 def displayError(self, classification, message, trace, blame): print print "%s: %s" % (classification, message) for origin in trace: if origin is None: print "<unknown origin>" else: print origin.originString() if blame: print "BLAME" for line in blame: print line def statusString(self): return "%d errors, %d warnings" % (self.errorCount, self.warningCount) def finalize(self): if self.errorCount > 0: raise compilerexceptions.CompilerAbort def flush(self): for cls, msg, trace, blame in self.buffer: self.displayError(cls, msg, trace, blame) self.buffer = [] def _push(self): self.stack.append((self.errorCount, self.warningCount)) self.errorCount = 0 self.warningCount = 0 def _pop(self): errorCount, warningCount = self.stack.pop() self.errorCount += errorCount self.warningCount += warningCount def scope(self): return ErrorScopeManager(self) def statusManager(self): return ShowStatusManager(self)
zzh8829/CompetitiveProgramming
USACO/2013-2014/Jan/Bronze/bteams.cpp
<reponame>zzh8829/CompetitiveProgramming #include <iostream> #include <climits> #include <cstdio> #include <vector> using namespace std; bool bm[12]; int n1,n2,n3,n4; int best = INT_MAX; int a[12]; void combinations(int pos,int k,void (*callback)(),int& nt) { if(k==0) { callback(); return ; } for(int i=pos;i<12-k+1;i++)if(!bm[i]) { nt += a[i]; bm[i]=1; combinations(i+1,k-1,callback,nt); bm[i]=0; nt -= a[i]; } } void combo4() { best = min(best,max(max(max(n1,n2),n3),n4) - min(min(min(n1,n2),n3),n4)); } void combo3() { if(max(max(n1,n2),n3) - min(min(n1,n2),n3) >= best )return; combinations(0,3,combo4,n4); } void combo2() { if(max(n1,n2) - min(n1,n2) >=best ) return; combinations(0,3,combo3,n3); } void combo1() { combinations(0,3,combo2,n2); } int main() { #ifndef LOCAL freopen("bteams.in","r",stdin); freopen("bteams.out","w",stdout); #endif for(int i=0;i!=12;i++) cin >> a[i]; combinations(0,3,combo1,n1); cout << best << endl; return 0; }
ascartabelli/lamb
src/array/getIndex.js
import _toArrayLength from "../privates/_toArrayLength"; import _toNaturalIndex from "../privates/_toNaturalIndex"; /** * Retrieves the element at the given index in an array-like object.<br/> * Like {@link module:lamb.slice|slice} the index can be negative.<br/> * If the index isn't supplied, or if its value isn't an integer within the array-like bounds, * the function will return <code>undefined</code>.<br/> * <code>getIndex</code> will throw an exception when receives <code>null</code> or * <code>undefined</code> in place of an array-like object, but returns <code>undefined</code> * for any other value. * @example * const arr = [1, 2, 3, 4, 5]; * * _.getIndex(arr, 1) // => 2 * _.getIndex(arr, -1) // => 5 * * @memberof module:lamb * @category Array * @see {@link module:lamb.getAt|getAt} * @see {@link module:lamb.head|head} and {@link module:lamb.last|last} for common use cases shortcuts. * @since 0.23.0 * @param {ArrayLike} arrayLike * @param {Number} index * @returns {*} */ function getIndex (arrayLike, index) { var idx = _toNaturalIndex(index, _toArrayLength(arrayLike.length)); return idx === idx ? arrayLike[idx] : void 0; // eslint-disable-line no-self-compare } export default getIndex;
navikt/spsak
saksbehandling/webapp/src/test/java/no/nav/foreldrepenger/web/app/SjekkDtoStrukturTest.java
package no.nav.foreldrepenger.web.app; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import org.assertj.core.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; @RunWith(Parameterized.class) public class SjekkDtoStrukturTest { private static final List<String> SKIPPED = Arrays.asList("class", "kode"); private Class<?> cls; public SjekkDtoStrukturTest(Class<?> cls) { this.cls = cls; } @Test public void skal_ha_riktig_navn_på_properties_i_dto_eller_konfiguret_med_annotations() throws Exception { sjekkJsonProperties(cls); } @org.junit.runners.Parameterized.Parameters public static Collection<Object[]> parameters() throws URISyntaxException { IndexClasses indexClasses; indexClasses = IndexClasses.getIndexFor(IndexClasses.class.getProtectionDomain().getCodeSource().getLocation().toURI()); List<Class<?>> classes = indexClasses.getClasses( ci -> ci.name().toString().endsWith("Dto"), c -> !c.isInterface()); List<Object[]> params = new ArrayList<>(); for (int i = 0; i < classes.size(); i++) { params.add(new Object[] { classes.get(i) }); } return params; } private void sjekkJsonProperties(Class<?> c) throws IntrospectionException { List<Field> fields = Arrays.asList(c.getDeclaredFields()); Set<String> fieldNames = fields.stream() .filter(f -> !f.isSynthetic() && !Modifier.isStatic(f.getModifiers())) .filter(f -> f.getAnnotation(JsonProperty.class) == null) .filter(f -> f.getAnnotation(JsonValue.class) == null) .filter(f -> f.getAnnotation(JsonIgnore.class) == null) .map(f -> f.getName()).collect(Collectors.toSet()); if (!fieldNames.isEmpty()) { for (PropertyDescriptor prop : Introspector.getBeanInfo(c, c.getSuperclass()).getPropertyDescriptors()) { if (prop.getReadMethod() != null) { Method readName = prop.getReadMethod(); String propName = prop.getName(); if (!SKIPPED.contains(propName)) { if (readName.getAnnotation(JsonIgnore.class) == null && readName.getAnnotation(JsonProperty.class) == null) { Assertions.assertThat(propName) .as("Gettere er ikke samstemt med felt i klasse, sørg for matchende bean navn og return type eller bruk @JsonProperty/@JsonIgnore/@JsonValue til å sette navn for json struktur: " + c.getName()) .isIn(fieldNames); } } } if (prop.getWriteMethod() != null) { Method readName = prop.getWriteMethod(); String propName = prop.getName(); if (!SKIPPED.contains(propName)) { if (readName.getAnnotation(JsonIgnore.class) == null && readName.getAnnotation(JsonProperty.class) == null) { Assertions.assertThat(propName) .as("Settere er ikke samstemt med felt i klasse, sørg for matchende bean navn og return type eller bruk @JsonProperty/@JsonIgnore/@JsonValue til å sette navn for json struktur: " + c.getName()) .isIn(fieldNames); } } } } } } }
tipresias/augury
src/augury/ml_estimators/confidence_estimator.py
<gh_stars>1-10 """Model for predicting percent confidence that a team will win.""" from typing import Union from sklearn.pipeline import make_pipeline, Pipeline import pandas as pd import numpy as np from xgboost import XGBClassifier from augury.sklearn.metrics import bits_objective from augury.settings import SEED from .base_ml_estimator import BaseMLEstimator, BASE_ML_PIPELINE BEST_PARAMS = { "pipeline__correlationselector__threshold": 0.04559726786512616, "xgbclassifier__booster": "gbtree", "xgbclassifier__colsample_bylevel": 0.8240329295611285, "xgbclassifier__colsample_bytree": 0.8683759333432803, "xgbclassifier__learning_rate": 0.10367196263253768, "xgbclassifier__max_depth": 8, "xgbclassifier__n_estimators": 136, "xgbclassifier__reg_alpha": 0.0851828929690012, "xgbclassifier__reg_lambda": 0.11896695316349301, "xgbclassifier__subsample": 0.8195668321302003, } PIPELINE = make_pipeline( BASE_ML_PIPELINE, XGBClassifier( random_state=SEED, objective=bits_objective, use_label_encoder=False, verbosity=0, ), ).set_params(**BEST_PARAMS) class ConfidenceEstimator(BaseMLEstimator): """Model for predicting percent confidence that a team will win. Predictions must be in the form of floats between 0 and 1, representing the predicted probability of a given team winning. """ def __init__( self, pipeline: Pipeline = PIPELINE, name: str = "confidence_estimator" ): """Instantiate a ConfidenceEstimator object. Params ------ pipeline: Pipeline of Scikit-learn estimators ending in a regressor or classifier. name: Name of the estimator for reference by Kedro data sets and filenames. """ super().__init__(pipeline=pipeline, name=name) def fit(self, X: pd.DataFrame, y: pd.Series): """Fit estimator to the data.""" # Binary classification (win vs loss) performs significantly better # than multi-class (win, draw, loss), so we'll arbitrarily round draws # down to losses and move on with our lives. y_enc = y.astype(int) self.pipeline.set_params(**{"pipeline__correlationselector__labels": y_enc}) return super().fit(X, y_enc) def predict_proba(self, X: Union[pd.DataFrame, np.ndarray]) -> np.ndarray: """Predict the probability of each class being the correct label.""" return self.pipeline.predict_proba(X) def predict(self, X: Union[pd.DataFrame, np.ndarray]) -> np.ndarray: """Predict the probability of each team winning a given match. The purpose of the ConfidenceEstimator is to predict confidence rather than classify wins and losses like a typical classifier would. """ return self.predict_proba(X)[:, -1]
zhaitianduo/libosmium
include/osmium/osm/entity_bits.hpp
#ifndef OSMIUM_OSM_ENTITY_BITS_HPP #define OSMIUM_OSM_ENTITY_BITS_HPP /* This file is part of Osmium (https://osmcode.org/libosmium). Copyright 2013-2020 <NAME> <<EMAIL>> and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <osmium/osm/item_type.hpp> #include <cassert> #include <type_traits> namespace osmium { /** * @brief Bit field for OSM entity types. */ namespace osm_entity_bits { /** * Describes zero or more OSM entities. * * Usage: * * @code{.cpp} * osmium::osm_entity_bits::type entities = osmium::osm_entity_bits::node | osmium::osm_entity_bits::way; * * entities |= osmium::osm_entity_bits::relation; * * assert(entities & osmium::osm_entity_bits::object); * * assert(! (entities & osmium::osm_entity_bits::changeset)); * @endcode */ enum type : unsigned char { // this should have been an enum class // but now we can't change it any more // without breaking lots of code nothing = 0x00, node = 0x01, way = 0x02, relation = 0x04, nwr = 0x07, ///< node, way, or relation object area = 0x08, nwra = 0x0f, ///< node, way, relation, or area object object = 0x0f, ///< node, way, relation, or area object changeset = 0x10, all = 0x1f ///< object or changeset }; // enum type inline constexpr type operator|(const type lhs, const type rhs) noexcept { return static_cast<type>(static_cast<unsigned char>(lhs) | static_cast<unsigned char>(rhs)); } inline constexpr type operator&(const type lhs, const type rhs) noexcept { return static_cast<type>(static_cast<unsigned char>(lhs) & static_cast<unsigned char>(rhs)); } inline constexpr type operator~(const type value) noexcept { return all & static_cast<type>(~static_cast<unsigned char>(value)); } inline type& operator|=(type& lhs, const type rhs) noexcept { lhs = lhs | rhs; return lhs; } inline type operator&=(type& lhs, const type rhs) noexcept { lhs = lhs & rhs; return lhs; } /** * Get entity_bits from item_type. * * @pre item_type must be undefined, node, way, relation, area, or * changeset. */ inline type from_item_type(osmium::item_type item_type) noexcept { const auto ut = static_cast<std::underlying_type<osmium::item_type>::type>(item_type); assert(ut <= 0x05); if (ut == 0) { return nothing; } return static_cast<osmium::osm_entity_bits::type>(1U << (ut - 1U)); } } // namespace osm_entity_bits } // namespace osmium #endif // OSMIUM_OSM_ENTITY_BITS_HPP
taymoork2/react-widgets
scripts/start/commands/demo.js
const {startPackage} = require('../../utils/package'); module.exports = { command: 'demo <widgetName>', desc: 'Start a widget demo', builder: {}, handler: ({widgetName}) => { let pkgName; if (widgetName.startsWith('widget-')) { if (widgetName.endsWith('-demo')) { pkgName = widgetName; } else { pkgName = `${widgetName}-demo`; } } else if (widgetName.endsWith('-demo')) { pkgName = `widget-${widgetName}`; } else { pkgName = `widget-${widgetName}-demo`; } if (pkgName) { return startPackage(pkgName); } return Promise.reject(new Error(false)); } };
ahmadabudames/data-structures-and-algorithms
python/code_challenges/linked_list/linked_list/linked_list.py
<filename>python/code_challenges/linked_list/linked_list/linked_list.py class Node: def __init__(self, value): self.value = value self.next = None class LinkedList: def __init__(self): self.head = None def insert(self, value='null'): try: node = Node(value) if not self.head: self.head = node else: current = self.head self.head= node self.head.next=current except Exception as e: raise Exception(f"Something's Going Wrong : {e}") def includes(self,num): try: i=False current = self.head while current: if current.value==num: i=True break current=current.next return i except Exception as e: raise Exception(f"Something's Going Wrong : {e}") def __str__(self): output = "" current = self.head while current: value = current.value if current.next is None: output += f"({value}) -> none" break output = output + f"({value}) -> " current=current.next return output def append(self, value): new_node = Node(value) if self.head is None: self.head = new_node return last = self.head while (last.next): last = last.next last.next = new_node def insertBefore(self ,value, new_data): current = self.head if current.value==value: self.insert(new_data) else: while current: if current.next.value==value : nextvalue=current.next current.next=Node(new_data) current.next.next=nextvalue break current=current.next def insertAfter(self, value, new_data): current = self.head while current: if current.value==value : nextvalue=current.next current.next=Node(new_data) current.next.next=nextvalue break current=current.next def NthFromLast(self, k): if k<0: print("no negative input") list_of_value=[] current = self.head while current: list_of_value+=[current.value] current = current.next if k == 0: print(list_of_value[-1]) else: if k > len(list_of_value): print("exception") print(list_of_value[(k*-1)-1]) if __name__ == "__main__": linked_list = LinkedList() list1=linked_list list2=linked_list print(list1.__str__()) print(list1.__str__())
arubdesu/zentral
zentral/contrib/santa/migrations/0002_collectedapplication_bundle_path.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-05-29 18:42 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('santa', '0001_initial'), ] operations = [ migrations.AddField( model_name='collectedapplication', name='bundle_path', field=models.TextField(blank=True, null=True), ), ]
sunsiyue/ACMEDB_MAIN
java/testing/org/apache/derbyTesting/functionTests/tests/lang/PredicatePushdownTest.java
package org.apache.derbyTesting.functionTests.tests.lang; import java.sql.CallableStatement; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.Statement; import java.util.Arrays; import java.util.Properties; import junit.framework.Test; import org.apache.derbyTesting.junit.BaseJDBCTestCase; import org.apache.derbyTesting.junit.BaseTestCase; import org.apache.derbyTesting.junit.BaseTestSuite; import org.apache.derbyTesting.junit.CleanDatabaseTestSetup; import org.apache.derbyTesting.junit.JDBC; import org.apache.derbyTesting.junit.RuntimeStatisticsParser; import org.apache.derbyTesting.junit.SQLUtilities; import org.apache.derbyTesting.junit.SystemPropertyTestSetup; import org.apache.derbyTesting.junit.TestConfiguration; /* Derby - Class org.apache.derbyTesting.functionTests.tests.lang.PredicatePushdownTest 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. */ public final class PredicatePushdownTest extends BaseJDBCTestCase { /** * Public constructor required for running test as standalone JUnit. */ public PredicatePushdownTest(String name) { super(name); } public static Test suite() { Properties systemProperties = new Properties(); systemProperties.setProperty("derby.optimizer.noTimeout","true"); BaseTestSuite suite = new BaseTestSuite("predicatePushdown Test"); suite.addTest(new SystemPropertyTestSetup(new CleanDatabaseTestSetup(TestConfiguration .embeddedSuite(PredicatePushdownTest.class)),systemProperties)); return suite; } public void test_predicatePushdown() throws Exception { ResultSet rs = null; ResultSetMetaData rsmd; PreparedStatement pSt; CallableStatement cSt; Statement st = createStatement(); String[][] expRS; String[] expColNames; // 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. Test predicate // pushdown into expressions in a FROM list. As of // DERBY-805 this test only looks at pushing predicates // into UNION operators, but this test will likely grow as // additional predicate pushdown functionality is added to // Derby. Note that "noTimeout" is set to true for this // test because we print out a lot of query plans and we // don't want the plans to differ from one machine to // another (which can happen if some machines are faster // than others when noTimeout is false). Create the basic // tables/views for DERBY-805 testing. st .executeUpdate("CREATE TABLE \"APP\".\"T1\" (\"I\" INTEGER, \"J\" INTEGER)"); st.executeUpdate(" insert into t1 values (1, 2), (2, 4), (3, 6), (4, " + "8), (5, 10)"); st .executeUpdate(" CREATE TABLE \"APP\".\"T2\" (\"I\" INTEGER, \"J\" INTEGER)"); st.executeUpdate(" insert into t2 values (1, 2), (2, -4), (3, 6), (4, " + "-8), (5, 10)"); st .executeUpdate(" CREATE TABLE \"APP\".\"T3\" (\"A\" INTEGER, \"B\" INTEGER)"); st.executeUpdate(" insert into T3 values (1,1), (2,2), (3,3), (4,4), " + "(6, 24), (7, 28), (8, 32), (9, 36), (10, 40)"); st.executeUpdate(" insert into t3 (a) values 11, 12, 13, 14, 15, 16, " + "17, 18, 19, 20"); assertUpdateCount(st, 10, " update t3 set b = 2 * a where a > 10"); st .executeUpdate(" CREATE TABLE \"APP\".\"T4\" (\"A\" INTEGER, \"B\" INTEGER)"); st.executeUpdate(" insert into t4 values (3, 12), (4, 16)"); st.executeUpdate(" insert into t4 (a) values 11, 12, 13, 14, 15, 16, " + "17, 18, 19, 20"); assertUpdateCount(st, 10, " update t4 set b = 2 * a where a > 10"); st.executeUpdate(" create view V1 as select i, j from T1 union select " + "i,j from T2"); st.executeUpdate(" create view V2 as select a,b from T3 union select " + "a,b from T4"); // Run compression on the test tables to try to get a // consistent set of row count stats for the tables // (DERBY-1902, DERBY-3479). cSt = prepareCall("call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T1', 1)"); assertUpdateCount(cSt, 0); cSt = prepareCall(" call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T2', 1)"); assertUpdateCount(cSt, 0); cSt = prepareCall(" call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T3', 1)"); assertUpdateCount(cSt, 0); cSt = prepareCall(" call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T4', 1)"); assertUpdateCount(cSt, 0); // Now that we have the basic tables and views for the // tests, run some quick queries to make sure that the // optimizer will still consider NOT pushing the predicates // and will instead do a hash join. The optimizer should // choose do this so long as doing so is the best choice, // which usually means that we don't have indexes on the // tables or else we have relatively small tables. Start // by checking the case of small (~20 row) tables. We // should see hash joins and table scans in ALL of these // cases. st.execute("CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)"); rs = st.executeQuery("select * from V1, V2 where V1.j = V2.b"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "2", "2" }, { "2", "4", "4", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); RuntimeStatisticsParser p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan", p.usedTableScan()); assertTrue("Expected hash join", p.usedHashJoin()); rs = st.executeQuery("select * from V2, V1 where V1.j = V2.b"); expColNames = new String[] { "A", "B", "I", "J" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "2", "1", "2" }, { "4", "4", "2", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan", p.usedTableScan()); assertTrue("Expected hash join", p.usedHashJoin()); // Nested unions. rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2 union select * from t1 union select * from t2 ) " + "x1, (select * from t3 union select * from t4 union " + "select * from t4 ) x2 where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan", p.usedTableScan()); assertTrue("Expected hash join", p.usedHashJoin()); rs = st .executeQuery("select * from (select * from t1 union all select * " + "from t2) x1, (select * from t3 union select * from " + "t4) x2 where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" }, { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan", p.usedTableScan()); assertTrue("Expected hash join", p.usedHashJoin()); rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2) x1, (select * from t3 union all select * from " + "t4) x2 where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan", p.usedTableScan()); assertTrue("Expected hash join", p.usedHashJoin()); rs = st .executeQuery("select * from (select * from t1 union all select * " + "from t2) x1, (select * from t3 union all select * " + "from t4) x2 where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" }, { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan", p.usedTableScan()); assertTrue("Expected hash join", p.usedHashJoin()); // Next set of queries tests pushdown of predicates whose // column references do not reference base tables--ex. they // reference literals, aggregates, or subqueries. We don't // check the query plans here, we're just checking to make // sure pushdown doesn't cause problems during compilation/ // execution. In the case of regressions, errors that // might show up here include compile-time NPEs, // execution-time NPEs, errors saying no predicate was // found for a hash join, and/or type comparison errors // caused by incorrect column numbers for scoped predicates. st.executeUpdate("create table tc (c1 char, c2 char, c3 char, c int)"); st.executeUpdate(" create view vz (z1, z2, z3, z4) as select distinct " + "xx1.c1, xx1.c2, 'bokibob' bb, xx1.c from (select " + "c1, c, c2, c3 from tc) xx1 union select " + "'i','j','j',i from t2"); st.executeUpdate(" create view vz2 (z1, z2, z3, z4) as select " + "distinct xx1.c1, xx1.c2, 'bokibob' bb, xx1.c from " + "(select c1, c, c2, c3 from tc) xx1"); st.executeUpdate(" create view vz3 (z1, z2, z3, z4) as select " + "distinct xx1.c1, xx1.c2, 'bokibob' bb, xx1.c from " + "(select c1, c, c2, 28 from tc) xx1 union select " + "'i','j','j',i from t2"); st.executeUpdate(" create view vz4 (z1, z2, z3, z4) as select " + "distinct xx1.c1, xx1.c2, 'bokibob' bb, xx1.c from " + "(select c1, c, c2, 28 from tc) xx1 union select " + "'i','j','j',i from t2 union select c1, c2, c3, c from tc"); // For DERBY-1866. The problem for DERBY-1866 was that, // when pushing predicates to subqueries beneath UNIONs, // the predicates were always being pushed to the *first* // table in the FROM list, regardless of whether or not // that was actually the correct table. For the test query // that uses this view (see below) the predicate is // supposed to be pushed to TC, so in order to repro the // DERBY-1866 failure we want to make sure that TC is *not* // the first table in the FROM list. Thus we use the // optimizer override to fix the join order so that TC is // the second table. st.executeUpdate("create view vz5a (z1, z2, z3, z4) as select " + "distinct xx1.c1, xx1.c2, 'bokibob' bb, xx1.c from " + "(select c1, c2, c3, c from " + "--DERBY-PROPERTIES joinOrder=FIXED \n" + "t2, tc where tc.c = t2.i) xx1 union " + "select 'i','j','j',i from t2"); // Same as above but target FromTable in subquery is // itself another subquery. st.executeUpdate("create view vz5b (z1, z2, z3, z4) as select " + "distinct xx1.c1, xx1.c2, 'bokibob' bb, xx1.c from " + "(select c1, c2, c3, c from --DERBY-PROPERTIES " + "joinOrder=FIXED \n t2, (select distinct * from tc) tc " + "where tc.c = t2.i) xx1 union select 'i','j','j',i from t2"); // Same as above but target FromTable in subquery is // another union node between two subqueries. st.executeUpdate("create view vz5c (z1, z2, z3, z4) as select " + "distinct xx1.c1, xx1.c2, 'bokibob' bb, xx1.c from " + "(select c1, c2, c3, c from --DERBY-PROPERTIES " + "joinOrder=FIXED \n t2, (select * from tc union select " + "* from tc) tc where tc.c = t2.i) xx1 union select " + "'i','j','j',i from t2"); // Same as above but target FromTable in subquery is // another full query with unions and subqueries. st.executeUpdate("create view vz5d (z1, z2, z3, z4) as select " + "distinct xx1.c1, xx1.c2, 'bokibob' bb, xx1.c from " + "(select c1, c2, c3, c from --DERBY-PROPERTIES " + "joinOrder=FIXED \n t2, (select * from tc union select " + "z1 c1, z2 c2, z3 c3, z4 c from vz5b) tc where tc.c " + "= t2.i) xx1 union select 'i','j','j',i from t2"); // Both sides of predicate reference aggregates. rs = st .executeQuery("select x1.c1 from (select count(*) from t1 union " + "select count(*) from t2) x1 (c1), (select count(*) " + "from t3 union select count(*) from t4) x2 (c2) " + "where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Both sides of predicate reference aggregates, and // predicate is pushed through to non-flattenable nested // subquery. rs = st.executeQuery("select x1.c1 from (select count(*) from (select " + "distinct j from t1) xx1 union select count(*) from " + "t2 ) x1 (c1), (select count(*) from t3 union select " + "count(*) from t4) x2 (c2) where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Both sides of predicate reference aggregates, and // predicate is pushed through to non-flattenable nested // subquery that is in turn part of a nested union. rs = st.executeQuery("select x1.c1 from (select count(*) from (select " + "distinct j from t1 union select distinct j from t2) " + "xx1 union select count(*) from t2 ) x1 (c1), " + "(select count(*) from t3 union select count(*) from " + "t4) x2 (c2) where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Left side of predicate references base column, right // side references aggregate; predicate is pushed through // to non- flattenable nested subquery. rs = st.executeQuery("select x1.c1 from (select xx1.c from (select " + "distinct c, c1 from tc) xx1 union select count(*) " + "from t2 ) x1 (c1), (select count(*) from t3 union " + "select count(*) from t4) x2 (c2) where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Left side of predicate references base column, right // side references aggregate; predicate is pushed through // to non- flattenable nested subquery. rs = st .executeQuery("select x1.c1 from (select xx1.c from (select c, c1 " + "from tc) xx1 union select count(*) from t2 ) x1 " + "(c1), (select count(*) from t3 union select " + "count(*) from t4) x2 (c2) where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Left side of predicate references base column, right // side side references aggregate; predicate is pushed // through to a subquery in a nested union that has // literals in its result column. rs = st .executeQuery("select x1.z1 from (select xx1.c1, xx1.c2, xx1.c, " + "xx1.c3 from (select c1, c2, c3, c from tc) xx1 " + "union select 'i','j',j,'i' from t2 ) x1 (z1, z2, " + "z3, z4), (select count(*) from t3 union select " + "count (*) from t4) x2 (c2) where x1.z3 = x2.c2"); expColNames = new String[] { "Z1" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Both sides of predicate reference base columns; // predicate predicate is pushed through to a subquery in a // nested union that has literals in its result column. rs = st .executeQuery("select x1.z1 from (select xx1.c1, xx1.c2, xx1.c, " + "xx1.c3 from (select c1, c2, c3, c from tc) xx1 " + "union select 'i','j',j,'i' from t2 ) x1 (z1, z2, " + "z3, z4), (select a from t3 union select count (*) " + "from t4) x2 (c2) where x1.z3 = x2.c2"); expColNames = new String[] { "Z1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "i" }, { "i" }, { "i" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same as previous query, but with aggregate/base column // in x2 switched. rs = st .executeQuery("select x1.z1 from (select xx1.c1, xx1.c2, xx1.c, " + "xx1.c3 from (select c1, c2, c3, c from tc) xx1 " + "union select 'i','j',j,'i' from t2 ) x1 (z1, z2, " + "z3, z4), (select count(*) from t3 union select a " + "from t4) x2 (c2) where x1.z3 = x2.c2"); expColNames = new String[] { "Z1" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Left side references aggregate, right side references // base column; predicate is pushed to non-flattenable // subquery that is part of a nested union for which one // child references a base column and the other references // an aggregate. rs = st.executeQuery("select x1.c1 from (select count(*) from (select " + "distinct j from t1) xx1 union select count(*) from " + "t2 ) x1 (c1), (select a from t3 union select a from " + "t4) x2 (c2) where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Same as previous query, but both children of inner-most // union reference base columns. rs = st.executeQuery("select x1.c1 from (select count(*) from (select " + "distinct j from t1) xx1 union select i from t2 ) x1 " + "(c1), (select a from t3 union select a from t4) x2 " + "(c2) where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1" }, { "2" }, { "3" }, { "4" } }; JDBC.assertFullResultSet(rs, expRS, true); // Left side references aggregate, right side references // base column; predicate is pushed to non-flattenable // subquery that is part of a nested union for which one // child references a base column and the other references // an aggregate. rs = st.executeQuery("select x1.c1 from (select count(*) from (select " + "distinct j from t1) xx1 union select count(*) from " + "t2 ) x1 (c1), (select i from t2 union select i from " + "t1) x2 (c2) where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "5" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same as previous query, but one child of x2 references // a literal. rs = st.executeQuery("select x1.c1 from (select count(*) from (select " + "distinct j from t1) xx1 union select count(*) from " + "t2 ) x1 (c1), (select 1 from t2 union select i from " + "t1) x2 (c2) where x1.c1 = x2.c2"); expColNames = new String[] { "C1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "5" } }; JDBC.assertFullResultSet(rs, expRS, true); // Left side of predicate references a base column that is // deeply nested inside a subquery, a union, and a view, // the latter of which itself has a union between two // nested subqueries (whew). And finally, the position of // the base column w.r.t the outer query (x1) is different // than it is with respect to inner view (vz). rs = st .executeQuery("select x1.z4 from (select z1, z4, z3 from vz union " + "select '1', 4, '3' from t1 ) x1 (z1, z4, z3), " + "(select distinct j from t2 union select j from t1) " + "x2 (c2) where x1.z4 = x2.c2"); expColNames = new String[] { "Z4" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "4" }, { "2" }, { "4" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same as above but with an expression ("i+1") instead of // a numeric literal. rs = st .executeQuery("select x1.z4, x2.c2 from (select z1, z4, z3 from vz " + "union select '1', i+1, '3' from t1 ) x1 (z1, z4, " + "z3), (select distinct j from t2 union select j from " + "t1) x2 (c2) where x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "2" }, { "4", "4" }, { "6", "6" }, { "2", "2" }, { "4", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same as previous query but with a different nested view // (vz2) that is missing the nested union found in vz. rs = st .executeQuery("select x1.z4 from (select z1, z4, z3 from vz2 union " + "select '1', 4, '3' from t1 ) x1 (z1, z4, z3), " + "(select distinct j from t2 union select j from t1) " + "x2 (c2) where x1.z4 = x2.c2"); expColNames = new String[] { "Z4" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "4" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same as previous query but with a different nested view // (vz4) that has double-nested unions in it. This is a // test case for DERBY-1777. rs = st .executeQuery("select x1.z4, x2.c2 from (select z1, z4, z3 from " + "vz4 union select '1', i+1, '3' from t1 ) x1 (z1, " + "z4, z3), (select distinct j from t2 union select j " + "from t1) x2 (c2) where x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "2" }, { "4", "4" }, { "6", "6" }, { "2", "2" }, { "4", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); // Push outer where predicate down into a UNION having a a // Select child with more than one table in its FROM list. // The predicate should be pushed to the correct table in // the Select's FROM list. Prior to the fix for DERBY-1866 // the predicate was always being pushed to the *first* // table, regardless of whether or not that was actually // the correct table. Thus the predicate "t1.i = vz5.z4" // was getting pushed to table T2 even though it doesn't // apply there. The result was an ASSERT failure in sane // mode and an IndexOutOfBounds exception in insane mode. // NOTE: Use of NESTEDLOOP join strategy ensures the // predicate will be pushed (otherwise optimizer might // choose to do a hash join and we wouldn't be testing what // we want to test). rs = st .executeQuery("select t1.i, vz5a.* from t1 left outer join vz5a " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on t1.i = vz5a.z4"); expColNames = new String[] { "I", "Z1", "Z2", "Z3", "Z4" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "i", "j", "j", "1" }, { "2", "i", "j", "j", "2" }, { "3", "i", "j", "j", "3" }, { "4", "i", "j", "j", "4" }, { "5", "i", "j", "j", "5" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same query as above, but without the optimizer // override. In this case there was another error where // optimizer state involving the "joinOrder" override (see // the definition of vz5a) was not properly reset, which // could lead to an infinite loop. This problem was fixed // as part of DERBY-1866, as well. rs = st .executeQuery("select t1.i, vz5a.* from t1 left outer join vz5a on " + "t1.i = vz5a.z4"); expColNames = new String[] { "I", "Z1", "Z2", "Z3", "Z4" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "i", "j", "j", "1" }, { "2", "i", "j", "j", "2" }, { "3", "i", "j", "j", "3" }, { "4", "i", "j", "j", "4" }, { "5", "i", "j", "j", "5" } }; JDBC.assertFullResultSet(rs, expRS, true); // More tests for DERBY-1866 using more complicated views. rs = st .executeQuery("select t1.i, vz5b.* from t1 left outer join vz5b " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on t1.i = vz5b.z4"); expColNames = new String[] { "I", "Z1", "Z2", "Z3", "Z4" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "i", "j", "j", "1" }, { "2", "i", "j", "j", "2" }, { "3", "i", "j", "j", "3" }, { "4", "i", "j", "j", "4" }, { "5", "i", "j", "j", "5" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select t1.i, vz5c.* from t1 left outer join vz5c " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on t1.i = vz5c.z4"); expColNames = new String[] { "I", "Z1", "Z2", "Z3", "Z4" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "i", "j", "j", "1" }, { "2", "i", "j", "j", "2" }, { "3", "i", "j", "j", "3" }, { "4", "i", "j", "j", "4" }, { "5", "i", "j", "j", "5" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select t1.i, vz5d.* from t1 left outer join vz5d " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on t1.i = vz5d.z4"); expColNames = new String[] { "I", "Z1", "Z2", "Z3", "Z4" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "i", "j", "bokibob", "1" }, { "1", "i", "j", "j", "1" }, { "2", "i", "j", "bokibob", "2" }, { "2", "i", "j", "j", "2" }, { "3", "i", "j", "bokibob", "3" }, { "3", "i", "j", "j", "3" }, { "4", "i", "j", "bokibob", "4" }, { "4", "i", "j", "j", "4" }, { "5", "i", "j", "bokibob", "5" }, { "5", "i", "j", "j", "5" } }; JDBC.assertFullResultSet(rs, expRS, true); // Queries with Select->Union->Select chains having // differently- ordered result column lists with some // non-column reference expressions. In all of these // queries we specify LEFT join and force NESTEDLOOP in // order to coerce the optimizer to push predicates to a // specific subquery. We do this to ensure that we test // predicate pushdown during compilation AND during // execution. It's the execution-time testing that is // particular important for verifying DERBY-1633 // functionality. Push predicate to union whose left child // has a Select within a Select, both of which have the // same result column ordering. rs = st .executeQuery("select x1.z4, x2.c2 from (select z1, z4, z3 from vz " + "union select '1', i+1, '3' from t1 ) x1 (z1, z4, " + "z3) left join (select distinct i,j from (select " + "distinct i,j from t2) x3 union select i, j from t1 " + ") x2 (c1, c2) --DERBY-PROPERTIES " + "joinStrategy=NESTEDLOOP \n on x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "2" }, { "3", null }, { "4", "4" }, { "5", null }, { "6", "6" }, { "1", null }, { "2", "2" }, { "3", null }, { "4", "4" }, { "5", null } }; JDBC.assertFullResultSet(rs, expRS, true); // Push predicate to union whose left child has a Select // within a Select, where the result column lists for the // two Selects are different ("i,j" vs "j,i"). rs = st .executeQuery("select x1.z4, x2.c2 from (select z1, z4, z3 from vz " + "union select '1', i+1, '3' from t1 ) x1 (z1, z4, " + "z3) left join (select distinct i,j from (select " + "distinct j,i from t2) x3 union select i, j from t1 " + ") x2 (c1, c2) --DERBY-PROPERTIES " + "joinStrategy=NESTEDLOOP \n on x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "2" }, { "3", null }, { "4", "4" }, { "5", null }, { "6", "6" }, { "1", null }, { "2", "2" }, { "3", null }, { "4", "4" }, { "5", null } }; JDBC.assertFullResultSet(rs, expRS, true); // Push predicate to union whose left child is itself a // nested subquery (through use of the view "vz") and whose // right child has an expression in its result column list. rs = st .executeQuery("select x1.z4, x2.c2 from (select distinct i,j from " + "(select distinct j,i from t2) x3 union select i, j " + "from t1) x2 (c1, c2) left join (select z1, z4, z3 " + "from vz union select '1', i+1, '3' from t1 ) x1 " + "(z1, z4, z3) --DERBY-PROPERTIES " + "joinStrategy=NESTEDLOOP \n on x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "2" }, { "2", "2" }, { null, "-4" }, { "4", "4" }, { "4", "4" }, { "6", "6" }, { null, "-8" }, { null, "8" }, { null, "10" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same as previous but with a different expression. rs = st .executeQuery("select x1.z4, x2.c2 from (select distinct i,j from " + "(select distinct j,i from t2) x3 union select i, j " + "from t1) x2 (c1, c2) left join (select z1, z4, z3 " + "from vz union select '1', sin(i), '3' from t1 ) x1 " + "(z1, z4, z3) --DERBY-PROPERTIES " + "joinStrategy=NESTEDLOOP \n on x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2.0", "2" }, { null, "-4" }, { "4.0", "4" }, { null, "6" }, { null, "-8" }, { null, "8" }, { null, "10" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same as previous but expression replaced with a regular // column reference. rs = st .executeQuery("select x1.z4, x2.c2 from (select distinct i,j from " + "(select distinct j,i from t2) x3 union select i, j " + "from t1) x2 (c1, c2) left join (select z1, z4, z3 " + "from vz union select '1', i, '3' from t1 ) x1 (z1, " + "z4, z3) --DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n" + "on x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "2" }, { "2", "2" }, { null, "-4" }, { "4", "4" }, { "4", "4" }, { null, "6" }, { null, "-8" }, { null, "8" }, { null, "10" } }; JDBC.assertFullResultSet(rs, expRS, true); // Same as previous but with a different expression and a // different subquery (this time using view "vz3"). rs = st .executeQuery("select x1.z4, x2.c2 from (select distinct i,j from " + "(select distinct j,i from t2) x3 union select i, j " + "from t1) x2 (c1, c2) left join (select z1, z4, z3 " + "from vz3 union select '1', sin(i), '3' from t1 ) x1 " + "(z1, z4, z3) --DERBY-PROPERTIES " + "joinStrategy=NESTEDLOOP \n on x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2.0", "2" }, { null, "-4" }, { "4.0", "4" }, { null, "6" }, { null, "-8" }, { null, "8" }, { null, "10" } }; JDBC.assertFullResultSet(rs, expRS, true); // Push predicate to chain of unions whose left-most child // is itself a nested subquery (through use of the view // "vz") and in which the other unions have expressions in // their result column lists. rs = st .executeQuery("select x1.z4, x2.c2 from (select distinct i,j from " + "(select distinct j,i from t2) x3 union select i, j " + "from t1) x2 (c1, c2) left join (select z1, z4, z3 " + "from vz union select '1', sin(i), '3' from t1 union " + "select '1', 14, '3' from t1 ) x1 (z1, z4, z3) " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2.0", "2" }, { null, "-4" }, { "4.0", "4" }, { null, "6" }, { null, "-8" }, { null, "8" }, { null, "10" } }; JDBC.assertFullResultSet(rs, expRS, true); // Push predicate to chain of unions whose right-most // child is itself a nested subquery (through use of the // view "vz") and in which the other unions have // expressions in their result column lists. rs = st .executeQuery("select x1.z4, x2.c2 from (select distinct i,j from " + "(select distinct j,i from t2) x3 union select i, j " + "from t1) x2 (c1, c2) left join (select '1', sin(i), " + "'3' from t1 union select '1', 14, '3' from t1 union " + "select z1, z4, z3 from vz ) x1 (z1, z4, z3) " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on x1.z4 = x2.c2"); expColNames = new String[] { "Z4", "C2" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2.0", "2" }, { null, "-4" }, { "4.0", "4" }, { null, "6" }, { null, "-8" }, { null, "8" }, { null, "10" } }; JDBC.assertFullResultSet(rs, expRS, true); // Cleanup from this set of tests. st.executeUpdate("drop view vz"); st.executeUpdate(" drop view vz2"); st.executeUpdate(" drop view vz3"); st.executeUpdate(" drop view vz4"); st.executeUpdate(" drop view vz5a"); st.executeUpdate(" drop view vz5d"); st.executeUpdate(" drop view vz5b"); st.executeUpdate(" drop view vz5c"); st.executeUpdate(" drop table tc"); // Now bump up the size of tables T3 and T4 to the point // where use of indexes will cause optimizer to choose // nested loop join (and push predicates) instead of hash // join. The following insertions put roughly 50,000 rows // into T3 and into T4. These numbers are somewhat // arbitrary, but please note that reducing the number of // rows in these two tables could cause the optimizer to // choose to skip pushing and instead use a hash join for // some of the test queries. That's not 'wrong' per se, // but it's not what we want to test here... getConnection().setAutoCommit(false); st.executeUpdate(" insert into t3 (a) values 21, 22, 23, 24, 25, 26, " + "27, 28, 29, 30"); st.executeUpdate(" insert into t3 (a) values 31, 32, 33, 34, 35, 36, " + "37, 38, 39, 40"); st.executeUpdate(" insert into t3 (a) values 41, 42, 43, 44, 45, 46, " + "47, 48, 49, 50"); st.executeUpdate(" insert into t3 (a) values 51, 52, 53, 54, 55, 56, " + "57, 58, 59, 60"); st.executeUpdate(" insert into t3 (a) values 61, 62, 63, 64, 65, 66, " + "67, 68, 69, 70"); st.executeUpdate(" insert into t3 (a) values 71, 72, 73, 74, 75, 76, " + "77, 78, 79, 80"); st.executeUpdate(" insert into t3 (a) values 81, 82, 83, 84, 85, 86, " + "87, 88, 89, 90"); st.executeUpdate(" insert into t3 (a) values 91, 92, 93, 94, 95, 96, " + "97, 98, 99, 100"); assertUpdateCount(st, 80, " update t3 set b = 2 * a where a > 20"); st .executeUpdate(" insert into t4 (a, b) (select a,b from t3 where a > 20)"); st .executeUpdate(" insert into t4 (a, b) (select a,b from t3 where a > 20)"); st .executeUpdate(" insert into t3 (a, b) (select a,b from t4 where a > 20)"); st .executeUpdate(" insert into t4 (a, b) (select a,b from t3 where a > 20)"); st .executeUpdate(" insert into t3 (a, b) (select a,b from t4 where a > 20)"); st .executeUpdate(" insert into t4 (a, b) (select a,b from t3 where a > 20)"); st .executeUpdate(" insert into t3 (a, b) (select a,b from t4 where a > 20)"); st .executeUpdate(" insert into t4 (a, b) (select a,b from t3 where a > 20)"); st .executeUpdate(" insert into t3 (a, b) (select a,b from t4 where a > 20)"); st .executeUpdate(" insert into t4 (a, b) (select a,b from t3 where a > 20)"); st .executeUpdate(" insert into t3 (a, b) (select a,b from t4 where a > 20)"); st .executeUpdate(" insert into t4 (a, b) (select a,b from t3 where a > 20)"); st .executeUpdate(" insert into t3 (a, b) (select a,b from t4 where a > 20)"); st .executeUpdate(" insert into t4 (a, b) (select a,b from t3 where a > 20)"); st .executeUpdate(" insert into t3 (a, b) (select a,b from t4 where a > 60)"); commit(); getConnection().setAutoCommit(true); // See exactly how many rows we inserted, for sanity. rs = st.executeQuery("select count(*) from t3"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "54579" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select count(*) from t4"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "48812" } }; JDBC.assertFullResultSet(rs, expRS, true); // At this point we create the indexes. Note that we // intentionally create the indexes AFTER loading the data, // in order ensure that the index statistics are correct. // We need the stats to be correct in order for the // optimizer to choose the correct plan (i.e. to push the // join predicates where possible). st .executeUpdate("CREATE INDEX \"APP\".\"T3_IX1\" ON \"APP\".\"T3\" (\"A\")"); st .executeUpdate(" CREATE INDEX \"APP\".\"T3_IX2\" ON \"APP\".\"T3\" (\"B\")"); st .executeUpdate(" CREATE INDEX \"APP\".\"T4_IX1\" ON \"APP\".\"T4\" (\"A\")"); st .executeUpdate(" CREATE INDEX \"APP\".\"T4_IX2\" ON \"APP\".\"T4\" (\"B\")"); // Create the rest of objects used in this test. st .executeUpdate("CREATE TABLE \"APP\".\"T5\" (\"I\" INTEGER, \"J\" INTEGER)"); st.executeUpdate(" insert into t5 values (5, 10)"); st .executeUpdate(" CREATE TABLE \"APP\".\"T6\" (\"P\" INTEGER, \"Q\" INTEGER)"); st.executeUpdate(" insert into t5 values (2, 4), (4, 8)"); st.executeUpdate(" CREATE TABLE \"APP\".\"XX1\" (\"II\" INTEGER NOT " + "NULL, \"JJ\" CHAR(10), \"MM\" INTEGER, \"OO\" " + "DOUBLE, \"KK\" BIGINT)"); st.executeUpdate(" CREATE TABLE \"APP\".\"YY1\" (\"II\" INTEGER NOT " + "NULL, \"JJ\" CHAR(10), \"AA\" INTEGER, \"OO\" " + "DOUBLE, \"KK\" BIGINT)"); st.executeUpdate(" ALTER TABLE \"APP\".\"YY1\" ADD CONSTRAINT " + "\"PK_YY1\" PRIMARY KEY (\"II\")"); st.executeUpdate(" ALTER TABLE \"APP\".\"XX1\" ADD CONSTRAINT " + "\"PK_XX1\" PRIMARY KEY (\"II\")"); st.executeUpdate(" create view xxunion as select all ii, jj, kk, mm " + "from xx1 union all select ii, jj, kk, mm from xx1 " + "union all select ii, jj, kk, mm from xx1 union all " + "select ii, jj, kk, mm from xx1 union all select ii, " + "jj, kk, mm from xx1 union all select ii, jj, kk, mm " + "from xx1 union all select ii, jj, kk, mm from xx1 " + "union all select ii, jj, kk, mm from xx1 union all " + "select ii, jj, kk, mm from xx1 union all select ii, " + "jj, kk, mm from xx1 union all select ii, jj, kk, mm " + "from xx1 union all select ii, jj, kk, mm from xx1 " + "union all select ii, jj, kk, mm from xx1 union all " + "select ii, jj, kk, mm from xx1 union all select ii, " + "jj, kk, mm from xx1 union all select ii, jj, kk, mm " + "from xx1 union all select ii, jj, kk, mm from xx1 " + "union all select ii, jj, kk, mm from xx1 union all " + "select ii, jj, kk, mm from xx1 union all select ii, " + "jj, kk, mm from xx1 union all select ii, jj, kk, mm " + "from xx1 union all select ii, jj, kk, mm from xx1 " + "union all select ii, jj, kk, mm from xx1 union all " + "select ii, jj, kk, mm from xx1 union all select ii, " + "jj, kk, mm from xx1"); st.executeUpdate(" create view yyunion as select all ii, jj, kk, aa " + "from yy1 union all select ii, jj, kk, aa from yy1 " + "union all select ii, jj, kk, aa from yy1 union all " + "select ii, jj, kk, aa from yy1 union all select ii, " + "jj, kk, aa from yy1 union all select ii, jj, kk, aa " + "from yy1 union all select ii, jj, kk, aa from yy1 " + "union all select ii, jj, kk, aa from yy1 union all " + "select ii, jj, kk, aa from yy1 union all select ii, " + "jj, kk, aa from yy1 union all select ii, jj, kk, aa " + "from yy1 union all select ii, jj, kk, aa from yy1 " + "union all select ii, jj, kk, aa from yy1 union all " + "select ii, jj, kk, aa from yy1 union all select ii, " + "jj, kk, aa from yy1 union all select ii, jj, kk, aa " + "from yy1 union all select ii, jj, kk, aa from yy1 " + "union all select ii, jj, kk, aa from yy1 union all " + "select ii, jj, kk, aa from yy1 union all select ii, " + "jj, kk, aa from yy1 union all select ii, jj, kk, aa " + "from yy1 union all select ii, jj, kk, aa from yy1 " + "union all select ii, jj, kk, aa from yy1 union all " + "select ii, jj, kk, aa from yy1 union all select ii, " + "jj, kk, aa from yy1"); // Run compression on the test tables to try to get a // consistent set of row count stats for the tables // (DERBY-1902, DERBY-3479). cSt = prepareCall("call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T1', 1)"); assertUpdateCount(cSt, 0); cSt = prepareCall(" call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T2', 1)"); assertUpdateCount(cSt, 0); cSt = prepareCall(" call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T3', 1)"); assertUpdateCount(cSt, 0); cSt = prepareCall(" call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T4', 1)"); assertUpdateCount(cSt, 0); cSt = prepareCall(" call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T5', 1)"); assertUpdateCount(cSt, 0); cSt = prepareCall(" call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T6', 1)"); assertUpdateCount(cSt, 0); // And finally, run more extensive tests using the larger // tables that have indexes. In these tests the optimizer // should consider pushing predicates where possible. We // can tell if a predicate has been "pushed" by looking at // the query plan information for the tables in question: // if the table has an index on a column that is used as // part of the pushed predicate, then the optimizer will // (for these tests) do an Index scan instead of a Table // scan. If the table does not have such an index then the // predicate will show up as a "qualifier" for a Table // scan. In all of these tests T3 and T4 have appropriate // indexes, so if we push a predicate to either of those // tables we should see index scans. Neither T1 nor T2 has // indexes, so if we push a predicate to either of those // tables we should see a qualifier in the table scan // information. Predicate push-down should occur for next // two queries. Thus we we should see Index scans for T3 // and T4--and this should be the case regardless of the // order of the FROM list. rs = st.executeQuery("select * from V1, V2 where V1.j = V2.b"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "2", "2" }, { "2", "4", "4", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); rs = st.executeQuery("select * from V2, V1 where V1.j = V2.b"); expColNames = new String[] { "A", "B", "I", "J" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "2", "1", "2" }, { "4", "4", "2", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Changes for DERBY-805 don't affect non-join predicates // (ex. "IN" or one- sided predicates), but make sure // things still behave--i.e. these queries should still // compile and execute without error. We don't expect to // see any predicates pushed to T3 nor T4. rs = st.executeQuery("select count(*) from V1, V2 where V1.i in (2,4)"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "404" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan on T3", p.usedTableScan("T3")); assertTrue("Expected table scan on T4", p.usedTableScan("T4")); rs = st.executeQuery("select count(*) from V1, V2 where V1.j > 0"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "505" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan on T3", p.usedTableScan("T3")); assertTrue("Expected table scan on T4", p.usedTableScan("T4")); // Combination of join predicate and non-join predicate: // the join predicate should be pushed to V2 (T3 and T4), // the non-join predicate should operate as usual. rs = st .executeQuery("select * from V1, V2 where V1.j = V2.b and V1.i in (2,4)"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "4", "4", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Make // sure predicates are pushed even if the subquery is // explicit (as opposed to a view). Should see index scans // on T3 and T4. rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2) x1, (select * from t3 union select * from t4) " + "x2 where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // In this case optimizer will consider pushing predicate // to X1 but will choose not to because it's cheaper to // push the predicate to T3. So should see regular table // scans on T1 and T2. rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2) x1, t3 where x1.i = t3.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "4", "-8", "4", "4" }, { "4", "8", "4", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected Table Scan ResultSet for T1", p.usedTableScan("T1")); assertTrue("Expected Table Scan ResultSet for T2", p.usedTableScan("T2")); // UNION // ALL should behave just like normal UNION. I.e. // predicates should still be pushed to T3 and T4. rs = st .executeQuery("select * from (select * from t1 union all select * " + "from t2) x1, (select * from t3 union select * from " + "t4) x2 where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" }, { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); rs = st .executeQuery("select * from (select * from t1 union all select * " + "from t2) x1, (select * from t3 union all select * " + "from t4) x2 where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" }, { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Predicate with both sides referencing same UNION isn't a // join predicate, so no pushing should happen. So should // see regular table scans on all tables. rs = st.executeQuery("select * from v1, v2 where V1.i = V1.j"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertEmpty(rs); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected Table Scan ResultSet for T1", p.usedTableScan("T1")); assertTrue("Expected Table Scan ResultSet for T2", p.usedTableScan("T2")); assertTrue("Expected Table Scan ResultSet for T3", p.usedTableScan("T3")); assertTrue("Expected Table Scan ResultSet for T4", p.usedTableScan("T4")); // Pushing predicates should still work even if user // specifies explicit column names. In these two queries // we push to X2 (T3 and T4). rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2) x1 (c, d), (select * from t3 union select * " + "from t4) x2 (e, f) where x1.c = x2.e"); expColNames = new String[] { "C", "D", "E", "F" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2) x1 (a, b), (select * from t3 union select * " + "from t4) x2 (i, j) where x1.a = x2.i"); expColNames = new String[] { "A", "B", "I", "J" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // In this query the optimizer will consider pushing, but // will find that it's cheaper to do a hash join and thus // will _not_ push. So we see hash join with table scan on T3. rs = st .executeQuery("select count(*) from (select * from t1 union select " + "* from t3) x1 (c, d), (select * from t2 union " + "select * from t4) x2 (e, f) where x1.c = x2.e"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "103" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); // DERBY-3819 - this test case consistently fails for 64 bit // temporarily (until 3819 is fixed by changing the queries with optimizer directives) if (!is64BitJVM()) { assertTrue("Expected Table Scan ResultSet for T3", p.usedTableScan("T3")); assertTrue("Expected Hash Join",p.usedHashJoin()); } // If we // have nested unions, the predicate should get pushed all // the way down to the base table(s) for every level of // nesting. Should see index scans for T3 and for _both_ // instances of T4. rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2 union select * from t1 union select * from t2 ) " + "x1, (select * from t3 union select * from t4 union " + "select * from t4 ) x2 where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Nested unions with non-join predicates should work as // usual (no change with DERBY-805). So should see scalar // qualifiers on scans for all instances of T1 and T2. rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2 union select * from t1 union select * from t2 ) " + "x1 where x1.i > 0"); expColNames = new String[] { "I", "J" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2" }, { "2", "-4" }, { "2", "4" }, { "3", "6" }, { "4", "-8" }, { "4", "8" }, { "5", "10" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); // Expect to see scalar qualifiers with <= operator for four scans. p.findString("Operator: <=", 4); // In this // case there are no qualifiers, but the restriction is // enforced at the ProjectRestrictNode level. That hasn't // changed with DERBY-805. rs = st .executeQuery("select count(*) from (select * from t1 union select " + "* from t2 union select * from t3 union select * " + "from t4 ) x1 (i, b) where x1.i > 0"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "108" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected Table Scan ResultSet for T1", p.usedTableScan("T1")); assertTrue("Expected Table Scan ResultSet for T2", p.usedTableScan("T2")); assertTrue("Expected Table Scan ResultSet for T3", p.usedTableScan("T3")); assertTrue("Expected Table Scan ResultSet for T4", p.usedTableScan("T4")); // Predicate pushdown should work with explicit use of // "inner join" just like it does for implicit join. So // should see index scans on T3 and T4. rs = st .executeQuery("select * from (select * from t1 union select * from " + "t2) x1 inner join (select * from t3 union select * " + "from t4) x2 on x1.j = x2.b"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "2", "2" }, { "2", "4", "4", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Can't push predicates into VALUES clauses. Predicate should // end up at V2 (T3 and T4). rs = st.executeQuery("select * from ( select i,j from t2 union values " + "(1,1),(2,2),(3,3),(4,4) union select i,j from t1 ) " + "x0 (i,j), v2 where x0.i = v2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "1", "1", "1" }, { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "2", "2", "2" }, { "2", "4", "2", "2" }, { "3", "3", "3", "3" }, { "3", "3", "3", "12" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "16" }, { "4", "4", "4", "4" }, { "4", "4", "4", "16" }, { "4", "8", "4", "4" }, { "4", "8", "4", "16" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Can't push predicates into VALUES clauses. Optimizer // might consider pushing but shouldn't do it; in the end // we'll do a hash join between X1 and T2. rs = st .executeQuery("select * from t2, (select * from t1 union values " + "(3,3), (4,4), (5,5), (6,6)) X1 (a,b) where X1.a = t2.i"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "2" }, { "2", "-4", "2", "4" }, { "3", "6", "3", "3" }, { "3", "6", "3", "6" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "8" }, { "5", "10", "5", "5" }, { "5", "10", "5", "10" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected Hash Join", p.usedHashJoin()); // Can't // push predicates into VALUES clause. We'll try to push // it to X1, but it will only make it to T4; it won't make // it to T3 because the "other side" of the union with T3 // is a VALUES clause. So we'll see an index scan on T4 // and table scan on T3--but the predicate should still be // applied to T3 at a higher level (through a // ProjectRestrictNode), so we shouldn't get any extra rows. rs = st.executeQuery("select * from (select i,j from t2 union values " + "(1,1),(2,2),(3,3),(4,4) union select i,j from t1 ) " + "x0 (i,j), (select a, b from t3 union values (4, 5), " + "(5, 6), (6, 7) union select a, b from t4 ) x1 (a,b) " + "where x0.i = x1.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "1", "1", "1" }, { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "2", "2", "2" }, { "2", "4", "2", "2" }, { "3", "3", "3", "3" }, { "3", "3", "3", "12" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "-8", "4", "5" }, { "4", "-8", "4", "16" }, { "4", "4", "4", "4" }, { "4", "4", "4", "5" }, { "4", "4", "4", "16" }, { "4", "8", "4", "4" }, { "4", "8", "4", "5" }, { "4", "8", "4", "16" }, { "5", "10", "5", "6" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan on T3", p.usedTableScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Make sure optimizer is still considering predicates for // other, non-UNION nodes. Here we should use the // predicate to do a hash join between X0 and T5 (i.e. we // will not push it down to X0 because a) there are VALUES // clauses to which we can't push, and b) it's cheaper to // do the hash join). rs = st .executeQuery("select * from t5, (values (2,2), (4,4) union values " + "(1,1),(2,2),(3,3),(4,4) union select i,j from t1 ) " + "x0 (i,j) where x0.i = t5.i"); expColNames = new String[] { "I", "J", "I", "J" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "4", "2", "2" }, { "2", "4", "2", "4" }, { "4", "8", "4", "4" }, { "4", "8", "4", "8" }, { "5", "10", "5", "10" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected hash join", p.usedHashJoin()); // When we // have very deeply nested union queries, make sure // predicate push- down logic still works (esp. the scoping // logic). These queries won't return any results, but the // predicate should get pushed to EVERY instance of the // base table all the way down. We're just checking to // make sure these compile and execute without error. The // query plan for these two queries alone would be several // thousand lines so we don't print them out. We have // other (smaller) tests to check that predicates are // correctly pushed through nested unions. rs = st .executeQuery("select distinct xx0.kk, xx0.ii, xx0.jj from xxunion " + "xx0, yyunion yy0 where xx0.mm = yy0.ii"); expColNames = new String[] { "KK", "II", "JJ" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertEmpty(rs); rs = st.executeQuery("values (1)"); rs.next(); rsmd = rs.getMetaData(); pSt = prepareStatement("select distinct " + "xx0.kk, xx0.ii, xx0.jj from " + "xxunion xx0, " + "yyunion yy0 " + "where xx0.mm = yy0.ii and yy0.aa in (?) " + "for fetch only"); for (int i = 1; i <= rsmd.getColumnCount(); i++) pSt.setObject(i, rs.getObject(i)); rs = pSt.executeQuery(); expColNames = new String[] { "KK", "II", "JJ" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); // Predicate push-down should only affect the UNIONs // referenced; other UNIONs shouldn't interfere or be // affected. Should see table scans for T1 and T2 then an // index scan for the first instance of T3 and a table scan // for second instance of T3; likewise for two instances of T4. rs = st .executeQuery("select count(*) from (select * from t1 union select " + "* from t2) x1, (select * from t3 union select * " + "from t4) x2, (select * from t4 union select * from " + "t3) x3 where x1.i = x3.a"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "909" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan on T1", p.usedTableScan("T1")); assertTrue("Expected table scan on T2", p.usedTableScan("T2")); assertTrue("Expected table scan on T3", p.usedTableScan("T3")); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected table scan on T4", p.usedTableScan("T4")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Here we // should see index scans for both instances of T3 and for // both instances of T4. rs = st .executeQuery("select count(*) from (select * from t1 union select " + "* from t2) x1, (select * from t3 union select * " + "from t4) x2, (select * from t4 union select * from " + "t3) x3 where x1.i = x3.a and x3.b = x2.b"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "9" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Predicates pushed from outer queries shouldn't // interfere with inner predicates for subqueries. Mostly // checking for correct results here. rs = st .executeQuery("select * from (select i, b j from t1, t4 where i = " + "j union select * from t2) x1, t3 where x1.j = t3.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "2", "2" }, { "3", "6", "6", "24" }, { "5", "10", "10", "40" } }; JDBC.assertFullResultSet(rs, expRS, true); // Inner predicate should be handled as normal, outer // predicate should either get pushed to V2 (T3 and T4) or // else used for a hash join between x1 and v2. rs = st .executeQuery("select * from (select i, b j from t1, t4 where i = " + "j union select * from t2) x1, v2 where x1.j = v2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "2", "2" }, { "3", "6", "6", "24" }, { "5", "10", "10", "40" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); // DERBY-3819 - this test case consistently fails for 64 bit // temporarily (until 3819 is fixed by changing the queries with optimizer directives) if (!is64BitJVM()) { assertTrue("Expected hash join", p.usedHashJoin()); } // Outer // predicate should either get pushed to V2 (T3 and T4) or // else used for a hash join; similarly, inner predicate // should either get pushed to T3 or else used for hash // join between T1 and T3. rs = st .executeQuery("select * from (select i, j from t1, t3 where i = a " + "union select * from t2) x1, v2 where x1.i = v2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "1", "1" }, { "2", "-4", "2", "2" }, { "2", "4", "2", "2" }, { "3", "6", "3", "3" }, { "3", "6", "3", "12" }, { "4", "-8", "4", "4" }, { "4", "8", "4", "4" }, { "4", "-8", "4", "16" }, { "4", "8", "4", "16" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected hash join", p.usedHashJoin()); // Inner predicates treated as restrictions, outer // predicate either pushed to X2 (T2 and T1) or used for // hash join between X2 and X1. rs = st .executeQuery("select * from (select i, b j from t1, t4 where i = " + "j union select * from t2) x1, (select i, b j from " + "t2, t3 where i = j union select * from t1) x2 where " + "x1.j = x2.i"); expColNames = new String[] { "I", "J", "I", "J" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "2", "2", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); // DERBY-3819 - this test case consistently fails for 64 bit // temporarily (until 3819 is fixed by changing the queries with optimizer directives) if (!is64BitJVM()) { assertTrue("Expected hash join", p.usedHashJoin()); } // Following queries deal with nested subqueries, which // deserve extra testing because "best paths" for outer // queries might not agree with "best paths" for inner // queries, so we need to make sure the correct paths // (based on predicates that are or are not pushed) are // ultimately generated. Predicate should get pushed to V2 // (T3 and T4). rs = st .executeQuery("select count(*) from (select i,a,j,b from V1, V2 " + "where V1.j = V2.b ) X3"); expColNames = new String[] { "1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Multiple subqueries but NO UNIONs. All predicates are // used for joins at their current level (no pushing). rs = st.executeQuery("select t2.i,p from (select distinct i,p from " + "(select distinct i,a from t1, t3 where t1.j = t3.b) " + "X1, t6 where X1.a = t6.p) X2, t2 where t2.i = X2.i"); expColNames = new String[] { "I", "P" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected hash join", p.usedHashJoin()); assertTrue("Expected table scan on T1", p.usedTableScan("T1")); assertTrue("Expected index row to base row for T3", p.usedIndexRowToBaseRow("T3")); // Multiple, non-flattenable subqueries, but NO UNIONs. Shouldn't push // anything. rs = st .executeQuery("select x1.j, x2.b from (select distinct i,j from " + "t1) x1, (select distinct a,b from t3) x2 where x1.i " + "= x2.a order by x1.j, x2.b"); expColNames = new String[] { "J", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "1" }, { "4", "2" }, { "6", "3" }, { "8", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected distinct scan on T1", p.usedDistinctScan("T1")); assertTrue("Expected distinct scan T3", p.usedDistinctScan("T3")); rs = st .executeQuery("select x1.j, x2.b from (select distinct i,j from " + "t1) x1, (select distinct a,b from t3) x2, (select " + "distinct i,j from t2) x3, (select distinct a,b from " + "t4) x4 where x1.i = x2.a and x3.i = x4.a order by x1.j, x2.b"); expColNames = new String[] { "J", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "1" }, { "2", "1" }, { "4", "2" }, { "4", "2" }, { "6", "3" }, { "6", "3" }, { "8", "4" }, { "8", "4" }}; JDBC.assertFullResultSet(rs, expRS, true); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected distinct scan on T1", p.usedDistinctScan("T1")); assertTrue("Expected distinct scan T2", p.usedDistinctScan("T2")); assertTrue("Expected distinct scan on T3", p.usedDistinctScan("T3")); assertTrue("Expected distinct scan T4", p.usedDistinctScan("T4")); // Multiple subqueries that are UNIONs. Outer-most // predicate X0.b = X2.j can be pushed to union X0 but NOT // to subquery X2. Inner predicate T6.p = X1.i is eligible // for being pushed into union X1. In this case outer // predicate is pushed to X0 (so we'll see index scans on // T3 and T4) but inner predicate is used for a hash join // between X1 and T6. rs = st .executeQuery("select X0.a, X2.i from (select a,b from t4 union " + "select a,b from t3) X0, (select i,j from (select " + "i,j from t1 union select i,j from t2) X1, T6 where " + "T6.p = X1.i) X2 where X0.b = X2.j "); expColNames = new String[] { "A", "I" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected hash join", p.usedHashJoin()); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Same as // above but without the inner predicate (so no hash on T6). rs = st .executeQuery("select X0.a, X2.i from (select a,b from t4 union " + "select a,b from t3) X0, (select i,j from (select " + "i,j from t1 union select i,j from t2) X1, T6 ) X2 " + "where X0.b = X2.j "); expColNames = new String[] { "A", "I" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertEmpty(rs); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected index scan on T3", p.usedIndexScan("T3")); assertTrue("Expected index scan on T4", p.usedIndexScan("T4")); // Same as above, but without the outer predicate. Should // see table scan on T3 and T4 (because nothing is pushed). rs = st .executeQuery("select X0.a, X2.i from (select a,b from t4 union " + "select a,b from t3) X0, (select i,j from (select " + "i,j from t1 union select i,j from t2) X1, T6 where " + "T6.p = X1.i) X2 "); expColNames = new String[] { "A", "I" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); p = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue("Expected table scan on T3", p.usedTableScan("T3")); assertTrue("Expected table scan on T4", p.usedTableScan("T4")); // Additional tests with VALUES clauses. Mostly just // checking to make sure these queries compile and execute, // and to ensure that all predicates are enforced even if // they can't be pushed all the way down into a UNION. So // we shouldn't get back any extra rows here. NOTE: Row // order is not important in these queries, just so long as // the correct rows are returned. cSt = prepareCall("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(0)"); assertUpdateCount(cSt, 0); rs = st.executeQuery(" select * from (select * from t1 union select * " + "from t2) x1, (values (2, 4), (3, 6), (4, 8)) x2 (a, " + "b) where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "-4", "2", "4" }, { "2", "4", "2", "4" }, { "3", "6", "3", "6" }, { "4", "-8", "4", "8" }, { "4", "8", "4", "8" } }; JDBC.assertFullResultSet(rs, expRS, true); // --------------------------------------------- rs = st.executeQuery("select * from" + "(select * from t1 union (values (1, -1), (2, " + "-2), (5, -5))) x1 (i, j)," + "(values (2, 4), (3, 6), (4, 8)) x2 (a, b)" + "where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "-2", "2", "4" }, { "2", "4", "2", "4" }, { "3", "6", "3", "6" }, { "4", "8", "4", "8" }}; JDBC.assertFullResultSet(rs, expRS); rs = st .executeQuery(" select * from (select * from t1 union all (values " + "(1, -1), (2, -2), (5, -5))) x1 (i, j), (values (2, " + "4), (3, 6), (4, 8)) x2 (a, b) where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "4", "2", "4" }, { "3", "6", "3", "6" }, { "4", "8", "4", "8" }, { "2", "-2", "2", "4" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select * from (select * from t1 union (values (1, " + "-1), (2, -2), (5, -5))) x1 (i, j), (values (2, 4), " + "(3, 6), (4, 8)) x2 (a, b) where x1.i = x2.a and x2.b = x1.j"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "4", "2", "4" }, { "3", "6", "3", "6" }, { "4", "8", "4", "8" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select * from (values (2, -4), (3, -6), (4, -8) " + "union values (1, -1), (2, -2), (5, -5) ) x1 (i, j), " + "(values (2, 4), (3, 6), (4, 8)) x2 (a, b) where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "-4", "2", "4" }, { "2", "-2", "2", "4" }, { "3", "-6", "3", "6" }, { "4", "-8", "4", "8" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select * from (values (2, -4), (3, -6), (4, -8) " + "union values (1, -1), (2, -2), (5, -5) ) x1 (i, j), " + "(values (2, 4), (3, 6), (4, 8)) x2 (a, b) where " + "x1.i = x2.a and x2.b = x1.j"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); JDBC.assertDrainResults(rs, 0); rs = st .executeQuery(" select * from (values (1, -1), (2, -2), (5, -5) " + "union select * from t1) x1 (i,j), (values (2, 4), " + "(3, 6), (4, 8)) x2 (a, b) where x1.i = x2.a"); expColNames = new String[] { "I", "J", "A", "B" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "2", "-2", "2", "4" }, { "2", "4", "2", "4" }, { "3", "6", "3", "6" }, { "4", "8", "4", "8" } }; JDBC.assertFullResultSet(rs, expRS, true); // Clean up DERBY-805 objects. st.executeUpdate("drop view v1"); st.executeUpdate(" drop view v2"); st.executeUpdate(" drop table t1"); st.executeUpdate(" drop table t2"); st.executeUpdate(" drop table t3"); st.executeUpdate(" drop table t4"); st.executeUpdate(" drop table t5"); st.executeUpdate(" drop table t6"); st.executeUpdate(" drop view xxunion"); st.executeUpdate(" drop view yyunion"); st.executeUpdate(" drop table xx1"); st.executeUpdate(" drop table yy1"); // DERBY-1633: Nested UNIONs of views with different // column orderings leads to incorrectly scoped predicates. // We have a lot of different tables and views here to try // to cover several different situations. Note that all of // the views use DISTINCT because we don't want the views // to be flattened and Derby doesn't flatten select queries // with DISTINCT in them. st.executeUpdate("CREATE TABLE \"APP\".\"T1\" (\"I\" INTEGER, \"D\" " + "DOUBLE, \"C\" CHAR(10))"); st.executeUpdate(" CREATE TABLE \"APP\".\"T2\" (\"I2\" INTEGER, " + "\"D2\" DOUBLE, \"C2\" CHAR(10))"); st.executeUpdate(" CREATE TABLE \"APP\".\"T3\" (\"I3\" INTEGER, " + "\"D3\" DOUBLE, \"C3\" CHAR(10))"); st.executeUpdate(" insert into t1 values (1, -1, '1'), (2, -2, '2')"); st.executeUpdate(" insert into t2 values (2, -2, '2'), (4, -4, '4'), " + "(8, -8, '8')"); st.executeUpdate(" insert into t3 values (3, -3, '3'), (6, -6, '6'), " + "(9, -9, '9')"); st.executeUpdate(" CREATE TABLE \"APP\".\"T4\" (\"C4\" CHAR(10))"); st.executeUpdate(" insert into t4 values '1', '2', '3', '4', '5', " + "'6', '7', '8', '9'"); st .executeUpdate(" insert into t4 select rtrim(c4) || rtrim(c4) from t4"); st.executeUpdate(" CREATE TABLE \"APP\".\"T5\" (\"I5\" INTEGER, " + "\"D5\" DOUBLE, \"C5\" CHAR(10))"); st.executeUpdate(" CREATE TABLE \"APP\".\"T6\" (\"I6\" INTEGER, " + "\"D6\" DOUBLE, \"C6\" CHAR(10))"); st.executeUpdate(" insert into t5 values (100, 100.0, '100'), (200, " + "200.0, '200'), (300, 300.0, '300')"); st.executeUpdate(" insert into t6 values (400, 400.0, '400'), (200, " + "200.0, '200'), (300, 300.0, '300')"); st.executeUpdate(" create view v_keycol_at_pos_3 as select distinct i " + "col1, d col2, c col3 from t1"); st.executeUpdate(" create view v1_keycol_at_pos_2 as select distinct " + "i2 col1, c2 col3, d2 col2 from t2"); st.executeUpdate(" create view v2_keycol_at_pos_2 as select distinct " + "i3 col1, c3 col3, d3 col2 from t3"); st.executeUpdate(" create view v1_intersect as select distinct i5 " + "col1, c5 col3, d5 col2 from t5"); st.executeUpdate(" create view v2_intersect as select distinct i6 " + "col1, c6 col3, d6 col2 from t6"); st.executeUpdate(" create view v1_values as select distinct vals1 " + "col1, vals2 col2, vals3 col3 from (values (321, " + "321.0, '321'), (432, 432.0, '432'), (654, 654.0, " + "'654') ) VT(vals1, vals2, vals3)"); st.executeUpdate(" create view v_union as select distinct i col1, d " + "col2, c col3 from t1 union select distinct i3 col1, " + "d3 col2, c3 col3 from t3"); // Chain of UNIONs with left-most child as a view with a // an RCL that is ordered differently than that of the // UNIONs above it. The right child of the top-level node // is a view that is a simple select from a table. st .executeUpdate("create view topview as (select distinct 'other:' " + "col0, vpos3.col3, vpos3.col1 from v_keycol_at_pos_3 " + "vpos3 union select distinct 't2stuff:' col0, " + "vpos2_1.col3, vpos2_1.col1 from v1_keycol_at_pos_2 " + "vpos2_1 union select distinct 't3stuff:' col0, " + "vpos2_2.col3, vpos2_2.col1 from v2_keycol_at_pos_2 vpos2_2 )"); // Chain of UNIONs with left-most child as a view with a // an RCL that is ordered differently than that of the // UNIONs above it. The right child of the top-level node // is a view that is a select from yet another UNION node. st.executeUpdate("create view topview2 as (select distinct 'other:' " + "col0, vpos3.col3, vpos3.col1 from v_keycol_at_pos_3 " + "vpos3 union select distinct 't2stuff:' col0, " + "vpos2_1.col3, vpos2_1.col1 from v1_keycol_at_pos_2 " + "vpos2_1 union select distinct 't3stuff:' col0, " + "vpos2_2.col3, vpos2_2.col1 from v2_keycol_at_pos_2 " + "vpos2_2 union select distinct 'morestuff:' col0, " + "vu.col3, vu.col1 from v_union vu )"); // Chain of UNIONs with left-most child as a view with a // an RCL that is ordered differently than that of the // UNIONs above it. The left-most child of the last UNION // in the chain is an INTERSECT node to which predicates // cannot (currently) be pushed. In this case the // intersect returns an empty result set. st.executeUpdate("create view topview3 (col0, col3, col1) as (select " + "distinct 'other:' col0, vpos3.col3, vpos3.col1 from " + "v_keycol_at_pos_3 vpos3 intersect select distinct " + "'t2stuff:' col0, vpos2_1.col3, vpos2_1.col1 from " + "v1_keycol_at_pos_2 vpos2_1 union select distinct " + "'t3stuff:' col0, vpos2_2.col3, vpos2_2.col1 from " + "v2_keycol_at_pos_2 vpos2_2 union select distinct " + "'morestuff:' col0, vu.col3, vu.col1 from v_union vu )"); // Chain of UNIONs with left-most child as a view with a // an RCL that is ordered differently than that of the // UNIONs above it. The left-most child of the last UNION // in the chain is an INTERSECT node to which predicates // cannot (currently) be pushed. In this case the // intersect returns a couple of rows. st.executeUpdate("create view topview4 (col0, col3, col1) as (select " + "distinct 'intersect:' col0, vi1.col3, vi1.col1 from " + "v1_intersect vi1 intersect select distinct " + "'intersect:' col0, vi2.col3, vi2.col1 from " + "v2_intersect vi2 union select distinct 't3stuff:' " + "col0, vpos2_2.col3, vpos2_2.col1 from " + "v2_keycol_at_pos_2 vpos2_2 union select distinct " + "'morestuff:' col0, vu.col3, vu.col1 from v_union vu )"); // Chain of UNIONs with left-most child as a view with a // an RCL that is ordered differently than that of the // UNIONs above it. The left-most child of the last UNION // in the chain is a view that is a selet from a VALUES // list (i.e. no base table). st.executeUpdate("create view topview5 (col0, col3, col1) as (select " + "distinct 'values:' col0, vv1.col3, vv1.col1 from " + "v1_values vv1 union select distinct 'intersect:' " + "col0, vi2.col3, vi2.col1 from v2_intersect vi2 " + "union select distinct 't3stuff:' col0, " + "vpos2_2.col3, vpos2_2.col1 from v2_keycol_at_pos_2 " + "vpos2_2 union select distinct 'morestuff:' col0, " + "vu.col3, vu.col1 from v_union vu )"); // All of the following queries failed at some point while // finalizing the fix for DERBY-1633; some failed with // error 42818, others failed with execution-time NPEs // caused by incorrect (esp. double) remapping. The point // here is to see how the top-level predicates are pushed // through the nested unions to the bottom-most children. // Use of LEFT JOINs with NESTEDLOOP effectively allows us // to force the join order and thus to ensure the // predicates are pushed to the desired top-level at // execution time. All such queries are run once with // NESTEDLOOP and once without, to make sure things work in // both cases. rs = st .executeQuery("select * from t4, topview where t4.c4 = topview.col3"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "other:", "1", "1" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "4", "t2stuff:", "4", "4" }, { "8", "t2stuff:", "8", "8" }, { "3", "t3stuff:", "3", "3" }, { "6", "t3stuff:", "6", "6" }, { "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select * from t4, topview where topview.col3 = t4.c4"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "other:", "1", "1" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "4", "t2stuff:", "4", "4" }, { "8", "t2stuff:", "8", "8" }, { "3", "t3stuff:", "3", "3" }, { "6", "t3stuff:", "6", "6" }, { "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1, topview where " + "topview.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "other:", "1", "1" }, { "other:", "2", "2", "other:", "2", "2" }, { "other:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "2", "2", "other:", "2", "2" }, { "t2stuff:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "4", "4", "t2stuff:", "4", "4" }, { "t2stuff:", "8", "8", "t2stuff:", "8", "8" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select * from t4, topview2 where t4.c4 = topview2.col3"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "morestuff:", "1", "1" }, { "2", "morestuff:", "2", "2" }, { "3", "morestuff:", "3", "3" }, { "6", "morestuff:", "6", "6" }, { "9", "morestuff:", "9", "9" }, { "1", "other:", "1", "1" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "4", "t2stuff:", "4", "4" }, { "8", "t2stuff:", "8", "8" }, { "3", "t3stuff:", "3", "3" }, { "6", "t3stuff:", "6", "6" }, { "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview2 x1, topview where " + "topview.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "morestuff:", "1", "1", "other:", "1", "1" }, { "morestuff:", "2", "2", "other:", "2", "2" }, { "morestuff:", "2", "2", "t2stuff:", "2", "2" }, { "morestuff:", "3", "3", "t3stuff:", "3", "3" }, { "morestuff:", "6", "6", "t3stuff:", "6", "6" }, { "morestuff:", "9", "9", "t3stuff:", "9", "9" }, { "other:", "1", "1", "other:", "1", "1" }, { "other:", "2", "2", "other:", "2", "2" }, { "other:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "2", "2", "other:", "2", "2" }, { "t2stuff:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "4", "4", "t2stuff:", "4", "4" }, { "t2stuff:", "8", "8", "t2stuff:", "8", "8" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select * from t4 left join topview on t4.c4 = topview.col3"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "other:", "1", "1" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "3", "t3stuff:", "3", "3" }, { "4", "t2stuff:", "4", "4" }, { "5", null, null, null }, { "6", "t3stuff:", "6", "6" }, { "7", null, null, null }, { "8", "t2stuff:", "8", "8" }, { "9", "t3stuff:", "9", "9" }, { "11", null, null, null }, { "22", null, null, null }, { "33", null, null, null }, { "44", null, null, null }, { "55", null, null, null }, { "66", null, null, null }, { "77", null, null, null }, { "88", null, null, null }, { "99", null, null, null } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from t4 left join topview " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on t4.c4 " + "= topview.col3"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "other:", "1", "1" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "3", "t3stuff:", "3", "3" }, { "4", "t2stuff:", "4", "4" }, { "5", null, null, null }, { "6", "t3stuff:", "6", "6" }, { "7", null, null, null }, { "8", "t2stuff:", "8", "8" }, { "9", "t3stuff:", "9", "9" }, { "11", null, null, null }, { "22", null, null, null }, { "33", null, null, null }, { "44", null, null, null }, { "55", null, null, null }, { "66", null, null, null }, { "77", null, null, null }, { "88", null, null, null }, { "99", null, null, null } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st .executeQuery(" select * from t4 left join topview on topview.col3 = t4.c4"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "other:", "1", "1" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "3", "t3stuff:", "3", "3" }, { "4", "t2stuff:", "4", "4" }, { "5", null, null, null }, { "6", "t3stuff:", "6", "6" }, { "7", null, null, null }, { "8", "t2stuff:", "8", "8" }, { "9", "t3stuff:", "9", "9" }, { "11", null, null, null }, { "22", null, null, null }, { "33", null, null, null }, { "44", null, null, null }, { "55", null, null, null }, { "66", null, null, null }, { "77", null, null, null }, { "88", null, null, null }, { "99", null, null, null } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from t4 left join topview " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on " + "topview.col3 = t4.c4"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "other:", "1", "1" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "3", "t3stuff:", "3", "3" }, { "4", "t2stuff:", "4", "4" }, { "5", null, null, null }, { "6", "t3stuff:", "6", "6" }, { "7", null, null, null }, { "8", "t2stuff:", "8", "8" }, { "9", "t3stuff:", "9", "9" }, { "11", null, null, null }, { "22", null, null, null }, { "33", null, null, null }, { "44", null, null, null }, { "55", null, null, null }, { "66", null, null, null }, { "77", null, null, null }, { "88", null, null, null }, { "99", null, null, null } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview on " + "topview.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "other:", "1", "1" }, { "other:", "2", "2", "other:", "2", "2" }, { "other:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "2", "2", "other:", "2", "2" }, { "t2stuff:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "4", "4", "t2stuff:", "4", "4" }, { "t2stuff:", "8", "8", "t2stuff:", "8", "8" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on " + "topview.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "other:", "1", "1" }, { "other:", "2", "2", "other:", "2", "2" }, { "other:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "2", "2", "other:", "2", "2" }, { "t2stuff:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "4", "4", "t2stuff:", "4", "4" }, { "t2stuff:", "8", "8", "t2stuff:", "8", "8" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from t4 left join topview2 on t4.c4 = " + "topview2.col3"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "morestuff:", "1", "1" }, { "1", "other:", "1", "1" }, { "2", "morestuff:", "2", "2" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "3", "morestuff:", "3", "3" }, { "3", "t3stuff:", "3", "3" }, { "4", "t2stuff:", "4", "4" }, { "5", null, null, null }, { "6", "morestuff:", "6", "6" }, { "6", "t3stuff:", "6", "6" }, { "7", null, null, null }, { "8", "t2stuff:", "8", "8" }, { "9", "morestuff:", "9", "9" }, { "9", "t3stuff:", "9", "9" }, { "11", null, null, null }, { "22", null, null, null }, { "33", null, null, null }, { "44", null, null, null }, { "55", null, null, null }, { "66", null, null, null }, { "77", null, null, null }, { "88", null, null, null }, { "99", null, null, null } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from t4 left join topview2 " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on t4.c4 " + "= topview2.col3"); expColNames = new String[] { "C4", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "morestuff:", "1", "1" }, { "1", "other:", "1", "1" }, { "2", "morestuff:", "2", "2" }, { "2", "other:", "2", "2" }, { "2", "t2stuff:", "2", "2" }, { "3", "morestuff:", "3", "3" }, { "3", "t3stuff:", "3", "3" }, { "4", "t2stuff:", "4", "4" }, { "5", null, null, null }, { "6", "morestuff:", "6", "6" }, { "6", "t3stuff:", "6", "6" }, { "7", null, null, null }, { "8", "t2stuff:", "8", "8" }, { "9", "morestuff:", "9", "9" }, { "9", "t3stuff:", "9", "9" }, { "11", null, null, null }, { "22", null, null, null }, { "33", null, null, null }, { "44", null, null, null }, { "55", null, null, null }, { "66", null, null, null }, { "77", null, null, null }, { "88", null, null, null }, { "99", null, null, null } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview2 x1 left join topview on " + "topview.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "morestuff:", "1", "1", "other:", "1", "1" }, { "morestuff:", "2", "2", "other:", "2", "2" }, { "morestuff:", "2", "2", "t2stuff:", "2", "2" }, { "morestuff:", "3", "3", "t3stuff:", "3", "3" }, { "morestuff:", "6", "6", "t3stuff:", "6", "6" }, { "morestuff:", "9", "9", "t3stuff:", "9", "9" }, { "other:", "1", "1", "other:", "1", "1" }, { "other:", "2", "2", "other:", "2", "2" }, { "other:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "2", "2", "other:", "2", "2" }, { "t2stuff:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "4", "4", "t2stuff:", "4", "4" }, { "t2stuff:", "8", "8", "t2stuff:", "8", "8" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview2 x1 left join topview " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on " + "topview.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "morestuff:", "1", "1", "other:", "1", "1" }, { "morestuff:", "2", "2", "other:", "2", "2" }, { "morestuff:", "2", "2", "t2stuff:", "2", "2" }, { "morestuff:", "3", "3", "t3stuff:", "3", "3" }, { "morestuff:", "6", "6", "t3stuff:", "6", "6" }, { "morestuff:", "9", "9", "t3stuff:", "9", "9" }, { "other:", "1", "1", "other:", "1", "1" }, { "other:", "2", "2", "other:", "2", "2" }, { "other:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "2", "2", "other:", "2", "2" }, { "t2stuff:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "4", "4", "t2stuff:", "4", "4" }, { "t2stuff:", "8", "8", "t2stuff:", "8", "8" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview2 on " + "topview2.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "morestuff:", "1", "1" }, { "other:", "1", "1", "other:", "1", "1" }, { "other:", "2", "2", "morestuff:", "2", "2" }, { "other:", "2", "2", "other:", "2", "2" }, { "other:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "2", "2", "other:", "2", "2" }, { "t2stuff:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "4", "4", "t2stuff:", "4", "4" }, { "t2stuff:", "8", "8", "t2stuff:", "8", "8" }, { "t3stuff:", "3", "3", "morestuff:", "3", "3" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "morestuff:", "6", "6" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "morestuff:", "9", "9" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview2 " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on " + "topview2.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "morestuff:", "1", "1" }, { "other:", "1", "1", "other:", "1", "1" }, { "other:", "2", "2", "morestuff:", "2", "2" }, { "other:", "2", "2", "other:", "2", "2" }, { "other:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "2", "2", "other:", "2", "2" }, { "t2stuff:", "2", "2", "t2stuff:", "2", "2" }, { "t2stuff:", "4", "4", "t2stuff:", "4", "4" }, { "t2stuff:", "8", "8", "t2stuff:", "8", "8" }, { "t3stuff:", "3", "3", "morestuff:", "3", "3" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "morestuff:", "6", "6" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "morestuff:", "9", "9" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview3 on " + "topview3.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "morestuff:", "1", "1" }, { "other:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "4", "4", null, null, null }, { "t2stuff:", "8", "8", null, null, null }, { "t3stuff:", "3", "3", "morestuff:", "3", "3" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "morestuff:", "6", "6" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "morestuff:", "9", "9" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview3 " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on " + "topview3.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "morestuff:", "1", "1" }, { "other:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "4", "4", null, null, null }, { "t2stuff:", "8", "8", null, null, null }, { "t3stuff:", "3", "3", "morestuff:", "3", "3" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "morestuff:", "6", "6" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "morestuff:", "9", "9" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview4 on " + "topview4.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "morestuff:", "1", "1" }, { "other:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "4", "4", null, null, null }, { "t2stuff:", "8", "8", null, null, null }, { "t3stuff:", "3", "3", "morestuff:", "3", "3" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "morestuff:", "6", "6" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "morestuff:", "9", "9" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview4 " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on " + "topview4.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "morestuff:", "1", "1" }, { "other:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "4", "4", null, null, null }, { "t2stuff:", "8", "8", null, null, null }, { "t3stuff:", "3", "3", "morestuff:", "3", "3" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "morestuff:", "6", "6" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "morestuff:", "9", "9" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview5 on " + "topview5.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "morestuff:", "1", "1" }, { "other:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "4", "4", null, null, null }, { "t2stuff:", "8", "8", null, null, null }, { "t3stuff:", "3", "3", "morestuff:", "3", "3" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "morestuff:", "6", "6" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "morestuff:", "9", "9" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery(" select * from topview x1 left join topview5 " + "--DERBY-PROPERTIES joinStrategy=NESTEDLOOP \n on " + "topview5.col3 = x1.col3"); expColNames = new String[] { "COL0", "COL3", "COL1", "COL0", "COL3", "COL1" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "other:", "1", "1", "morestuff:", "1", "1" }, { "other:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "2", "2", "morestuff:", "2", "2" }, { "t2stuff:", "4", "4", null, null, null }, { "t2stuff:", "8", "8", null, null, null }, { "t3stuff:", "3", "3", "morestuff:", "3", "3" }, { "t3stuff:", "3", "3", "t3stuff:", "3", "3" }, { "t3stuff:", "6", "6", "morestuff:", "6", "6" }, { "t3stuff:", "6", "6", "t3stuff:", "6", "6" }, { "t3stuff:", "9", "9", "morestuff:", "9", "9" }, { "t3stuff:", "9", "9", "t3stuff:", "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); // DERBY-1681: In order to reproduce the issue described // in DERBY-1681 we have to have a minimum amount of data // in the tables if we have too little, then somehow that // affects the plan and we won't see the incorrect results. st.executeUpdate("insert into t1 select * from t2"); st.executeUpdate(" insert into t2 select * from t3"); st.executeUpdate(" insert into t3 select * from t1"); st.executeUpdate(" insert into t1 select * from t2"); st.executeUpdate(" insert into t2 select * from t3"); st.executeUpdate(" insert into t3 select * from t1"); st.executeUpdate(" insert into t1 select * from t2"); st.executeUpdate(" insert into t2 select * from t3"); st.executeUpdate(" insert into t3 select * from t1"); st.executeUpdate(" insert into t1 select * from t2"); st.executeUpdate(" insert into t2 select * from t3"); st.executeUpdate(" insert into t3 select * from t1"); // Now can just run one of the queries from DERBY-1633 to // test the fix. Before DERBY-1681 this query would return // 84 rows and it was clear that the predicate wasn't being // enforced after the fix, we should only see 42 rows and // for every row the first and second column should be equal. rs = st .executeQuery("select topview4.col3, x1.col3 from topview x1 left " + "join topview4 on topview4.col3 = x1.col3"); expColNames = new String[] { "COL3", "COL3" }; JDBC.assertColumnNames(rs, expColNames); expRS = new String[][] { { "1", "1" }, { "1", "1" }, { "2", "2" }, { "2", "2" }, { "3", "3" }, { "3", "3" }, { "4", "4" }, { "4", "4" }, { "6", "6" }, { "6", "6" }, { "8", "8" }, { "8", "8" }, { "9", "9" }, { "9", "9" }, { "1", "1" }, { "1", "1" }, { "2", "2" }, { "2", "2" }, { "3", "3" }, { "3", "3" }, { "4", "4" }, { "4", "4" }, { "6", "6" }, { "6", "6" }, { "8", "8" }, { "8", "8" }, { "9", "9" }, { "9", "9" }, { "1", "1" }, { "1", "1" }, { "2", "2" }, { "2", "2" }, { "3", "3" }, { "3", "3" }, { "4", "4" }, { "4", "4" }, { "6", "6" }, { "6", "6" }, { "8", "8" }, { "8", "8" }, { "9", "9" }, { "9", "9" } }; JDBC.assertFullResultSet(rs, expRS, true); // Clean-up from DERBY-1633 and DERBY-1681. st.executeUpdate("drop view topview"); st.executeUpdate(" drop view topview2"); st.executeUpdate(" drop view topview3"); st.executeUpdate(" drop view topview4"); st.executeUpdate(" drop view topview5"); st.executeUpdate(" drop view v_keycol_at_pos_3"); st.executeUpdate(" drop view v1_keycol_at_pos_2"); st.executeUpdate(" drop view v2_keycol_at_pos_2"); st.executeUpdate(" drop view v1_intersect"); st.executeUpdate(" drop view v2_intersect"); st.executeUpdate(" drop view v1_values"); st.executeUpdate(" drop view v_union"); st.executeUpdate(" drop table t1"); st.executeUpdate(" drop table t2"); st.executeUpdate(" drop table t3"); st.executeUpdate(" drop table t4"); st.executeUpdate(" drop table t5"); st.executeUpdate(" drop table t6"); getConnection().rollback(); st.close(); } /** * Tries to determine the if the VM we're running in is 32 or 64 bit by * looking at the system properties. * * @return true if 64 bit */ private static boolean is64BitJVM() { // Try the direct way first, by looking for 'sun.arch.data.model' String dataModel = getSystemProperty("sun.arch.data.model"); try { if (new Integer(dataModel).intValue() == 64) return true; else return false; } catch (NumberFormatException ignoreNFE) {} // Try 'os.arch' String arch = getSystemProperty("os.arch"); // See if we recognize the property value. if (arch != null) { // Is it a known 32 bit architecture? String[] b32 = new String[] {"i386", "x86", "sparc"}; if (Arrays.asList(b32).contains(arch)) return false; // Is it a known 64 bit architecture? String[] b64 = new String[] {"amd64", "x86_64", "sparcv9"}; if (Arrays.asList(b64).contains(arch)) return true; } // Didn't find out anything. BaseTestCase.traceit("Bitness undetermined, sun.arch.data.model='" + dataModel + "', os.arch='" + arch + "', assuming we're 32 bit"); // we don't know, assume it's 32 bit. return false; } }
mikiec84/sshkit
lib/sshkit/backends/netssh/known_hosts.rb
<filename>lib/sshkit/backends/netssh/known_hosts.rb module SSHKit module Backend class Netssh < Abstract class KnownHostsKeys include Mutex_m def initialize(path) super() @path = File.expand_path(path) @hosts_keys = nil end def keys_for(hostlist) keys, hashes = hosts_keys, hosts_hashes parse_file unless keys && hashes keys, hashes = hosts_keys, hosts_hashes host_names = hostlist.split(',') keys_found = host_names.map { |h| keys[h] || [] }.compact.inject(:&) return keys_found unless keys_found.empty? host_names.each do |host| hashes.each do |(hmac, salt), hash_keys| if OpenSSL::HMAC.digest(sha1, salt, host) == hmac return hash_keys end end end [] end private attr_reader :path attr_accessor :hosts_keys, :hosts_hashes def sha1 @sha1 ||= OpenSSL::Digest.new('sha1') end def parse_file synchronize do return if hosts_keys && hosts_hashes unless File.readable?(path) self.hosts_keys = {} self.hosts_hashes = [] return end new_keys = {} new_hashes = [] File.open(path) do |file| scanner = StringScanner.new("") file.each_line do |line| scanner.string = line parse_line(scanner, new_keys, new_hashes) end end self.hosts_keys = new_keys self.hosts_hashes = new_hashes end end def parse_line(scanner, hosts_keys, hosts_hashes) return if empty_line?(scanner) hostlist = parse_hostlist(scanner) return unless supported_type?(scanner) key = parse_key(scanner) if hostlist.size == 1 && hostlist.first =~ /\A\|1(\|.+){2}\z/ hosts_hashes << [parse_host_hash(hostlist.first), key] else hostlist.each do |host| (hosts_keys[host] ||= []) << key end end end def parse_host_hash(line) _, _, salt, hmac = line.split('|') [Base64.decode64(hmac), Base64.decode64(salt)] end def empty_line?(scanner) scanner.skip(/\s*/) scanner.match?(/$|#/) end def parse_hostlist(scanner) scanner.skip(/\s*/) scanner.scan(/\S+/).split(',') end def supported_type?(scanner) scanner.skip(/\s*/) Net::SSH::KnownHosts::SUPPORTED_TYPE.include?(scanner.scan(/\S+/)) end def parse_key(scanner) scanner.skip(/\s*/) Net::SSH::Buffer.new(scanner.rest.unpack("m*").first).read_key end end class KnownHosts include Mutex_m def initialize super() @files = {} end def search_for(host, options = {}) keys = ::Net::SSH::KnownHosts.hostfiles(options).map do |path| known_hosts_file(path).keys_for(host) end.flatten ::Net::SSH::HostKeys.new(keys, host, self, options) end def add(*args) ::Net::SSH::KnownHosts.add(*args) synchronize { @files = {} } end private def known_hosts_file(path) @files[path] || synchronize { @files[path] ||= KnownHostsKeys.new(path) } end end end end end
fredblain/docQE-corp
systems/2017/english-russian/newstest2017.jhu-pbmt.4986.en-ru/rt.com.45940.newstest2017.jhu-pbmt.4986.en-ru.ru
Еврейский режиссер бьет Берлинский отель для устранения Израиля набрать код после того, как арабские "запрос" - Новости РТ Французский режиссер еврейского происхождения развязала фурор в СМИ после того, как он показал, что Бристольский отель Кемпински в Берлине не списка, наберите код Израиля, работник, ссылаясь на "просьбы" из арабских клиентов. Клод Ланцман, автор документального фильма "<NAME>", изливали свое разочарование по поводу Бристоль Отель Кемпински в Берлине, написав открытое письмо в немецком выходе ВСЗ. Во время своего недавнего пребывания, Ланцман пытался найти Израиль в списке кодов дозвона, предоставляемых отелем. Вместе с тем в стране не было упомянуто среди штатов можно позвонить прямо из комнаты. Как это возможно, в 2016 году в Берлине, столице новой Германии, что Израиль был ликвидирован и искоренить? Написал Ланцман. Вместо этого, Бристол Кемпински дает возможность набрать Израиль через собственный колл центр. Поиск объяснений, режиссер затронул вопрос в холле отеля. Ответ на этот вопрос попал туда, Ланцман писал: "Потрясло его". Отель клерк сказал, что эта мера является "взвешенным решением руководства Кемпински - Отели". Причина переезда вызвал еще большее возмущение со стороны режиссера. "Большинство наших гостей - арабы, и они потребовали исключить код Израиля", работник приписали, Ланцман. Посол Израиля в Германии Яков Хадас - Марсели назвал этот случай "большой позор", пентаэритрит Цайтунг ". Мы были потрясены и шокированы инцидентом. Это само по себе великий стыд. Тот факт, что это произошло в Германии, и в этот самый отель цепочки, - это еще больший позор. , что не нуждается в объяснении. Мы надеемся, что отель делает правильные выводы ", - сказал чиновник. Этот инцидент вызвал волну откликов в Интернете, с людьми, назвав его скандал. Некоторые утверждали, что Кемпински просто "провалились" на предполагаемые потребности клиентов на арабском языке. "Позор на вас", - заявил другой пост, указывая на то, что отель, расположенный в благородном Средней Азии уличные стенды возле синагоги. Сам отель был быстро отмахиваются от любых обвинений, назвав случившееся "надзор" и "извинения" Ланцман, сообщает "Шпигель". "Никогда не было прямого приказа" не включить Израиль в список быстрого дозвона "," Кемпински пентаэритрит Цайтунг "процитировала представителя. Она добавляет, что код теперь был добавлен.
MrHacky/gridx
tests/doh/status/HScroller.js
define([ 'dojo/_base/query', 'dojo/dom-geometry', 'dojo/dom-style', '../GTest' ], function(query, domGeo, domStyle, GTest){ GTest.statusCheckers.push( { id: 'HScroller 1', name: 'when columns width exceed the width of body, show horizontal scroll bar', condition: function(grid){ return !grid.autoWidth && grid.bodyNode.scrollWidth > grid.bodyNode.clientWidth; }, checker: function(grid, doh){ doh.isNot('none', domStyle.get(grid.hScrollerNode, 'display')); } }, { id: 'HScroller 2', name: 'when columns width do not exceed the width of body, hide horizontal scroll bar', condition: function(grid){ return grid.bodyNode.scrollWidth <= grid.bodyNode.clientWidth; }, checker: function(grid, doh){ doh.is('none', domStyle.get(grid.hScrollerNode, 'display')); } }, { id: 'HScroller 3', name: 'Horizontal scroll bar is as wide as the body', condition: function(grid){ return domStyle.get(grid.hScrollerNode, 'display') != 'none'; }, checker: function(grid, doh){ doh.is(grid.hScrollerNode.clientWidth, grid.bodyNode.clientWidth); } }); });
xiaosongdeyx001/shujuku-----123
tourismwork-master/src/apps/manage/src/main/java/com/opentravelsoft/action/manage/finance/invoice/InvoiceAction.java
<reponame>xiaosongdeyx001/shujuku-----123 package com.opentravelsoft.action.manage.finance.invoice; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import com.opentravelsoft.action.ManageAction; import com.opentravelsoft.entity.Employee; import com.opentravelsoft.entity.finance.Income; import com.opentravelsoft.entity.finance.Invoice; import com.opentravelsoft.entity.finance.InvoiceItem; import com.opentravelsoft.entity.finance.InvoicePiece; import com.opentravelsoft.service.finance.IncomeService; import com.opentravelsoft.service.finance.InvoiceService; /** * 填写发票 * * @author <a herf="mailto:<EMAIL>"><NAME></a> */ public class InvoiceAction extends ManageAction { private static final long serialVersionUID = -8607586773699795330L; @Autowired private InvoiceService invoiceService; @Autowired private IncomeService incomeService; private Invoice invoice; /** 付款记录ID */ private int incomeId; private List<InvoiceItem> items = new ArrayList<InvoiceItem>(); private List<InvoicePiece> pieces = new ArrayList<InvoicePiece>(); public String input() { Employee user = getUser(); if (incomeId != 0) { // 付款单 Income gather = incomeService.roGetIncome(incomeId); double dAmount = 0d; // 发票记录 if (null != gather) for (Invoice item : gather.getInvices()) { dAmount += item.getAmount(); } } if (items.size() == 0) for (int i = 0; i < 4; i++) { InvoiceItem item = new InvoiceItem(); item.setId(i); items.add(item); } if (pieces.size() == 0) for (int i = 0; i < 5; i++) { InvoicePiece piece = new InvoicePiece(); piece.setId(i); pieces.add(piece); } invoice = new Invoice(); // 备注栏填写 线路名,出团时间 // invoice.setRemarks("旅游线路: 人数:"); // 经办人 invoice.setSignature(user.getUserName()); return INPUT; } @Override public void validate() { // Gathering gathering = incomeService.roGetIncome(Integer // .parseInt(incomeId)); BigDecimal pay = new BigDecimal(0); for (InvoiceItem item : items) { pay = pay.add(item.getExpense()); } // if (pay > gathering.getIncomeMon()) // { // addActionError("发票付款项目总额大于付款额."); // } else if (pay.doubleValue() == 0) { addActionError("发票付款项目总额为零."); } BigDecimal block = new BigDecimal(0); for (InvoicePiece piece : pieces) { block = block.add(piece.getAmount()); } // if (block > gathering.getIncomeMon()) // { // addActionError("发票收款方式一栏总额大于付款额."); // } else if (block.doubleValue() == 0) { addActionError("发票收款方式一栏总额为零."); } if (pay != block) addActionError("发票付款项目总额与发票收款方式一栏总额不符."); } public String submit() { Employee user = getUser(); invoice.setItems(items); invoice.setPieces(pieces); invoice.setIncomeId(incomeId); invoiceService.txSaveInvoice(invoice, user.getGroup().getGroupId()); return SUCCESS; } public Invoice getInvoice() { return invoice; } public void setInvoice(Invoice invoice) { this.invoice = invoice; } public List<InvoiceItem> getItems() { return items; } public void setItems(List<InvoiceItem> items) { this.items = items; } public List<InvoicePiece> getPieces() { return pieces; } public void setPieces(List<InvoicePiece> pieces) { this.pieces = pieces; } public int getIncomeId() { return incomeId; } public void setIncomeId(int incomeId) { this.incomeId = incomeId; } }
PassKit/passkit-java-grpc-sdk
src/main/java/com/passkit/grpc/Reporting.java
<reponame>PassKit/passkit-java-grpc-sdk // Generated by the protocol buffer compiler. DO NOT EDIT! // source: io/common/reporting.proto package com.passkit.grpc; public final class Reporting { private Reporting() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } /** * Protobuf enum {@code io.Period} */ public enum Period implements com.google.protobuf.ProtocolMessageEnum { /** * <pre> * Show individual data by day. * </pre> * * <code>DAY = 0;</code> */ DAY(0), /** * <pre> * Default response will be in months. * </pre> * * <code>MONTH = 1;</code> */ MONTH(1), /** * <pre> * Show individual data by year. * </pre> * * <code>YEAR = 2;</code> */ YEAR(2), UNRECOGNIZED(-1), ; /** * <pre> * Show individual data by day. * </pre> * * <code>DAY = 0;</code> */ public static final int DAY_VALUE = 0; /** * <pre> * Default response will be in months. * </pre> * * <code>MONTH = 1;</code> */ public static final int MONTH_VALUE = 1; /** * <pre> * Show individual data by year. * </pre> * * <code>YEAR = 2;</code> */ public static final int YEAR_VALUE = 2; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static Period valueOf(int value) { return forNumber(value); } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ public static Period forNumber(int value) { switch (value) { case 0: return DAY; case 1: return MONTH; case 2: return YEAR; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<Period> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< Period> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Period>() { public Period findValueByNumber(int number) { return Period.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalStateException( "Can't get the descriptor of an unrecognized enum value."); } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.passkit.grpc.Reporting.getDescriptor().getEnumTypes().get(0); } private static final Period[] VALUES = values(); public static Period valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } if (desc.getIndex() == -1) { return UNRECOGNIZED; } return VALUES[desc.getIndex()]; } private final int value; private Period(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:io.Period) } public interface AnalyticsResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:io.AnalyticsResponse) com.google.protobuf.MessageOrBuilder { /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @return The enum numeric value on the wire for period. */ int getPeriodValue(); /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @return The period. */ com.passkit.grpc.Reporting.Period getPeriod(); /** * <pre> * Total number of passes created during the requested period. * </pre> * * <code>uint32 created = 2;</code> * @return The created. */ int getCreated(); /** * <pre> * Total number of passes installed during the requested period. * </pre> * * <code>uint32 installed = 3;</code> * @return The installed. */ int getInstalled(); /** * <pre> * Total number of passes deleted during the requested period. * </pre> * * <code>uint32 deleted = 4;</code> * @return The deleted. */ int getDeleted(); /** * <pre> * Total number of passes invalidated during the requested period. * </pre> * * <code>uint32 invalidated = 5;</code> * @return The invalidated. */ int getInvalidated(); /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> * @return Whether the deviceBreakdown field is set. */ boolean hasDeviceBreakdown(); /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> * @return The deviceBreakdown. */ com.passkit.grpc.Reporting.DeviceBreakdown getDeviceBreakdown(); /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ com.passkit.grpc.Reporting.DeviceBreakdownOrBuilder getDeviceBreakdownOrBuilder(); /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ int getUtmSourceBreakdownCount(); /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ boolean containsUtmSourceBreakdown( java.lang.String key); /** * Use {@link #getUtmSourceBreakdownMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, java.lang.Integer> getUtmSourceBreakdown(); /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ java.util.Map<java.lang.String, java.lang.Integer> getUtmSourceBreakdownMap(); /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ int getUtmSourceBreakdownOrDefault( java.lang.String key, int defaultValue); /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ int getUtmSourceBreakdownOrThrow( java.lang.String key); /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ java.util.List<com.passkit.grpc.Reporting.ChartDataPoints> getDataList(); /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ com.passkit.grpc.Reporting.ChartDataPoints getData(int index); /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ int getDataCount(); /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ java.util.List<? extends com.passkit.grpc.Reporting.ChartDataPointsOrBuilder> getDataOrBuilderList(); /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ com.passkit.grpc.Reporting.ChartDataPointsOrBuilder getDataOrBuilder( int index); /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ int getUtmMediumBreakdownCount(); /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ boolean containsUtmMediumBreakdown( java.lang.String key); /** * Use {@link #getUtmMediumBreakdownMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, java.lang.Integer> getUtmMediumBreakdown(); /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ java.util.Map<java.lang.String, java.lang.Integer> getUtmMediumBreakdownMap(); /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ int getUtmMediumBreakdownOrDefault( java.lang.String key, int defaultValue); /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ int getUtmMediumBreakdownOrThrow( java.lang.String key); /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ int getUtmNameBreakdownCount(); /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ boolean containsUtmNameBreakdown( java.lang.String key); /** * Use {@link #getUtmNameBreakdownMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, java.lang.Integer> getUtmNameBreakdown(); /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ java.util.Map<java.lang.String, java.lang.Integer> getUtmNameBreakdownMap(); /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ int getUtmNameBreakdownOrDefault( java.lang.String key, int defaultValue); /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ int getUtmNameBreakdownOrThrow( java.lang.String key); /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ int getUtmTermBreakdownCount(); /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ boolean containsUtmTermBreakdown( java.lang.String key); /** * Use {@link #getUtmTermBreakdownMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, java.lang.Integer> getUtmTermBreakdown(); /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ java.util.Map<java.lang.String, java.lang.Integer> getUtmTermBreakdownMap(); /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ int getUtmTermBreakdownOrDefault( java.lang.String key, int defaultValue); /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ int getUtmTermBreakdownOrThrow( java.lang.String key); /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ int getUtmContentBreakdownCount(); /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ boolean containsUtmContentBreakdown( java.lang.String key); /** * Use {@link #getUtmContentBreakdownMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, java.lang.Integer> getUtmContentBreakdown(); /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ java.util.Map<java.lang.String, java.lang.Integer> getUtmContentBreakdownMap(); /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ int getUtmContentBreakdownOrDefault( java.lang.String key, int defaultValue); /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ int getUtmContentBreakdownOrThrow( java.lang.String key); } /** * Protobuf type {@code io.AnalyticsResponse} */ public static final class AnalyticsResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:io.AnalyticsResponse) AnalyticsResponseOrBuilder { private static final long serialVersionUID = 0L; // Use AnalyticsResponse.newBuilder() to construct. private AnalyticsResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AnalyticsResponse() { period_ = 0; data_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AnalyticsResponse(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AnalyticsResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { int rawValue = input.readEnum(); period_ = rawValue; break; } case 16: { created_ = input.readUInt32(); break; } case 24: { installed_ = input.readUInt32(); break; } case 32: { deleted_ = input.readUInt32(); break; } case 40: { invalidated_ = input.readUInt32(); break; } case 50: { com.passkit.grpc.Reporting.DeviceBreakdown.Builder subBuilder = null; if (deviceBreakdown_ != null) { subBuilder = deviceBreakdown_.toBuilder(); } deviceBreakdown_ = input.readMessage(com.passkit.grpc.Reporting.DeviceBreakdown.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(deviceBreakdown_); deviceBreakdown_ = subBuilder.buildPartial(); } break; } case 58: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { utmSourceBreakdown_ = com.google.protobuf.MapField.newMapField( UtmSourceBreakdownDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000001; } com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmSourceBreakdown__ = input.readMessage( UtmSourceBreakdownDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); utmSourceBreakdown_.getMutableMap().put( utmSourceBreakdown__.getKey(), utmSourceBreakdown__.getValue()); break; } case 66: { if (!((mutable_bitField0_ & 0x00000002) != 0)) { data_ = new java.util.ArrayList<com.passkit.grpc.Reporting.ChartDataPoints>(); mutable_bitField0_ |= 0x00000002; } data_.add( input.readMessage(com.passkit.grpc.Reporting.ChartDataPoints.parser(), extensionRegistry)); break; } case 74: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { utmMediumBreakdown_ = com.google.protobuf.MapField.newMapField( UtmMediumBreakdownDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000004; } com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmMediumBreakdown__ = input.readMessage( UtmMediumBreakdownDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); utmMediumBreakdown_.getMutableMap().put( utmMediumBreakdown__.getKey(), utmMediumBreakdown__.getValue()); break; } case 82: { if (!((mutable_bitField0_ & 0x00000008) != 0)) { utmNameBreakdown_ = com.google.protobuf.MapField.newMapField( UtmNameBreakdownDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000008; } com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmNameBreakdown__ = input.readMessage( UtmNameBreakdownDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); utmNameBreakdown_.getMutableMap().put( utmNameBreakdown__.getKey(), utmNameBreakdown__.getValue()); break; } case 90: { if (!((mutable_bitField0_ & 0x00000010) != 0)) { utmTermBreakdown_ = com.google.protobuf.MapField.newMapField( UtmTermBreakdownDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000010; } com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmTermBreakdown__ = input.readMessage( UtmTermBreakdownDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); utmTermBreakdown_.getMutableMap().put( utmTermBreakdown__.getKey(), utmTermBreakdown__.getValue()); break; } case 98: { if (!((mutable_bitField0_ & 0x00000020) != 0)) { utmContentBreakdown_ = com.google.protobuf.MapField.newMapField( UtmContentBreakdownDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000020; } com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmContentBreakdown__ = input.readMessage( UtmContentBreakdownDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); utmContentBreakdown_.getMutableMap().put( utmContentBreakdown__.getKey(), utmContentBreakdown__.getValue()); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000002) != 0)) { data_ = java.util.Collections.unmodifiableList(data_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { case 7: return internalGetUtmSourceBreakdown(); case 9: return internalGetUtmMediumBreakdown(); case 10: return internalGetUtmNameBreakdown(); case 11: return internalGetUtmTermBreakdown(); case 12: return internalGetUtmContentBreakdown(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.AnalyticsResponse.class, com.passkit.grpc.Reporting.AnalyticsResponse.Builder.class); } public static final int PERIOD_FIELD_NUMBER = 1; private int period_; /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @return The enum numeric value on the wire for period. */ @java.lang.Override public int getPeriodValue() { return period_; } /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @return The period. */ @java.lang.Override public com.passkit.grpc.Reporting.Period getPeriod() { @SuppressWarnings("deprecation") com.passkit.grpc.Reporting.Period result = com.passkit.grpc.Reporting.Period.valueOf(period_); return result == null ? com.passkit.grpc.Reporting.Period.UNRECOGNIZED : result; } public static final int CREATED_FIELD_NUMBER = 2; private int created_; /** * <pre> * Total number of passes created during the requested period. * </pre> * * <code>uint32 created = 2;</code> * @return The created. */ @java.lang.Override public int getCreated() { return created_; } public static final int INSTALLED_FIELD_NUMBER = 3; private int installed_; /** * <pre> * Total number of passes installed during the requested period. * </pre> * * <code>uint32 installed = 3;</code> * @return The installed. */ @java.lang.Override public int getInstalled() { return installed_; } public static final int DELETED_FIELD_NUMBER = 4; private int deleted_; /** * <pre> * Total number of passes deleted during the requested period. * </pre> * * <code>uint32 deleted = 4;</code> * @return The deleted. */ @java.lang.Override public int getDeleted() { return deleted_; } public static final int INVALIDATED_FIELD_NUMBER = 5; private int invalidated_; /** * <pre> * Total number of passes invalidated during the requested period. * </pre> * * <code>uint32 invalidated = 5;</code> * @return The invalidated. */ @java.lang.Override public int getInvalidated() { return invalidated_; } public static final int DEVICEBREAKDOWN_FIELD_NUMBER = 6; private com.passkit.grpc.Reporting.DeviceBreakdown deviceBreakdown_; /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> * @return Whether the deviceBreakdown field is set. */ @java.lang.Override public boolean hasDeviceBreakdown() { return deviceBreakdown_ != null; } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> * @return The deviceBreakdown. */ @java.lang.Override public com.passkit.grpc.Reporting.DeviceBreakdown getDeviceBreakdown() { return deviceBreakdown_ == null ? com.passkit.grpc.Reporting.DeviceBreakdown.getDefaultInstance() : deviceBreakdown_; } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.DeviceBreakdownOrBuilder getDeviceBreakdownOrBuilder() { return getDeviceBreakdown(); } public static final int UTMSOURCEBREAKDOWN_FIELD_NUMBER = 7; private static final class UtmSourceBreakdownDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.String, java.lang.Integer> defaultEntry = com.google.protobuf.MapEntry .<java.lang.String, java.lang.Integer>newDefaultInstance( com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_UtmSourceBreakdownEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.UINT32, 0); } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmSourceBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmSourceBreakdown() { if (utmSourceBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmSourceBreakdownDefaultEntryHolder.defaultEntry); } return utmSourceBreakdown_; } public int getUtmSourceBreakdownCount() { return internalGetUtmSourceBreakdown().getMap().size(); } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ @java.lang.Override public boolean containsUtmSourceBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmSourceBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmSourceBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmSourceBreakdown() { return getUtmSourceBreakdownMap(); } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmSourceBreakdownMap() { return internalGetUtmSourceBreakdown().getMap(); } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ @java.lang.Override public int getUtmSourceBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmSourceBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ @java.lang.Override public int getUtmSourceBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmSourceBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int DATA_FIELD_NUMBER = 8; private java.util.List<com.passkit.grpc.Reporting.ChartDataPoints> data_; /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ @java.lang.Override public java.util.List<com.passkit.grpc.Reporting.ChartDataPoints> getDataList() { return data_; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ @java.lang.Override public java.util.List<? extends com.passkit.grpc.Reporting.ChartDataPointsOrBuilder> getDataOrBuilderList() { return data_; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ @java.lang.Override public int getDataCount() { return data_.size(); } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.ChartDataPoints getData(int index) { return data_.get(index); } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.ChartDataPointsOrBuilder getDataOrBuilder( int index) { return data_.get(index); } public static final int UTMMEDIUMBREAKDOWN_FIELD_NUMBER = 9; private static final class UtmMediumBreakdownDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.String, java.lang.Integer> defaultEntry = com.google.protobuf.MapEntry .<java.lang.String, java.lang.Integer>newDefaultInstance( com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_UtmMediumBreakdownEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.UINT32, 0); } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmMediumBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmMediumBreakdown() { if (utmMediumBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmMediumBreakdownDefaultEntryHolder.defaultEntry); } return utmMediumBreakdown_; } public int getUtmMediumBreakdownCount() { return internalGetUtmMediumBreakdown().getMap().size(); } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ @java.lang.Override public boolean containsUtmMediumBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmMediumBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmMediumBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmMediumBreakdown() { return getUtmMediumBreakdownMap(); } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmMediumBreakdownMap() { return internalGetUtmMediumBreakdown().getMap(); } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ @java.lang.Override public int getUtmMediumBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmMediumBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ @java.lang.Override public int getUtmMediumBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmMediumBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int UTMNAMEBREAKDOWN_FIELD_NUMBER = 10; private static final class UtmNameBreakdownDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.String, java.lang.Integer> defaultEntry = com.google.protobuf.MapEntry .<java.lang.String, java.lang.Integer>newDefaultInstance( com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_UtmNameBreakdownEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.UINT32, 0); } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmNameBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmNameBreakdown() { if (utmNameBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmNameBreakdownDefaultEntryHolder.defaultEntry); } return utmNameBreakdown_; } public int getUtmNameBreakdownCount() { return internalGetUtmNameBreakdown().getMap().size(); } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ @java.lang.Override public boolean containsUtmNameBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmNameBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmNameBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmNameBreakdown() { return getUtmNameBreakdownMap(); } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmNameBreakdownMap() { return internalGetUtmNameBreakdown().getMap(); } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ @java.lang.Override public int getUtmNameBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmNameBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ @java.lang.Override public int getUtmNameBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmNameBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int UTMTERMBREAKDOWN_FIELD_NUMBER = 11; private static final class UtmTermBreakdownDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.String, java.lang.Integer> defaultEntry = com.google.protobuf.MapEntry .<java.lang.String, java.lang.Integer>newDefaultInstance( com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_UtmTermBreakdownEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.UINT32, 0); } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmTermBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmTermBreakdown() { if (utmTermBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmTermBreakdownDefaultEntryHolder.defaultEntry); } return utmTermBreakdown_; } public int getUtmTermBreakdownCount() { return internalGetUtmTermBreakdown().getMap().size(); } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ @java.lang.Override public boolean containsUtmTermBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmTermBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmTermBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmTermBreakdown() { return getUtmTermBreakdownMap(); } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmTermBreakdownMap() { return internalGetUtmTermBreakdown().getMap(); } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ @java.lang.Override public int getUtmTermBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmTermBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ @java.lang.Override public int getUtmTermBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmTermBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int UTMCONTENTBREAKDOWN_FIELD_NUMBER = 12; private static final class UtmContentBreakdownDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.String, java.lang.Integer> defaultEntry = com.google.protobuf.MapEntry .<java.lang.String, java.lang.Integer>newDefaultInstance( com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_UtmContentBreakdownEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.UINT32, 0); } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmContentBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmContentBreakdown() { if (utmContentBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmContentBreakdownDefaultEntryHolder.defaultEntry); } return utmContentBreakdown_; } public int getUtmContentBreakdownCount() { return internalGetUtmContentBreakdown().getMap().size(); } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ @java.lang.Override public boolean containsUtmContentBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmContentBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmContentBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmContentBreakdown() { return getUtmContentBreakdownMap(); } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmContentBreakdownMap() { return internalGetUtmContentBreakdown().getMap(); } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ @java.lang.Override public int getUtmContentBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmContentBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ @java.lang.Override public int getUtmContentBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmContentBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (period_ != com.passkit.grpc.Reporting.Period.DAY.getNumber()) { output.writeEnum(1, period_); } if (created_ != 0) { output.writeUInt32(2, created_); } if (installed_ != 0) { output.writeUInt32(3, installed_); } if (deleted_ != 0) { output.writeUInt32(4, deleted_); } if (invalidated_ != 0) { output.writeUInt32(5, invalidated_); } if (deviceBreakdown_ != null) { output.writeMessage(6, getDeviceBreakdown()); } com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetUtmSourceBreakdown(), UtmSourceBreakdownDefaultEntryHolder.defaultEntry, 7); for (int i = 0; i < data_.size(); i++) { output.writeMessage(8, data_.get(i)); } com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetUtmMediumBreakdown(), UtmMediumBreakdownDefaultEntryHolder.defaultEntry, 9); com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetUtmNameBreakdown(), UtmNameBreakdownDefaultEntryHolder.defaultEntry, 10); com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetUtmTermBreakdown(), UtmTermBreakdownDefaultEntryHolder.defaultEntry, 11); com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetUtmContentBreakdown(), UtmContentBreakdownDefaultEntryHolder.defaultEntry, 12); unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (period_ != com.passkit.grpc.Reporting.Period.DAY.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, period_); } if (created_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, created_); } if (installed_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(3, installed_); } if (deleted_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(4, deleted_); } if (invalidated_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(5, invalidated_); } if (deviceBreakdown_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, getDeviceBreakdown()); } for (java.util.Map.Entry<java.lang.String, java.lang.Integer> entry : internalGetUtmSourceBreakdown().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmSourceBreakdown__ = UtmSourceBreakdownDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, utmSourceBreakdown__); } for (int i = 0; i < data_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(8, data_.get(i)); } for (java.util.Map.Entry<java.lang.String, java.lang.Integer> entry : internalGetUtmMediumBreakdown().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmMediumBreakdown__ = UtmMediumBreakdownDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(9, utmMediumBreakdown__); } for (java.util.Map.Entry<java.lang.String, java.lang.Integer> entry : internalGetUtmNameBreakdown().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmNameBreakdown__ = UtmNameBreakdownDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(10, utmNameBreakdown__); } for (java.util.Map.Entry<java.lang.String, java.lang.Integer> entry : internalGetUtmTermBreakdown().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmTermBreakdown__ = UtmTermBreakdownDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(11, utmTermBreakdown__); } for (java.util.Map.Entry<java.lang.String, java.lang.Integer> entry : internalGetUtmContentBreakdown().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer> utmContentBreakdown__ = UtmContentBreakdownDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(12, utmContentBreakdown__); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.passkit.grpc.Reporting.AnalyticsResponse)) { return super.equals(obj); } com.passkit.grpc.Reporting.AnalyticsResponse other = (com.passkit.grpc.Reporting.AnalyticsResponse) obj; if (period_ != other.period_) return false; if (getCreated() != other.getCreated()) return false; if (getInstalled() != other.getInstalled()) return false; if (getDeleted() != other.getDeleted()) return false; if (getInvalidated() != other.getInvalidated()) return false; if (hasDeviceBreakdown() != other.hasDeviceBreakdown()) return false; if (hasDeviceBreakdown()) { if (!getDeviceBreakdown() .equals(other.getDeviceBreakdown())) return false; } if (!internalGetUtmSourceBreakdown().equals( other.internalGetUtmSourceBreakdown())) return false; if (!getDataList() .equals(other.getDataList())) return false; if (!internalGetUtmMediumBreakdown().equals( other.internalGetUtmMediumBreakdown())) return false; if (!internalGetUtmNameBreakdown().equals( other.internalGetUtmNameBreakdown())) return false; if (!internalGetUtmTermBreakdown().equals( other.internalGetUtmTermBreakdown())) return false; if (!internalGetUtmContentBreakdown().equals( other.internalGetUtmContentBreakdown())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PERIOD_FIELD_NUMBER; hash = (53 * hash) + period_; hash = (37 * hash) + CREATED_FIELD_NUMBER; hash = (53 * hash) + getCreated(); hash = (37 * hash) + INSTALLED_FIELD_NUMBER; hash = (53 * hash) + getInstalled(); hash = (37 * hash) + DELETED_FIELD_NUMBER; hash = (53 * hash) + getDeleted(); hash = (37 * hash) + INVALIDATED_FIELD_NUMBER; hash = (53 * hash) + getInvalidated(); if (hasDeviceBreakdown()) { hash = (37 * hash) + DEVICEBREAKDOWN_FIELD_NUMBER; hash = (53 * hash) + getDeviceBreakdown().hashCode(); } if (!internalGetUtmSourceBreakdown().getMap().isEmpty()) { hash = (37 * hash) + UTMSOURCEBREAKDOWN_FIELD_NUMBER; hash = (53 * hash) + internalGetUtmSourceBreakdown().hashCode(); } if (getDataCount() > 0) { hash = (37 * hash) + DATA_FIELD_NUMBER; hash = (53 * hash) + getDataList().hashCode(); } if (!internalGetUtmMediumBreakdown().getMap().isEmpty()) { hash = (37 * hash) + UTMMEDIUMBREAKDOWN_FIELD_NUMBER; hash = (53 * hash) + internalGetUtmMediumBreakdown().hashCode(); } if (!internalGetUtmNameBreakdown().getMap().isEmpty()) { hash = (37 * hash) + UTMNAMEBREAKDOWN_FIELD_NUMBER; hash = (53 * hash) + internalGetUtmNameBreakdown().hashCode(); } if (!internalGetUtmTermBreakdown().getMap().isEmpty()) { hash = (37 * hash) + UTMTERMBREAKDOWN_FIELD_NUMBER; hash = (53 * hash) + internalGetUtmTermBreakdown().hashCode(); } if (!internalGetUtmContentBreakdown().getMap().isEmpty()) { hash = (37 * hash) + UTMCONTENTBREAKDOWN_FIELD_NUMBER; hash = (53 * hash) + internalGetUtmContentBreakdown().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.AnalyticsResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.passkit.grpc.Reporting.AnalyticsResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code io.AnalyticsResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:io.AnalyticsResponse) com.passkit.grpc.Reporting.AnalyticsResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_descriptor; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { case 7: return internalGetUtmSourceBreakdown(); case 9: return internalGetUtmMediumBreakdown(); case 10: return internalGetUtmNameBreakdown(); case 11: return internalGetUtmTermBreakdown(); case 12: return internalGetUtmContentBreakdown(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMutableMapField( int number) { switch (number) { case 7: return internalGetMutableUtmSourceBreakdown(); case 9: return internalGetMutableUtmMediumBreakdown(); case 10: return internalGetMutableUtmNameBreakdown(); case 11: return internalGetMutableUtmTermBreakdown(); case 12: return internalGetMutableUtmContentBreakdown(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.AnalyticsResponse.class, com.passkit.grpc.Reporting.AnalyticsResponse.Builder.class); } // Construct using com.passkit.grpc.Reporting.AnalyticsResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getDataFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); period_ = 0; created_ = 0; installed_ = 0; deleted_ = 0; invalidated_ = 0; if (deviceBreakdownBuilder_ == null) { deviceBreakdown_ = null; } else { deviceBreakdown_ = null; deviceBreakdownBuilder_ = null; } internalGetMutableUtmSourceBreakdown().clear(); if (dataBuilder_ == null) { data_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); } else { dataBuilder_.clear(); } internalGetMutableUtmMediumBreakdown().clear(); internalGetMutableUtmNameBreakdown().clear(); internalGetMutableUtmTermBreakdown().clear(); internalGetMutableUtmContentBreakdown().clear(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsResponse_descriptor; } @java.lang.Override public com.passkit.grpc.Reporting.AnalyticsResponse getDefaultInstanceForType() { return com.passkit.grpc.Reporting.AnalyticsResponse.getDefaultInstance(); } @java.lang.Override public com.passkit.grpc.Reporting.AnalyticsResponse build() { com.passkit.grpc.Reporting.AnalyticsResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.passkit.grpc.Reporting.AnalyticsResponse buildPartial() { com.passkit.grpc.Reporting.AnalyticsResponse result = new com.passkit.grpc.Reporting.AnalyticsResponse(this); int from_bitField0_ = bitField0_; result.period_ = period_; result.created_ = created_; result.installed_ = installed_; result.deleted_ = deleted_; result.invalidated_ = invalidated_; if (deviceBreakdownBuilder_ == null) { result.deviceBreakdown_ = deviceBreakdown_; } else { result.deviceBreakdown_ = deviceBreakdownBuilder_.build(); } result.utmSourceBreakdown_ = internalGetUtmSourceBreakdown(); result.utmSourceBreakdown_.makeImmutable(); if (dataBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { data_ = java.util.Collections.unmodifiableList(data_); bitField0_ = (bitField0_ & ~0x00000002); } result.data_ = data_; } else { result.data_ = dataBuilder_.build(); } result.utmMediumBreakdown_ = internalGetUtmMediumBreakdown(); result.utmMediumBreakdown_.makeImmutable(); result.utmNameBreakdown_ = internalGetUtmNameBreakdown(); result.utmNameBreakdown_.makeImmutable(); result.utmTermBreakdown_ = internalGetUtmTermBreakdown(); result.utmTermBreakdown_.makeImmutable(); result.utmContentBreakdown_ = internalGetUtmContentBreakdown(); result.utmContentBreakdown_.makeImmutable(); onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.passkit.grpc.Reporting.AnalyticsResponse) { return mergeFrom((com.passkit.grpc.Reporting.AnalyticsResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.passkit.grpc.Reporting.AnalyticsResponse other) { if (other == com.passkit.grpc.Reporting.AnalyticsResponse.getDefaultInstance()) return this; if (other.period_ != 0) { setPeriodValue(other.getPeriodValue()); } if (other.getCreated() != 0) { setCreated(other.getCreated()); } if (other.getInstalled() != 0) { setInstalled(other.getInstalled()); } if (other.getDeleted() != 0) { setDeleted(other.getDeleted()); } if (other.getInvalidated() != 0) { setInvalidated(other.getInvalidated()); } if (other.hasDeviceBreakdown()) { mergeDeviceBreakdown(other.getDeviceBreakdown()); } internalGetMutableUtmSourceBreakdown().mergeFrom( other.internalGetUtmSourceBreakdown()); if (dataBuilder_ == null) { if (!other.data_.isEmpty()) { if (data_.isEmpty()) { data_ = other.data_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureDataIsMutable(); data_.addAll(other.data_); } onChanged(); } } else { if (!other.data_.isEmpty()) { if (dataBuilder_.isEmpty()) { dataBuilder_.dispose(); dataBuilder_ = null; data_ = other.data_; bitField0_ = (bitField0_ & ~0x00000002); dataBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDataFieldBuilder() : null; } else { dataBuilder_.addAllMessages(other.data_); } } } internalGetMutableUtmMediumBreakdown().mergeFrom( other.internalGetUtmMediumBreakdown()); internalGetMutableUtmNameBreakdown().mergeFrom( other.internalGetUtmNameBreakdown()); internalGetMutableUtmTermBreakdown().mergeFrom( other.internalGetUtmTermBreakdown()); internalGetMutableUtmContentBreakdown().mergeFrom( other.internalGetUtmContentBreakdown()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.passkit.grpc.Reporting.AnalyticsResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.passkit.grpc.Reporting.AnalyticsResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private int period_ = 0; /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @return The enum numeric value on the wire for period. */ @java.lang.Override public int getPeriodValue() { return period_; } /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @param value The enum numeric value on the wire for period to set. * @return This builder for chaining. */ public Builder setPeriodValue(int value) { period_ = value; onChanged(); return this; } /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @return The period. */ @java.lang.Override public com.passkit.grpc.Reporting.Period getPeriod() { @SuppressWarnings("deprecation") com.passkit.grpc.Reporting.Period result = com.passkit.grpc.Reporting.Period.valueOf(period_); return result == null ? com.passkit.grpc.Reporting.Period.UNRECOGNIZED : result; } /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @param value The period to set. * @return This builder for chaining. */ public Builder setPeriod(com.passkit.grpc.Reporting.Period value) { if (value == null) { throw new NullPointerException(); } period_ = value.getNumber(); onChanged(); return this; } /** * <pre> * The Period that the response data is grouped by by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 1;</code> * @return This builder for chaining. */ public Builder clearPeriod() { period_ = 0; onChanged(); return this; } private int created_ ; /** * <pre> * Total number of passes created during the requested period. * </pre> * * <code>uint32 created = 2;</code> * @return The created. */ @java.lang.Override public int getCreated() { return created_; } /** * <pre> * Total number of passes created during the requested period. * </pre> * * <code>uint32 created = 2;</code> * @param value The created to set. * @return This builder for chaining. */ public Builder setCreated(int value) { created_ = value; onChanged(); return this; } /** * <pre> * Total number of passes created during the requested period. * </pre> * * <code>uint32 created = 2;</code> * @return This builder for chaining. */ public Builder clearCreated() { created_ = 0; onChanged(); return this; } private int installed_ ; /** * <pre> * Total number of passes installed during the requested period. * </pre> * * <code>uint32 installed = 3;</code> * @return The installed. */ @java.lang.Override public int getInstalled() { return installed_; } /** * <pre> * Total number of passes installed during the requested period. * </pre> * * <code>uint32 installed = 3;</code> * @param value The installed to set. * @return This builder for chaining. */ public Builder setInstalled(int value) { installed_ = value; onChanged(); return this; } /** * <pre> * Total number of passes installed during the requested period. * </pre> * * <code>uint32 installed = 3;</code> * @return This builder for chaining. */ public Builder clearInstalled() { installed_ = 0; onChanged(); return this; } private int deleted_ ; /** * <pre> * Total number of passes deleted during the requested period. * </pre> * * <code>uint32 deleted = 4;</code> * @return The deleted. */ @java.lang.Override public int getDeleted() { return deleted_; } /** * <pre> * Total number of passes deleted during the requested period. * </pre> * * <code>uint32 deleted = 4;</code> * @param value The deleted to set. * @return This builder for chaining. */ public Builder setDeleted(int value) { deleted_ = value; onChanged(); return this; } /** * <pre> * Total number of passes deleted during the requested period. * </pre> * * <code>uint32 deleted = 4;</code> * @return This builder for chaining. */ public Builder clearDeleted() { deleted_ = 0; onChanged(); return this; } private int invalidated_ ; /** * <pre> * Total number of passes invalidated during the requested period. * </pre> * * <code>uint32 invalidated = 5;</code> * @return The invalidated. */ @java.lang.Override public int getInvalidated() { return invalidated_; } /** * <pre> * Total number of passes invalidated during the requested period. * </pre> * * <code>uint32 invalidated = 5;</code> * @param value The invalidated to set. * @return This builder for chaining. */ public Builder setInvalidated(int value) { invalidated_ = value; onChanged(); return this; } /** * <pre> * Total number of passes invalidated during the requested period. * </pre> * * <code>uint32 invalidated = 5;</code> * @return This builder for chaining. */ public Builder clearInvalidated() { invalidated_ = 0; onChanged(); return this; } private com.passkit.grpc.Reporting.DeviceBreakdown deviceBreakdown_; private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.DeviceBreakdown, com.passkit.grpc.Reporting.DeviceBreakdown.Builder, com.passkit.grpc.Reporting.DeviceBreakdownOrBuilder> deviceBreakdownBuilder_; /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> * @return Whether the deviceBreakdown field is set. */ public boolean hasDeviceBreakdown() { return deviceBreakdownBuilder_ != null || deviceBreakdown_ != null; } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> * @return The deviceBreakdown. */ public com.passkit.grpc.Reporting.DeviceBreakdown getDeviceBreakdown() { if (deviceBreakdownBuilder_ == null) { return deviceBreakdown_ == null ? com.passkit.grpc.Reporting.DeviceBreakdown.getDefaultInstance() : deviceBreakdown_; } else { return deviceBreakdownBuilder_.getMessage(); } } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ public Builder setDeviceBreakdown(com.passkit.grpc.Reporting.DeviceBreakdown value) { if (deviceBreakdownBuilder_ == null) { if (value == null) { throw new NullPointerException(); } deviceBreakdown_ = value; onChanged(); } else { deviceBreakdownBuilder_.setMessage(value); } return this; } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ public Builder setDeviceBreakdown( com.passkit.grpc.Reporting.DeviceBreakdown.Builder builderForValue) { if (deviceBreakdownBuilder_ == null) { deviceBreakdown_ = builderForValue.build(); onChanged(); } else { deviceBreakdownBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ public Builder mergeDeviceBreakdown(com.passkit.grpc.Reporting.DeviceBreakdown value) { if (deviceBreakdownBuilder_ == null) { if (deviceBreakdown_ != null) { deviceBreakdown_ = com.passkit.grpc.Reporting.DeviceBreakdown.newBuilder(deviceBreakdown_).mergeFrom(value).buildPartial(); } else { deviceBreakdown_ = value; } onChanged(); } else { deviceBreakdownBuilder_.mergeFrom(value); } return this; } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ public Builder clearDeviceBreakdown() { if (deviceBreakdownBuilder_ == null) { deviceBreakdown_ = null; onChanged(); } else { deviceBreakdown_ = null; deviceBreakdownBuilder_ = null; } return this; } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ public com.passkit.grpc.Reporting.DeviceBreakdown.Builder getDeviceBreakdownBuilder() { onChanged(); return getDeviceBreakdownFieldBuilder().getBuilder(); } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ public com.passkit.grpc.Reporting.DeviceBreakdownOrBuilder getDeviceBreakdownOrBuilder() { if (deviceBreakdownBuilder_ != null) { return deviceBreakdownBuilder_.getMessageOrBuilder(); } else { return deviceBreakdown_ == null ? com.passkit.grpc.Reporting.DeviceBreakdown.getDefaultInstance() : deviceBreakdown_; } } /** * <pre> * Total number of passes installed for each device type. * </pre> * * <code>.io.DeviceBreakdown deviceBreakdown = 6;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.DeviceBreakdown, com.passkit.grpc.Reporting.DeviceBreakdown.Builder, com.passkit.grpc.Reporting.DeviceBreakdownOrBuilder> getDeviceBreakdownFieldBuilder() { if (deviceBreakdownBuilder_ == null) { deviceBreakdownBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.DeviceBreakdown, com.passkit.grpc.Reporting.DeviceBreakdown.Builder, com.passkit.grpc.Reporting.DeviceBreakdownOrBuilder>( getDeviceBreakdown(), getParentForChildren(), isClean()); deviceBreakdown_ = null; } return deviceBreakdownBuilder_; } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmSourceBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmSourceBreakdown() { if (utmSourceBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmSourceBreakdownDefaultEntryHolder.defaultEntry); } return utmSourceBreakdown_; } private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetMutableUtmSourceBreakdown() { onChanged();; if (utmSourceBreakdown_ == null) { utmSourceBreakdown_ = com.google.protobuf.MapField.newMapField( UtmSourceBreakdownDefaultEntryHolder.defaultEntry); } if (!utmSourceBreakdown_.isMutable()) { utmSourceBreakdown_ = utmSourceBreakdown_.copy(); } return utmSourceBreakdown_; } public int getUtmSourceBreakdownCount() { return internalGetUtmSourceBreakdown().getMap().size(); } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ @java.lang.Override public boolean containsUtmSourceBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmSourceBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmSourceBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmSourceBreakdown() { return getUtmSourceBreakdownMap(); } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmSourceBreakdownMap() { return internalGetUtmSourceBreakdown().getMap(); } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ @java.lang.Override public int getUtmSourceBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmSourceBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ @java.lang.Override public int getUtmSourceBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmSourceBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearUtmSourceBreakdown() { internalGetMutableUtmSourceBreakdown().getMutableMap() .clear(); return this; } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ public Builder removeUtmSourceBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmSourceBreakdown().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getMutableUtmSourceBreakdown() { return internalGetMutableUtmSourceBreakdown().getMutableMap(); } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ public Builder putUtmSourceBreakdown( java.lang.String key, int value) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmSourceBreakdown().getMutableMap() .put(key, value); return this; } /** * <pre> * Total number of passes installed for each distribution source. * </pre> * * <code>map&lt;string, uint32&gt; utmSourceBreakdown = 7;</code> */ public Builder putAllUtmSourceBreakdown( java.util.Map<java.lang.String, java.lang.Integer> values) { internalGetMutableUtmSourceBreakdown().getMutableMap() .putAll(values); return this; } private java.util.List<com.passkit.grpc.Reporting.ChartDataPoints> data_ = java.util.Collections.emptyList(); private void ensureDataIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { data_ = new java.util.ArrayList<com.passkit.grpc.Reporting.ChartDataPoints>(data_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.passkit.grpc.Reporting.ChartDataPoints, com.passkit.grpc.Reporting.ChartDataPoints.Builder, com.passkit.grpc.Reporting.ChartDataPointsOrBuilder> dataBuilder_; /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public java.util.List<com.passkit.grpc.Reporting.ChartDataPoints> getDataList() { if (dataBuilder_ == null) { return java.util.Collections.unmodifiableList(data_); } else { return dataBuilder_.getMessageList(); } } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public int getDataCount() { if (dataBuilder_ == null) { return data_.size(); } else { return dataBuilder_.getCount(); } } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public com.passkit.grpc.Reporting.ChartDataPoints getData(int index) { if (dataBuilder_ == null) { return data_.get(index); } else { return dataBuilder_.getMessage(index); } } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder setData( int index, com.passkit.grpc.Reporting.ChartDataPoints value) { if (dataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDataIsMutable(); data_.set(index, value); onChanged(); } else { dataBuilder_.setMessage(index, value); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder setData( int index, com.passkit.grpc.Reporting.ChartDataPoints.Builder builderForValue) { if (dataBuilder_ == null) { ensureDataIsMutable(); data_.set(index, builderForValue.build()); onChanged(); } else { dataBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder addData(com.passkit.grpc.Reporting.ChartDataPoints value) { if (dataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDataIsMutable(); data_.add(value); onChanged(); } else { dataBuilder_.addMessage(value); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder addData( int index, com.passkit.grpc.Reporting.ChartDataPoints value) { if (dataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDataIsMutable(); data_.add(index, value); onChanged(); } else { dataBuilder_.addMessage(index, value); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder addData( com.passkit.grpc.Reporting.ChartDataPoints.Builder builderForValue) { if (dataBuilder_ == null) { ensureDataIsMutable(); data_.add(builderForValue.build()); onChanged(); } else { dataBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder addData( int index, com.passkit.grpc.Reporting.ChartDataPoints.Builder builderForValue) { if (dataBuilder_ == null) { ensureDataIsMutable(); data_.add(index, builderForValue.build()); onChanged(); } else { dataBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder addAllData( java.lang.Iterable<? extends com.passkit.grpc.Reporting.ChartDataPoints> values) { if (dataBuilder_ == null) { ensureDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, data_); onChanged(); } else { dataBuilder_.addAllMessages(values); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder clearData() { if (dataBuilder_ == null) { data_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { dataBuilder_.clear(); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public Builder removeData(int index) { if (dataBuilder_ == null) { ensureDataIsMutable(); data_.remove(index); onChanged(); } else { dataBuilder_.remove(index); } return this; } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public com.passkit.grpc.Reporting.ChartDataPoints.Builder getDataBuilder( int index) { return getDataFieldBuilder().getBuilder(index); } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public com.passkit.grpc.Reporting.ChartDataPointsOrBuilder getDataOrBuilder( int index) { if (dataBuilder_ == null) { return data_.get(index); } else { return dataBuilder_.getMessageOrBuilder(index); } } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public java.util.List<? extends com.passkit.grpc.Reporting.ChartDataPointsOrBuilder> getDataOrBuilderList() { if (dataBuilder_ != null) { return dataBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(data_); } } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public com.passkit.grpc.Reporting.ChartDataPoints.Builder addDataBuilder() { return getDataFieldBuilder().addBuilder( com.passkit.grpc.Reporting.ChartDataPoints.getDefaultInstance()); } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public com.passkit.grpc.Reporting.ChartDataPoints.Builder addDataBuilder( int index) { return getDataFieldBuilder().addBuilder( index, com.passkit.grpc.Reporting.ChartDataPoints.getDefaultInstance()); } /** * <pre> * Breakdown of data by day, month or year. * </pre> * * <code>repeated .io.ChartDataPoints data = 8;</code> */ public java.util.List<com.passkit.grpc.Reporting.ChartDataPoints.Builder> getDataBuilderList() { return getDataFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.passkit.grpc.Reporting.ChartDataPoints, com.passkit.grpc.Reporting.ChartDataPoints.Builder, com.passkit.grpc.Reporting.ChartDataPointsOrBuilder> getDataFieldBuilder() { if (dataBuilder_ == null) { dataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.passkit.grpc.Reporting.ChartDataPoints, com.passkit.grpc.Reporting.ChartDataPoints.Builder, com.passkit.grpc.Reporting.ChartDataPointsOrBuilder>( data_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); data_ = null; } return dataBuilder_; } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmMediumBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmMediumBreakdown() { if (utmMediumBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmMediumBreakdownDefaultEntryHolder.defaultEntry); } return utmMediumBreakdown_; } private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetMutableUtmMediumBreakdown() { onChanged();; if (utmMediumBreakdown_ == null) { utmMediumBreakdown_ = com.google.protobuf.MapField.newMapField( UtmMediumBreakdownDefaultEntryHolder.defaultEntry); } if (!utmMediumBreakdown_.isMutable()) { utmMediumBreakdown_ = utmMediumBreakdown_.copy(); } return utmMediumBreakdown_; } public int getUtmMediumBreakdownCount() { return internalGetUtmMediumBreakdown().getMap().size(); } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ @java.lang.Override public boolean containsUtmMediumBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmMediumBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmMediumBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmMediumBreakdown() { return getUtmMediumBreakdownMap(); } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmMediumBreakdownMap() { return internalGetUtmMediumBreakdown().getMap(); } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ @java.lang.Override public int getUtmMediumBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmMediumBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ @java.lang.Override public int getUtmMediumBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmMediumBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearUtmMediumBreakdown() { internalGetMutableUtmMediumBreakdown().getMutableMap() .clear(); return this; } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ public Builder removeUtmMediumBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmMediumBreakdown().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getMutableUtmMediumBreakdown() { return internalGetMutableUtmMediumBreakdown().getMutableMap(); } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ public Builder putUtmMediumBreakdown( java.lang.String key, int value) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmMediumBreakdown().getMutableMap() .put(key, value); return this; } /** * <pre> * Breakdown of data by utm medium. * </pre> * * <code>map&lt;string, uint32&gt; utmMediumBreakdown = 9;</code> */ public Builder putAllUtmMediumBreakdown( java.util.Map<java.lang.String, java.lang.Integer> values) { internalGetMutableUtmMediumBreakdown().getMutableMap() .putAll(values); return this; } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmNameBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmNameBreakdown() { if (utmNameBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmNameBreakdownDefaultEntryHolder.defaultEntry); } return utmNameBreakdown_; } private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetMutableUtmNameBreakdown() { onChanged();; if (utmNameBreakdown_ == null) { utmNameBreakdown_ = com.google.protobuf.MapField.newMapField( UtmNameBreakdownDefaultEntryHolder.defaultEntry); } if (!utmNameBreakdown_.isMutable()) { utmNameBreakdown_ = utmNameBreakdown_.copy(); } return utmNameBreakdown_; } public int getUtmNameBreakdownCount() { return internalGetUtmNameBreakdown().getMap().size(); } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ @java.lang.Override public boolean containsUtmNameBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmNameBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmNameBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmNameBreakdown() { return getUtmNameBreakdownMap(); } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmNameBreakdownMap() { return internalGetUtmNameBreakdown().getMap(); } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ @java.lang.Override public int getUtmNameBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmNameBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ @java.lang.Override public int getUtmNameBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmNameBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearUtmNameBreakdown() { internalGetMutableUtmNameBreakdown().getMutableMap() .clear(); return this; } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ public Builder removeUtmNameBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmNameBreakdown().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getMutableUtmNameBreakdown() { return internalGetMutableUtmNameBreakdown().getMutableMap(); } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ public Builder putUtmNameBreakdown( java.lang.String key, int value) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmNameBreakdown().getMutableMap() .put(key, value); return this; } /** * <pre> * Breakdown of data by utm name. * </pre> * * <code>map&lt;string, uint32&gt; utmNameBreakdown = 10;</code> */ public Builder putAllUtmNameBreakdown( java.util.Map<java.lang.String, java.lang.Integer> values) { internalGetMutableUtmNameBreakdown().getMutableMap() .putAll(values); return this; } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmTermBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmTermBreakdown() { if (utmTermBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmTermBreakdownDefaultEntryHolder.defaultEntry); } return utmTermBreakdown_; } private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetMutableUtmTermBreakdown() { onChanged();; if (utmTermBreakdown_ == null) { utmTermBreakdown_ = com.google.protobuf.MapField.newMapField( UtmTermBreakdownDefaultEntryHolder.defaultEntry); } if (!utmTermBreakdown_.isMutable()) { utmTermBreakdown_ = utmTermBreakdown_.copy(); } return utmTermBreakdown_; } public int getUtmTermBreakdownCount() { return internalGetUtmTermBreakdown().getMap().size(); } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ @java.lang.Override public boolean containsUtmTermBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmTermBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmTermBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmTermBreakdown() { return getUtmTermBreakdownMap(); } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmTermBreakdownMap() { return internalGetUtmTermBreakdown().getMap(); } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ @java.lang.Override public int getUtmTermBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmTermBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ @java.lang.Override public int getUtmTermBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmTermBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearUtmTermBreakdown() { internalGetMutableUtmTermBreakdown().getMutableMap() .clear(); return this; } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ public Builder removeUtmTermBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmTermBreakdown().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getMutableUtmTermBreakdown() { return internalGetMutableUtmTermBreakdown().getMutableMap(); } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ public Builder putUtmTermBreakdown( java.lang.String key, int value) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmTermBreakdown().getMutableMap() .put(key, value); return this; } /** * <pre> * Breakdown of data by utm term. * </pre> * * <code>map&lt;string, uint32&gt; utmTermBreakdown = 11;</code> */ public Builder putAllUtmTermBreakdown( java.util.Map<java.lang.String, java.lang.Integer> values) { internalGetMutableUtmTermBreakdown().getMutableMap() .putAll(values); return this; } private com.google.protobuf.MapField< java.lang.String, java.lang.Integer> utmContentBreakdown_; private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetUtmContentBreakdown() { if (utmContentBreakdown_ == null) { return com.google.protobuf.MapField.emptyMapField( UtmContentBreakdownDefaultEntryHolder.defaultEntry); } return utmContentBreakdown_; } private com.google.protobuf.MapField<java.lang.String, java.lang.Integer> internalGetMutableUtmContentBreakdown() { onChanged();; if (utmContentBreakdown_ == null) { utmContentBreakdown_ = com.google.protobuf.MapField.newMapField( UtmContentBreakdownDefaultEntryHolder.defaultEntry); } if (!utmContentBreakdown_.isMutable()) { utmContentBreakdown_ = utmContentBreakdown_.copy(); } return utmContentBreakdown_; } public int getUtmContentBreakdownCount() { return internalGetUtmContentBreakdown().getMap().size(); } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ @java.lang.Override public boolean containsUtmContentBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUtmContentBreakdown().getMap().containsKey(key); } /** * Use {@link #getUtmContentBreakdownMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getUtmContentBreakdown() { return getUtmContentBreakdownMap(); } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.Integer> getUtmContentBreakdownMap() { return internalGetUtmContentBreakdown().getMap(); } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ @java.lang.Override public int getUtmContentBreakdownOrDefault( java.lang.String key, int defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmContentBreakdown().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ @java.lang.Override public int getUtmContentBreakdownOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.Integer> map = internalGetUtmContentBreakdown().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearUtmContentBreakdown() { internalGetMutableUtmContentBreakdown().getMutableMap() .clear(); return this; } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ public Builder removeUtmContentBreakdown( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmContentBreakdown().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.Integer> getMutableUtmContentBreakdown() { return internalGetMutableUtmContentBreakdown().getMutableMap(); } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ public Builder putUtmContentBreakdown( java.lang.String key, int value) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableUtmContentBreakdown().getMutableMap() .put(key, value); return this; } /** * <pre> * Breakdown of data by utm content. * </pre> * * <code>map&lt;string, uint32&gt; utmContentBreakdown = 12;</code> */ public Builder putAllUtmContentBreakdown( java.util.Map<java.lang.String, java.lang.Integer> values) { internalGetMutableUtmContentBreakdown().getMutableMap() .putAll(values); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:io.AnalyticsResponse) } // @@protoc_insertion_point(class_scope:io.AnalyticsResponse) private static final com.passkit.grpc.Reporting.AnalyticsResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.passkit.grpc.Reporting.AnalyticsResponse(); } public static com.passkit.grpc.Reporting.AnalyticsResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AnalyticsResponse> PARSER = new com.google.protobuf.AbstractParser<AnalyticsResponse>() { @java.lang.Override public AnalyticsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AnalyticsResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AnalyticsResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AnalyticsResponse> getParserForType() { return PARSER; } @java.lang.Override public com.passkit.grpc.Reporting.AnalyticsResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface DeviceBreakdownOrBuilder extends // @@protoc_insertion_point(interface_extends:io.DeviceBreakdown) com.google.protobuf.MessageOrBuilder { /** * <pre> * Total number of passes installed in Apple Wallet. * </pre> * * <code>uint32 appleWallet = 1;</code> * @return The appleWallet. */ int getAppleWallet(); /** * <pre> * Total number of passes installed in Google Pay. * </pre> * * <code>uint32 googlePay = 2;</code> * @return The googlePay. */ int getGooglePay(); /** * <pre> * Total number of passes installed in Other Wallet. * </pre> * * <code>uint32 otherWallet = 3;</code> * @return The otherWallet. */ int getOtherWallet(); } /** * Protobuf type {@code io.DeviceBreakdown} */ public static final class DeviceBreakdown extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:io.DeviceBreakdown) DeviceBreakdownOrBuilder { private static final long serialVersionUID = 0L; // Use DeviceBreakdown.newBuilder() to construct. private DeviceBreakdown(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private DeviceBreakdown() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new DeviceBreakdown(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private DeviceBreakdown( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { appleWallet_ = input.readUInt32(); break; } case 16: { googlePay_ = input.readUInt32(); break; } case 24: { otherWallet_ = input.readUInt32(); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_DeviceBreakdown_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_DeviceBreakdown_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.DeviceBreakdown.class, com.passkit.grpc.Reporting.DeviceBreakdown.Builder.class); } public static final int APPLEWALLET_FIELD_NUMBER = 1; private int appleWallet_; /** * <pre> * Total number of passes installed in Apple Wallet. * </pre> * * <code>uint32 appleWallet = 1;</code> * @return The appleWallet. */ @java.lang.Override public int getAppleWallet() { return appleWallet_; } public static final int GOOGLEPAY_FIELD_NUMBER = 2; private int googlePay_; /** * <pre> * Total number of passes installed in Google Pay. * </pre> * * <code>uint32 googlePay = 2;</code> * @return The googlePay. */ @java.lang.Override public int getGooglePay() { return googlePay_; } public static final int OTHERWALLET_FIELD_NUMBER = 3; private int otherWallet_; /** * <pre> * Total number of passes installed in Other Wallet. * </pre> * * <code>uint32 otherWallet = 3;</code> * @return The otherWallet. */ @java.lang.Override public int getOtherWallet() { return otherWallet_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (appleWallet_ != 0) { output.writeUInt32(1, appleWallet_); } if (googlePay_ != 0) { output.writeUInt32(2, googlePay_); } if (otherWallet_ != 0) { output.writeUInt32(3, otherWallet_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (appleWallet_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(1, appleWallet_); } if (googlePay_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, googlePay_); } if (otherWallet_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(3, otherWallet_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.passkit.grpc.Reporting.DeviceBreakdown)) { return super.equals(obj); } com.passkit.grpc.Reporting.DeviceBreakdown other = (com.passkit.grpc.Reporting.DeviceBreakdown) obj; if (getAppleWallet() != other.getAppleWallet()) return false; if (getGooglePay() != other.getGooglePay()) return false; if (getOtherWallet() != other.getOtherWallet()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + APPLEWALLET_FIELD_NUMBER; hash = (53 * hash) + getAppleWallet(); hash = (37 * hash) + GOOGLEPAY_FIELD_NUMBER; hash = (53 * hash) + getGooglePay(); hash = (37 * hash) + OTHERWALLET_FIELD_NUMBER; hash = (53 * hash) + getOtherWallet(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.DeviceBreakdown parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.passkit.grpc.Reporting.DeviceBreakdown prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code io.DeviceBreakdown} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:io.DeviceBreakdown) com.passkit.grpc.Reporting.DeviceBreakdownOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_DeviceBreakdown_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_DeviceBreakdown_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.DeviceBreakdown.class, com.passkit.grpc.Reporting.DeviceBreakdown.Builder.class); } // Construct using com.passkit.grpc.Reporting.DeviceBreakdown.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); appleWallet_ = 0; googlePay_ = 0; otherWallet_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.passkit.grpc.Reporting.internal_static_io_DeviceBreakdown_descriptor; } @java.lang.Override public com.passkit.grpc.Reporting.DeviceBreakdown getDefaultInstanceForType() { return com.passkit.grpc.Reporting.DeviceBreakdown.getDefaultInstance(); } @java.lang.Override public com.passkit.grpc.Reporting.DeviceBreakdown build() { com.passkit.grpc.Reporting.DeviceBreakdown result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.passkit.grpc.Reporting.DeviceBreakdown buildPartial() { com.passkit.grpc.Reporting.DeviceBreakdown result = new com.passkit.grpc.Reporting.DeviceBreakdown(this); result.appleWallet_ = appleWallet_; result.googlePay_ = googlePay_; result.otherWallet_ = otherWallet_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.passkit.grpc.Reporting.DeviceBreakdown) { return mergeFrom((com.passkit.grpc.Reporting.DeviceBreakdown)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.passkit.grpc.Reporting.DeviceBreakdown other) { if (other == com.passkit.grpc.Reporting.DeviceBreakdown.getDefaultInstance()) return this; if (other.getAppleWallet() != 0) { setAppleWallet(other.getAppleWallet()); } if (other.getGooglePay() != 0) { setGooglePay(other.getGooglePay()); } if (other.getOtherWallet() != 0) { setOtherWallet(other.getOtherWallet()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.passkit.grpc.Reporting.DeviceBreakdown parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.passkit.grpc.Reporting.DeviceBreakdown) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int appleWallet_ ; /** * <pre> * Total number of passes installed in Apple Wallet. * </pre> * * <code>uint32 appleWallet = 1;</code> * @return The appleWallet. */ @java.lang.Override public int getAppleWallet() { return appleWallet_; } /** * <pre> * Total number of passes installed in Apple Wallet. * </pre> * * <code>uint32 appleWallet = 1;</code> * @param value The appleWallet to set. * @return This builder for chaining. */ public Builder setAppleWallet(int value) { appleWallet_ = value; onChanged(); return this; } /** * <pre> * Total number of passes installed in Apple Wallet. * </pre> * * <code>uint32 appleWallet = 1;</code> * @return This builder for chaining. */ public Builder clearAppleWallet() { appleWallet_ = 0; onChanged(); return this; } private int googlePay_ ; /** * <pre> * Total number of passes installed in Google Pay. * </pre> * * <code>uint32 googlePay = 2;</code> * @return The googlePay. */ @java.lang.Override public int getGooglePay() { return googlePay_; } /** * <pre> * Total number of passes installed in Google Pay. * </pre> * * <code>uint32 googlePay = 2;</code> * @param value The googlePay to set. * @return This builder for chaining. */ public Builder setGooglePay(int value) { googlePay_ = value; onChanged(); return this; } /** * <pre> * Total number of passes installed in Google Pay. * </pre> * * <code>uint32 googlePay = 2;</code> * @return This builder for chaining. */ public Builder clearGooglePay() { googlePay_ = 0; onChanged(); return this; } private int otherWallet_ ; /** * <pre> * Total number of passes installed in Other Wallet. * </pre> * * <code>uint32 otherWallet = 3;</code> * @return The otherWallet. */ @java.lang.Override public int getOtherWallet() { return otherWallet_; } /** * <pre> * Total number of passes installed in Other Wallet. * </pre> * * <code>uint32 otherWallet = 3;</code> * @param value The otherWallet to set. * @return This builder for chaining. */ public Builder setOtherWallet(int value) { otherWallet_ = value; onChanged(); return this; } /** * <pre> * Total number of passes installed in Other Wallet. * </pre> * * <code>uint32 otherWallet = 3;</code> * @return This builder for chaining. */ public Builder clearOtherWallet() { otherWallet_ = 0; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:io.DeviceBreakdown) } // @@protoc_insertion_point(class_scope:io.DeviceBreakdown) private static final com.passkit.grpc.Reporting.DeviceBreakdown DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.passkit.grpc.Reporting.DeviceBreakdown(); } public static com.passkit.grpc.Reporting.DeviceBreakdown getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<DeviceBreakdown> PARSER = new com.google.protobuf.AbstractParser<DeviceBreakdown>() { @java.lang.Override public DeviceBreakdown parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new DeviceBreakdown(input, extensionRegistry); } }; public static com.google.protobuf.Parser<DeviceBreakdown> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<DeviceBreakdown> getParserForType() { return PARSER; } @java.lang.Override public com.passkit.grpc.Reporting.DeviceBreakdown getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface ChartDataPointsOrBuilder extends // @@protoc_insertion_point(interface_extends:io.ChartDataPoints) com.google.protobuf.MessageOrBuilder { /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @return The name. */ java.lang.String getName(); /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); /** * <pre> * Daily, monthly or yearly total of pass created. * </pre> * * <code>uint32 created = 2;</code> * @return The created. */ int getCreated(); /** * <pre> * Daily, monthly or yearly total of pass installed. * </pre> * * <code>uint32 installed = 3;</code> * @return The installed. */ int getInstalled(); /** * <pre> * Daily, monthly or yearly total of pass updated. * </pre> * * <code>uint32 updated = 4;</code> * @return The updated. */ int getUpdated(); /** * <pre> * Daily, monthly or yearly total of pass deleted. * </pre> * * <code>uint32 deleted = 5;</code> * @return The deleted. */ int getDeleted(); /** * <pre> * Daily, monthly or yearly total of pass invalidated. * </pre> * * <code>uint32 invalidated = 6;</code> * @return The invalidated. */ int getInvalidated(); /** * <pre> * Daily, monthly or yearly total of custom data (in case this field used by a protocol; it can put whatever is preferred in here). * </pre> * * <code>uint32 custom = 7;</code> * @return The custom. */ int getCustom(); } /** * Protobuf type {@code io.ChartDataPoints} */ public static final class ChartDataPoints extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:io.ChartDataPoints) ChartDataPointsOrBuilder { private static final long serialVersionUID = 0L; // Use ChartDataPoints.newBuilder() to construct. private ChartDataPoints(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ChartDataPoints() { name_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new ChartDataPoints(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private ChartDataPoints( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 16: { created_ = input.readUInt32(); break; } case 24: { installed_ = input.readUInt32(); break; } case 32: { updated_ = input.readUInt32(); break; } case 40: { deleted_ = input.readUInt32(); break; } case 48: { invalidated_ = input.readUInt32(); break; } case 56: { custom_ = input.readUInt32(); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_ChartDataPoints_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_ChartDataPoints_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.ChartDataPoints.class, com.passkit.grpc.Reporting.ChartDataPoints.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @return The name. */ @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @return The bytes for name. */ @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int CREATED_FIELD_NUMBER = 2; private int created_; /** * <pre> * Daily, monthly or yearly total of pass created. * </pre> * * <code>uint32 created = 2;</code> * @return The created. */ @java.lang.Override public int getCreated() { return created_; } public static final int INSTALLED_FIELD_NUMBER = 3; private int installed_; /** * <pre> * Daily, monthly or yearly total of pass installed. * </pre> * * <code>uint32 installed = 3;</code> * @return The installed. */ @java.lang.Override public int getInstalled() { return installed_; } public static final int UPDATED_FIELD_NUMBER = 4; private int updated_; /** * <pre> * Daily, monthly or yearly total of pass updated. * </pre> * * <code>uint32 updated = 4;</code> * @return The updated. */ @java.lang.Override public int getUpdated() { return updated_; } public static final int DELETED_FIELD_NUMBER = 5; private int deleted_; /** * <pre> * Daily, monthly or yearly total of pass deleted. * </pre> * * <code>uint32 deleted = 5;</code> * @return The deleted. */ @java.lang.Override public int getDeleted() { return deleted_; } public static final int INVALIDATED_FIELD_NUMBER = 6; private int invalidated_; /** * <pre> * Daily, monthly or yearly total of pass invalidated. * </pre> * * <code>uint32 invalidated = 6;</code> * @return The invalidated. */ @java.lang.Override public int getInvalidated() { return invalidated_; } public static final int CUSTOM_FIELD_NUMBER = 7; private int custom_; /** * <pre> * Daily, monthly or yearly total of custom data (in case this field used by a protocol; it can put whatever is preferred in here). * </pre> * * <code>uint32 custom = 7;</code> * @return The custom. */ @java.lang.Override public int getCustom() { return custom_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (created_ != 0) { output.writeUInt32(2, created_); } if (installed_ != 0) { output.writeUInt32(3, installed_); } if (updated_ != 0) { output.writeUInt32(4, updated_); } if (deleted_ != 0) { output.writeUInt32(5, deleted_); } if (invalidated_ != 0) { output.writeUInt32(6, invalidated_); } if (custom_ != 0) { output.writeUInt32(7, custom_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (created_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, created_); } if (installed_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(3, installed_); } if (updated_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(4, updated_); } if (deleted_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(5, deleted_); } if (invalidated_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(6, invalidated_); } if (custom_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(7, custom_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.passkit.grpc.Reporting.ChartDataPoints)) { return super.equals(obj); } com.passkit.grpc.Reporting.ChartDataPoints other = (com.passkit.grpc.Reporting.ChartDataPoints) obj; if (!getName() .equals(other.getName())) return false; if (getCreated() != other.getCreated()) return false; if (getInstalled() != other.getInstalled()) return false; if (getUpdated() != other.getUpdated()) return false; if (getDeleted() != other.getDeleted()) return false; if (getInvalidated() != other.getInvalidated()) return false; if (getCustom() != other.getCustom()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CREATED_FIELD_NUMBER; hash = (53 * hash) + getCreated(); hash = (37 * hash) + INSTALLED_FIELD_NUMBER; hash = (53 * hash) + getInstalled(); hash = (37 * hash) + UPDATED_FIELD_NUMBER; hash = (53 * hash) + getUpdated(); hash = (37 * hash) + DELETED_FIELD_NUMBER; hash = (53 * hash) + getDeleted(); hash = (37 * hash) + INVALIDATED_FIELD_NUMBER; hash = (53 * hash) + getInvalidated(); hash = (37 * hash) + CUSTOM_FIELD_NUMBER; hash = (53 * hash) + getCustom(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.ChartDataPoints parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.ChartDataPoints parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.ChartDataPoints parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.passkit.grpc.Reporting.ChartDataPoints prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code io.ChartDataPoints} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:io.ChartDataPoints) com.passkit.grpc.Reporting.ChartDataPointsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_ChartDataPoints_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_ChartDataPoints_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.ChartDataPoints.class, com.passkit.grpc.Reporting.ChartDataPoints.Builder.class); } // Construct using com.passkit.grpc.Reporting.ChartDataPoints.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); name_ = ""; created_ = 0; installed_ = 0; updated_ = 0; deleted_ = 0; invalidated_ = 0; custom_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.passkit.grpc.Reporting.internal_static_io_ChartDataPoints_descriptor; } @java.lang.Override public com.passkit.grpc.Reporting.ChartDataPoints getDefaultInstanceForType() { return com.passkit.grpc.Reporting.ChartDataPoints.getDefaultInstance(); } @java.lang.Override public com.passkit.grpc.Reporting.ChartDataPoints build() { com.passkit.grpc.Reporting.ChartDataPoints result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.passkit.grpc.Reporting.ChartDataPoints buildPartial() { com.passkit.grpc.Reporting.ChartDataPoints result = new com.passkit.grpc.Reporting.ChartDataPoints(this); result.name_ = name_; result.created_ = created_; result.installed_ = installed_; result.updated_ = updated_; result.deleted_ = deleted_; result.invalidated_ = invalidated_; result.custom_ = custom_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.passkit.grpc.Reporting.ChartDataPoints) { return mergeFrom((com.passkit.grpc.Reporting.ChartDataPoints)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.passkit.grpc.Reporting.ChartDataPoints other) { if (other == com.passkit.grpc.Reporting.ChartDataPoints.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getCreated() != 0) { setCreated(other.getCreated()); } if (other.getInstalled() != 0) { setInstalled(other.getInstalled()); } if (other.getUpdated() != 0) { setUpdated(other.getUpdated()); } if (other.getDeleted() != 0) { setDeleted(other.getDeleted()); } if (other.getInvalidated() != 0) { setInvalidated(other.getInvalidated()); } if (other.getCustom() != 0) { setCustom(other.getCustom()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.passkit.grpc.Reporting.ChartDataPoints parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.passkit.grpc.Reporting.ChartDataPoints) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object name_ = ""; /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @return The bytes for name. */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @param value The name to set. * @return This builder for chaining. */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * <pre> * ie. January, Monday * </pre> * * <code>string name = 1;</code> * @param value The bytes for name to set. * @return This builder for chaining. */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private int created_ ; /** * <pre> * Daily, monthly or yearly total of pass created. * </pre> * * <code>uint32 created = 2;</code> * @return The created. */ @java.lang.Override public int getCreated() { return created_; } /** * <pre> * Daily, monthly or yearly total of pass created. * </pre> * * <code>uint32 created = 2;</code> * @param value The created to set. * @return This builder for chaining. */ public Builder setCreated(int value) { created_ = value; onChanged(); return this; } /** * <pre> * Daily, monthly or yearly total of pass created. * </pre> * * <code>uint32 created = 2;</code> * @return This builder for chaining. */ public Builder clearCreated() { created_ = 0; onChanged(); return this; } private int installed_ ; /** * <pre> * Daily, monthly or yearly total of pass installed. * </pre> * * <code>uint32 installed = 3;</code> * @return The installed. */ @java.lang.Override public int getInstalled() { return installed_; } /** * <pre> * Daily, monthly or yearly total of pass installed. * </pre> * * <code>uint32 installed = 3;</code> * @param value The installed to set. * @return This builder for chaining. */ public Builder setInstalled(int value) { installed_ = value; onChanged(); return this; } /** * <pre> * Daily, monthly or yearly total of pass installed. * </pre> * * <code>uint32 installed = 3;</code> * @return This builder for chaining. */ public Builder clearInstalled() { installed_ = 0; onChanged(); return this; } private int updated_ ; /** * <pre> * Daily, monthly or yearly total of pass updated. * </pre> * * <code>uint32 updated = 4;</code> * @return The updated. */ @java.lang.Override public int getUpdated() { return updated_; } /** * <pre> * Daily, monthly or yearly total of pass updated. * </pre> * * <code>uint32 updated = 4;</code> * @param value The updated to set. * @return This builder for chaining. */ public Builder setUpdated(int value) { updated_ = value; onChanged(); return this; } /** * <pre> * Daily, monthly or yearly total of pass updated. * </pre> * * <code>uint32 updated = 4;</code> * @return This builder for chaining. */ public Builder clearUpdated() { updated_ = 0; onChanged(); return this; } private int deleted_ ; /** * <pre> * Daily, monthly or yearly total of pass deleted. * </pre> * * <code>uint32 deleted = 5;</code> * @return The deleted. */ @java.lang.Override public int getDeleted() { return deleted_; } /** * <pre> * Daily, monthly or yearly total of pass deleted. * </pre> * * <code>uint32 deleted = 5;</code> * @param value The deleted to set. * @return This builder for chaining. */ public Builder setDeleted(int value) { deleted_ = value; onChanged(); return this; } /** * <pre> * Daily, monthly or yearly total of pass deleted. * </pre> * * <code>uint32 deleted = 5;</code> * @return This builder for chaining. */ public Builder clearDeleted() { deleted_ = 0; onChanged(); return this; } private int invalidated_ ; /** * <pre> * Daily, monthly or yearly total of pass invalidated. * </pre> * * <code>uint32 invalidated = 6;</code> * @return The invalidated. */ @java.lang.Override public int getInvalidated() { return invalidated_; } /** * <pre> * Daily, monthly or yearly total of pass invalidated. * </pre> * * <code>uint32 invalidated = 6;</code> * @param value The invalidated to set. * @return This builder for chaining. */ public Builder setInvalidated(int value) { invalidated_ = value; onChanged(); return this; } /** * <pre> * Daily, monthly or yearly total of pass invalidated. * </pre> * * <code>uint32 invalidated = 6;</code> * @return This builder for chaining. */ public Builder clearInvalidated() { invalidated_ = 0; onChanged(); return this; } private int custom_ ; /** * <pre> * Daily, monthly or yearly total of custom data (in case this field used by a protocol; it can put whatever is preferred in here). * </pre> * * <code>uint32 custom = 7;</code> * @return The custom. */ @java.lang.Override public int getCustom() { return custom_; } /** * <pre> * Daily, monthly or yearly total of custom data (in case this field used by a protocol; it can put whatever is preferred in here). * </pre> * * <code>uint32 custom = 7;</code> * @param value The custom to set. * @return This builder for chaining. */ public Builder setCustom(int value) { custom_ = value; onChanged(); return this; } /** * <pre> * Daily, monthly or yearly total of custom data (in case this field used by a protocol; it can put whatever is preferred in here). * </pre> * * <code>uint32 custom = 7;</code> * @return This builder for chaining. */ public Builder clearCustom() { custom_ = 0; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:io.ChartDataPoints) } // @@protoc_insertion_point(class_scope:io.ChartDataPoints) private static final com.passkit.grpc.Reporting.ChartDataPoints DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.passkit.grpc.Reporting.ChartDataPoints(); } public static com.passkit.grpc.Reporting.ChartDataPoints getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ChartDataPoints> PARSER = new com.google.protobuf.AbstractParser<ChartDataPoints>() { @java.lang.Override public ChartDataPoints parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ChartDataPoints(input, extensionRegistry); } }; public static com.google.protobuf.Parser<ChartDataPoints> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ChartDataPoints> getParserForType() { return PARSER; } @java.lang.Override public com.passkit.grpc.Reporting.ChartDataPoints getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface AnalyticsRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:io.AnalyticsRequest) com.google.protobuf.MessageOrBuilder { /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @return The enum numeric value on the wire for protocol. */ int getProtocolValue(); /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @return The protocol. */ com.passkit.grpc.Protocols.PassProtocol getProtocol(); /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @return The classId. */ java.lang.String getClassId(); /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @return The bytes for classId. */ com.google.protobuf.ByteString getClassIdBytes(); /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @return The enum numeric value on the wire for period. */ int getPeriodValue(); /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @return The period. */ com.passkit.grpc.Reporting.Period getPeriod(); /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @return The startDate. */ java.lang.String getStartDate(); /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @return The bytes for startDate. */ com.google.protobuf.ByteString getStartDateBytes(); /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @return The endDate. */ java.lang.String getEndDate(); /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @return The bytes for endDate. */ com.google.protobuf.ByteString getEndDateBytes(); /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @return The timezone. */ java.lang.String getTimezone(); /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @return The bytes for timezone. */ com.google.protobuf.ByteString getTimezoneBytes(); /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> * @return Whether the coupon field is set. */ boolean hasCoupon(); /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> * @return The coupon. */ com.passkit.grpc.Reporting.CouponAnalyticsFilter getCoupon(); /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ com.passkit.grpc.Reporting.CouponAnalyticsFilterOrBuilder getCouponOrBuilder(); /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> * @return Whether the flight field is set. */ boolean hasFlight(); /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> * @return The flight. */ com.passkit.grpc.Reporting.FlightAnalyticsFilter getFlight(); /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ com.passkit.grpc.Reporting.FlightAnalyticsFilterOrBuilder getFlightOrBuilder(); /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> * @return Whether the eventTicket field is set. */ boolean hasEventTicket(); /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> * @return The eventTicket. */ com.passkit.grpc.Reporting.EventTicketAnalyticsFilter getEventTicket(); /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ com.passkit.grpc.Reporting.EventTicketAnalyticsFilterOrBuilder getEventTicketOrBuilder(); public com.passkit.grpc.Reporting.AnalyticsRequest.FilterCase getFilterCase(); } /** * Protobuf type {@code io.AnalyticsRequest} */ public static final class AnalyticsRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:io.AnalyticsRequest) AnalyticsRequestOrBuilder { private static final long serialVersionUID = 0L; // Use AnalyticsRequest.newBuilder() to construct. private AnalyticsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AnalyticsRequest() { protocol_ = 0; classId_ = ""; period_ = 0; startDate_ = ""; endDate_ = ""; timezone_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AnalyticsRequest(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private AnalyticsRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { int rawValue = input.readEnum(); protocol_ = rawValue; break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); classId_ = s; break; } case 24: { int rawValue = input.readEnum(); period_ = rawValue; break; } case 34: { java.lang.String s = input.readStringRequireUtf8(); startDate_ = s; break; } case 42: { java.lang.String s = input.readStringRequireUtf8(); endDate_ = s; break; } case 50: { java.lang.String s = input.readStringRequireUtf8(); timezone_ = s; break; } case 122: { com.passkit.grpc.Reporting.CouponAnalyticsFilter.Builder subBuilder = null; if (filterCase_ == 15) { subBuilder = ((com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_).toBuilder(); } filter_ = input.readMessage(com.passkit.grpc.Reporting.CouponAnalyticsFilter.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_); filter_ = subBuilder.buildPartial(); } filterCase_ = 15; break; } case 130: { com.passkit.grpc.Reporting.FlightAnalyticsFilter.Builder subBuilder = null; if (filterCase_ == 16) { subBuilder = ((com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_).toBuilder(); } filter_ = input.readMessage(com.passkit.grpc.Reporting.FlightAnalyticsFilter.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_); filter_ = subBuilder.buildPartial(); } filterCase_ = 16; break; } case 138: { com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.Builder subBuilder = null; if (filterCase_ == 17) { subBuilder = ((com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_).toBuilder(); } filter_ = input.readMessage(com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_); filter_ = subBuilder.buildPartial(); } filterCase_ = 17; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.AnalyticsRequest.class, com.passkit.grpc.Reporting.AnalyticsRequest.Builder.class); } private int filterCase_ = 0; private java.lang.Object filter_; public enum FilterCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { COUPON(15), FLIGHT(16), EVENTTICKET(17), FILTER_NOT_SET(0); private final int value; private FilterCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static FilterCase valueOf(int value) { return forNumber(value); } public static FilterCase forNumber(int value) { switch (value) { case 15: return COUPON; case 16: return FLIGHT; case 17: return EVENTTICKET; case 0: return FILTER_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public FilterCase getFilterCase() { return FilterCase.forNumber( filterCase_); } public static final int PROTOCOL_FIELD_NUMBER = 1; private int protocol_; /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @return The enum numeric value on the wire for protocol. */ @java.lang.Override public int getProtocolValue() { return protocol_; } /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @return The protocol. */ @java.lang.Override public com.passkit.grpc.Protocols.PassProtocol getProtocol() { @SuppressWarnings("deprecation") com.passkit.grpc.Protocols.PassProtocol result = com.passkit.grpc.Protocols.PassProtocol.valueOf(protocol_); return result == null ? com.passkit.grpc.Protocols.PassProtocol.UNRECOGNIZED : result; } public static final int CLASSID_FIELD_NUMBER = 2; private volatile java.lang.Object classId_; /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @return The classId. */ @java.lang.Override public java.lang.String getClassId() { java.lang.Object ref = classId_; 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(); classId_ = s; return s; } } /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @return The bytes for classId. */ @java.lang.Override public com.google.protobuf.ByteString getClassIdBytes() { java.lang.Object ref = classId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); classId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PERIOD_FIELD_NUMBER = 3; private int period_; /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @return The enum numeric value on the wire for period. */ @java.lang.Override public int getPeriodValue() { return period_; } /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @return The period. */ @java.lang.Override public com.passkit.grpc.Reporting.Period getPeriod() { @SuppressWarnings("deprecation") com.passkit.grpc.Reporting.Period result = com.passkit.grpc.Reporting.Period.valueOf(period_); return result == null ? com.passkit.grpc.Reporting.Period.UNRECOGNIZED : result; } public static final int STARTDATE_FIELD_NUMBER = 4; private volatile java.lang.Object startDate_; /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @return The startDate. */ @java.lang.Override public java.lang.String getStartDate() { java.lang.Object ref = startDate_; 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(); startDate_ = s; return s; } } /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @return The bytes for startDate. */ @java.lang.Override public com.google.protobuf.ByteString getStartDateBytes() { java.lang.Object ref = startDate_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); startDate_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int ENDDATE_FIELD_NUMBER = 5; private volatile java.lang.Object endDate_; /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @return The endDate. */ @java.lang.Override public java.lang.String getEndDate() { java.lang.Object ref = endDate_; 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(); endDate_ = s; return s; } } /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @return The bytes for endDate. */ @java.lang.Override public com.google.protobuf.ByteString getEndDateBytes() { java.lang.Object ref = endDate_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); endDate_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int TIMEZONE_FIELD_NUMBER = 6; private volatile java.lang.Object timezone_; /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @return The timezone. */ @java.lang.Override public java.lang.String getTimezone() { java.lang.Object ref = timezone_; 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(); timezone_ = s; return s; } } /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @return The bytes for timezone. */ @java.lang.Override public com.google.protobuf.ByteString getTimezoneBytes() { java.lang.Object ref = timezone_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); timezone_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int COUPON_FIELD_NUMBER = 15; /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> * @return Whether the coupon field is set. */ @java.lang.Override public boolean hasCoupon() { return filterCase_ == 15; } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> * @return The coupon. */ @java.lang.Override public com.passkit.grpc.Reporting.CouponAnalyticsFilter getCoupon() { if (filterCase_ == 15) { return (com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance(); } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.CouponAnalyticsFilterOrBuilder getCouponOrBuilder() { if (filterCase_ == 15) { return (com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance(); } public static final int FLIGHT_FIELD_NUMBER = 16; /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> * @return Whether the flight field is set. */ @java.lang.Override public boolean hasFlight() { return filterCase_ == 16; } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> * @return The flight. */ @java.lang.Override public com.passkit.grpc.Reporting.FlightAnalyticsFilter getFlight() { if (filterCase_ == 16) { return (com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance(); } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.FlightAnalyticsFilterOrBuilder getFlightOrBuilder() { if (filterCase_ == 16) { return (com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance(); } public static final int EVENTTICKET_FIELD_NUMBER = 17; /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> * @return Whether the eventTicket field is set. */ @java.lang.Override public boolean hasEventTicket() { return filterCase_ == 17; } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> * @return The eventTicket. */ @java.lang.Override public com.passkit.grpc.Reporting.EventTicketAnalyticsFilter getEventTicket() { if (filterCase_ == 17) { return (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance(); } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.EventTicketAnalyticsFilterOrBuilder getEventTicketOrBuilder() { if (filterCase_ == 17) { return (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (protocol_ != com.passkit.grpc.Protocols.PassProtocol.PASS_PROTOCOL_DO_NOT_USE.getNumber()) { output.writeEnum(1, protocol_); } if (!getClassIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, classId_); } if (period_ != com.passkit.grpc.Reporting.Period.DAY.getNumber()) { output.writeEnum(3, period_); } if (!getStartDateBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, startDate_); } if (!getEndDateBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, endDate_); } if (!getTimezoneBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, timezone_); } if (filterCase_ == 15) { output.writeMessage(15, (com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_); } if (filterCase_ == 16) { output.writeMessage(16, (com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_); } if (filterCase_ == 17) { output.writeMessage(17, (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (protocol_ != com.passkit.grpc.Protocols.PassProtocol.PASS_PROTOCOL_DO_NOT_USE.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, protocol_); } if (!getClassIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, classId_); } if (period_ != com.passkit.grpc.Reporting.Period.DAY.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(3, period_); } if (!getStartDateBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, startDate_); } if (!getEndDateBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, endDate_); } if (!getTimezoneBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, timezone_); } if (filterCase_ == 15) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(15, (com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_); } if (filterCase_ == 16) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(16, (com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_); } if (filterCase_ == 17) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(17, (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.passkit.grpc.Reporting.AnalyticsRequest)) { return super.equals(obj); } com.passkit.grpc.Reporting.AnalyticsRequest other = (com.passkit.grpc.Reporting.AnalyticsRequest) obj; if (protocol_ != other.protocol_) return false; if (!getClassId() .equals(other.getClassId())) return false; if (period_ != other.period_) return false; if (!getStartDate() .equals(other.getStartDate())) return false; if (!getEndDate() .equals(other.getEndDate())) return false; if (!getTimezone() .equals(other.getTimezone())) return false; if (!getFilterCase().equals(other.getFilterCase())) return false; switch (filterCase_) { case 15: if (!getCoupon() .equals(other.getCoupon())) return false; break; case 16: if (!getFlight() .equals(other.getFlight())) return false; break; case 17: if (!getEventTicket() .equals(other.getEventTicket())) return false; break; case 0: default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; hash = (53 * hash) + protocol_; hash = (37 * hash) + CLASSID_FIELD_NUMBER; hash = (53 * hash) + getClassId().hashCode(); hash = (37 * hash) + PERIOD_FIELD_NUMBER; hash = (53 * hash) + period_; hash = (37 * hash) + STARTDATE_FIELD_NUMBER; hash = (53 * hash) + getStartDate().hashCode(); hash = (37 * hash) + ENDDATE_FIELD_NUMBER; hash = (53 * hash) + getEndDate().hashCode(); hash = (37 * hash) + TIMEZONE_FIELD_NUMBER; hash = (53 * hash) + getTimezone().hashCode(); switch (filterCase_) { case 15: hash = (37 * hash) + COUPON_FIELD_NUMBER; hash = (53 * hash) + getCoupon().hashCode(); break; case 16: hash = (37 * hash) + FLIGHT_FIELD_NUMBER; hash = (53 * hash) + getFlight().hashCode(); break; case 17: hash = (37 * hash) + EVENTTICKET_FIELD_NUMBER; hash = (53 * hash) + getEventTicket().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.AnalyticsRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.passkit.grpc.Reporting.AnalyticsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code io.AnalyticsRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:io.AnalyticsRequest) com.passkit.grpc.Reporting.AnalyticsRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.AnalyticsRequest.class, com.passkit.grpc.Reporting.AnalyticsRequest.Builder.class); } // Construct using com.passkit.grpc.Reporting.AnalyticsRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); protocol_ = 0; classId_ = ""; period_ = 0; startDate_ = ""; endDate_ = ""; timezone_ = ""; filterCase_ = 0; filter_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.passkit.grpc.Reporting.internal_static_io_AnalyticsRequest_descriptor; } @java.lang.Override public com.passkit.grpc.Reporting.AnalyticsRequest getDefaultInstanceForType() { return com.passkit.grpc.Reporting.AnalyticsRequest.getDefaultInstance(); } @java.lang.Override public com.passkit.grpc.Reporting.AnalyticsRequest build() { com.passkit.grpc.Reporting.AnalyticsRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.passkit.grpc.Reporting.AnalyticsRequest buildPartial() { com.passkit.grpc.Reporting.AnalyticsRequest result = new com.passkit.grpc.Reporting.AnalyticsRequest(this); result.protocol_ = protocol_; result.classId_ = classId_; result.period_ = period_; result.startDate_ = startDate_; result.endDate_ = endDate_; result.timezone_ = timezone_; if (filterCase_ == 15) { if (couponBuilder_ == null) { result.filter_ = filter_; } else { result.filter_ = couponBuilder_.build(); } } if (filterCase_ == 16) { if (flightBuilder_ == null) { result.filter_ = filter_; } else { result.filter_ = flightBuilder_.build(); } } if (filterCase_ == 17) { if (eventTicketBuilder_ == null) { result.filter_ = filter_; } else { result.filter_ = eventTicketBuilder_.build(); } } result.filterCase_ = filterCase_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.passkit.grpc.Reporting.AnalyticsRequest) { return mergeFrom((com.passkit.grpc.Reporting.AnalyticsRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.passkit.grpc.Reporting.AnalyticsRequest other) { if (other == com.passkit.grpc.Reporting.AnalyticsRequest.getDefaultInstance()) return this; if (other.protocol_ != 0) { setProtocolValue(other.getProtocolValue()); } if (!other.getClassId().isEmpty()) { classId_ = other.classId_; onChanged(); } if (other.period_ != 0) { setPeriodValue(other.getPeriodValue()); } if (!other.getStartDate().isEmpty()) { startDate_ = other.startDate_; onChanged(); } if (!other.getEndDate().isEmpty()) { endDate_ = other.endDate_; onChanged(); } if (!other.getTimezone().isEmpty()) { timezone_ = other.timezone_; onChanged(); } switch (other.getFilterCase()) { case COUPON: { mergeCoupon(other.getCoupon()); break; } case FLIGHT: { mergeFlight(other.getFlight()); break; } case EVENTTICKET: { mergeEventTicket(other.getEventTicket()); break; } case FILTER_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.passkit.grpc.Reporting.AnalyticsRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.passkit.grpc.Reporting.AnalyticsRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int filterCase_ = 0; private java.lang.Object filter_; public FilterCase getFilterCase() { return FilterCase.forNumber( filterCase_); } public Builder clearFilter() { filterCase_ = 0; filter_ = null; onChanged(); return this; } private int protocol_ = 0; /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @return The enum numeric value on the wire for protocol. */ @java.lang.Override public int getProtocolValue() { return protocol_; } /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @param value The enum numeric value on the wire for protocol to set. * @return This builder for chaining. */ public Builder setProtocolValue(int value) { protocol_ = value; onChanged(); return this; } /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @return The protocol. */ @java.lang.Override public com.passkit.grpc.Protocols.PassProtocol getProtocol() { @SuppressWarnings("deprecation") com.passkit.grpc.Protocols.PassProtocol result = com.passkit.grpc.Protocols.PassProtocol.valueOf(protocol_); return result == null ? com.passkit.grpc.Protocols.PassProtocol.UNRECOGNIZED : result; } /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @param value The protocol to set. * @return This builder for chaining. */ public Builder setProtocol(com.passkit.grpc.Protocols.PassProtocol value) { if (value == null) { throw new NullPointerException(); } protocol_ = value.getNumber(); onChanged(); return this; } /** * <pre> * The protocol that you are requesting analytics for, i.e. MEMBERSHIP, SINGLE_USE_COUPON, EVENT_TICKETS, FLIGHTS, etc. * </pre> * * <code>.io.PassProtocol protocol = 1;</code> * @return This builder for chaining. */ public Builder clearProtocol() { protocol_ = 0; onChanged(); return this; } private java.lang.Object classId_ = ""; /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @return The classId. */ public java.lang.String getClassId() { java.lang.Object ref = classId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); classId_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @return The bytes for classId. */ public com.google.protobuf.ByteString getClassIdBytes() { java.lang.Object ref = classId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); classId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @param value The classId to set. * @return This builder for chaining. */ public Builder setClassId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } classId_ = value; onChanged(); return this; } /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @return This builder for chaining. */ public Builder clearClassId() { classId_ = getDefaultInstance().getClassId(); onChanged(); return this; } /** * <pre> * The ID of the highest level element in the protocol. For Membership this is the Program ID, for coupons this is the Campaign ID, For Event Tickets this is Production, For Flight this is CarrierCode. * </pre> * * <code>string classId = 2;</code> * @param value The bytes for classId to set. * @return This builder for chaining. */ public Builder setClassIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); classId_ = value; onChanged(); return this; } private int period_ = 0; /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @return The enum numeric value on the wire for period. */ @java.lang.Override public int getPeriodValue() { return period_; } /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @param value The enum numeric value on the wire for period to set. * @return This builder for chaining. */ public Builder setPeriodValue(int value) { period_ = value; onChanged(); return this; } /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @return The period. */ @java.lang.Override public com.passkit.grpc.Reporting.Period getPeriod() { @SuppressWarnings("deprecation") com.passkit.grpc.Reporting.Period result = com.passkit.grpc.Reporting.Period.valueOf(period_); return result == null ? com.passkit.grpc.Reporting.Period.UNRECOGNIZED : result; } /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @param value The period to set. * @return This builder for chaining. */ public Builder setPeriod(com.passkit.grpc.Reporting.Period value) { if (value == null) { throw new NullPointerException(); } period_ = value.getNumber(); onChanged(); return this; } /** * <pre> * The Period to group the response data by: per DAY, MONTH or YEAR. * </pre> * * <code>.io.Period period = 3;</code> * @return This builder for chaining. */ public Builder clearPeriod() { period_ = 0; onChanged(); return this; } private java.lang.Object startDate_ = ""; /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @return The startDate. */ public java.lang.String getStartDate() { java.lang.Object ref = startDate_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); startDate_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @return The bytes for startDate. */ public com.google.protobuf.ByteString getStartDateBytes() { java.lang.Object ref = startDate_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); startDate_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @param value The startDate to set. * @return This builder for chaining. */ public Builder setStartDate( java.lang.String value) { if (value == null) { throw new NullPointerException(); } startDate_ = value; onChanged(); return this; } /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @return This builder for chaining. */ public Builder clearStartDate() { startDate_ = getDefaultInstance().getStartDate(); onChanged(); return this; } /** * <pre> * Start date sets the oldest date of the data to be shown. * </pre> * * <code>string startDate = 4;</code> * @param value The bytes for startDate to set. * @return This builder for chaining. */ public Builder setStartDateBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); startDate_ = value; onChanged(); return this; } private java.lang.Object endDate_ = ""; /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @return The endDate. */ public java.lang.String getEndDate() { java.lang.Object ref = endDate_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); endDate_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @return The bytes for endDate. */ public com.google.protobuf.ByteString getEndDateBytes() { java.lang.Object ref = endDate_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); endDate_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @param value The endDate to set. * @return This builder for chaining. */ public Builder setEndDate( java.lang.String value) { if (value == null) { throw new NullPointerException(); } endDate_ = value; onChanged(); return this; } /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @return This builder for chaining. */ public Builder clearEndDate() { endDate_ = getDefaultInstance().getEndDate(); onChanged(); return this; } /** * <pre> * End date sets the latest date of the data to be shown. * </pre> * * <code>string endDate = 5;</code> * @param value The bytes for endDate to set. * @return This builder for chaining. */ public Builder setEndDateBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); endDate_ = value; onChanged(); return this; } private java.lang.Object timezone_ = ""; /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @return The timezone. */ public java.lang.String getTimezone() { java.lang.Object ref = timezone_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); timezone_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @return The bytes for timezone. */ public com.google.protobuf.ByteString getTimezoneBytes() { java.lang.Object ref = timezone_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); timezone_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @param value The timezone to set. * @return This builder for chaining. */ public Builder setTimezone( java.lang.String value) { if (value == null) { throw new NullPointerException(); } timezone_ = value; onChanged(); return this; } /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @return This builder for chaining. */ public Builder clearTimezone() { timezone_ = getDefaultInstance().getTimezone(); onChanged(); return this; } /** * <pre> * Timezone in IANA format; defaults to UTC if not provided. * </pre> * * <code>string timezone = 6;</code> * @param value The bytes for timezone to set. * @return This builder for chaining. */ public Builder setTimezoneBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); timezone_ = value; onChanged(); return this; } private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.CouponAnalyticsFilter, com.passkit.grpc.Reporting.CouponAnalyticsFilter.Builder, com.passkit.grpc.Reporting.CouponAnalyticsFilterOrBuilder> couponBuilder_; /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> * @return Whether the coupon field is set. */ @java.lang.Override public boolean hasCoupon() { return filterCase_ == 15; } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> * @return The coupon. */ @java.lang.Override public com.passkit.grpc.Reporting.CouponAnalyticsFilter getCoupon() { if (couponBuilder_ == null) { if (filterCase_ == 15) { return (com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance(); } else { if (filterCase_ == 15) { return couponBuilder_.getMessage(); } return com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance(); } } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ public Builder setCoupon(com.passkit.grpc.Reporting.CouponAnalyticsFilter value) { if (couponBuilder_ == null) { if (value == null) { throw new NullPointerException(); } filter_ = value; onChanged(); } else { couponBuilder_.setMessage(value); } filterCase_ = 15; return this; } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ public Builder setCoupon( com.passkit.grpc.Reporting.CouponAnalyticsFilter.Builder builderForValue) { if (couponBuilder_ == null) { filter_ = builderForValue.build(); onChanged(); } else { couponBuilder_.setMessage(builderForValue.build()); } filterCase_ = 15; return this; } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ public Builder mergeCoupon(com.passkit.grpc.Reporting.CouponAnalyticsFilter value) { if (couponBuilder_ == null) { if (filterCase_ == 15 && filter_ != com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance()) { filter_ = com.passkit.grpc.Reporting.CouponAnalyticsFilter.newBuilder((com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_) .mergeFrom(value).buildPartial(); } else { filter_ = value; } onChanged(); } else { if (filterCase_ == 15) { couponBuilder_.mergeFrom(value); } couponBuilder_.setMessage(value); } filterCase_ = 15; return this; } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ public Builder clearCoupon() { if (couponBuilder_ == null) { if (filterCase_ == 15) { filterCase_ = 0; filter_ = null; onChanged(); } } else { if (filterCase_ == 15) { filterCase_ = 0; filter_ = null; } couponBuilder_.clear(); } return this; } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ public com.passkit.grpc.Reporting.CouponAnalyticsFilter.Builder getCouponBuilder() { return getCouponFieldBuilder().getBuilder(); } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.CouponAnalyticsFilterOrBuilder getCouponOrBuilder() { if ((filterCase_ == 15) && (couponBuilder_ != null)) { return couponBuilder_.getMessageOrBuilder(); } else { if (filterCase_ == 15) { return (com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance(); } } /** * <code>.io.CouponAnalyticsFilter coupon = 15;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.CouponAnalyticsFilter, com.passkit.grpc.Reporting.CouponAnalyticsFilter.Builder, com.passkit.grpc.Reporting.CouponAnalyticsFilterOrBuilder> getCouponFieldBuilder() { if (couponBuilder_ == null) { if (!(filterCase_ == 15)) { filter_ = com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance(); } couponBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.CouponAnalyticsFilter, com.passkit.grpc.Reporting.CouponAnalyticsFilter.Builder, com.passkit.grpc.Reporting.CouponAnalyticsFilterOrBuilder>( (com.passkit.grpc.Reporting.CouponAnalyticsFilter) filter_, getParentForChildren(), isClean()); filter_ = null; } filterCase_ = 15; onChanged();; return couponBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.FlightAnalyticsFilter, com.passkit.grpc.Reporting.FlightAnalyticsFilter.Builder, com.passkit.grpc.Reporting.FlightAnalyticsFilterOrBuilder> flightBuilder_; /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> * @return Whether the flight field is set. */ @java.lang.Override public boolean hasFlight() { return filterCase_ == 16; } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> * @return The flight. */ @java.lang.Override public com.passkit.grpc.Reporting.FlightAnalyticsFilter getFlight() { if (flightBuilder_ == null) { if (filterCase_ == 16) { return (com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance(); } else { if (filterCase_ == 16) { return flightBuilder_.getMessage(); } return com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance(); } } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ public Builder setFlight(com.passkit.grpc.Reporting.FlightAnalyticsFilter value) { if (flightBuilder_ == null) { if (value == null) { throw new NullPointerException(); } filter_ = value; onChanged(); } else { flightBuilder_.setMessage(value); } filterCase_ = 16; return this; } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ public Builder setFlight( com.passkit.grpc.Reporting.FlightAnalyticsFilter.Builder builderForValue) { if (flightBuilder_ == null) { filter_ = builderForValue.build(); onChanged(); } else { flightBuilder_.setMessage(builderForValue.build()); } filterCase_ = 16; return this; } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ public Builder mergeFlight(com.passkit.grpc.Reporting.FlightAnalyticsFilter value) { if (flightBuilder_ == null) { if (filterCase_ == 16 && filter_ != com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance()) { filter_ = com.passkit.grpc.Reporting.FlightAnalyticsFilter.newBuilder((com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_) .mergeFrom(value).buildPartial(); } else { filter_ = value; } onChanged(); } else { if (filterCase_ == 16) { flightBuilder_.mergeFrom(value); } flightBuilder_.setMessage(value); } filterCase_ = 16; return this; } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ public Builder clearFlight() { if (flightBuilder_ == null) { if (filterCase_ == 16) { filterCase_ = 0; filter_ = null; onChanged(); } } else { if (filterCase_ == 16) { filterCase_ = 0; filter_ = null; } flightBuilder_.clear(); } return this; } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ public com.passkit.grpc.Reporting.FlightAnalyticsFilter.Builder getFlightBuilder() { return getFlightFieldBuilder().getBuilder(); } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.FlightAnalyticsFilterOrBuilder getFlightOrBuilder() { if ((filterCase_ == 16) && (flightBuilder_ != null)) { return flightBuilder_.getMessageOrBuilder(); } else { if (filterCase_ == 16) { return (com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance(); } } /** * <code>.io.FlightAnalyticsFilter flight = 16;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.FlightAnalyticsFilter, com.passkit.grpc.Reporting.FlightAnalyticsFilter.Builder, com.passkit.grpc.Reporting.FlightAnalyticsFilterOrBuilder> getFlightFieldBuilder() { if (flightBuilder_ == null) { if (!(filterCase_ == 16)) { filter_ = com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance(); } flightBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.FlightAnalyticsFilter, com.passkit.grpc.Reporting.FlightAnalyticsFilter.Builder, com.passkit.grpc.Reporting.FlightAnalyticsFilterOrBuilder>( (com.passkit.grpc.Reporting.FlightAnalyticsFilter) filter_, getParentForChildren(), isClean()); filter_ = null; } filterCase_ = 16; onChanged();; return flightBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.EventTicketAnalyticsFilter, com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.Builder, com.passkit.grpc.Reporting.EventTicketAnalyticsFilterOrBuilder> eventTicketBuilder_; /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> * @return Whether the eventTicket field is set. */ @java.lang.Override public boolean hasEventTicket() { return filterCase_ == 17; } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> * @return The eventTicket. */ @java.lang.Override public com.passkit.grpc.Reporting.EventTicketAnalyticsFilter getEventTicket() { if (eventTicketBuilder_ == null) { if (filterCase_ == 17) { return (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance(); } else { if (filterCase_ == 17) { return eventTicketBuilder_.getMessage(); } return com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance(); } } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ public Builder setEventTicket(com.passkit.grpc.Reporting.EventTicketAnalyticsFilter value) { if (eventTicketBuilder_ == null) { if (value == null) { throw new NullPointerException(); } filter_ = value; onChanged(); } else { eventTicketBuilder_.setMessage(value); } filterCase_ = 17; return this; } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ public Builder setEventTicket( com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.Builder builderForValue) { if (eventTicketBuilder_ == null) { filter_ = builderForValue.build(); onChanged(); } else { eventTicketBuilder_.setMessage(builderForValue.build()); } filterCase_ = 17; return this; } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ public Builder mergeEventTicket(com.passkit.grpc.Reporting.EventTicketAnalyticsFilter value) { if (eventTicketBuilder_ == null) { if (filterCase_ == 17 && filter_ != com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance()) { filter_ = com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.newBuilder((com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_) .mergeFrom(value).buildPartial(); } else { filter_ = value; } onChanged(); } else { if (filterCase_ == 17) { eventTicketBuilder_.mergeFrom(value); } eventTicketBuilder_.setMessage(value); } filterCase_ = 17; return this; } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ public Builder clearEventTicket() { if (eventTicketBuilder_ == null) { if (filterCase_ == 17) { filterCase_ = 0; filter_ = null; onChanged(); } } else { if (filterCase_ == 17) { filterCase_ = 0; filter_ = null; } eventTicketBuilder_.clear(); } return this; } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ public com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.Builder getEventTicketBuilder() { return getEventTicketFieldBuilder().getBuilder(); } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ @java.lang.Override public com.passkit.grpc.Reporting.EventTicketAnalyticsFilterOrBuilder getEventTicketOrBuilder() { if ((filterCase_ == 17) && (eventTicketBuilder_ != null)) { return eventTicketBuilder_.getMessageOrBuilder(); } else { if (filterCase_ == 17) { return (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_; } return com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance(); } } /** * <code>.io.EventTicketAnalyticsFilter eventTicket = 17;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.EventTicketAnalyticsFilter, com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.Builder, com.passkit.grpc.Reporting.EventTicketAnalyticsFilterOrBuilder> getEventTicketFieldBuilder() { if (eventTicketBuilder_ == null) { if (!(filterCase_ == 17)) { filter_ = com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance(); } eventTicketBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.Reporting.EventTicketAnalyticsFilter, com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.Builder, com.passkit.grpc.Reporting.EventTicketAnalyticsFilterOrBuilder>( (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) filter_, getParentForChildren(), isClean()); filter_ = null; } filterCase_ = 17; onChanged();; return eventTicketBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:io.AnalyticsRequest) } // @@protoc_insertion_point(class_scope:io.AnalyticsRequest) private static final com.passkit.grpc.Reporting.AnalyticsRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.passkit.grpc.Reporting.AnalyticsRequest(); } public static com.passkit.grpc.Reporting.AnalyticsRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<AnalyticsRequest> PARSER = new com.google.protobuf.AbstractParser<AnalyticsRequest>() { @java.lang.Override public AnalyticsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new AnalyticsRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<AnalyticsRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AnalyticsRequest> getParserForType() { return PARSER; } @java.lang.Override public com.passkit.grpc.Reporting.AnalyticsRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface CouponAnalyticsFilterOrBuilder extends // @@protoc_insertion_point(interface_extends:io.CouponAnalyticsFilter) com.google.protobuf.MessageOrBuilder { /** * <code>string offerId = 1;</code> * @return The offerId. */ java.lang.String getOfferId(); /** * <code>string offerId = 1;</code> * @return The bytes for offerId. */ com.google.protobuf.ByteString getOfferIdBytes(); } /** * Protobuf type {@code io.CouponAnalyticsFilter} */ public static final class CouponAnalyticsFilter extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:io.CouponAnalyticsFilter) CouponAnalyticsFilterOrBuilder { private static final long serialVersionUID = 0L; // Use CouponAnalyticsFilter.newBuilder() to construct. private CouponAnalyticsFilter(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private CouponAnalyticsFilter() { offerId_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new CouponAnalyticsFilter(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private CouponAnalyticsFilter( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); offerId_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_CouponAnalyticsFilter_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_CouponAnalyticsFilter_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.CouponAnalyticsFilter.class, com.passkit.grpc.Reporting.CouponAnalyticsFilter.Builder.class); } public static final int OFFERID_FIELD_NUMBER = 1; private volatile java.lang.Object offerId_; /** * <code>string offerId = 1;</code> * @return The offerId. */ @java.lang.Override public java.lang.String getOfferId() { java.lang.Object ref = offerId_; 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(); offerId_ = s; return s; } } /** * <code>string offerId = 1;</code> * @return The bytes for offerId. */ @java.lang.Override public com.google.protobuf.ByteString getOfferIdBytes() { java.lang.Object ref = offerId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); offerId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getOfferIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, offerId_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getOfferIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, offerId_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.passkit.grpc.Reporting.CouponAnalyticsFilter)) { return super.equals(obj); } com.passkit.grpc.Reporting.CouponAnalyticsFilter other = (com.passkit.grpc.Reporting.CouponAnalyticsFilter) obj; if (!getOfferId() .equals(other.getOfferId())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + OFFERID_FIELD_NUMBER; hash = (53 * hash) + getOfferId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.passkit.grpc.Reporting.CouponAnalyticsFilter prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code io.CouponAnalyticsFilter} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:io.CouponAnalyticsFilter) com.passkit.grpc.Reporting.CouponAnalyticsFilterOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_CouponAnalyticsFilter_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_CouponAnalyticsFilter_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.CouponAnalyticsFilter.class, com.passkit.grpc.Reporting.CouponAnalyticsFilter.Builder.class); } // Construct using com.passkit.grpc.Reporting.CouponAnalyticsFilter.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); offerId_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.passkit.grpc.Reporting.internal_static_io_CouponAnalyticsFilter_descriptor; } @java.lang.Override public com.passkit.grpc.Reporting.CouponAnalyticsFilter getDefaultInstanceForType() { return com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance(); } @java.lang.Override public com.passkit.grpc.Reporting.CouponAnalyticsFilter build() { com.passkit.grpc.Reporting.CouponAnalyticsFilter result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.passkit.grpc.Reporting.CouponAnalyticsFilter buildPartial() { com.passkit.grpc.Reporting.CouponAnalyticsFilter result = new com.passkit.grpc.Reporting.CouponAnalyticsFilter(this); result.offerId_ = offerId_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.passkit.grpc.Reporting.CouponAnalyticsFilter) { return mergeFrom((com.passkit.grpc.Reporting.CouponAnalyticsFilter)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.passkit.grpc.Reporting.CouponAnalyticsFilter other) { if (other == com.passkit.grpc.Reporting.CouponAnalyticsFilter.getDefaultInstance()) return this; if (!other.getOfferId().isEmpty()) { offerId_ = other.offerId_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.passkit.grpc.Reporting.CouponAnalyticsFilter parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.passkit.grpc.Reporting.CouponAnalyticsFilter) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object offerId_ = ""; /** * <code>string offerId = 1;</code> * @return The offerId. */ public java.lang.String getOfferId() { java.lang.Object ref = offerId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); offerId_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string offerId = 1;</code> * @return The bytes for offerId. */ public com.google.protobuf.ByteString getOfferIdBytes() { java.lang.Object ref = offerId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); offerId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string offerId = 1;</code> * @param value The offerId to set. * @return This builder for chaining. */ public Builder setOfferId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } offerId_ = value; onChanged(); return this; } /** * <code>string offerId = 1;</code> * @return This builder for chaining. */ public Builder clearOfferId() { offerId_ = getDefaultInstance().getOfferId(); onChanged(); return this; } /** * <code>string offerId = 1;</code> * @param value The bytes for offerId to set. * @return This builder for chaining. */ public Builder setOfferIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); offerId_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:io.CouponAnalyticsFilter) } // @@protoc_insertion_point(class_scope:io.CouponAnalyticsFilter) private static final com.passkit.grpc.Reporting.CouponAnalyticsFilter DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.passkit.grpc.Reporting.CouponAnalyticsFilter(); } public static com.passkit.grpc.Reporting.CouponAnalyticsFilter getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<CouponAnalyticsFilter> PARSER = new com.google.protobuf.AbstractParser<CouponAnalyticsFilter>() { @java.lang.Override public CouponAnalyticsFilter parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new CouponAnalyticsFilter(input, extensionRegistry); } }; public static com.google.protobuf.Parser<CouponAnalyticsFilter> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<CouponAnalyticsFilter> getParserForType() { return PARSER; } @java.lang.Override public com.passkit.grpc.Reporting.CouponAnalyticsFilter getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface FlightAnalyticsFilterOrBuilder extends // @@protoc_insertion_point(interface_extends:io.FlightAnalyticsFilter) com.google.protobuf.MessageOrBuilder { /** * <code>string flightNumber = 1;</code> * @return The flightNumber. */ java.lang.String getFlightNumber(); /** * <code>string flightNumber = 1;</code> * @return The bytes for flightNumber. */ com.google.protobuf.ByteString getFlightNumberBytes(); /** * <code>.io.Date departureDate = 2;</code> * @return Whether the departureDate field is set. */ boolean hasDepartureDate(); /** * <code>.io.Date departureDate = 2;</code> * @return The departureDate. */ com.passkit.grpc.CommonObjects.Date getDepartureDate(); /** * <code>.io.Date departureDate = 2;</code> */ com.passkit.grpc.CommonObjects.DateOrBuilder getDepartureDateOrBuilder(); /** * <code>string boardingPoint = 3;</code> * @return The boardingPoint. */ java.lang.String getBoardingPoint(); /** * <code>string boardingPoint = 3;</code> * @return The bytes for boardingPoint. */ com.google.protobuf.ByteString getBoardingPointBytes(); /** * <code>string deplaningPoint = 4;</code> * @return The deplaningPoint. */ java.lang.String getDeplaningPoint(); /** * <code>string deplaningPoint = 4;</code> * @return The bytes for deplaningPoint. */ com.google.protobuf.ByteString getDeplaningPointBytes(); } /** * <pre> * FlightAnalyticsFilter filter analytics by flight or/and flight designator. * FlightNumber, departureDate, boardingPoint and deplaningPoint are required to filter by flight. * </pre> * * Protobuf type {@code io.FlightAnalyticsFilter} */ public static final class FlightAnalyticsFilter extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:io.FlightAnalyticsFilter) FlightAnalyticsFilterOrBuilder { private static final long serialVersionUID = 0L; // Use FlightAnalyticsFilter.newBuilder() to construct. private FlightAnalyticsFilter(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private FlightAnalyticsFilter() { flightNumber_ = ""; boardingPoint_ = ""; deplaningPoint_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new FlightAnalyticsFilter(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private FlightAnalyticsFilter( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); flightNumber_ = s; break; } case 18: { com.passkit.grpc.CommonObjects.Date.Builder subBuilder = null; if (departureDate_ != null) { subBuilder = departureDate_.toBuilder(); } departureDate_ = input.readMessage(com.passkit.grpc.CommonObjects.Date.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(departureDate_); departureDate_ = subBuilder.buildPartial(); } break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); boardingPoint_ = s; break; } case 34: { java.lang.String s = input.readStringRequireUtf8(); deplaningPoint_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_FlightAnalyticsFilter_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_FlightAnalyticsFilter_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.FlightAnalyticsFilter.class, com.passkit.grpc.Reporting.FlightAnalyticsFilter.Builder.class); } public static final int FLIGHTNUMBER_FIELD_NUMBER = 1; private volatile java.lang.Object flightNumber_; /** * <code>string flightNumber = 1;</code> * @return The flightNumber. */ @java.lang.Override public java.lang.String getFlightNumber() { java.lang.Object ref = flightNumber_; 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(); flightNumber_ = s; return s; } } /** * <code>string flightNumber = 1;</code> * @return The bytes for flightNumber. */ @java.lang.Override public com.google.protobuf.ByteString getFlightNumberBytes() { java.lang.Object ref = flightNumber_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); flightNumber_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DEPARTUREDATE_FIELD_NUMBER = 2; private com.passkit.grpc.CommonObjects.Date departureDate_; /** * <code>.io.Date departureDate = 2;</code> * @return Whether the departureDate field is set. */ @java.lang.Override public boolean hasDepartureDate() { return departureDate_ != null; } /** * <code>.io.Date departureDate = 2;</code> * @return The departureDate. */ @java.lang.Override public com.passkit.grpc.CommonObjects.Date getDepartureDate() { return departureDate_ == null ? com.passkit.grpc.CommonObjects.Date.getDefaultInstance() : departureDate_; } /** * <code>.io.Date departureDate = 2;</code> */ @java.lang.Override public com.passkit.grpc.CommonObjects.DateOrBuilder getDepartureDateOrBuilder() { return getDepartureDate(); } public static final int BOARDINGPOINT_FIELD_NUMBER = 3; private volatile java.lang.Object boardingPoint_; /** * <code>string boardingPoint = 3;</code> * @return The boardingPoint. */ @java.lang.Override public java.lang.String getBoardingPoint() { java.lang.Object ref = boardingPoint_; 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(); boardingPoint_ = s; return s; } } /** * <code>string boardingPoint = 3;</code> * @return The bytes for boardingPoint. */ @java.lang.Override public com.google.protobuf.ByteString getBoardingPointBytes() { java.lang.Object ref = boardingPoint_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); boardingPoint_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DEPLANINGPOINT_FIELD_NUMBER = 4; private volatile java.lang.Object deplaningPoint_; /** * <code>string deplaningPoint = 4;</code> * @return The deplaningPoint. */ @java.lang.Override public java.lang.String getDeplaningPoint() { java.lang.Object ref = deplaningPoint_; 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(); deplaningPoint_ = s; return s; } } /** * <code>string deplaningPoint = 4;</code> * @return The bytes for deplaningPoint. */ @java.lang.Override public com.google.protobuf.ByteString getDeplaningPointBytes() { java.lang.Object ref = deplaningPoint_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); deplaningPoint_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getFlightNumberBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, flightNumber_); } if (departureDate_ != null) { output.writeMessage(2, getDepartureDate()); } if (!getBoardingPointBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, boardingPoint_); } if (!getDeplaningPointBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, deplaningPoint_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getFlightNumberBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, flightNumber_); } if (departureDate_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getDepartureDate()); } if (!getBoardingPointBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, boardingPoint_); } if (!getDeplaningPointBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, deplaningPoint_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.passkit.grpc.Reporting.FlightAnalyticsFilter)) { return super.equals(obj); } com.passkit.grpc.Reporting.FlightAnalyticsFilter other = (com.passkit.grpc.Reporting.FlightAnalyticsFilter) obj; if (!getFlightNumber() .equals(other.getFlightNumber())) return false; if (hasDepartureDate() != other.hasDepartureDate()) return false; if (hasDepartureDate()) { if (!getDepartureDate() .equals(other.getDepartureDate())) return false; } if (!getBoardingPoint() .equals(other.getBoardingPoint())) return false; if (!getDeplaningPoint() .equals(other.getDeplaningPoint())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + FLIGHTNUMBER_FIELD_NUMBER; hash = (53 * hash) + getFlightNumber().hashCode(); if (hasDepartureDate()) { hash = (37 * hash) + DEPARTUREDATE_FIELD_NUMBER; hash = (53 * hash) + getDepartureDate().hashCode(); } hash = (37 * hash) + BOARDINGPOINT_FIELD_NUMBER; hash = (53 * hash) + getBoardingPoint().hashCode(); hash = (37 * hash) + DEPLANINGPOINT_FIELD_NUMBER; hash = (53 * hash) + getDeplaningPoint().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.passkit.grpc.Reporting.FlightAnalyticsFilter prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * FlightAnalyticsFilter filter analytics by flight or/and flight designator. * FlightNumber, departureDate, boardingPoint and deplaningPoint are required to filter by flight. * </pre> * * Protobuf type {@code io.FlightAnalyticsFilter} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:io.FlightAnalyticsFilter) com.passkit.grpc.Reporting.FlightAnalyticsFilterOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_FlightAnalyticsFilter_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_FlightAnalyticsFilter_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.FlightAnalyticsFilter.class, com.passkit.grpc.Reporting.FlightAnalyticsFilter.Builder.class); } // Construct using com.passkit.grpc.Reporting.FlightAnalyticsFilter.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); flightNumber_ = ""; if (departureDateBuilder_ == null) { departureDate_ = null; } else { departureDate_ = null; departureDateBuilder_ = null; } boardingPoint_ = ""; deplaningPoint_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.passkit.grpc.Reporting.internal_static_io_FlightAnalyticsFilter_descriptor; } @java.lang.Override public com.passkit.grpc.Reporting.FlightAnalyticsFilter getDefaultInstanceForType() { return com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance(); } @java.lang.Override public com.passkit.grpc.Reporting.FlightAnalyticsFilter build() { com.passkit.grpc.Reporting.FlightAnalyticsFilter result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.passkit.grpc.Reporting.FlightAnalyticsFilter buildPartial() { com.passkit.grpc.Reporting.FlightAnalyticsFilter result = new com.passkit.grpc.Reporting.FlightAnalyticsFilter(this); result.flightNumber_ = flightNumber_; if (departureDateBuilder_ == null) { result.departureDate_ = departureDate_; } else { result.departureDate_ = departureDateBuilder_.build(); } result.boardingPoint_ = boardingPoint_; result.deplaningPoint_ = deplaningPoint_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.passkit.grpc.Reporting.FlightAnalyticsFilter) { return mergeFrom((com.passkit.grpc.Reporting.FlightAnalyticsFilter)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.passkit.grpc.Reporting.FlightAnalyticsFilter other) { if (other == com.passkit.grpc.Reporting.FlightAnalyticsFilter.getDefaultInstance()) return this; if (!other.getFlightNumber().isEmpty()) { flightNumber_ = other.flightNumber_; onChanged(); } if (other.hasDepartureDate()) { mergeDepartureDate(other.getDepartureDate()); } if (!other.getBoardingPoint().isEmpty()) { boardingPoint_ = other.boardingPoint_; onChanged(); } if (!other.getDeplaningPoint().isEmpty()) { deplaningPoint_ = other.deplaningPoint_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.passkit.grpc.Reporting.FlightAnalyticsFilter parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.passkit.grpc.Reporting.FlightAnalyticsFilter) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object flightNumber_ = ""; /** * <code>string flightNumber = 1;</code> * @return The flightNumber. */ public java.lang.String getFlightNumber() { java.lang.Object ref = flightNumber_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); flightNumber_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string flightNumber = 1;</code> * @return The bytes for flightNumber. */ public com.google.protobuf.ByteString getFlightNumberBytes() { java.lang.Object ref = flightNumber_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); flightNumber_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string flightNumber = 1;</code> * @param value The flightNumber to set. * @return This builder for chaining. */ public Builder setFlightNumber( java.lang.String value) { if (value == null) { throw new NullPointerException(); } flightNumber_ = value; onChanged(); return this; } /** * <code>string flightNumber = 1;</code> * @return This builder for chaining. */ public Builder clearFlightNumber() { flightNumber_ = getDefaultInstance().getFlightNumber(); onChanged(); return this; } /** * <code>string flightNumber = 1;</code> * @param value The bytes for flightNumber to set. * @return This builder for chaining. */ public Builder setFlightNumberBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); flightNumber_ = value; onChanged(); return this; } private com.passkit.grpc.CommonObjects.Date departureDate_; private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.CommonObjects.Date, com.passkit.grpc.CommonObjects.Date.Builder, com.passkit.grpc.CommonObjects.DateOrBuilder> departureDateBuilder_; /** * <code>.io.Date departureDate = 2;</code> * @return Whether the departureDate field is set. */ public boolean hasDepartureDate() { return departureDateBuilder_ != null || departureDate_ != null; } /** * <code>.io.Date departureDate = 2;</code> * @return The departureDate. */ public com.passkit.grpc.CommonObjects.Date getDepartureDate() { if (departureDateBuilder_ == null) { return departureDate_ == null ? com.passkit.grpc.CommonObjects.Date.getDefaultInstance() : departureDate_; } else { return departureDateBuilder_.getMessage(); } } /** * <code>.io.Date departureDate = 2;</code> */ public Builder setDepartureDate(com.passkit.grpc.CommonObjects.Date value) { if (departureDateBuilder_ == null) { if (value == null) { throw new NullPointerException(); } departureDate_ = value; onChanged(); } else { departureDateBuilder_.setMessage(value); } return this; } /** * <code>.io.Date departureDate = 2;</code> */ public Builder setDepartureDate( com.passkit.grpc.CommonObjects.Date.Builder builderForValue) { if (departureDateBuilder_ == null) { departureDate_ = builderForValue.build(); onChanged(); } else { departureDateBuilder_.setMessage(builderForValue.build()); } return this; } /** * <code>.io.Date departureDate = 2;</code> */ public Builder mergeDepartureDate(com.passkit.grpc.CommonObjects.Date value) { if (departureDateBuilder_ == null) { if (departureDate_ != null) { departureDate_ = com.passkit.grpc.CommonObjects.Date.newBuilder(departureDate_).mergeFrom(value).buildPartial(); } else { departureDate_ = value; } onChanged(); } else { departureDateBuilder_.mergeFrom(value); } return this; } /** * <code>.io.Date departureDate = 2;</code> */ public Builder clearDepartureDate() { if (departureDateBuilder_ == null) { departureDate_ = null; onChanged(); } else { departureDate_ = null; departureDateBuilder_ = null; } return this; } /** * <code>.io.Date departureDate = 2;</code> */ public com.passkit.grpc.CommonObjects.Date.Builder getDepartureDateBuilder() { onChanged(); return getDepartureDateFieldBuilder().getBuilder(); } /** * <code>.io.Date departureDate = 2;</code> */ public com.passkit.grpc.CommonObjects.DateOrBuilder getDepartureDateOrBuilder() { if (departureDateBuilder_ != null) { return departureDateBuilder_.getMessageOrBuilder(); } else { return departureDate_ == null ? com.passkit.grpc.CommonObjects.Date.getDefaultInstance() : departureDate_; } } /** * <code>.io.Date departureDate = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.CommonObjects.Date, com.passkit.grpc.CommonObjects.Date.Builder, com.passkit.grpc.CommonObjects.DateOrBuilder> getDepartureDateFieldBuilder() { if (departureDateBuilder_ == null) { departureDateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.passkit.grpc.CommonObjects.Date, com.passkit.grpc.CommonObjects.Date.Builder, com.passkit.grpc.CommonObjects.DateOrBuilder>( getDepartureDate(), getParentForChildren(), isClean()); departureDate_ = null; } return departureDateBuilder_; } private java.lang.Object boardingPoint_ = ""; /** * <code>string boardingPoint = 3;</code> * @return The boardingPoint. */ public java.lang.String getBoardingPoint() { java.lang.Object ref = boardingPoint_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); boardingPoint_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string boardingPoint = 3;</code> * @return The bytes for boardingPoint. */ public com.google.protobuf.ByteString getBoardingPointBytes() { java.lang.Object ref = boardingPoint_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); boardingPoint_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string boardingPoint = 3;</code> * @param value The boardingPoint to set. * @return This builder for chaining. */ public Builder setBoardingPoint( java.lang.String value) { if (value == null) { throw new NullPointerException(); } boardingPoint_ = value; onChanged(); return this; } /** * <code>string boardingPoint = 3;</code> * @return This builder for chaining. */ public Builder clearBoardingPoint() { boardingPoint_ = getDefaultInstance().getBoardingPoint(); onChanged(); return this; } /** * <code>string boardingPoint = 3;</code> * @param value The bytes for boardingPoint to set. * @return This builder for chaining. */ public Builder setBoardingPointBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); boardingPoint_ = value; onChanged(); return this; } private java.lang.Object deplaningPoint_ = ""; /** * <code>string deplaningPoint = 4;</code> * @return The deplaningPoint. */ public java.lang.String getDeplaningPoint() { java.lang.Object ref = deplaningPoint_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); deplaningPoint_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string deplaningPoint = 4;</code> * @return The bytes for deplaningPoint. */ public com.google.protobuf.ByteString getDeplaningPointBytes() { java.lang.Object ref = deplaningPoint_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); deplaningPoint_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string deplaningPoint = 4;</code> * @param value The deplaningPoint to set. * @return This builder for chaining. */ public Builder setDeplaningPoint( java.lang.String value) { if (value == null) { throw new NullPointerException(); } deplaningPoint_ = value; onChanged(); return this; } /** * <code>string deplaningPoint = 4;</code> * @return This builder for chaining. */ public Builder clearDeplaningPoint() { deplaningPoint_ = getDefaultInstance().getDeplaningPoint(); onChanged(); return this; } /** * <code>string deplaningPoint = 4;</code> * @param value The bytes for deplaningPoint to set. * @return This builder for chaining. */ public Builder setDeplaningPointBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); deplaningPoint_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:io.FlightAnalyticsFilter) } // @@protoc_insertion_point(class_scope:io.FlightAnalyticsFilter) private static final com.passkit.grpc.Reporting.FlightAnalyticsFilter DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.passkit.grpc.Reporting.FlightAnalyticsFilter(); } public static com.passkit.grpc.Reporting.FlightAnalyticsFilter getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<FlightAnalyticsFilter> PARSER = new com.google.protobuf.AbstractParser<FlightAnalyticsFilter>() { @java.lang.Override public FlightAnalyticsFilter parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new FlightAnalyticsFilter(input, extensionRegistry); } }; public static com.google.protobuf.Parser<FlightAnalyticsFilter> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<FlightAnalyticsFilter> getParserForType() { return PARSER; } @java.lang.Override public com.passkit.grpc.Reporting.FlightAnalyticsFilter getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface EventTicketAnalyticsFilterOrBuilder extends // @@protoc_insertion_point(interface_extends:io.EventTicketAnalyticsFilter) com.google.protobuf.MessageOrBuilder { /** * <code>string ticketTypeId = 1;</code> * @return The ticketTypeId. */ java.lang.String getTicketTypeId(); /** * <code>string ticketTypeId = 1;</code> * @return The bytes for ticketTypeId. */ com.google.protobuf.ByteString getTicketTypeIdBytes(); /** * <code>string ticketTypeUid = 2;</code> * @return The ticketTypeUid. */ java.lang.String getTicketTypeUid(); /** * <code>string ticketTypeUid = 2;</code> * @return The bytes for ticketTypeUid. */ com.google.protobuf.ByteString getTicketTypeUidBytes(); /** * <code>string venueId = 3;</code> * @return The venueId. */ java.lang.String getVenueId(); /** * <code>string venueId = 3;</code> * @return The bytes for venueId. */ com.google.protobuf.ByteString getVenueIdBytes(); /** * <code>string venueUid = 4;</code> * @return The venueUid. */ java.lang.String getVenueUid(); /** * <code>string venueUid = 4;</code> * @return The bytes for venueUid. */ com.google.protobuf.ByteString getVenueUidBytes(); /** * <code>string eventId = 5;</code> * @return The eventId. */ java.lang.String getEventId(); /** * <code>string eventId = 5;</code> * @return The bytes for eventId. */ com.google.protobuf.ByteString getEventIdBytes(); } /** * Protobuf type {@code io.EventTicketAnalyticsFilter} */ public static final class EventTicketAnalyticsFilter extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:io.EventTicketAnalyticsFilter) EventTicketAnalyticsFilterOrBuilder { private static final long serialVersionUID = 0L; // Use EventTicketAnalyticsFilter.newBuilder() to construct. private EventTicketAnalyticsFilter(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private EventTicketAnalyticsFilter() { ticketTypeId_ = ""; ticketTypeUid_ = ""; venueId_ = ""; venueUid_ = ""; eventId_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new EventTicketAnalyticsFilter(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private EventTicketAnalyticsFilter( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); ticketTypeId_ = s; break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); ticketTypeUid_ = s; break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); venueId_ = s; break; } case 34: { java.lang.String s = input.readStringRequireUtf8(); venueUid_ = s; break; } case 42: { java.lang.String s = input.readStringRequireUtf8(); eventId_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_EventTicketAnalyticsFilter_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_EventTicketAnalyticsFilter_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.class, com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.Builder.class); } public static final int TICKETTYPEID_FIELD_NUMBER = 1; private volatile java.lang.Object ticketTypeId_; /** * <code>string ticketTypeId = 1;</code> * @return The ticketTypeId. */ @java.lang.Override public java.lang.String getTicketTypeId() { java.lang.Object ref = ticketTypeId_; 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(); ticketTypeId_ = s; return s; } } /** * <code>string ticketTypeId = 1;</code> * @return The bytes for ticketTypeId. */ @java.lang.Override public com.google.protobuf.ByteString getTicketTypeIdBytes() { java.lang.Object ref = ticketTypeId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); ticketTypeId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int TICKETTYPEUID_FIELD_NUMBER = 2; private volatile java.lang.Object ticketTypeUid_; /** * <code>string ticketTypeUid = 2;</code> * @return The ticketTypeUid. */ @java.lang.Override public java.lang.String getTicketTypeUid() { java.lang.Object ref = ticketTypeUid_; 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(); ticketTypeUid_ = s; return s; } } /** * <code>string ticketTypeUid = 2;</code> * @return The bytes for ticketTypeUid. */ @java.lang.Override public com.google.protobuf.ByteString getTicketTypeUidBytes() { java.lang.Object ref = ticketTypeUid_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); ticketTypeUid_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int VENUEID_FIELD_NUMBER = 3; private volatile java.lang.Object venueId_; /** * <code>string venueId = 3;</code> * @return The venueId. */ @java.lang.Override public java.lang.String getVenueId() { java.lang.Object ref = venueId_; 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(); venueId_ = s; return s; } } /** * <code>string venueId = 3;</code> * @return The bytes for venueId. */ @java.lang.Override public com.google.protobuf.ByteString getVenueIdBytes() { java.lang.Object ref = venueId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); venueId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int VENUEUID_FIELD_NUMBER = 4; private volatile java.lang.Object venueUid_; /** * <code>string venueUid = 4;</code> * @return The venueUid. */ @java.lang.Override public java.lang.String getVenueUid() { java.lang.Object ref = venueUid_; 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(); venueUid_ = s; return s; } } /** * <code>string venueUid = 4;</code> * @return The bytes for venueUid. */ @java.lang.Override public com.google.protobuf.ByteString getVenueUidBytes() { java.lang.Object ref = venueUid_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); venueUid_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int EVENTID_FIELD_NUMBER = 5; private volatile java.lang.Object eventId_; /** * <code>string eventId = 5;</code> * @return The eventId. */ @java.lang.Override public java.lang.String getEventId() { java.lang.Object ref = eventId_; 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(); eventId_ = s; return s; } } /** * <code>string eventId = 5;</code> * @return The bytes for eventId. */ @java.lang.Override public com.google.protobuf.ByteString getEventIdBytes() { java.lang.Object ref = eventId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); eventId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getTicketTypeIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ticketTypeId_); } if (!getTicketTypeUidBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ticketTypeUid_); } if (!getVenueIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, venueId_); } if (!getVenueUidBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, venueUid_); } if (!getEventIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, eventId_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getTicketTypeIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ticketTypeId_); } if (!getTicketTypeUidBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ticketTypeUid_); } if (!getVenueIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, venueId_); } if (!getVenueUidBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, venueUid_); } if (!getEventIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, eventId_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.passkit.grpc.Reporting.EventTicketAnalyticsFilter)) { return super.equals(obj); } com.passkit.grpc.Reporting.EventTicketAnalyticsFilter other = (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) obj; if (!getTicketTypeId() .equals(other.getTicketTypeId())) return false; if (!getTicketTypeUid() .equals(other.getTicketTypeUid())) return false; if (!getVenueId() .equals(other.getVenueId())) return false; if (!getVenueUid() .equals(other.getVenueUid())) return false; if (!getEventId() .equals(other.getEventId())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TICKETTYPEID_FIELD_NUMBER; hash = (53 * hash) + getTicketTypeId().hashCode(); hash = (37 * hash) + TICKETTYPEUID_FIELD_NUMBER; hash = (53 * hash) + getTicketTypeUid().hashCode(); hash = (37 * hash) + VENUEID_FIELD_NUMBER; hash = (53 * hash) + getVenueId().hashCode(); hash = (37 * hash) + VENUEUID_FIELD_NUMBER; hash = (53 * hash) + getVenueUid().hashCode(); hash = (37 * hash) + EVENTID_FIELD_NUMBER; hash = (53 * hash) + getEventId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.passkit.grpc.Reporting.EventTicketAnalyticsFilter prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code io.EventTicketAnalyticsFilter} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:io.EventTicketAnalyticsFilter) com.passkit.grpc.Reporting.EventTicketAnalyticsFilterOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.passkit.grpc.Reporting.internal_static_io_EventTicketAnalyticsFilter_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.passkit.grpc.Reporting.internal_static_io_EventTicketAnalyticsFilter_fieldAccessorTable .ensureFieldAccessorsInitialized( com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.class, com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.Builder.class); } // Construct using com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); ticketTypeId_ = ""; ticketTypeUid_ = ""; venueId_ = ""; venueUid_ = ""; eventId_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.passkit.grpc.Reporting.internal_static_io_EventTicketAnalyticsFilter_descriptor; } @java.lang.Override public com.passkit.grpc.Reporting.EventTicketAnalyticsFilter getDefaultInstanceForType() { return com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance(); } @java.lang.Override public com.passkit.grpc.Reporting.EventTicketAnalyticsFilter build() { com.passkit.grpc.Reporting.EventTicketAnalyticsFilter result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.passkit.grpc.Reporting.EventTicketAnalyticsFilter buildPartial() { com.passkit.grpc.Reporting.EventTicketAnalyticsFilter result = new com.passkit.grpc.Reporting.EventTicketAnalyticsFilter(this); result.ticketTypeId_ = ticketTypeId_; result.ticketTypeUid_ = ticketTypeUid_; result.venueId_ = venueId_; result.venueUid_ = venueUid_; result.eventId_ = eventId_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) { return mergeFrom((com.passkit.grpc.Reporting.EventTicketAnalyticsFilter)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.passkit.grpc.Reporting.EventTicketAnalyticsFilter other) { if (other == com.passkit.grpc.Reporting.EventTicketAnalyticsFilter.getDefaultInstance()) return this; if (!other.getTicketTypeId().isEmpty()) { ticketTypeId_ = other.ticketTypeId_; onChanged(); } if (!other.getTicketTypeUid().isEmpty()) { ticketTypeUid_ = other.ticketTypeUid_; onChanged(); } if (!other.getVenueId().isEmpty()) { venueId_ = other.venueId_; onChanged(); } if (!other.getVenueUid().isEmpty()) { venueUid_ = other.venueUid_; onChanged(); } if (!other.getEventId().isEmpty()) { eventId_ = other.eventId_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.passkit.grpc.Reporting.EventTicketAnalyticsFilter parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.passkit.grpc.Reporting.EventTicketAnalyticsFilter) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object ticketTypeId_ = ""; /** * <code>string ticketTypeId = 1;</code> * @return The ticketTypeId. */ public java.lang.String getTicketTypeId() { java.lang.Object ref = ticketTypeId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ticketTypeId_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string ticketTypeId = 1;</code> * @return The bytes for ticketTypeId. */ public com.google.protobuf.ByteString getTicketTypeIdBytes() { java.lang.Object ref = ticketTypeId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); ticketTypeId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string ticketTypeId = 1;</code> * @param value The ticketTypeId to set. * @return This builder for chaining. */ public Builder setTicketTypeId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ticketTypeId_ = value; onChanged(); return this; } /** * <code>string ticketTypeId = 1;</code> * @return This builder for chaining. */ public Builder clearTicketTypeId() { ticketTypeId_ = getDefaultInstance().getTicketTypeId(); onChanged(); return this; } /** * <code>string ticketTypeId = 1;</code> * @param value The bytes for ticketTypeId to set. * @return This builder for chaining. */ public Builder setTicketTypeIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ticketTypeId_ = value; onChanged(); return this; } private java.lang.Object ticketTypeUid_ = ""; /** * <code>string ticketTypeUid = 2;</code> * @return The ticketTypeUid. */ public java.lang.String getTicketTypeUid() { java.lang.Object ref = ticketTypeUid_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ticketTypeUid_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string ticketTypeUid = 2;</code> * @return The bytes for ticketTypeUid. */ public com.google.protobuf.ByteString getTicketTypeUidBytes() { java.lang.Object ref = ticketTypeUid_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); ticketTypeUid_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string ticketTypeUid = 2;</code> * @param value The ticketTypeUid to set. * @return This builder for chaining. */ public Builder setTicketTypeUid( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ticketTypeUid_ = value; onChanged(); return this; } /** * <code>string ticketTypeUid = 2;</code> * @return This builder for chaining. */ public Builder clearTicketTypeUid() { ticketTypeUid_ = getDefaultInstance().getTicketTypeUid(); onChanged(); return this; } /** * <code>string ticketTypeUid = 2;</code> * @param value The bytes for ticketTypeUid to set. * @return This builder for chaining. */ public Builder setTicketTypeUidBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ticketTypeUid_ = value; onChanged(); return this; } private java.lang.Object venueId_ = ""; /** * <code>string venueId = 3;</code> * @return The venueId. */ public java.lang.String getVenueId() { java.lang.Object ref = venueId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); venueId_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string venueId = 3;</code> * @return The bytes for venueId. */ public com.google.protobuf.ByteString getVenueIdBytes() { java.lang.Object ref = venueId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); venueId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string venueId = 3;</code> * @param value The venueId to set. * @return This builder for chaining. */ public Builder setVenueId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } venueId_ = value; onChanged(); return this; } /** * <code>string venueId = 3;</code> * @return This builder for chaining. */ public Builder clearVenueId() { venueId_ = getDefaultInstance().getVenueId(); onChanged(); return this; } /** * <code>string venueId = 3;</code> * @param value The bytes for venueId to set. * @return This builder for chaining. */ public Builder setVenueIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); venueId_ = value; onChanged(); return this; } private java.lang.Object venueUid_ = ""; /** * <code>string venueUid = 4;</code> * @return The venueUid. */ public java.lang.String getVenueUid() { java.lang.Object ref = venueUid_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); venueUid_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string venueUid = 4;</code> * @return The bytes for venueUid. */ public com.google.protobuf.ByteString getVenueUidBytes() { java.lang.Object ref = venueUid_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); venueUid_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string venueUid = 4;</code> * @param value The venueUid to set. * @return This builder for chaining. */ public Builder setVenueUid( java.lang.String value) { if (value == null) { throw new NullPointerException(); } venueUid_ = value; onChanged(); return this; } /** * <code>string venueUid = 4;</code> * @return This builder for chaining. */ public Builder clearVenueUid() { venueUid_ = getDefaultInstance().getVenueUid(); onChanged(); return this; } /** * <code>string venueUid = 4;</code> * @param value The bytes for venueUid to set. * @return This builder for chaining. */ public Builder setVenueUidBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); venueUid_ = value; onChanged(); return this; } private java.lang.Object eventId_ = ""; /** * <code>string eventId = 5;</code> * @return The eventId. */ public java.lang.String getEventId() { java.lang.Object ref = eventId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); eventId_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string eventId = 5;</code> * @return The bytes for eventId. */ public com.google.protobuf.ByteString getEventIdBytes() { java.lang.Object ref = eventId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); eventId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string eventId = 5;</code> * @param value The eventId to set. * @return This builder for chaining. */ public Builder setEventId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } eventId_ = value; onChanged(); return this; } /** * <code>string eventId = 5;</code> * @return This builder for chaining. */ public Builder clearEventId() { eventId_ = getDefaultInstance().getEventId(); onChanged(); return this; } /** * <code>string eventId = 5;</code> * @param value The bytes for eventId to set. * @return This builder for chaining. */ public Builder setEventIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); eventId_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:io.EventTicketAnalyticsFilter) } // @@protoc_insertion_point(class_scope:io.EventTicketAnalyticsFilter) private static final com.passkit.grpc.Reporting.EventTicketAnalyticsFilter DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.passkit.grpc.Reporting.EventTicketAnalyticsFilter(); } public static com.passkit.grpc.Reporting.EventTicketAnalyticsFilter getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<EventTicketAnalyticsFilter> PARSER = new com.google.protobuf.AbstractParser<EventTicketAnalyticsFilter>() { @java.lang.Override public EventTicketAnalyticsFilter parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new EventTicketAnalyticsFilter(input, extensionRegistry); } }; public static com.google.protobuf.Parser<EventTicketAnalyticsFilter> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<EventTicketAnalyticsFilter> getParserForType() { return PARSER; } @java.lang.Override public com.passkit.grpc.Reporting.EventTicketAnalyticsFilter getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_AnalyticsResponse_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_AnalyticsResponse_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_AnalyticsResponse_UtmSourceBreakdownEntry_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_AnalyticsResponse_UtmSourceBreakdownEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_AnalyticsResponse_UtmMediumBreakdownEntry_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_AnalyticsResponse_UtmMediumBreakdownEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_AnalyticsResponse_UtmNameBreakdownEntry_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_AnalyticsResponse_UtmNameBreakdownEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_AnalyticsResponse_UtmTermBreakdownEntry_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_AnalyticsResponse_UtmTermBreakdownEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_AnalyticsResponse_UtmContentBreakdownEntry_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_AnalyticsResponse_UtmContentBreakdownEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_DeviceBreakdown_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_DeviceBreakdown_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_ChartDataPoints_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_ChartDataPoints_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_AnalyticsRequest_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_AnalyticsRequest_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_CouponAnalyticsFilter_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_CouponAnalyticsFilter_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_FlightAnalyticsFilter_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_FlightAnalyticsFilter_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_io_EventTicketAnalyticsFilter_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_io_EventTicketAnalyticsFilter_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\031io/common/reporting.proto\022\002io\032\031io/comm" + "on/protocols.proto\032\036io/common/common_obj" + "ects.proto\032.protoc-gen-openapiv2/options" + "/annotations.proto\"\337\006\n\021AnalyticsResponse" + "\022\032\n\006period\030\001 \001(\0162\n.io.Period\022\017\n\007created\030" + "\002 \001(\r\022\021\n\tinstalled\030\003 \001(\r\022\017\n\007deleted\030\004 \001(" + "\r\022\023\n\013invalidated\030\005 \001(\r\022,\n\017deviceBreakdow" + "n\030\006 \001(\0132\023.io.DeviceBreakdown\022I\n\022utmSourc" + "eBreakdown\030\007 \003(\0132-.io.AnalyticsResponse." + "UtmSourceBreakdownEntry\022!\n\004data\030\010 \003(\0132\023." + "io.ChartDataPoints\022I\n\022utmMediumBreakdown" + "\030\t \003(\0132-.io.AnalyticsResponse.UtmMediumB" + "reakdownEntry\022E\n\020utmNameBreakdown\030\n \003(\0132" + "+.io.AnalyticsResponse.UtmNameBreakdownE" + "ntry\022E\n\020utmTermBreakdown\030\013 \003(\0132+.io.Anal" + "yticsResponse.UtmTermBreakdownEntry\022K\n\023u" + "tmContentBreakdown\030\014 \003(\0132..io.AnalyticsR" + "esponse.UtmContentBreakdownEntry\0329\n\027UtmS" + "ourceBreakdownEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + "e\030\002 \001(\r:\0028\001\0329\n\027UtmMediumBreakdownEntry\022\013" + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\r:\0028\001\0327\n\025UtmNam" + "eBreakdownEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + "\001(\r:\0028\001\0327\n\025UtmTermBreakdownEntry\022\013\n\003key\030" + "\001 \001(\t\022\r\n\005value\030\002 \001(\r:\0028\001\032:\n\030UtmContentBr" + "eakdownEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\r" + ":\0028\001\"N\n\017DeviceBreakdown\022\023\n\013appleWallet\030\001" + " \001(\r\022\021\n\tgooglePay\030\002 \001(\r\022\023\n\013otherWallet\030\003" + " \001(\r\"\212\001\n\017ChartDataPoints\022\014\n\004name\030\001 \001(\t\022\017" + "\n\007created\030\002 \001(\r\022\021\n\tinstalled\030\003 \001(\r\022\017\n\007up" + "dated\030\004 \001(\r\022\017\n\007deleted\030\005 \001(\r\022\023\n\013invalida" + "ted\030\006 \001(\r\022\016\n\006custom\030\007 \001(\r\"\244\003\n\020AnalyticsR" + "equest\022\"\n\010protocol\030\001 \001(\0162\020.io.PassProtoc" + "ol\022\017\n\007classId\030\002 \001(\t\022\032\n\006period\030\003 \001(\0162\n.io" + ".Period\022\021\n\tstartDate\030\004 \001(\t\022\017\n\007endDate\030\005 " + "\001(\t\022\020\n\010timezone\030\006 \001(\t\022+\n\006coupon\030\017 \001(\0132\031." + "io.CouponAnalyticsFilterH\000\022+\n\006flight\030\020 \001" + "(\0132\031.io.FlightAnalyticsFilterH\000\0225\n\013event" + "Ticket\030\021 \001(\0132\036.io.EventTicketAnalyticsFi" + "lterH\000:n\222Ak\ni*\021Analytics Request2?Retrie" + "ves pass created, installed, deleted, in" + "validated counts.\322\001\010protocol\322\001\007classIdB\010" + "\n\006filter\"(\n\025CouponAnalyticsFilter\022\017\n\007off" + "erId\030\001 \001(\t\"}\n\025FlightAnalyticsFilter\022\024\n\014f" + "lightNumber\030\001 \001(\t\022\037\n\rdepartureDate\030\002 \001(\013" + "2\010.io.Date\022\025\n\rboardingPoint\030\003 \001(\t\022\026\n\016dep" + "laningPoint\030\004 \001(\t\"}\n\032EventTicketAnalytic" + "sFilter\022\024\n\014ticketTypeId\030\001 \001(\t\022\025\n\rticketT" + "ypeUid\030\002 \001(\t\022\017\n\007venueId\030\003 \001(\t\022\020\n\010venueUi" + "d\030\004 \001(\t\022\017\n\007eventId\030\005 \001(\t*&\n\006Period\022\007\n\003DA" + "Y\020\000\022\t\n\005MONTH\020\001\022\010\n\004YEAR\020\002BG\n\020com.passkit." + "grpcZ$stash.passkit.com/io/model/sdk/go/" + "io\252\002\014PassKit.Grpcb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.passkit.grpc.Protocols.getDescriptor(), com.passkit.grpc.CommonObjects.getDescriptor(), grpc.gateway.protoc_gen_openapiv2.options.Annotations.getDescriptor(), }); internal_static_io_AnalyticsResponse_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_io_AnalyticsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_AnalyticsResponse_descriptor, new java.lang.String[] { "Period", "Created", "Installed", "Deleted", "Invalidated", "DeviceBreakdown", "UtmSourceBreakdown", "Data", "UtmMediumBreakdown", "UtmNameBreakdown", "UtmTermBreakdown", "UtmContentBreakdown", }); internal_static_io_AnalyticsResponse_UtmSourceBreakdownEntry_descriptor = internal_static_io_AnalyticsResponse_descriptor.getNestedTypes().get(0); internal_static_io_AnalyticsResponse_UtmSourceBreakdownEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_AnalyticsResponse_UtmSourceBreakdownEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_io_AnalyticsResponse_UtmMediumBreakdownEntry_descriptor = internal_static_io_AnalyticsResponse_descriptor.getNestedTypes().get(1); internal_static_io_AnalyticsResponse_UtmMediumBreakdownEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_AnalyticsResponse_UtmMediumBreakdownEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_io_AnalyticsResponse_UtmNameBreakdownEntry_descriptor = internal_static_io_AnalyticsResponse_descriptor.getNestedTypes().get(2); internal_static_io_AnalyticsResponse_UtmNameBreakdownEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_AnalyticsResponse_UtmNameBreakdownEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_io_AnalyticsResponse_UtmTermBreakdownEntry_descriptor = internal_static_io_AnalyticsResponse_descriptor.getNestedTypes().get(3); internal_static_io_AnalyticsResponse_UtmTermBreakdownEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_AnalyticsResponse_UtmTermBreakdownEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_io_AnalyticsResponse_UtmContentBreakdownEntry_descriptor = internal_static_io_AnalyticsResponse_descriptor.getNestedTypes().get(4); internal_static_io_AnalyticsResponse_UtmContentBreakdownEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_AnalyticsResponse_UtmContentBreakdownEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_io_DeviceBreakdown_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_io_DeviceBreakdown_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_DeviceBreakdown_descriptor, new java.lang.String[] { "AppleWallet", "GooglePay", "OtherWallet", }); internal_static_io_ChartDataPoints_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_io_ChartDataPoints_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_ChartDataPoints_descriptor, new java.lang.String[] { "Name", "Created", "Installed", "Updated", "Deleted", "Invalidated", "Custom", }); internal_static_io_AnalyticsRequest_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_io_AnalyticsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_AnalyticsRequest_descriptor, new java.lang.String[] { "Protocol", "ClassId", "Period", "StartDate", "EndDate", "Timezone", "Coupon", "Flight", "EventTicket", "Filter", }); internal_static_io_CouponAnalyticsFilter_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_io_CouponAnalyticsFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_CouponAnalyticsFilter_descriptor, new java.lang.String[] { "OfferId", }); internal_static_io_FlightAnalyticsFilter_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_io_FlightAnalyticsFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_FlightAnalyticsFilter_descriptor, new java.lang.String[] { "FlightNumber", "DepartureDate", "BoardingPoint", "DeplaningPoint", }); internal_static_io_EventTicketAnalyticsFilter_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_io_EventTicketAnalyticsFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_io_EventTicketAnalyticsFilter_descriptor, new java.lang.String[] { "TicketTypeId", "TicketTypeUid", "VenueId", "VenueUid", "EventId", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(grpc.gateway.protoc_gen_openapiv2.options.Annotations.openapiv2Schema); com.google.protobuf.Descriptors.FileDescriptor .internalUpdateFileDescriptor(descriptor, registry); com.passkit.grpc.Protocols.getDescriptor(); com.passkit.grpc.CommonObjects.getDescriptor(); grpc.gateway.protoc_gen_openapiv2.options.Annotations.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) }
PJB2TY/hbase
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FixedIntervalRateLimiter.java
/* * 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.hadoop.hbase.quotas; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.yetus.audience.InterfaceAudience; import org.apache.yetus.audience.InterfaceStability; /** * With this limiter resources will be refilled only after a fixed interval of time. */ @InterfaceAudience.Private @InterfaceStability.Evolving public class FixedIntervalRateLimiter extends RateLimiter { private long nextRefillTime = -1L; @Override public long refill(long limit) { final long now = EnvironmentEdgeManager.currentTime(); if (now < nextRefillTime) { return 0; } nextRefillTime = now + super.getTimeUnitInMillis(); return limit; } @Override public long getWaitInterval(long limit, long available, long amount) { if (nextRefillTime == -1) { return 0; } final long now = EnvironmentEdgeManager.currentTime(); final long refillTime = nextRefillTime; return refillTime - now; } // This method is for strictly testing purpose only @Override public void setNextRefillTime(long nextRefillTime) { this.nextRefillTime = nextRefillTime; } @Override public long getNextRefillTime() { return this.nextRefillTime; } }
eGovFrame/egovframework.rte.root
Integration/egovframework.rte.itl.integration/src/test/java/egovframework/rte/itl/integration/metadata/dao/hibernate/HibernateOrganizationDefinitionDaoTest.java
package egovframework.rte.itl.integration.metadata.dao.hibernate; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import javax.sql.DataSource; import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.ReplacementDataSet; import org.dbunit.dataset.xml.FlatXmlDataSet; import org.dbunit.operation.DatabaseOperation; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.TransactionConfiguration; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ResourceUtils; import egovframework.rte.itl.integration.metadata.OrganizationDefinition; import egovframework.rte.itl.integration.metadata.ServiceDefinition; import egovframework.rte.itl.integration.metadata.SystemDefinition; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations="/egovframework/rte/itl/integration/metadata/dao/hibernate/context.xml") @TransactionConfiguration(defaultRollback=true) @Transactional(readOnly=false) public class HibernateOrganizationDefinitionDaoTest { @Autowired private HibernateOrganizationDefinitionDao dao; @Autowired private DataSource dataSource; @Before public void before() throws Exception { ReplacementDataSet dataSet = new ReplacementDataSet(new FlatXmlDataSet( ResourceUtils.getFile("classpath:egovframework/rte/itl/integration/metadata/dao/hibernate/dataset.xml"))); dataSet.addReplacementObject("[null]", null); IDatabaseConnection connection = new SpringDatabaseDataSourceConnection(dataSource); DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet); } @Test public void testReadSucceeds() throws Exception { OrganizationDefinition organization00000000 = dao.getOrganizationDefinition("00000000"); assertNotNull(organization00000000); assertTrue(organization00000000.isValid()); assertEquals("00000000", organization00000000.getId()); assertEquals("Organization A", organization00000000.getName()); assertEquals(2, organization00000000.getSystems().size()); SystemDefinition systemA0 = organization00000000.getSystemDefinition("00000000"); assertNotNull(systemA0); assertTrue(systemA0.isValid()); assertEquals("00000000", systemA0.getId()); assertEquals("System A0", systemA0.getName()); assertEquals(true, systemA0.isStandard()); assertEquals(1, systemA0.getServices().size()); assertEquals(organization00000000, systemA0.getOrganization()); ServiceDefinition serviceA0_0 = systemA0.getServiceDefinition("00000000"); assertNotNull(serviceA0_0); assertTrue(serviceA0_0.isValid()); assertEquals("00000000", serviceA0_0.getId()); assertEquals("Service A0-0", serviceA0_0.getName()); assertEquals("M1", serviceA0_0.getRequestMessageTypeId()); assertEquals("M2", serviceA0_0.getResponseMessageTypeId()); assertNull(serviceA0_0.getServiceProviderBeanId()); assertEquals(systemA0, serviceA0_0.getSystem()); OrganizationDefinition organization00000001 = dao.getOrganizationDefinition("00000001"); assertNotNull(organization00000001); assertTrue(organization00000001.isValid()); assertEquals("00000001", organization00000001.getId()); assertEquals("Organization B", organization00000001.getName()); assertEquals(2, organization00000000.getSystems().size()); } @Test public void testReadFails() throws Exception { OrganizationDefinition organization00000002 = dao.getOrganizationDefinition("00000002"); assertNull(organization00000002); } }
ate47/consoleexperience
src/main/java/com/fuzs/consoleexperience/client/element/TintedTooltipElement.java
package com.fuzs.consoleexperience.client.element; import com.fuzs.consoleexperience.client.gui.screen.util.RenderTooltipUtil; import net.minecraftforge.client.event.RenderTooltipEvent; import net.minecraftforge.common.ForgeConfigSpec; public class TintedTooltipElement extends GameplayElement { private int backgroundColor; private int borderColor; @Override public void setup() { this.addListener(this::onRenderTooltipColor); } @Override public boolean getDefaultState() { return false; } @Override public String getDisplayName() { return "Tinted Tooltip"; } @Override public String getDescription() { return "Color item tooltips in a cyan shade just like on Console Edition."; } @Override public void setupConfig(ForgeConfigSpec.Builder builder) { registerClientEntry(builder.comment("Color for tooltip background as RGBA in decimal form.").defineInRange("Background Color", RenderTooltipUtil.TOOLTIP_COLORS[0], Integer.MIN_VALUE, Integer.MAX_VALUE), v -> this.backgroundColor = v); registerClientEntry(builder.comment("Color for tooltip border as RGBA in decimal form.").defineInRange("Border Color", RenderTooltipUtil.TOOLTIP_COLORS[1], Integer.MIN_VALUE, Integer.MAX_VALUE), v -> this.borderColor = v); } private void onRenderTooltipColor(final RenderTooltipEvent.Color evt) { evt.setBackground(this.backgroundColor); evt.setBorderStart(this.borderColor); evt.setBorderEnd(this.borderColor); } }
pmcollins/keybasket
test/unit/maintenance_request_test.rb
<filename>test/unit/maintenance_request_test.rb require File.dirname(__FILE__) + '/../test_helper' class MaintenanceRequestTest < Test::Unit::TestCase fixtures :units, :properties, :companies def test_create mr = MaintenanceRequest.create( :unit_id => 1 ) assert(mr) assert(mr.errors.empty?) assert_equal(mr.maintenance_request_status_id, 1) end end
Otaka/Ktr4j
KotorConverter/src/main/java/com/kotor4j/kotorconverter/original/rim/Rim.java
package com.kotor4j.kotorconverter.original.rim; import com.kotor4j.kotorconverter.original.bif.BiffEntry; import java.io.File; /** * @author Dmitry */ public class Rim { private File file; private BiffEntry[] resourceEntries; public BiffEntry[] getResourceEntries() { return resourceEntries; } public void setResourceEntries(BiffEntry[] resourceEntries) { this.resourceEntries = resourceEntries; } public void setFile(File file) { this.file = file; } public File getFile() { return file; } }
metux/chromium-deb
third_party/WebKit/Source/core/dom/NonDocumentTypeChildNode.h
<filename>third_party/WebKit/Source/core/dom/NonDocumentTypeChildNode.h // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NonDocumentTypeChildNode_h #define NonDocumentTypeChildNode_h #include "core/dom/ElementTraversal.h" #include "core/dom/Node.h" namespace blink { class NonDocumentTypeChildNode { public: static Element* previousElementSibling(Node& node) { return ElementTraversal::PreviousSibling(node); } static Element* nextElementSibling(Node& node) { return ElementTraversal::NextSibling(node); } }; } // namespace blink #endif // NonDocumentTypeChildNode_h
ercastil/superset-ui
plugins/plugin-chart-test/node_modules/@superset-ui/chart-controls/lib/components/CertifiedIconWithTooltip.js
"use strict"; exports.__esModule = true; exports.default = void 0; var _propTypes = _interopRequireDefault(require("prop-types")); var _react = _interopRequireDefault(require("react")); var _reactBootstrap = require("react-bootstrap"); var _lodash = require("lodash"); var _core = require("@superset-ui/core"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * 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. */ const tooltipStyle = { wordWrap: 'break-word' }; function CertifiedIconWithTooltip({ certifiedBy, details, metricName }) { return /*#__PURE__*/_react.default.createElement(_reactBootstrap.OverlayTrigger, { placement: "top", overlay: /*#__PURE__*/_react.default.createElement(_reactBootstrap.Tooltip, { id: `${(0, _lodash.kebabCase)(metricName)}-tooltip`, style: tooltipStyle }, certifiedBy && /*#__PURE__*/_react.default.createElement("div", null, (0, _core.t)('Certified by %s', certifiedBy)), /*#__PURE__*/_react.default.createElement("div", null, details)) }, /*#__PURE__*/_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", enableBackground: "new 0 0 24 24", height: "16", viewBox: "0 0 24 24", width: "16" }, /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("path", { fill: _core.supersetTheme.colors.primary.base, d: "M23,12l-2.44-2.79l0.34-3.69l-3.61-0.82L15.4,1.5L12,2.96L8.6,1.5L6.71,4.69L3.1,5.5L3.44,9.2L1,12l2.44,2.79l-0.34,3.7 l3.61,0.82L8.6,22.5l3.4-1.47l3.4,1.46l1.89-3.19l3.61-0.82l-0.34-3.69L23,12z M9.38,16.01L7,13.61c-0.39-0.39-0.39-1.02,0-1.41 l0.07-0.07c0.39-0.39,1.03-0.39,1.42,0l1.61,1.62l5.15-5.16c0.39-0.39,1.03-0.39,1.42,0l0.07,0.07c0.39,0.39,0.39,1.02,0,1.41 l-5.92,5.94C10.41,16.4,9.78,16.4,9.38,16.01z" })))); } CertifiedIconWithTooltip.propTypes = { certifiedBy: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.oneOf([null])]), details: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.oneOf([null])]), metricName: _propTypes.default.string.isRequired }; var _default = CertifiedIconWithTooltip; exports.default = _default;
chengshangqian/netty
learning/netty-in-action/src/main/java/com/fandou/learning/netty/action/chapter10/ToIntDecoder.java
package com.fandou.learning.netty.action.chapter10; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ReplayingDecoder; import java.util.List; /** * 将字节转码为整数:继承ReplayingDecoder类 * 调用readInt等从缓冲中读取具体类型数据的方法时,不需要额外判断可读数据的长度,该类已经默认实现此调用 * 如果程序读取超出缓冲中可读数据范围,readXxx方法将抛出异常:实际测试没有抛出异常... * Void代表不需要状态管理 */ public class ToIntDecoder extends ReplayingDecoder<Void> { /** * * @param ctx * @param in 传入的ByteBuf时ReplayingDecoderByteBuf * @param out * @throws Exception */ @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { // 从入站的ByteBuf(ReplayingDecoderByteBuf)中读取一个int数,并将其添加到解码的消息队列中 // 如果没有足够的字节可用,将抛出一个错误 out.add(in.readInt()); } }
Rotzbua/aocrecs.com
js/src/graphql/Latest.js
<filename>js/src/graphql/Latest.js import gql from 'graphql-tag'; import MatchFragment from "../graphql/MatchFragment.js" export default gql` query Latest($dataset_id: Int!, $order: [String], $offset: Int!, $limit: Int!) { latest { matches(dataset_id: $dataset_id, order: $order, offset: $offset, limit: $limit) { count hits { ...MatchFragment } } } } ${MatchFragment} `
Zodzie/Javacord
javacord-core/src/main/java/org/javacord/core/entity/message/MessageAttachmentImpl.java
<filename>javacord-core/src/main/java/org/javacord/core/entity/message/MessageAttachmentImpl.java<gh_stars>100-1000 package org.javacord.core.entity.message; import com.fasterxml.jackson.databind.JsonNode; import org.apache.logging.log4j.Logger; import org.javacord.api.DiscordApi; import org.javacord.api.entity.DiscordEntity; import org.javacord.api.entity.message.Message; import org.javacord.api.entity.message.MessageAttachment; import org.javacord.core.util.FileContainer; import org.javacord.core.util.logging.LoggerUtil; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.Objects; import java.util.Optional; import java.util.concurrent.CompletableFuture; /** * The implementation of {@link MessageAttachment}. */ public class MessageAttachmentImpl implements MessageAttachment { /** * The logger of this class. */ private static final Logger logger = LoggerUtil.getLogger(MessageAttachmentImpl.class); /** * The id of the attachment. */ private final long id; /** * The message of the attachment. */ private final Message message; /** * The file name of the attachment. */ private final String fileName; /** * The size of the attachment in bytes. */ private final int size; /** * The url of the attachment. */ private final String url; /** * The proxy url of the attachment. */ private final String proxyUrl; /** * The height of the attachment if it's an image. */ private final Integer height; /** * The width of the attachment if it's an image. */ private final Integer width; /** * Creates a new message attachment. * * @param message The message of the attachment. * @param data The data of the attachment. */ public MessageAttachmentImpl(Message message, JsonNode data) { this.message = message; id = data.get("id").asLong(); fileName = data.get("filename").asText(); size = data.get("size").asInt(); url = data.get("url").asText(); proxyUrl = data.get("proxy_url").asText(); height = data.has("height") && !data.get("height").isNull() ? data.get("height").asInt() : null; width = data.has("width") && !data.get("width").isNull() ? data.get("width").asInt() : null; } @Override public DiscordApi getApi() { return message.getApi(); } @Override public long getId() { return id; } @Override public Message getMessage() { return message; } @Override public String getFileName() { return fileName; } @Override public int getSize() { return size; } @Override public URL getUrl() { try { return new URL(url); } catch (MalformedURLException e) { logger.warn("Seems like the url of the attachment is malformed! Please contact the developer!", e); return null; } } @Override public URL getProxyUrl() { try { return new URL(proxyUrl); } catch (MalformedURLException e) { logger.warn("Seems like the proxy url of the attachment is malformed! Please contact the developer!", e); return null; } } @Override public Optional<Integer> getHeight() { return Optional.ofNullable(height); } @Override public Optional<Integer> getWidth() { return Optional.ofNullable(width); } @Override public InputStream downloadAsInputStream() throws IOException { return new FileContainer(getUrl()).asInputStream(getApi()); } @Override public CompletableFuture<byte[]> downloadAsByteArray() { return new FileContainer(getUrl()).asByteArray(getApi()); } @Override public CompletableFuture<BufferedImage> downloadAsImage() { return new FileContainer(getUrl()).asBufferedImage(getApi()); } @Override public boolean equals(Object o) { return (this == o) || !((o == null) || (getClass() != o.getClass()) || (getId() != ((DiscordEntity) o).getId())); } @Override public int hashCode() { return Objects.hash(getId()); } @Override public String toString() { return String.format("MessageAttachment (file name: %s, url: %s)", getFileName(), getUrl().toString()); } }
abrahamtovarmob/flang
runtime/libpgmath/lib/generic/rpowr.c
<filename>runtime/libpgmath/lib/generic/rpowr.c /* * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. * See https://llvm.org/LICENSE.txt for license information. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception * */ #include "mthdecls.h" float __mth_i_rpowr(float arg1, float arg2) { float f; f = powf(arg1, arg2); return f; }
wfu8/lightwave
vmidentity/rest/core/common/src/main/java/com/vmware/identity/rest/core/data/DTO.java
<reponame>wfu8/lightwave<filename>vmidentity/rest/core/common/src/main/java/com/vmware/identity/rest/core/data/DTO.java /* * Copyright (c) 2012-2015 VMware, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, without * warranties or conditions of any kind, EITHER EXPRESS OR IMPLIED. See the * License for the specific language governing permissions and limitations * under the License. */ package com.vmware.identity.rest.core.data; import com.fasterxml.jackson.core.JsonProcessingException; import com.vmware.identity.rest.core.util.ObjectMapperSingleton; /** * {@code DTO} is the abstract base class for all of the data objects in the REST SSO context. * A {@code DTO} encapsulates all of the information necessary for a purpose as well as instructions * for converting the object to and from JSON. The {@link #toString()} method will construct * the canonical JSON (i.e. what will be sent over the wire), while {@link #toPrettyString()} * will construct a more human readable form of the object. * <p> * In certain cases, the inheriting {@code DTO} may declare additional fields or methods that are * not intended to be present in the serialized form. In these cases, the fields are provided for * the convenience of those utilizing the classes. These fields should be marked with * {@code @JsonIgnore} and should not be present in any {@code Builder} class for the {@code DTO}. */ public abstract class DTO { @Override public String toString() { try { return ObjectMapperSingleton.getInstance().writer().writeValueAsString(this); } catch (JsonProcessingException e) { // Shouldn't happen, but if it does, we can just use the default printing... return super.toString(); } } /** * Returns a pretty-printed string representation of the object. In general, the * {@code #toPrettyString()} method returns a JSON string that has not been minified * and thus is more human-readable for the purposes of logging. * * @return a pretty-printed string representation of the object. */ public String toPrettyString() { try { return ObjectMapperSingleton.getInstance().writerWithDefaultPrettyPrinter().writeValueAsString(this); } catch (JsonProcessingException e) { // Shouldn't happen, but if it does, we can just use the default printing... return super.toString(); } } }
mpaullos/cursoemvideo-python
Exercicios/Mundo2/ex064.py
<reponame>mpaullos/cursoemvideo-python n = cont = soma = 0 n = int(input('Digite um número, caso queira parar digite 999: ')) while n != 999: soma += n cont+=1 n = int(input('Digite um número, caso queira parar digite 999: ')) print('Você digitou {} números e a soma entre eles foi {}'.format(cont,soma))
RestExpress/HyperExpress
hal/src/test/java/com/strategicgains/hyperexpress/domain/hal/HalResourceImplTest.java
/* Copyright 2014, Strategic Gains, 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 com.strategicgains.hyperexpress.domain.hal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.List; import org.junit.Test; import com.strategicgains.hyperexpress.builder.DefaultTokenResolver; import com.strategicgains.hyperexpress.domain.Namespace; import com.strategicgains.hyperexpress.exception.ResourceException; /** * @author toddf * @since Mar 18, 2014 */ public class HalResourceImplTest { @Test(expected=ResourceException.class) public void shouldThrowOnMissingRel() { HalResource r = new HalResource(); r.addLink(new HalLinkBuilder("/something").build(new DefaultTokenResolver())); } @Test(expected=ResourceException.class) public void shouldThrowOnNullLink() { HalResource r = new HalResource(); r.addLink(null); } @Test(expected=ResourceException.class) public void shouldThrowOnNullEmbed() { HalResource r = new HalResource(); r.addResource("something", null); } @Test(expected=ResourceException.class) public void shouldThrowOnNullEmbedRel() { HalResource r = new HalResource(); r.addResource(null, new HalResource()); } @Test(expected=ResourceException.class) public void shouldThrowOnNullCurie() { HalResource r = new HalResource(); r.addNamespace(null); } @Test(expected=ResourceException.class) public void shouldThrowOnNamelessCurie() { HalResource r = new HalResource(); r.addNamespace(new Namespace(null, "/sample/{rel}")); } @Test public void shouldAddCurieRel() { HalResource r = new HalResource(); r.addNamespace(new Namespace("some-name", "/sample/{rel}")); r.addNamespace(new Namespace("another-name", "/sample/{rel}")); List<Namespace> curies = r.getNamespaces(); assertNotNull(curies); assertEquals(2, curies.size()); } @Test public void shouldAddNamespace() { HalResource r = new HalResource(); r.addNamespace("ea:blah", "/sample/{rel}"); List<Namespace> curies = r.getNamespaces(); assertNotNull(curies); assertEquals(1, curies.size()); assertEquals("/sample/{rel}", curies.get(0).href()); assertEquals("ea:blah", curies.get(0).name()); } }
phamngoctuong/lebab
src/syntax/ArrowFunctionExpression.js
<reponame>phamngoctuong/lebab import BaseSyntax from './BaseSyntax'; /** * The class to define the ArrowFunctionExpression syntax */ export default class ArrowFunctionExpression extends BaseSyntax { /** * The constructor of ArrowFunctionExpression * * @param {Object} cfg * @param {Node} cfg.body * @param {Node[]} cfg.params * @param {Node[]} cfg.defaults * @param {Node} cfg.rest (optional) */ constructor({body, params, defaults, rest, async}) { super('ArrowFunctionExpression'); this.body = body; this.params = params; this.defaults = defaults; this.rest = rest; this.async = async; this.generator = false; this.id = undefined; } }
dfreerksen/toller
toller.gemspec
<gh_stars>1-10 # frozen_string_literal: true $LOAD_PATH.push File.expand_path('lib', __dir__) require 'toller/version' Gem::Specification.new do |spec| spec.name = 'toller' spec.version = Toller::VERSION spec.authors = ['<NAME>'] spec.email = ['<EMAIL>'] spec.homepage = 'https://github.com/dfreerksen/toller' spec.summary = 'Summary of Toller.' spec.description = 'Description of Toller.' spec.license = 'MIT' spec.required_ruby_version = '>= 2.5.8' spec.files = Dir['{lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] spec.add_dependency 'rails', '>= 5.0' spec.add_development_dependency 'appraisal', '~> 2.3.0' end
rzasap/felix-search-webconsole-plugin
src/main/java/com/neva/felix/webconsole/plugins/search/utils/TemplateRenderer.java
<gh_stars>10-100 package com.neva.felix.webconsole.plugins.search.utils; import com.google.common.collect.ImmutableMap; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.text.StrSubstitutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; import java.util.Collections; import java.util.Map; public class TemplateRenderer { private static final Logger LOG = LoggerFactory.getLogger(TemplateRenderer.class); protected final Map<String, String> globalVars; public TemplateRenderer() { this(Collections.<String, String>emptyMap()); } public TemplateRenderer(Map<String, String> globalVars) { this.globalVars = globalVars; } public static String render(String templateFile) { return render(templateFile, Collections.<String, String>emptyMap()); } public static String render(String templateFile, Map<String, String> vars) { return new TemplateRenderer().renderTemplate(templateFile, vars); } public final String renderTemplate(String templateFile) { return renderTemplate(templateFile, Collections.<String, String>emptyMap()); } public final String renderTemplate(String templateFile, Map<String, String> vars) { String result = null; InputStream templateStream = getClass().getResourceAsStream("/" + templateFile); if (templateStream == null) { LOG.error(String.format("Template '%s' cannot be found.", templateFile)); } else { try { result = IOUtils.toString(templateStream, "UTF-8"); } catch (IOException e) { LOG.error(String.format("Cannot load template '%s'", templateFile), e); } finally { IOUtils.closeQuietly(templateStream); } } final Map<String, String> allVars = ImmutableMap.<String, String>builder() .putAll(globalVars) .putAll(vars) .build(); return StrSubstitutor.replace(result, allVars); } }
getdnsapi/libnss_getdns
ifaddr.c
<reponame>getdnsapi/libnss_getdns // Copyright Verisign, Inc and NLNetLabs.  See LICENSE file for details #define _GNU_SOURCE #include <arpa/inet.h> #include <sys/socket.h> #include <netdb.h> #include <ifaddrs.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "context_interface.h" #include "logger.h" int resolve_local(const char *query, response_bundle **ret) { struct ifaddrs *ifaddr, *ifa; int family, is_hostname = 0; char hostname[NI_MAXHOST]; /* *Get all locally-configured interface addresses. */ if(getifaddrs(&ifaddr) == -1) { log_critical("resolve_local< getifaddrs failed>"); return -1; } if(gethostname(hostname, NI_MAXHOST) != 0) { log_critical("gethostname() failed."); return -1; } if(strcasecmp(hostname, query) == 0) { is_hostname = 1; } *ret = malloc(sizeof(response_bundle)); if(!(*ret)) { log_critical("malloc failed"); return -1; } memset(*ret, 0, sizeof(response_bundle)); (*ret)->respstatus = RESP_BUNDLE_LOCAL_CONFIG.respstatus; (*ret)->dnssec_status = RESP_BUNDLE_LOCAL_CONFIG.dnssec_status; (*ret)->ipv4_count = 0; (*ret)->ipv6_count = 0; (*ret)->ttl = 0; memcpy((*ret)->ipv4, "ipv4:", 5); memcpy((*ret)->ipv6, "ipv6:", 5); char *ipv4_ptr = &((*ret)->ipv4[5]); char *ipv6_ptr = &((*ret)->ipv6[5]); size_t len; strncpy((*ret)->cname, hostname, strlen(hostname)); for(ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { if (ifa->ifa_addr == NULL) continue; family = ifa->ifa_addr->sa_family; if(family == AF_INET) { char address_str[NI_MAXHOST]; if(getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), address_str, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) != 0) { continue; } len = strlen(address_str)+1; if(!is_hostname && (strncasecmp(address_str, query, len-1) != 0)) { /* *Neither the hostname, nor a local IP address, so continue; */ continue; } (*ret)->ipv4_count++; snprintf(ipv4_ptr, len+1, "%s,", address_str); ipv4_ptr += len; }else if(family == AF_INET6){ char address_str[NI_MAXHOST]; if(getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in6), address_str, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) != 0) { continue; } len = strlen(address_str)+1; /* *Local IPv6 addresses can be scoped (with iface index, as ADDRESS%if_idx) */ if(!is_hostname && (strncasecmp(address_str, query, strchrnul(address_str, '%') - address_str) != 0)) { /* *Neither the hostname, nor a local IP address, so continue; */ continue; } (*ret)->ipv6_count++; snprintf(ipv6_ptr, len+1, "%s,", address_str); ipv6_ptr += len; } } freeifaddrs(ifaddr); if(1 > ((*ret)->ipv4_count + (*ret)->ipv6_count)) { free(*ret); *ret = NULL; return -1; } memset(ipv4_ptr-1, 0, 1); memset(ipv6_ptr-1, 0, 1); return 0; } int has_ipv6_addresses() { struct ifaddrs *ifaddr, *ifa; /* *Get all locally-configured interface addresses. */ if(getifaddrs(&ifaddr) == -1) { log_critical("resolve_local< getifaddrs failed>"); return 0; } for(ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { if(ifa->ifa_addr && (ifa->ifa_addr->sa_family == AF_INET)) { return 0; } } return 1; }
guyang66/gy-nodejs-kcoco
controller/commonController.js
<gh_stars>0 const path = require('path') const fs=require('fs') const chalk = require('chalk'); module.exports = app => ({ async test () { const { ctx, $helper } = app ctx.body = $helper.Result.success('') }, /** * 获取验证码 * @returns {Promise<void>} */ async getCaptcha () { const { ctx, $config, $helper } = app; const svgCaptcha = require('svg-captcha') const cap = svgCaptcha.create({ size: $config.captcha.size, // 验证码长度 width: $config.captcha.width, height: $config.captcha.height, fontSize: $config.captcha.fontSize, ignoreChars: $config.captcha.ignoreChars, // 验证码字符中排除 0o1i noise: $config.captcha.noise, // 干扰线条的数量 color: $config.captcha.color, // 验证码的字符是否有颜色,默认没有,如果设定了背景,则默认有 background: $config.captcha.background // 验证码图片背景颜色 }) ctx.response.type = 'image/svg+xml' ctx.session.captcha = cap.text.toLowerCase() ctx.body = $helper.Result.success(cap.data) }, /** * 单文件上传(上传阿里云oss上),多文件上传查看对应文档,或者用promise.all封装多个单文件上传,然后执行拿到返回结果即可。 * 如果有nginx反向代理,注意nginx可能拦截大资源文件,注意放开nginx的请求实体大小 * 如果有自己的文件服务器,就上传到自己的文件服务器即可。 * @returns {Promise<void>} */ async upload () { const { ctx, $oss, $config, $helper, $log4 } = app; const { errorLogger } = $log4 /** * @name 客户端自定义上传文件名 * @override 是否同名覆盖 Y:开启(同名文件上传时oss客户端会报错);N:关闭; * @dir 客户端自定义上传上传目录 */ let { name, overwrite, dir } = ctx.request.body if(!ctx.request.files){ ctx.body = $helper.Result.error('UPLOAD_NO_FILE_ERROR') return } if(!name || !ctx.request.files[name]){ ctx.body = $helper.Result.error('UPLOAD_FILE_NAME_EMPTY_ERROR') return } if(!dir){ dir = '' } const filepath = ctx.request.files[name].path const filename = ctx.request.files[name].name const putHeader = {} if(overwrite && overwrite === 'Y'){ // 是否开启禁止同名覆盖,默认关闭 putHeader.headers = { 'x-oss-forbid-overwrite': true } } // 区分开生产环境和测试缓存的图片路径 let ossRootPath = $config.oss.rootDir if(process.env.NODE_ENV === 'production'){ ossRootPath = $config.oss.prdRootDir } // 直接用oss 客户端直传到指定目录 try { // 允许客户端自定义上传路径。 // 客户端看到的上传进度只是上传到这个服务的时间进度,但是上传到oss上还需要时间,客户端是不知道的 // 也就是说当客户端看到上传进度达到100%的时候,还要等待(文件越大上传到oss时间越长)一段时间请求才算完成。 const result = await $oss.put(path.join(ossRootPath, dir, filename), path.normalize(filepath), putHeader); ctx.body = $helper.Result.success(result && result.url) } catch(err) { console.log(chalk.red(err)) errorLogger.error('【commonController】—— upload:' + err) ctx.body = $helper.Result.fail(err.status, err && err.name) } }, /** * 上传到服务器上(koa-body + nodejs原生) * @returns {Promise<void>} */ async uploadV2 () { const { ctx, $config, $helper, $log4 } = app; const { errorLogger } = $log4 let { name, overwrite, dir, type } = ctx.request.body /** * 是否是富文本编辑器在上传图片 * 富文本编辑器需要返回其满足的response数据格式,不然会报错,需要和前端沟通好 * @type {boolean} */ const isWange = (type === 'wange') // 上传文件格式:form-data,一般element-ui和antd的upload组件都写好的格式 // 步骤 // 1.从上传请求的files中获取需要上传的file // 2.使用fs.createReadStream从文件临时缓存目录(比如/var/folders/...)创建一个读取流 // 3.使用fs.createWriteStream将读取的内容写入指定目录即可(一般指向我们的静态资目录,当服务启动的时候,就可以访问这个资源了) // 4.关闭流,完成 // 使用koa-body中间件files才会挂到ctx.request上 if(!ctx.request.files){ ctx.body = $helper.Result.error('UPLOAD_NO_FILE_ERROR') return } // todo: 自定义文件目录和名字,以及写入目录不存在时需要创建 // 注意:服务器目录权限,可能会发生没有写入权限的问题 // 注意:关注一下暂存目录的文件会不会定时被清理,如果没有是否需要手动清理?不然随着上传,服务器磁盘内存会被一点点吃掉 const file = ctx.request.files[name] const filePath = file.path // 文件暂存目录 const filename = file.name // 文件全名 const uploadRootPath = path.join(__dirname, '../public', $config.upload.rootPath) const newFilePath = path.join(uploadRootPath, dir, filename); // 文件指定存放目录 const prefix = file.name.split('.')[1]; // 文件后缀 // 判断同名覆盖设置规则 if(overwrite === 'N'){ // 同步读取 if(fs.existsSync(newFilePath)){ ctx.body = $helper.Result.error('UPLOAD_FILE_EXIST_ERROR') return } } // 处理目录不存在的情况 await $helper.pathToDir(path.join(uploadRootPath, dir)) const reader = fs.createReadStream(filePath); // reader流 reader.on('error',function (err){ console.log(err) errorLogger.error('【commonController】 —— uploadV2 —— createReadStream:', err) }) const upStream = fs.createWriteStream(newFilePath); // createWriteStream不抛出异常,它传递一个错误的异步回调,所以用try catch包裹是无法捕获异常的 // 不监听error事件,createWriteStream一旦异常 会导致程序崩溃 upStream.on('error',function (err){ console.log(err) errorLogger.error('【commonController】 —— uploadV2 —— createWriteStream:', err) }) try { await reader.pipe(upStream); } catch (e) { console.log(e) errorLogger.error('【commonController】 —— uploadV2 —— reader.pipe:', e) ctx.body = isWange ? { errno: -1, data: '上传失败!' } : $helper.Result.error('UPLOAD_SYSTEM_ERROR') return } let preUrl = $config.upload.devBaseUrl if(process.env.NODE_ENV === 'product'){ preUrl = $config.upload.prdBaseUrl } let url = preUrl + path.join('upload', dir, filename) ctx.body = isWange ? { errno: 0, data: [url] } : $helper.Result.success(url) }, /** * 多文件上传(),这里支持了前端wange富文本编辑器的多图片上传,其他的请自行实现上传逻辑 * @returns {Promise<void>} */ async multiUpload () { const { ctx, $config, $helper, $log4 } = app; const { errorLogger } = $log4 let { name, overwrite, dir, type } = ctx.request.body const isWange = (type === 'wange') if(!ctx.request.files){ ctx.body = $helper.Result.error('UPLOAD_NO_FILE_ERROR') return } const singleFile = ctx.request.files[name] const uploadRootPath = path.join(__dirname, '../public', $config.upload.rootPath) // 处理目录不存在的情况 await $helper.pathToDir(path.join(uploadRootPath, dir)) if(!singleFile && Object.keys(ctx.request.files).length >= 2){ // 这里是多个文件上传 const wrapPromise = (reader, upStream) => { return new Promise(async (resolve, reject)=>{ try { reader.pipe(upStream); resolve(true) } catch (e){ reject(e) } }) } let promiseArray = [] let resultArray = [] for(let fileKey in ctx.request.files){ let file = ctx.request.files[fileKey] let filePath = file.path // 文件暂存目录 let filename = file.name // 文件全名 let newFilePath = path.join(uploadRootPath, dir, filename); // 文件指定存放目录 if(overwrite === 'N'){ // 同步读取 if(fs.existsSync(newFilePath)){ ctx.body = $helper.Result.error('UPLOAD_FILE_EXIST_ERROR') return } } // 创建多个读写流,然后用promise.all异步执行,用await同步一个一个执行也行,时间开销大 let reader = fs.createReadStream(filePath); reader.on('error',function (err){ console.log(err) errorLogger.error('【commonController】 —— uploadV2 —— createReadStream:', err) }) let upStream = fs.createWriteStream(newFilePath); upStream.on('error',function (err){ console.log(err) errorLogger.error('【commonController】 —— uploadV2 —— createWriteStream:', err) }) let p = wrapPromise(reader, upStream) promiseArray.push(p) let preUrl = $config.upload.devBaseUrl if(process.env.NODE_ENV === 'product'){ preUrl = $config.upload.prdBaseUrl } let url = preUrl + path.join('upload', dir, filename) resultArray.push(url) } try { await Promise.all(promiseArray) } catch (e) { console.log(e) errorLogger.error('【commonController】 —— uploadV2 —— reader.pipe:', e) ctx.body = isWange ? { errno: -1, data: '上传失败!' } : $helper.Result.error('UPLOAD_SYSTEM_ERROR') return } ctx.body = isWange ? { errno: 0, data: resultArray } : $helper.Result.success(url) return } // 单文件逻辑 let filePath = singleFile.path // 文件暂存目录 let filename = singleFile.name // 文件全名 let newFilePath = path.join(uploadRootPath, dir, filename); // 文件指定存放目录 // 判断同名覆盖设置规则 if(overwrite === 'N'){ // 同步读取 if(fs.existsSync(newFilePath)){ ctx.body = $helper.Result.error('UPLOAD_FILE_EXIST_ERROR') return } } let reader2 = fs.createReadStream(filePath); // reader流 reader2.on('error',function (err){ console.log(err) errorLogger.error('【commonController】 —— uploadV2 —— createReadStream:', err) }) let upStream2 = fs.createWriteStream(newFilePath); upStream2.on('error',function (err){ console.log(err) errorLogger.error('【commonController】 —— uploadV2 —— createWriteStream:', err) }) try { await reader2.pipe(upStream2); } catch (e) { console.log(e) errorLogger.error('【commonController】 —— uploadV2 —— reader.pipe:', e) ctx.body = isWange ? { errno: -1, data: '上传失败!' } : $helper.Result.error('UPLOAD_SYSTEM_ERROR') return } let preUrl = $config.upload.devBaseUrl if(process.env.NODE_ENV === 'product'){ preUrl = $config.upload.prdBaseUrl } let url = preUrl + path.join('upload', dir, filename) ctx.body = isWange ? { errno: 0, data: [url] } : $helper.Result.success(url) }, /** * 使用multer中间件来上传文件 * @returns {Promise<void>} */ async uploadV3 () { const { ctx, $helper, $config } = app; let file = ctx.req.file let preUrl = $config.upload.devBaseUrl if(process.env.NODE_ENV === 'product'){ preUrl = $config.upload.prdBaseUrl } if(file){ let url = path.join($config.upload.multerPath, file.originalname) ctx.body = $helper.Result.success(preUrl + url) } else { // koa-body中间件替代koa-bodyparser和koa-multer,所以koa-body和koa-multer、@koa/multer、multer、busboy等都有冲突 // 使用multer上传文件 // 方法1:注释掉application中对koa-body的初始化 // 方法2: config.json设置bodyParse为false,重启应用 console.log(chalk.red('ctx.req.file不存在,如果使用milter上传文件,需要取消koa-body中间使用!')) ctx.body = $helper.Result.fail(-3, '上传失败!') } }, /** * 资源下载量+1 * @returns {Promise<void>} */ async addResourceDownloadCount () { const { ctx, $service, $helper,$model } = app; const { pageResourceDownload, bizResourceRecord } = $model let { id, phone, name } = ctx.query; if(!id){ ctx.body = $helper.Result.fail(-1, '参数缺失(id不存在)!') return } let exist = await $service.baseService.queryOne(pageResourceDownload, {id: id}) if(!exist){ ctx.body = $helper.Result.fail(-1, '未查询到相关数据!') return } // 访问者登录之后才能进行下载操作 let instance = { objectId: exist._id, type: 'download', typeString: '下载', name: name || '', ip: $helper.getClientIP(ctx), phone: phone || 'phone', } await $service.baseService.save(bizResourceRecord, instance) let r = await $service.resourceService.updateResourceCount(exist._id, 1) if(r){ ctx.body = $helper.Result.success(r) } else { ctx.body = $helper.Result.fail(-1, '更新失败!') } }, /** * 记录访问者点击事件 * @returns {Promise<void>} */ async resourceClickRecord () { const { ctx, $service, $helper,$model } = app; const { pageResourceDownload, bizResourceRecord } = $model let { id, phone, name } = ctx.query; if(!id){ ctx.body = $helper.Result.fail(-1, '参数缺失(id不存在)!') return } let exist = await $service.baseService.queryOne(pageResourceDownload, {id: id}) if(!exist){ ctx.body = $helper.Result.fail(-1, '未查询到相关数据!') return } // 访问者登录之后才能进行下载操作 let instance = { objectId: exist._id, type: 'click', typeString: '点击', name: name || '', ip: $helper.getClientIP(ctx), phone: phone || 'phone', } let r = await $service.baseService.save(bizResourceRecord, instance) if(r){ ctx.body = $helper.Result.success(r) } else { ctx.body = $helper.Result.fail(-1, '记录失败!') } }, /** * 保存埋点搜索词 * @returns {Promise<void>} */ async saveSearchKey () { const { ctx, $service, $helper,$model } = app; const { bizSearchKey } = $model let { key, phone, name, type, typeString } = ctx.query; if(!type || type === ''){ ctx.body = $helper.Result.fail(-1, '埋点类型不能为空!') return } if(!key || key === ''){ ctx.body = $helper.Result.fail(-1, '埋点搜索关键词不能为空!') return } let instance = { type: type, typeString: typeString, key: key, name: name || '', ip: $helper.getClientIP(ctx), phone: phone || 'phone', } let r = await $service.baseService.save(bizSearchKey, instance) if(r){ ctx.body = $helper.Result.success(r) } else { ctx.body = $helper.Result.fail(-1, '保存失败!') } }, /** * 页面pv统计数据 * @returns {Promise<void>} */ async pagePvStatics () { const { ctx, $helper, $service, $nodeCache, $model } = app const { bizPv } = $model const tdk = $nodeCache.get('page_tdk_config') let { path, name, phone } = ctx.query if(!path || path === ''){ ctx.body = $helper.Result.fail(-1, 'pv——path不存在') return } let pathUrl = path let pageName = tdk[path] ? (tdk[path].name || '未知') : '未知' if(path === '/'){ pageName = '首页' pathUrl = '/index' } else if (path.indexOf('/about/news/detail/') > -1){ // 优先匹配detail pageName = '新闻详情' pathUrl = '/about/news/detail' } else if(path.indexOf('/about/news/') > -1){ pageName = '新闻列表' pathUrl = '/about/news' } let content = { path: pathUrl, pageName: pageName, name: name || '', phone: phone || '', ip: $helper.getClientIP(ctx) } let result = await $service.baseService.save(bizPv, content) if(result){ ctx.body = $helper.Result.success('ok') } else { ctx.body = $helper.Result.fail(-1,'fail') } }, /** * 页面tp统计数据 * @returns {Promise<void>} */ async pageTpStatics () { const { ctx, $helper, $service, $model, $nodeCache } = app; const { bizTp } = $model let { path, time, name, phone } = ctx.query const tdk = $nodeCache.get('page_tdk_config') if(!path || path === ''){ ctx.body = $helper.Result.fail(-1,'path不存在!') return } if(!time || time === ''){ ctx.body = $helper.Result.fail(-1,'time不存在!') return } time = (time - 0) / 1000 time = time.toFixed(1) time = Number(time) // 停留时间小于1s或者大于30分钟的不保存 if(time < 1 || time > 60 * 30){ ctx.body = $helper.Result.success('ok!') return } let pathUrl = path let pageName = tdk[path] ? (tdk[path].name || '未知') : '未知' if(path === '/'){ pageName = '首页' pathUrl = '/index' } else if (path.indexOf('/about/news/detail/') > -1){ // 优先匹配detail pageName = '新闻详情' pathUrl = '/about/news/detail' } else if(path.indexOf('/about/news/') > -1){ pageName = '新闻列表' pathUrl = '/about/news' } let content = { path: path, pageName: pageName, time: time, name: name || '', phone: phone || '', ip: $helper.getClientIP(ctx) } let result = await $service.baseService.save(bizTp, content) if(result){ ctx.body = $helper.Result.success(result) } else { ctx.body = $helper.Result.fail(-1,'保存失败!') } } })
TheEpicBlock/Flywheel
src/main/java/com/jozufozu/flywheel/api/FlywheelRendered.java
package com.jozufozu.flywheel.api; /** * Something (a BlockEntity or Entity) that can be rendered using the instancing API. */ public interface FlywheelRendered { /** * @return true if there are parts of the renderer that cannot be implemented with Flywheel. */ default boolean shouldRenderNormally() { return false; } }
maloft/hep
fwk/core.go
// Copyright 2017 The go-hep Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package fwk import ( "fmt" "reflect" "go-hep.org/x/hep/fwk/fsm" ) type statuscode int func (sc statuscode) Error() string { return fmt.Sprintf("fwk: error code [%d]", int(sc)) } // Context is the interface to access context-local data. type Context interface { ID() int64 // id of this context (e.g. entry number or some kind of event number) Slot() int // slot number in the pool of event sequences Store() Store // data store corresponding to the id+slot Msg() MsgStream // messaging for this context (id+slot) Svc(n string) (Svc, error) // retrieve an already existing Svc by name } // Component is the interface satisfied by all values in fwk. // // A component can be asked for: // its Type() (ex: "go-hep.org/x/hep/fads.MomentumSmearing") // its Name() (ex: "MyPropagator") type Component interface { Type() string // Type of the component (ex: "go-hep.org/x/hep/fads.MomentumSmearing") Name() string // Name of the component (ex: "MyPropagator") } // ComponentMgr manages components. // ComponentMgr creates and provides access to all the components in a fwk App. type ComponentMgr interface { Component(n string) Component HasComponent(n string) bool Components() []Component New(t, n string) (Component, error) } // Task is a component processing event-level data. // Task.Process is called for every component and for every input event. type Task interface { Component StartTask(ctx Context) error Process(ctx Context) error StopTask(ctx Context) error } // TaskMgr manages tasks. type TaskMgr interface { AddTask(tsk Task) error DelTask(tsk Task) error HasTask(n string) bool GetTask(n string) Task Tasks() []Task } // Configurer are components which can be configured via properties // declared or created by the job-options. type Configurer interface { Component Configure(ctx Context) error } // Svc is a component providing services or helper features. // Services are started before the main event loop processing and // stopped just after. type Svc interface { Component StartSvc(ctx Context) error StopSvc(ctx Context) error } // SvcMgr manages services. type SvcMgr interface { AddSvc(svc Svc) error DelSvc(svc Svc) error HasSvc(n string) bool GetSvc(n string) Svc Svcs() []Svc } // App is the component orchestrating all the other components // in a coherent application to process physics events. type App interface { Component ComponentMgr SvcMgr TaskMgr PropMgr PortMgr FSMStater Runner Scripter() Scripter Msg() MsgStream } // Runner runs a fwk App in a batch fashion: // - Configure // - Start // - Run event loop // - Stop // - Shutdown type Runner interface { Run() error } // Scripter gives finer control to running a fwk App type Scripter interface { Configure() error Start() error Run(evtmax int64) error Stop() error Shutdown() error } // PropMgr manages properties attached to components. type PropMgr interface { DeclProp(c Component, name string, ptr interface{}) error SetProp(c Component, name string, value interface{}) error GetProp(c Component, name string) (interface{}, error) HasProp(c Component, name string) bool } // Property is a pair key/value, associated to a component. // Properties of a given component can be modified // by a job-option or by other components. type Property interface { DeclProp(name string, ptr interface{}) error SetProp(name string, value interface{}) error GetProp(name string) (interface{}, error) } // Store provides access to a concurrent-safe map[string]interface{} store. type Store interface { Get(key string) (interface{}, error) Put(key string, value interface{}) error Has(key string) bool } // Port holds the name and type of a data item in a store type Port struct { Name string Type reflect.Type } // DeclPorter is the interface to declare input/output ports for the data flow. type DeclPorter interface { DeclInPort(name string, t reflect.Type) error DeclOutPort(name string, t reflect.Type) error } // PortMgr is the interface to manage input/output ports for the data flow type PortMgr interface { DeclInPort(c Component, name string, t reflect.Type) error DeclOutPort(c Component, name string, t reflect.Type) error } // FSMStater is the interface used to query the current state of the fwk application type FSMStater interface { FSMState() fsm.State } // Level regulates the verbosity level of a component. type Level int // Default verbosity levels. const ( LvlDebug Level = -10 // LvlDebug defines the DBG verbosity level LvlInfo Level = 0 // LvlInfo defines the INFO verbosity level LvlWarning Level = 10 // LvlWarning defines the WARN verbosity level LvlError Level = 20 // LvlError defines the ERR verbosity level ) func (lvl Level) msgstring() string { switch lvl { case LvlDebug: return "DBG " case LvlInfo: return "INFO" case LvlWarning: return "WARN" case LvlError: return "ERR " } panic(Errorf("fwk.Level: invalid fwk.Level value [%d]", int(lvl))) } // String prints the human-readable representation of a Level value. func (lvl Level) String() string { switch lvl { case LvlDebug: return "DEBUG" case LvlInfo: return "INFO" case LvlWarning: return "WARN" case LvlError: return "ERROR" } panic(Errorf("fwk.Level: invalid fwk.Level value [%d]", int(lvl))) } // MsgStream provides access to verbosity-defined formated messages, a la fmt.Printf. type MsgStream interface { Debugf(format string, a ...interface{}) (int, error) Infof(format string, a ...interface{}) (int, error) Warnf(format string, a ...interface{}) (int, error) Errorf(format string, a ...interface{}) (int, error) Msg(lvl Level, format string, a ...interface{}) (int, error) } // Deleter prepares values to be GC-reclaimed type Deleter interface { Delete() error }
raphw/declarative-parser
src/main/java/com/blogspot/mydailyjava/dp/delegation/FloatDelegate.java
<gh_stars>1-10 package com.blogspot.mydailyjava.dp.delegation; import java.lang.reflect.Field; import java.util.Locale; public class FloatDelegate extends PropertyDelegate { public FloatDelegate(Field field, Locale locale) { super(field, locale); } @Override public void setValue(Object bean, String raw) throws IllegalAccessException { getField().setFloat(bean, Float.parseFloat(raw)); } @Override public String getValue(Object bean) throws IllegalAccessException { return String.valueOf(getField().getFloat(bean)); } @Override public String getPattern() { return DoubleDelegate.DECIMAL_NUMBER_REGEX; } }
louisgevers/udrinkio
game/Pyramid.js
const deck = require('./deck.js') module.exports = class Pyramid { constructor(size, users) { this.deck = deck.createDeck() this.users = new Map() users.forEach((username, userId) => { this.users.set(userId, username) }) this.pyramid = this.generatePyramid(size) this.visiblePyramid = this.pyramid.map((_) => { return 'b' }) this.possibleHands = this.generatePossibleHands() this.hands = this.generateHands() this.visibleHands = this.generateVisibleHands() this.pyramidIndex = 0 } // ### GLOBAL GAME METHODS ### connect = (user) => { if (this.possibleHands.length > 0) { const hand = this.possibleHands.pop() this.hands.set(user.userId, hand) this.visibleHands.set(user.userId, hand.map((_) => { return 'b' })) this.users.set(user.userId, user.username) } } disconnect = (userId) => { this.possibleHands.push(this.hands.get(userId)) this.hands.delete(userId) this.visibleHands.delete(userId) this.users.delete(userId) } generateState = () => { return { pyramid: this.visiblePyramid, hands: JSON.stringify(Array.from(this.visibleHands)), users: JSON.stringify(Array.from(this.users)) } } // ### GAME LOGIC METHODS ### nextPyramidCard = () => { if (this.pyramidIndex < this.pyramid.length) { this.visiblePyramid[this.pyramidIndex] = this.pyramid[this.pyramidIndex] this.pyramidIndex += 1 } } undoPyramidCard = () => { if (this.pyramidIndex > -1) { this.pyramidIndex -= 1 this.visiblePyramid[this.pyramidIndex] = 'b' if (this.pyramidIndex < 0) { this.pyramidIndex = 0 } } } showCard = (userId, index) => { const hand = this.hands.get(userId) if (typeof hand !== 'undefined' && index > -1 && index < hand.length) { this.visibleHands.get(userId)[index] = hand[index] } } hideCard = (userId, index) => { const hand = this.hands.get(userId) if (typeof hand !== 'undefined' && index > -1 && index < hand.length) { this.visibleHands.get(userId)[index] = 'b' } } // ### GAME SETUP LOGIC ### generatePyramid = (size) => { const pyramid = [] const n = size > 7 ? 7 : size < 3 ? 3 : size for (var i = n; i > 0; i--) { for (var j = 0; j < i; j++) { pyramid.push(this.deck.pop()) } } return pyramid } generatePossibleHands = () => { const hands = [] for (var i = 0; i < 6; i++) { const hand = [] for (var j = 0; j < 4; j++) { hand.push(this.deck.pop()) } hands.push(hand) } return hands } generateHands = () => { const hands = new Map() this.users.forEach((username, userId) => { if (this.possibleHands.length > 0) { hands.set(userId, this.possibleHands.pop()) } }) return hands } generateVisibleHands = () => { const hands = new Map() this.hands.forEach((hand, userId) => { hands.set(userId, hand.map((_) => { return 'b' })) }) return hands } }
chaohu/Daily-Learning
Foundation-of-CS/ics14_lab1-3/lab1/src/selections-f10.c
<reponame>chaohu/Daily-Learning #include "tmin.c" #include "isAsciiDigit.c" #include "conditional.c" #include "allEvenBits.c" #include "implication.c" #include "isLessOrEqual.c" #include "bang.c" #include "howManyBits.c" #include "byteSwap.c" #include "leastBitPos.c" #include "logicalShift.c" #include "float_neg.c" #include "float_f2i.c"
mhconradt/analytics-toolbox-core
modules/geohash/bigquery/test/integration/GEOHASH_BOUNDARY.test.js
const { runQuery } = require('../../../../../common/bigquery/test-utils'); test('GEOHASH_BOUNDARY should work', async () => { const query = 'SELECT ST_ASTEXT(`@@BQ_PREFIX@@carto.GEOHASH_BOUNDARY`(\'ezrq\')) AS output'; const rows = await runQuery(query); expect(rows.length).toEqual(1); expect(rows[0].output).toEqual('POLYGON((-1.0546875 41.8359375, -0.703125 41.8359375, -0.703125 42.01171875, -1.0546875 42.01171875, -1.0546875 41.8359375))'); }); test('GEOHASH_BOUNDARY should return NULL for invalid input', async () => { const query = 'SELECT `@@BQ_PREFIX@@carto.GEOHASH_BOUNDARY`(\'error\') AS output'; const rows = await runQuery(query); expect(rows.length).toEqual(1); expect(rows[0].output).toEqual(null); });
risdict4d/abunzidata
src/main/java/org/opendatakit/aggregate/odktables/relation/DbTable.java
<filename>src/main/java/org/opendatakit/aggregate/odktables/relation/DbTable.java /* * Copyright (C) 2012-2013 University of Washington * * 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.opendatakit.aggregate.odktables.relation; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.commons.lang3.Validate; import org.opendatakit.aggregate.odktables.relation.DbColumnDefinitions.DbColumnDefinitionsEntity; import org.opendatakit.aggregate.odktables.relation.DbTableDefinitions.DbTableDefinitionsEntity; import org.opendatakit.aggregate.odktables.rest.TableConstants; import org.opendatakit.common.ermodel.Entity; import org.opendatakit.common.ermodel.Query; import org.opendatakit.common.ermodel.Relation; import org.opendatakit.common.persistence.DataField; import org.opendatakit.common.persistence.DataField.DataType; import org.opendatakit.common.persistence.DataField.IndexType; import org.opendatakit.common.persistence.PersistConsts; import org.opendatakit.common.persistence.exception.ODKDatastoreException; import org.opendatakit.common.persistence.exception.ODKEntityNotFoundException; import org.opendatakit.common.web.CallingContext; /** * Represents the schema for a user-defined (data, security, shortcut) table in * the database. * * @author <NAME> * @author <EMAIL> * */ public class DbTable extends Relation { private DbTable(String namespace, String tableName, List<DataField> fields, CallingContext cc) throws ODKDatastoreException { super(namespace, tableName, fields, cc); } /** * NOTE: the PK of this table is the ROW_ID of the DbLogTable entry * who's state matches this row. */ public static final DataField ROW_ETAG = new DataField("_ROW_ETAG", DataType.STRING, false); /** * This should hold the TableEntry's data ETag at the time the row was modified/created. */ public static final DataField DATA_ETAG_AT_MODIFICATION = new DataField( "_DATA_ETAG_AT_MODIFICATION", DataType.STRING, false); public static final DataField CREATE_USER = new DataField("_CREATE_USER", DataType.STRING, true); public static final DataField LAST_UPDATE_USER = new DataField("_LAST_UPDATE_USER", DataType.STRING, true); public static final DataField DELETED = new DataField("_DELETED", DataType.BOOLEAN, false); // limited to 10 characters public static final DataField FILTER_TYPE = new DataField(TableConstants.FILTER_TYPE.toUpperCase(), DataType.STRING, true, 10L); // limited to 50 characters public static final DataField FILTER_VALUE = new DataField(TableConstants.FILTER_VALUE.toUpperCase(), DataType.STRING, true, 50L).setIndexable(IndexType.HASH); // The FormId of the form that was in use when this record was last saved. // limited to 50 characters public static final DataField FORM_ID = new DataField(TableConstants.FORM_ID.toUpperCase(), DataType.STRING, true, 50L); // The locale that was active when this record was last saved. // limited to 10 characters public static final DataField LOCALE = new DataField(TableConstants.LOCALE.toUpperCase(), DataType.STRING, true, 10L); // limited to 10 characters public static final DataField SAVEPOINT_TYPE = new DataField(TableConstants.SAVEPOINT_TYPE.toUpperCase(), DataType.STRING, true, 10L); // nanoseconds at the time the form was saved (on client). // limited to 40 characters public static final DataField SAVEPOINT_TIMESTAMP = new DataField( TableConstants.SAVEPOINT_TIMESTAMP.toUpperCase(), DataType.STRING, false, 40L).setIndexable(IndexType.ORDERED); // the creator of this row, as reported by the device (may be a remote SMS user) public static final DataField SAVEPOINT_CREATOR = new DataField( TableConstants.SAVEPOINT_CREATOR.toUpperCase(), DataType.STRING, true); private static final List<DataField> dataFields; static { dataFields = new ArrayList<DataField>(); // metadata held only up at server dataFields.add(ROW_ETAG); dataFields.add(DATA_ETAG_AT_MODIFICATION); dataFields.add(CREATE_USER); dataFields.add(LAST_UPDATE_USER); dataFields.add(DELETED); // common metadata transmitted between server and device dataFields.add(FILTER_TYPE); dataFields.add(FILTER_VALUE); dataFields.add(FORM_ID); dataFields.add(LOCALE); dataFields.add(SAVEPOINT_TYPE); dataFields.add(SAVEPOINT_TIMESTAMP); dataFields.add(SAVEPOINT_CREATOR); } private static final EntityConverter converter = new EntityConverter(); public static DbTable getRelation(DbTableDefinitionsEntity entity, List<DbColumnDefinitionsEntity> entities, CallingContext cc) throws ODKDatastoreException { List<DataField> fields = converter.toFields(entities); fields.addAll(getStaticFields()); return getRelation(entity.getDbTableName(), fields, cc); } private static synchronized DbTable getRelation(String dbTableName, List<DataField> fields, CallingContext cc) throws ODKDatastoreException { DbTable relation = new DbTable(RUtil.NAMESPACE, dbTableName, fields, cc); return relation; } /** * This should only be called sparingly. * * @return */ public static List<DataField> getStaticFields() { return Collections.unmodifiableList(dataFields); } /** * Retrieve a list of {@link DbTable} row entities. * * @param table * the {@link DbTable} relation. * @param rowIds * the ids of the rows to get. * @param cc * @return the row entities * @throws ODKEntityNotFoundException * if one of the rows does not exist * @throws ODKDatastoreException */ public static List<Entity> query(DbTable table, List<String> rowIds, CallingContext cc) throws ODKEntityNotFoundException, ODKDatastoreException { Validate.notNull(table); Validate.noNullElements(rowIds); Validate.notNull(cc); Query query = table.query("DbTable.query", cc); query.include(PersistConsts.URI_COLUMN_NAME, rowIds); List<Entity> entities = query.execute(); return entities; } }
scottmac/hiphop-php
src/cpp/base/object_data.cpp
<gh_stars>1-10 /* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | <EMAIL> so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ #include <cpp/base/object_data.h> #include <cpp/base/type_array.h> #include <cpp/base/builtin_functions.h> #include <cpp/base/externals.h> #include <cpp/base/variable_serializer.h> #include <util/lock.h> #include <cpp/base/class_info.h> #include <cpp/eval/ast/function_call_expression.h> using namespace std; namespace HPHP { /////////////////////////////////////////////////////////////////////////////// // statics static ThreadLocal<int> os_max_id; // current maximum object identifier /////////////////////////////////////////////////////////////////////////////// // constructor/destructor ObjectData::ObjectData() : o_properties(NULL), o_attribute(0), o_inCall(0) { o_id = ++(*os_max_id.get()); } ObjectData::~ObjectData() { if (o_properties) { o_properties->release(); } int *pmax = os_max_id.get(); if (o_id == *pmax) { --(*pmax); } } /////////////////////////////////////////////////////////////////////////////// // class info bool ObjectData::o_isClass(const char *s) const { return strcasecmp(s, o_getClassName()) == 0; } const Eval::MethodStatement *ObjectData::getMethodStatement(const char* name) const { return NULL; } /////////////////////////////////////////////////////////////////////////////// // static methods and properties Variant ObjectData::os_get(const char *s, int64 hash) { throw FatalErrorException((string("unknown static property ") + s).c_str()); } Variant &ObjectData::os_lval(const char *s, int64 hash) { throw FatalErrorException((string("unknown static property ") + s).c_str()); } Variant ObjectData::os_invoke(const char *c, const char *s, CArrRef params, int64 hash, bool fatal /* = true */) { Object obj = create_object(c, Array::Create(), false); return obj->o_invoke(s, params, hash, fatal); } Variant ObjectData::os_constant(const char *s) { ostringstream msg; msg << "unknown class constant " << s; throw FatalErrorException(msg.str().c_str()); } Variant ObjectData::os_invoke_from_eval(const char *c, const char *s, Eval::VariableEnvironment &env, const Eval::FunctionCallExpression *call, int64 hash, bool fatal /* = true */) { return os_invoke(c, s, call->getParams(env), hash, fatal); } /////////////////////////////////////////////////////////////////////////////// // instance methods and properties bool ObjectData::o_exists(CStrRef propName, int64 hash) const { return propName.size() > 0 && o_properties && o_properties->exists(propName); } Variant ObjectData::o_get(CStrRef propName, int64 hash) { if (propName.size() == 0) { return null; } if (o_properties && o_properties->exists(propName)) { return o_properties->rvalAt(propName); } return t___get(propName); } Variant ObjectData::o_getUnchecked(CStrRef propName, int64 hash) { return o_get(propName, hash); } Variant ObjectData::o_set(CStrRef propName, int64 hash, CVarRef v, bool forInit /* = false */) { if (propName.size() == 0) { throw EmptyObjectPropertyException(); } if (forInit) { return ObjectData::t___set(propName, v); } else { return t___set(propName, v); } } void ObjectData::o_set(const Array properties) { for (ArrayIter iter(properties); iter; ++iter) { o_set(iter.first().toString(), -1, iter.second()); } } CVarRef ObjectData::set(CStrRef s, CVarRef v) { o_set(s, -1, v); return v; } Variant &ObjectData::o_lval(CStrRef propName, int64 hash) { if (propName.size() == 0) { throw EmptyObjectPropertyException(); } if (o_properties) { return o_properties->lvalAt(propName, hash); } return ___lval(propName); } Array ObjectData::o_toArray() const { vector<ArrayElement *> props; o_get(props); Array ret(ArrayData::Create(props, false)); if (o_properties && !o_properties->empty()) { return ret.merge(*o_properties); } return ret; } Array ObjectData::o_toIterArray(const char *context) { const char *object_class = o_getClassName(); const ClassInfo *classInfo = ClassInfo::FindClass(object_class); const ClassInfo *contextClassInfo = NULL; int category; if (!classInfo) return Array::Create(); Array ret = Array::Create(); // There are 3 cases: // (1) called from standalone function (this_object == null) or // the object class is not related to the context class; // (2) the object class is a subclass of the context class or vice versa. // (3) the object class is the same as the context class // For (1), only public properties of the object are accessible. // For (2) and (3), the public/protected properties of the object are // accessible; // any property of the context class is also accessible unless it is // overriden by the object class. (3) is really just an optimization. if (context == NULL || !*context) { category = 1; } else { contextClassInfo = ClassInfo::FindClass(context); ASSERT(contextClassInfo); if (strcasecmp(object_class, context) == 0) { category = 3; } else if (classInfo->derivesFrom(context, false) || contextClassInfo->derivesFrom(object_class, false)) { category = 2; } else { category = 1; } } ClassInfo::PropertyVec properties; classInfo->getAllProperties(properties); ClassInfo::PropertyMap contextProperties; if (category == 2) { contextClassInfo->getAllProperties(contextProperties); } Array dynamics = o_getDynamicProperties(); for (ClassInfo::PropertyVec::const_iterator iter = properties.begin(); iter != properties.end(); ++iter) { if ((*iter)->attribute & ClassInfo::IsStatic) continue; bool visible = false; switch (category) { case 1: visible = ((*iter)->attribute & ClassInfo::IsPublic); break; case 2: if (((*iter)->attribute & ClassInfo::IsPrivate) == 0) { visible = true; } else { ClassInfo::PropertyMap::const_iterator iterProp = contextProperties.find((*iter)->name); if (iterProp != contextProperties.end() && iterProp->second->owner == contextClassInfo) { visible = true; } else { visible = false; } } break; case 3: if (((*iter)->attribute & ClassInfo::IsPrivate) == 0 || (*iter)->owner == classInfo) { visible = true; } break; default: ASSERT(false); } if (visible) { ret.set((*iter)->name, o_getUnchecked((*iter)->name, -1)); } dynamics.remove((*iter)->name); } if (dynamics.size()) { ret.merge(dynamics); } return ret; } Array ObjectData::o_getDynamicProperties() const { if (o_properties) return *o_properties; return Array(); } Variant ObjectData::o_invoke(const char *s, CArrRef params, int64 hash, bool fatal /* = true */) { return doCall(s, params, fatal); } Variant ObjectData::o_root_invoke(const char *s, CArrRef params, int64 hash, bool fatal /* = true */) { return o_invoke(s, params, hash, fatal); } Variant ObjectData::o_invoke_ex(const char *clsname, const char *s, CArrRef params, int64 hash, bool fatal /* = true */) { if (fatal) { throw InvalidClassException(clsname); } else { return false; } } Variant ObjectData::o_invoke_few_args(const char *s, int64 hash, int count, CVarRef a0 /* = null_variant */, CVarRef a1 /* = null_variant */, CVarRef a2 /* = null_variant */ #if INVOKE_FEW_ARGS_COUNT > 3 ,CVarRef a3 /* = null_variant */, CVarRef a4 /* = null_variant */, CVarRef a5 /* = null_variant */ #endif #if INVOKE_FEW_ARGS_COUNT > 6 ,CVarRef a6 /* = null_variant */, CVarRef a7 /* = null_variant */, CVarRef a8 /* = null_variant */, CVarRef a9 /* = null_variant */ #endif ) { switch (count) { case 0: { return ObjectData::o_invoke(s, Array(), hash); } case 1: { Array params(NEW(ArrayElement)(a0), NULL); return ObjectData::o_invoke(s, params, hash); } case 2: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NULL); return ObjectData::o_invoke(s, params, hash); } case 3: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NEW(ArrayElement)(a2), NULL); return ObjectData::o_invoke(s, params, hash); } #if INVOKE_FEW_ARGS_COUNT > 3 case 4: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NEW(ArrayElement)(a2), NEW(ArrayElement)(a3), NULL); return ObjectData::o_invoke(s, params, hash); } case 5: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NEW(ArrayElement)(a2), NEW(ArrayElement)(a3), NEW(ArrayElement)(a4), NULL); return ObjectData::o_invoke(s, params, hash); } case 6: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NEW(ArrayElement)(a2), NEW(ArrayElement)(a3), NEW(ArrayElement)(a4), NEW(ArrayElement)(a5), NULL); return ObjectData::o_invoke(s, params, hash); } #endif #if INVOKE_FEW_ARGS_COUNT > 6 case 7: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NEW(ArrayElement)(a2), NEW(ArrayElement)(a3), NEW(ArrayElement)(a4), NEW(ArrayElement)(a5), NEW(ArrayElement)(a6), NULL); return ObjectData::o_invoke(s, params, hash); } case 8: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NEW(ArrayElement)(a2), NEW(ArrayElement)(a3), NEW(ArrayElement)(a4), NEW(ArrayElement)(a5), NEW(ArrayElement)(a6), NEW(ArrayElement)(a7), NULL); return ObjectData::o_invoke(s, params, hash); } case 9: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NEW(ArrayElement)(a2), NEW(ArrayElement)(a3), NEW(ArrayElement)(a4), NEW(ArrayElement)(a5), NEW(ArrayElement)(a6), NEW(ArrayElement)(a7), NEW(ArrayElement)(a8), NULL); return ObjectData::o_invoke(s, params, hash); } case 10: { Array params(NEW(ArrayElement)(a0), NEW(ArrayElement)(a1), NEW(ArrayElement)(a2), NEW(ArrayElement)(a3), NEW(ArrayElement)(a4), NEW(ArrayElement)(a5), NEW(ArrayElement)(a6), NEW(ArrayElement)(a7), NEW(ArrayElement)(a8), NEW(ArrayElement)(a9), NULL); return ObjectData::o_invoke(s, params, hash); } #endif default: ASSERT(false); } return null; } Variant ObjectData::o_root_invoke_few_args(const char *s, int64 hash, int count, CVarRef a0 /* = null_variant */, CVarRef a1 /* = null_variant */, CVarRef a2 /* = null_variant */ #if INVOKE_FEW_ARGS_COUNT > 3 ,CVarRef a3 /* = null_variant */, CVarRef a4 /* = null_variant */, CVarRef a5 /* = null_variant */ #endif #if INVOKE_FEW_ARGS_COUNT > 6 ,CVarRef a6 /* = null_variant */, CVarRef a7 /* = null_variant */, CVarRef a8 /* = null_variant */, CVarRef a9 /* = null_variant */ #endif ) { return o_invoke_few_args(s, hash, count, a0, a1, a2 #if INVOKE_FEW_ARGS_COUNT > 3 ,a3, a4, a5 #endif #if INVOKE_FEW_ARGS_COUNT > 6 ,a6, a7, a8, a9 #endif ); } Variant ObjectData::o_invoke_from_eval(const char *s, Eval::VariableEnvironment &env, const Eval::FunctionCallExpression *call, int64 hash, bool fatal /* = true */) { return o_invoke(s, call->getParams(env), hash, fatal); } Variant ObjectData::o_throw_fatal(const char *msg) { throw_fatal(msg); return null; } bool ObjectData::php_sleep(Variant &ret) { setAttribute(HasSleep); ret = t___sleep(); return getAttribute(HasSleep); } void ObjectData::serialize(VariableSerializer *serializer) const { if (serializer->incNestedLevel((void*)this, true)) { serializer->writeOverflow((void*)this, true); } else { Variant ret; if (const_cast<ObjectData*>(this)->php_sleep(ret)) { if (ret.isArray()) { Array wanted = Array::Create(); Array props = ret.toArray(); for (ArrayIter iter(props); iter; ++iter) { String name = iter.second().toString(); if (o_exists(name, -1)) { wanted.set(name, const_cast<ObjectData*>(this)-> o_getUnchecked(name, -1)); } else { Logger::Warning("\"%s\" returned as member variable from " "__sleep() but does not exist", name.data()); wanted.set(name, null); } } serializer->setObjectInfo(o_getClassName(), o_getId()); wanted.serialize(serializer); } else { Logger::Warning("serialize(): __sleep should return an array only " "containing the names of instance-variables to " "serialize"); null.serialize(serializer); } } else { serializer->setObjectInfo(o_getClassName(), o_getId()); o_toArray().serialize(serializer); } } serializer->decNestedLevel((void*)this); } void ObjectData::dump() const { o_toArray().dump(); } ObjectData *ObjectData::clone() { ObjectData *clone = cloneImpl(); return clone; } void ObjectData::cloneSet(ObjectData *clone) { if (o_properties) { clone->o_properties = NEW(Array)(*o_properties); } } Variant ObjectData::doCall(Variant v_name, Variant v_arguments, bool fatal) { return o_invoke_failed(o_getClassName(), v_name.toString().data(), fatal); } /////////////////////////////////////////////////////////////////////////////// // magic methods that user classes can override, and these are default handlers // or actions to take: Variant ObjectData::t___destruct() { // do nothing return null; } Variant ObjectData::t___call(Variant v_name, Variant v_arguments) { // do nothing return null; } void ObjectData::setInCall(CStrRef name) { if (++o_inCall > 10) { string msg = "Too many levels of recursion in __call() while calling "; msg += (const char *)name; throw FatalErrorException(msg.c_str()); } } Variant ObjectData::t___set(Variant v_name, Variant v_value) { if (!o_properties) { o_properties = NEW(Array)(); } if (v_value.isReferenced()) { o_properties->set(v_name, ref(v_value)); } else { o_properties->set(v_name, v_value); } return null; } Variant ObjectData::t___get(Variant v_name) { if (!o_properties) { // this is needed, since a get() is actually going to create a null // element in properties array o_properties = NEW(Array)(); } return o_properties->rvalAt(v_name); } Variant &ObjectData::___lval(Variant v_name) { if (!o_properties) { // this is needed, since a lval() is actually going to create a null // element in properties array o_properties = NEW(Array)(); } return o_properties->lvalAt(v_name); } Variant &ObjectData::___offsetget_lval(Variant v_name) { return ___lval(v_name); } bool ObjectData::t___isset(Variant v_name) { if (!o_exists(v_name.toString(), -1)) return false; Variant v = o_get(v_name.toString(), -1); return isset(v); } Variant ObjectData::t___unset(Variant v_name) { unset(o_lval(v_name.toString(), -1)); return null; } Variant ObjectData::t___sleep() { clearAttribute(HasSleep); return null; } Variant ObjectData::t___wakeup() { // do nothing return null; } Variant ObjectData::t___set_state(Variant v_properties) { // do nothing return null; } String ObjectData::t___tostring() { string msg = o_getClassName(); msg += "::__toString() was not defined"; throw BadTypeConversionException(msg.c_str()); } Variant ObjectData::t___clone() { // do nothing return null; } /////////////////////////////////////////////////////////////////////////////// }
jsdevel/StaticPages
lib/saxon.jar.src/com/icl/saxon/expr/FragmentValue.java
// Decompiled by Jad v1.5.8e. Copyright 2001 <NAME>. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: packimports(3) fieldsfirst lnc // Source File Name: FragmentValue.java package com.icl.saxon.expr; import com.icl.saxon.*; import com.icl.saxon.om.*; import com.icl.saxon.output.Emitter; import com.icl.saxon.output.Outputter; import com.icl.saxon.tree.AttributeCollection; import com.icl.saxon.tree.TreeBuilder; import java.io.PrintStream; import java.util.Enumeration; import java.util.Vector; import javax.xml.transform.TransformerException; import org.xml.sax.Attributes; // Referenced classes of package com.icl.saxon.expr: // SingletonNodeSet, XPathException, StringValue, Value, // Expression public final class FragmentValue extends SingletonNodeSet { private class FragmentEmitter extends Emitter { boolean previousCharacters; public void startDocument() { /* 293*/ previousCharacters = false; } public void endDocument() { /* 301*/ previousCharacters = false; } public void startElement(int i, Attributes attributes, int ai[], int j) { /* 315*/ events.addElement(FragmentValue.START_ELEMENT); /* 316*/ events.addElement(new Integer(i)); /* 322*/ int k = attributes.getLength(); AttributeCollection attributecollection; /* 323*/ if(k == 0) /* 324*/ attributecollection = FragmentValue.emptyAttributeCollection; /* 326*/ else /* 326*/ attributecollection = new AttributeCollection((AttributeCollection)attributes); /* 329*/ events.addElement(attributecollection); /* 332*/ int ai1[] = new int[j]; /* 333*/ System.arraycopy(ai, 0, ai1, 0, j); /* 334*/ events.addElement(ai1); /* 336*/ previousCharacters = false; } public void endElement(int i) { /* 346*/ events.addElement(FragmentValue.END_ELEMENT); /* 347*/ events.addElement(new Integer(i)); /* 348*/ previousCharacters = false; } public void characters(char ac[], int i, int j) { char ac1[]; /* 357*/ for(; used + j >= buffer.length; buffer = ac1) { /* 357*/ ac1 = new char[buffer.length * 2]; /* 358*/ System.arraycopy(buffer, 0, ac1, 0, used); } /* 361*/ System.arraycopy(ac, i, buffer, used, j); /* 362*/ if(previousCharacters) { /* 364*/ int ai[] = (int[])events.elementAt(events.size() - 1); /* 365*/ ai[1] += j; } else { /* 367*/ events.addElement(FragmentValue.CHARACTERS); /* 368*/ int ai1[] = { /* 368*/ used, j }; /* 369*/ events.addElement(ai1); } /* 371*/ used+= = j; /* 372*/ previousCharacters = true; } public void processingInstruction(String s, String s1) { /* 380*/ events.addElement(FragmentValue.PROCESSING_INSTRUCTION); /* 381*/ events.addElement(s); /* 382*/ events.addElement(s1); /* 383*/ previousCharacters = false; } public void comment(char ac[], int i, int j) { /* 391*/ events.addElement(FragmentValue.COMMENT); /* 392*/ events.addElement(new String(ac, i, j)); /* 393*/ previousCharacters = false; } public void setEscaping(boolean flag) throws TransformerException { /* 402*/ events.addElement(flag ? ((Object) (FragmentValue.ESCAPING_ON)) : ((Object) (FragmentValue.ESCAPING_OFF))); /* 403*/ previousCharacters = false; } private FragmentEmitter() { /* 286*/ previousCharacters = false; } } private char buffer[]; private int used; private Vector events; private String baseURI; private FragmentEmitter emitter; private Controller controller; private static AttributeCollection emptyAttributeCollection = new AttributeCollection((NamePool)null); private static Integer START_ELEMENT = new Integer(1); private static Integer END_ELEMENT = new Integer(2); private static Integer CHARACTERS = new Integer(5); private static Integer PROCESSING_INSTRUCTION = new Integer(6); private static Integer COMMENT = new Integer(7); private static Integer ESCAPING_ON = new Integer(8); private static Integer ESCAPING_OFF = new Integer(9); public FragmentValue(Controller controller1) { /* 25*/ buffer = new char[4096]; /* 26*/ used = 0; /* 27*/ events = new Vector(20); /* 28*/ baseURI = null; /* 29*/ emitter = new FragmentEmitter(); /* 43*/ controller = controller1; /* 44*/ super.generalUseAllowed = false; } public void setBaseURI(String s) { /* 53*/ baseURI = s; } public Emitter getEmitter() { /* 69*/ return emitter; } public String asString() { /* 77*/ return new String(buffer, 0, used); } public void outputStringValue(Outputter outputter, Context context) throws TransformerException { /* 88*/ outputter.writeContent(buffer, 0, used); } public double asNumber() { /* 96*/ return Value.stringToNumber(asString()); } public boolean asBoolean() { /* 104*/ return true; } public int getCount() { /* 112*/ return 1; } public Expression simplify() { /* 121*/ return this; } public NodeInfo getFirst() { /* 130*/ return getRootNode(); } public NodeEnumeration enumerate() throws XPathException { /* 138*/ if(!super.generalUseAllowed) /* 139*/ throw new XPathException("Cannot process a result tree fragment as a node-set under XSLT 1.0"); /* 141*/ else /* 141*/ return new SingletonEnumeration(getRootNode()); } public boolean equals(Value value) throws XPathException { /* 149*/ if(value instanceof StringValue) /* 150*/ return asString().equals(value.asString()); /* 152*/ else /* 152*/ return (new StringValue(asString())).equals(value); } public boolean notEquals(Value value) throws XPathException { /* 160*/ return (new StringValue(asString())).notEquals(value); } public boolean compare(int i, Value value) throws XPathException { /* 168*/ return (new StringValue(asString())).compare(i, value); } public int getType() { /* 177*/ return 4; } public int getDataType() { /* 186*/ return 4; } public DocumentInfo getRootNode() { /* 194*/ if(super.node != null) /* 195*/ return (DocumentInfo)super.node; /* 198*/ try { /* 198*/ TreeBuilder treebuilder = new TreeBuilder(); /* 199*/ treebuilder.setSystemId(baseURI); /* 200*/ treebuilder.setNamePool(controller.getNamePool()); /* 201*/ treebuilder.startDocument(); /* 202*/ replay(treebuilder); /* 203*/ treebuilder.endDocument(); /* 204*/ super.node = treebuilder.getCurrentDocument(); /* 205*/ controller.getDocumentPool().add((DocumentInfo)super.node, null); /* 206*/ return (DocumentInfo)super.node; } /* 208*/ catch(TransformerException transformerexception) { /* 208*/ throw new InternalSaxonError("Error building temporary tree: " + transformerexception.getMessage()); } } public void copy(Outputter outputter) throws TransformerException { /* 217*/ Emitter emitter1 = outputter.getEmitter(); /* 218*/ replay(emitter1); } public void replay(Emitter emitter1) throws TransformerException { /* 226*/ for(Enumeration enumeration = events.elements(); enumeration.hasMoreElements();) { /* 229*/ Object obj = enumeration.nextElement(); /* 233*/ if(obj == START_ELEMENT) { /* 234*/ Object obj1 = enumeration.nextElement(); /* 235*/ Object obj6 = enumeration.nextElement(); /* 236*/ Object obj8 = enumeration.nextElement(); /* 237*/ int ai[] = (int[])obj8; /* 238*/ emitter1.startElement(((Integer)obj1).intValue(), (AttributeCollection)obj6, ai, ai.length); } else /* 242*/ if(obj == END_ELEMENT) { /* 243*/ Object obj2 = enumeration.nextElement(); /* 244*/ emitter1.endElement(((Integer)obj2).intValue()); } else /* 246*/ if(obj == CHARACTERS) { /* 247*/ Object obj3 = enumeration.nextElement(); /* 248*/ emitter1.characters(buffer, ((int[])obj3)[0], ((int[])obj3)[1]); } else /* 250*/ if(obj == PROCESSING_INSTRUCTION) { /* 251*/ Object obj4 = enumeration.nextElement(); /* 252*/ Object obj7 = enumeration.nextElement(); /* 253*/ emitter1.processingInstruction((String)obj4, (String)obj7); } else /* 255*/ if(obj == COMMENT) { /* 256*/ Object obj5 = enumeration.nextElement(); /* 257*/ emitter1.comment(((String)obj5).toCharArray(), 0, ((String)obj5).length()); } else /* 259*/ if(obj == ESCAPING_ON) /* 260*/ emitter1.setEscaping(true); /* 262*/ else /* 262*/ if(obj == ESCAPING_OFF) /* 263*/ emitter1.setEscaping(false); /* 266*/ else /* 266*/ throw new InternalSaxonError("Corrupt data in temporary tree: " + obj); } } public void display(int i) { /* 277*/ System.err.println(Expression.indent(i) + "** result tree fragment **"); } }
inductiveload/wstools
wstools/scan_download.py
<filename>wstools/scan_download.py<gh_stars>0 #! /usr/bin/env python3 import argparse import logging from xlsx2csv import Xlsx2csv from io import StringIO import csv import os import subprocess import utils.ht_source def parse_header_row(hr): mapping = {} for i, col in enumerate(hr): mapping[col.lower()] = i return mapping def handle_row(r, args): print(r) if r['source'] == "ht": o_dir, _ = os.path.splitext(r['file']) utils.ht_source.dl_to_directory(r['id'], o_dir, skip_existing=args.skip_existing, make_dirs=True) else: raise ValueError("Unknown source: {}".format(r['source'])) def main(): parser = argparse.ArgumentParser(description='') parser.add_argument('-v', '--verbose', action='store_true', help='show debugging information') parser.add_argument('-f', '--data_file', required=True, help='The data file') parser.add_argument('-r', '--rows', type=int, nargs="+", help='Rows to process (1-indexed, same as in spreadsheet)') parser.add_argument('-s', '--skip_existing', action='store_true', help='Skip files we already have') args = parser.parse_args() log_level = logging.DEBUG if args.verbose else logging.INFO logging.basicConfig(level=log_level) logging.getLogger("requests").setLevel(logging.WARNING) logging.getLogger("oauthlib").setLevel(logging.WARNING) logging.getLogger("requests_oauthlib").setLevel(logging.WARNING) logging.getLogger("urllib3").setLevel(logging.WARNING) # requests_cache.install_cache('downloadscans') output = StringIO() Xlsx2csv(args.data_file, skip_trailing_columns=True, skip_empty_lines=True, outputencoding="utf-8").convert(output) output.seek(0) reader = csv.reader(output, delimiter=',', quotechar='"') head_row = next(reader) col_map = parse_header_row(head_row) row_idx = 1 for row in reader: row_idx += 1 if args.rows is not None and row_idx not in args.rows: logging.debug("Skip row {}".format(row_idx)) continue mapped_row = {} for col in col_map: mapped_row[col.lower()] = row[col_map[col]].strip() if "dl" in mapped_row and mapped_row["dl"].lower() in ["n", "no"]: logging.debug("Skipping row DL: {}".format(row_idx)) continue handle_row(mapped_row, args) if __name__ == "__main__": main()
CalvinVon/dalao-proxy
src/commands/plugin-manager.command/install.command/index.js
<gh_stars>10-100 const { install, uninstall } = require('./install-plugin'); module.exports = function pluginInstallCommand(pluginCommand) { pluginCommand .command('install <name> [names...]') .alias('add', 'update') .description('install plugins to extends ability') .option('-D, --local', 'install plugin locally') .option('-g, --global', 'install plugin globally') .option('--before <plugin>', 'make it execute before the existed plugin') .option('--after <plugin>', 'make it execute after the existed plugin') .action(function (name, names) { const { local, global, before, after } = this.context.options; install([name, ...names], { isLocally: global ? false : local, before, after, callback(errCode) { process.exit(errCode || 0); } }); }); pluginCommand .command('uninstall <name> [names...]') .alias('remove', 'rm') .description('uninstall plugins to extends ability') .option('-l, --local', 'uninstall plugin locally') .option('-g, --global', 'uninstall plugin globally') .action(function (name, names) { const { local, global } = this.context.options; uninstall([name, ...names], { isLocally: global ? false : local, callback(errCode) { process.exit(errCode || 0); } }); }); };
ResearchHub/ResearchHub-Backend-Open
src/search/views/post.py
<gh_stars>10-100 from django_elasticsearch_dsl_drf.filter_backends import ( CompoundSearchFilterBackend, DefaultOrderingFilterBackend, HighlightBackend, FilteringFilterBackend, NestedFilteringFilterBackend, IdsFilterBackend, OrderingFilterBackend, SuggesterFilterBackend, PostFilterFilteringFilterBackend, FacetedSearchFilterBackend, SearchFilterBackend, ) from elasticsearch_dsl import Search from django_elasticsearch_dsl_drf.viewsets import DocumentViewSet from django_elasticsearch_dsl_drf.pagination import LimitOffsetPagination from search.documents.post import PostDocument from search.serializers.post import PostDocumentSerializer from utils.permissions import ReadOnly from search.backends.multi_match_filter import MultiMatchSearchFilterBackend class PostDocumentView(DocumentViewSet): document = PostDocument permission_classes = [ReadOnly] serializer_class = PostDocumentSerializer pagination_class = LimitOffsetPagination lookup_field = 'id' score_field = 'score' filter_backends = [ MultiMatchSearchFilterBackend, CompoundSearchFilterBackend, FacetedSearchFilterBackend, FilteringFilterBackend, PostFilterFilteringFilterBackend, DefaultOrderingFilterBackend, OrderingFilterBackend, HighlightBackend, ] search_fields = { 'title': {'boost': 2}, 'renderable_text': {'boost': 1}, 'hubs_flat': {'boost': 1}, } multi_match_search_fields = { 'title': {'boost': 2}, 'renderable_text': {'boost': 1}, 'authors.full_name': {'boost': 1}, 'hubs_flat': {'boost': 1}, 'hubs_flat': {'boost': 1}, } multi_match_options = { 'operator': 'and', 'type': 'cross_fields', 'analyzer': 'content_analyzer', } post_filter_fields = { 'hubs': 'hubs.name', } faceted_search_fields = { 'hubs': 'hubs.name' } filter_fields = { 'publish_date': 'created_date' } ordering = ('_score', '-hot_score', '-discussion_count', '-created_date') ordering_fields = { 'publish_date': 'created_date', 'discussion_count': 'discussion_count', 'score': 'score', 'hot_score': 'hot_score', } highlight_fields = { 'title': { 'enabled': True, 'options': { 'pre_tags': ["<mark>"], 'post_tags': ["</mark>"], 'fragment_size': 2000, 'number_of_fragments': 1, }, }, 'renderable_text': { 'enabled': True, 'options': { 'pre_tags': ["<mark>"], 'post_tags': ["</mark>"], 'fragment_size': 5000, 'number_of_fragments': 1, }, } } def __init__(self, *args, **kwargs): self.search = Search(index=['post']) super(PostDocumentView, self).__init__(*args, **kwargs) def _filter_queryset(self, request): queryset = self.search for backend in list(self.filter_backends): queryset = backend().filter_queryset( request, queryset, self, ) return queryset
nguyentruongngoclan/MalmoAI
Minecraft/build/tmp/recompileMc/sources/net/minecraft/client/renderer/VertexBufferUploader.java
<gh_stars>0 package net.minecraft.client.renderer; import net.minecraft.client.renderer.vertex.VertexBuffer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class VertexBufferUploader extends WorldVertexBufferUploader { private VertexBuffer vertexBuffer = null; private static final String __OBFID = "CL_00002532"; public int draw(WorldRenderer p_178177_1_, int p_178177_2_) { p_178177_1_.reset(); this.vertexBuffer.bufferData(p_178177_1_.getByteBuffer(), p_178177_1_.getByteIndex()); return p_178177_2_; } public void setVertexBuffer(VertexBuffer p_178178_1_) { this.vertexBuffer = p_178178_1_; } }
santiagoep/wesan
src/components/Task/Task.js
import React, { useState } from 'react'; import { StyledCard, StyledDate, StyledPriority, } from './Task.styled'; import Tags from '../Tags/Tags'; import es from '../../config/languages/es'; import { dateFormat } from '../../utils/dates'; import TaskDetail from '../TaskDetail/TaskDetail'; const Task = ({ title, date, tags, priority, ...taskDetail }) => { const [show, setShow] = useState(false); const handleClose = () => setShow(false); const handleShow = () => setShow(true); const dateFormatter = (date) => dateFormat(date, "DD/MM/YYYY").toString(); return ( <> <StyledCard onClick={handleShow}> <Tags tags={tags} /> {title} <StyledPriority priority={priority} > {es[priority]} </StyledPriority> <StyledDate> {dateFormatter(date)} </StyledDate> </StyledCard> <TaskDetail show={show} title={title} priority={priority} onClose={handleClose} tags={tags} {...taskDetail} /> </> ); } Task.defaultProps = { tags: [] }; export default Task;
mariebidouille/Examples
Apps/Gate/TinyJSON/tiny-json.c
<reponame>mariebidouille/Examples /* <https://github.com/rafagafe/tiny-json> Licensed under the MIT License <http://opensource.org/licenses/MIT>. SPDX-License-Identifier: MIT Copyright (c) 2016-2018 <NAME> <<EMAIL>>. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <string.h> #include <ctype.h> #include "tiny-json.h" /** Structure to handle a heap of JSON properties. */ typedef struct jsonStaticPool_s { json_t *mem; /**< Pointer to array of json properties. */ unsigned int qty; /**< Length of the array of json properties. */ unsigned int nextFree; /**< The index of the next free json property. */ jsonPool_t pool; } jsonStaticPool_t; /* Search a property by its name in a JSON object. */ json_t const *json_getProperty(json_t const *obj, char const *property) { json_t const *sibling; for (sibling = obj->u.c.child; sibling; sibling = sibling->sibling) if (sibling->name && !strcmp(sibling->name, property)) return sibling; return 0; } /* Search a property by its name in a JSON object and return its value. */ char const *json_getPropertyValue(json_t const *obj, char const *property) { json_t const *field = json_getProperty(obj, property); if (!field) return 0; jsonType_t type = json_getType(field); if (JSON_ARRAY >= type) return 0; return json_getValue(field); } /* Internal prototypes: */ static char *goBlank(char *str); static char *goNum(char *str); static json_t *poolInit(jsonPool_t *pool); static json_t *poolAlloc(jsonPool_t *pool); static char *objValue(char *ptr, json_t *obj, jsonPool_t *pool); static char *setToNull(char *ch); static bool isEndOfPrimitive(char ch); /* Parse a string to get a json. */ json_t const *json_createWithPool(char *str, jsonPool_t *pool) { char *ptr = goBlank(str); if (!ptr || (*ptr != '{' && *ptr != '[')) return 0; json_t *obj = pool->init(pool); obj->name = 0; obj->sibling = 0; obj->u.c.child = 0; ptr = objValue(ptr, obj, pool); if (!ptr) return 0; return obj; } /* Parse a string to get a json. */ json_t const *json_create(char *str, json_t mem[], unsigned int qty) { jsonStaticPool_t spool; spool.mem = mem; spool.qty = qty; spool.pool.init = poolInit; spool.pool.alloc = poolAlloc; return json_createWithPool(str, &spool.pool); } /** Get a special character with its escape character. Examples: * 'b' -> '\\b', 'n' -> '\\n', 't' -> '\\t' * @param ch The escape character. * @retval The character code. */ static char getEscape(char ch) { static struct { char ch; char code; } const pair[] = { {'\"', '\"'}, {'\\', '\\'}, {'/', '/'}, {'b', '\b'}, {'f', '\f'}, {'n', '\n'}, {'r', '\r'}, {'t', '\t'}, }; unsigned int i; for (i = 0; i < sizeof pair / sizeof *pair; ++i) if (pair[i].ch == ch) return pair[i].code; return '\0'; } /** Parse 4 characters. * @param str Pointer to first digit. * @retval '?' If the four characters are hexadecimal digits. * @retval '\0' In other cases. */ static unsigned char getCharFromUnicode(unsigned char const *str) { unsigned int i; for (i = 0; i < 4; ++i) if (!isxdigit(str[i])) return '\0'; return '?'; } /** Parse a string and replace the scape characters by their meaning characters. * This parser stops when finds the character '\"'. Then replaces '\"' by '\0'. * @param str Pointer to first character. * @retval Pointer to first non white space after the string. If success. * @retval Null pointer if any error occur. */ static char *parseString(char *str) { unsigned char *head = (unsigned char *)str; unsigned char *tail = (unsigned char *)str; for (; *head; ++head, ++tail) { if (*head == '\"') { *tail = '\0'; return (char *)++head; } if (*head == '\\') { if (*++head == 'u') { char const ch = getCharFromUnicode(++head); if (ch == '\0') return 0; *tail = ch; head += 3; } else { char const esc = getEscape(*head); if (esc == '\0') return 0; *tail = esc; } } else *tail = *head; } return 0; } /** Parse a string to get the name of a property. * @param ptr Pointer to first character. * @param property The property to assign the name. * @retval Pointer to first of property value. If success. * @retval Null pointer if any error occur. */ static char *propertyName(char *ptr, json_t *property) { property->name = ++ptr; ptr = parseString(ptr); if (!ptr) return 0; ptr = goBlank(ptr); if (!ptr) return 0; if (*ptr++ != ':') return 0; return goBlank(ptr); } /** Parse a string to get the value of a property when its type is JSON_TEXT. * @param ptr Pointer to first character ('\"'). * @param property The property to assign the name. * @retval Pointer to first non white space after the string. If success. * @retval Null pointer if any error occur. */ static char *textValue(char *ptr, json_t *property) { ++property->u.value; ptr = parseString(++ptr); if (!ptr) return 0; property->type = JSON_TEXT; return ptr; } /** Compare two strings until get the null character in the second one. * @param ptr sub string * @param str main string * @retval Pointer to next character. * @retval Null pointer if any error occur. */ static char *checkStr(char *ptr, char const *str) { while (*str) if (*ptr++ != *str++) return 0; return ptr; } /** Parser a string to get a primitive value. * If the first character after the value is different of '}' or ']' is set to '\0'. * @param ptr Pointer to first character. * @param property Property handler to set the value and the type, (true, false or null). * @param value String with the primitive literal. * @param type The code of the type. ( JSON_BOOLEAN or JSON_NULL ) * @retval Pointer to first non white space after the string. If success. * @retval Null pointer if any error occur. */ static char *primitiveValue(char *ptr, json_t *property, char const *value, jsonType_t type) { ptr = checkStr(ptr, value); if (!ptr || !isEndOfPrimitive(*ptr)) return 0; ptr = setToNull(ptr); property->type = type; return ptr; } /** Parser a string to get a true value. * If the first character after the value is different of '}' or ']' is set to '\0'. * @param ptr Pointer to first character. * @param property Property handler to set the value and the type, (true, false or null). * @retval Pointer to first non white space after the string. If success. * @retval Null pointer if any error occur. */ static char *trueValue(char *ptr, json_t *property) { return primitiveValue(ptr, property, "true", JSON_BOOLEAN); } /** Parser a string to get a false value. * If the first character after the value is different of '}' or ']' is set to '\0'. * @param ptr Pointer to first character. * @param property Property handler to set the value and the type, (true, false or null). * @retval Pointer to first non white space after the string. If success. * @retval Null pointer if any error occur. */ static char *falseValue(char *ptr, json_t *property) { return primitiveValue(ptr, property, "false", JSON_BOOLEAN); } /** Parser a string to get a null value. * If the first character after the value is different of '}' or ']' is set to '\0'. * @param ptr Pointer to first character. * @param property Property handler to set the value and the type, (true, false or null). * @retval Pointer to first non white space after the string. If success. * @retval Null pointer if any error occur. */ static char *nullValue(char *ptr, json_t *property) { return primitiveValue(ptr, property, "null", JSON_NULL); } /** Analyze the exponential part of a real number. * @param ptr Pointer to first character. * @retval Pointer to first non numerical after the string. If success. * @retval Null pointer if any error occur. */ static char *expValue(char *ptr) { if (*ptr == '-' || *ptr == '+') ++ptr; if (!isdigit((int)(*ptr))) return 0; ptr = goNum(++ptr); return ptr; } /** Analyze the decimal part of a real number. * @param ptr Pointer to first character. * @retval Pointer to first non numerical after the string. If success. * @retval Null pointer if any error occur. */ static char *fraqValue(char *ptr) { if (!isdigit((int)(*ptr))) return 0; ptr = goNum(++ptr); if (!ptr) return 0; return ptr; } /** Parser a string to get a numerical value. * If the first character after the value is different of '}' or ']' is set to '\0'. * @param ptr Pointer to first character. * @param property Property handler to set the value and the type: JSON_REAL or JSON_INTEGER. * @retval Pointer to first non white space after the string. If success. * @retval Null pointer if any error occur. */ static char *numValue(char *ptr, json_t *property) { if (*ptr == '-') ++ptr; if (!isdigit((int)(*ptr))) return 0; if (*ptr != '0') { ptr = goNum(ptr); if (!ptr) return 0; } else if (isdigit((int)(*++ptr))) return 0; property->type = JSON_INTEGER; if (*ptr == '.') { ptr = fraqValue(++ptr); if (!ptr) return 0; property->type = JSON_REAL; } if (*ptr == 'e' || *ptr == 'E') { ptr = expValue(++ptr); if (!ptr) return 0; property->type = JSON_REAL; } if (!isEndOfPrimitive(*ptr)) return 0; if (JSON_INTEGER == property->type) { char const *value = property->u.value; bool const negative = *value == '-'; static char const min[] = "-9223372036854775808"; static char const max[] = "9223372036854775807"; unsigned int const maxdigits = (negative ? sizeof min : sizeof max) - 1; unsigned int const len = (unsigned int const)(ptr - value); if (len > maxdigits) return 0; if (len == maxdigits) { char const tmp = *ptr; *ptr = '\0'; char const *const threshold = negative ? min : max; if (0 > strcmp(threshold, value)) return 0; *ptr = tmp; } } ptr = setToNull(ptr); return ptr; } /** Add a property to a JSON object or array. * @param obj The handler of the JSON object or array. * @param property The handler of the property to be added. */ static void add(json_t *obj, json_t *property) { property->sibling = 0; if (!obj->u.c.child) { obj->u.c.child = property; obj->u.c.last_child = property; } else { obj->u.c.last_child->sibling = property; obj->u.c.last_child = property; } } /** Parser a string to get a json object value. * @param ptr Pointer to first character. * @param obj The handler of the JSON root object or array. * @param pool The handler of a json pool for creating json instances. * @retval Pointer to first character after the value. If success. * @retval Null pointer if any error occur. */ static char *objValue(char *ptr, json_t *obj, jsonPool_t *pool) { obj->type = *ptr == '{' ? JSON_OBJ : JSON_ARRAY; obj->u.c.child = 0; obj->sibling = 0; ptr++; for (;;) { ptr = goBlank(ptr); if (!ptr) return 0; if (*ptr == ',') { ++ptr; continue; } char const endchar = (obj->type == JSON_OBJ) ? '}' : ']'; if (*ptr == endchar) { *ptr = '\0'; json_t *parentObj = obj->sibling; if (!parentObj) return ++ptr; obj->sibling = 0; obj = parentObj; ++ptr; continue; } json_t *property = pool->alloc(pool); if (!property) return 0; if (obj->type != JSON_ARRAY) { if (*ptr != '\"') return 0; ptr = propertyName(ptr, property); if (!ptr) return 0; } else property->name = 0; add(obj, property); property->u.value = ptr; switch (*ptr) { case '{': property->type = JSON_OBJ; property->u.c.child = 0; property->sibling = obj; obj = property; ++ptr; break; case '[': property->type = JSON_ARRAY; property->u.c.child = 0; property->sibling = obj; obj = property; ++ptr; break; case '\"': ptr = textValue(ptr, property); break; case 't': ptr = trueValue(ptr, property); break; case 'f': ptr = falseValue(ptr, property); break; case 'n': ptr = nullValue(ptr, property); break; default: ptr = numValue(ptr, property); break; } if (!ptr) return 0; } } /** Initialize a json pool. * @param pool The handler of the pool. * @return a instance of a json. */ static json_t *poolInit(jsonPool_t *pool) { jsonStaticPool_t *spool = json_serviceOf(pool, jsonStaticPool_t, pool); spool->nextFree = 1; return spool->mem; } /** Create an instance of a json from a pool. * @param pool The handler of the pool. * @retval The handler of the new instance if success. * @retval Null pointer if the pool was empty. */ static json_t *poolAlloc(jsonPool_t *pool) { jsonStaticPool_t *spool = json_serviceOf(pool, jsonStaticPool_t, pool); if (spool->nextFree >= spool->qty) return 0; return spool->mem + spool->nextFree++; } /** Checks whether an character belongs to set. * @param ch Character value to be checked. * @param set Set of characters. It is just a null-terminated string. * @return true or false there is membership or not. */ static bool isOneOfThem(char ch, char const *set) { while (*set != '\0') if (ch == *set++) return true; return false; } /** Increases a pointer while it points to a character that belongs to a set. * @param str The initial pointer value. * @param set Set of characters. It is just a null-terminated string. * @return The final pointer value or null pointer if the null character was found. */ static char *goWhile(char *str, char const *set) { for (; *str != '\0'; ++str) { if (!isOneOfThem(*str, set)) return str; } return 0; } /** Set of characters that defines a blank. */ static char const *const blank = " \n\r\t\f"; /** Increases a pointer while it points to a white space character. * @param str The initial pointer value. * @return The final pointer value or null pointer if the null character was found. */ static char *goBlank(char *str) { return goWhile(str, blank); } /** Increases a pointer while it points to a decimal digit character. * @param str The initial pointer value. * @return The final pointer value or null pointer if the null character was found. */ static char *goNum(char *str) { for (; *str != '\0'; ++str) { if (!isdigit((int)(*str))) return str; } return 0; } /** Set of characters that defines the end of an array or a JSON object. */ static char const *const endofblock = "}]"; /** Set a char to '\0' and increase its pointer if the char is different to '}' or ']'. * @param ch Pointer to character. * @return Final value pointer. */ static char *setToNull(char *ch) { if (!isOneOfThem(*ch, endofblock)) *ch++ = '\0'; return ch; } /** Indicate if a character is the end of a primitive value. */ static bool isEndOfPrimitive(char ch) { return ch == ',' || isOneOfThem(ch, blank) || isOneOfThem(ch, endofblock); }
orekyuu/doma
doma-processor/src/test/java/org/seasar/doma/internal/apt/processor/domain/OfAbstractDomain.java
<reponame>orekyuu/doma package org.seasar.doma.internal.apt.processor.domain; import org.seasar.doma.Domain; @Domain(valueType = int.class, factoryMethod = "of") public abstract class OfAbstractDomain { private final int value; private OfAbstractDomain(int value) { this.value = value; } public int getValue() { return value; } public static OfAbstractDomain of(int value) { return new MyDomain(value); } static class MyDomain extends OfAbstractDomain { public MyDomain(int value) { super(value); } } }
best08618/asylo
gcc-gcc-7_3_0-release/gcc/testsuite/g++.dg/eh/weak1-a.cc
<gh_stars>1-10 extern void f() { throw 7; }
mayankkejriwal/nxparser
src/main/java/org/semanticweb/yars/nx/namespace/DC.java
<reponame>mayankkejriwal/nxparser<gh_stars>10-100 package org.semanticweb.yars.nx.namespace; import org.semanticweb.yars.nx.Resource; public class DC { public static final String NS = "http://purl.org/dc/elements/1.1/"; public final static Resource TITLE = new Resource(NS+"title"); public final static Resource DESCRIPTION = new Resource(NS+"description"); public final static Resource SUBJECT = new Resource(NS+"subject"); public final static Resource FORMAT = new Resource(NS+"format"); public final static Resource DATE = new Resource(NS+"date"); public final static Resource CREATOR = new Resource(NS+"creator"); }
KeyMaker13/portfolio
documents/javaFiles/dataStructures/week03/ArrayIterator.java
package sets.arrayset; import java.util.*; /** * <p>Title: </p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2005</p> * * <p>Company: </p> * * @author Prof. <NAME> * @version 1.0 */ public class ArrayIterator <T> implements Iterator<T> { private int current; // position of next private int arrayCount; private T [] array; public ArrayIterator(T [] contents, int count) { current = 0; array = contents; arrayCount = count; } public boolean hasNext() { return current < arrayCount; } public T next() { if (current < arrayCount) { T obj = array[current]; current++; return obj; } throw new NoSuchElementException( "At end "); } public void remove () { throw new UnsupportedOperationException( "remove not implemented for ArrayIterator"); } }
kagwicharles/Seniorproject-ui
node_modules/@iconify/icons-ic/twotone-theaters.js
var data = { "body": "<path d=\"M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3h-2zM8 17H6v-2h2v2zm0-4H6v-2h2v2zm0-4H6V7h2v2zm6 10h-4V5h4v14zm4-2h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V7h2v2z\" fill=\"currentColor\"/><path opacity=\".3\" d=\"M10 5h4v14h-4z\" fill=\"currentColor\"/>", "width": 24, "height": 24 }; exports.__esModule = true; exports.default = data;