text
stringlengths
1
1.05M
package rkentry import ( "context" "github.com/stretchr/testify/assert" "net/http" "net/http/httptest" "net/url" "os" "path" "testing" ) func TestNewStaticFileHandlerEntry(t *testing.T) { // without options entry := RegisterStaticFileHandlerEntry() assert.NotNil(t, entry) assert.NotNil(t, entry.ZapLoggerEntry) assert.NotNil(t, entry.EventLoggerEntry) assert.Equal(t, "/rk/v1/static/", entry.Path) assert.NotNil(t, entry.Fs) assert.NotNil(t, entry.Template) // with options utFs := http.Dir("") utPath := "/ut-path/" utZapLogger := NoopZapLoggerEntry() utEventLogger := NoopEventLoggerEntry() utName := "ut-entry" entry = RegisterStaticFileHandlerEntry( WithPathStatic(utPath), WithEventLoggerEntryStatic(utEventLogger), WithZapLoggerEntryStatic(utZapLogger), WithNameStatic(utName), WithFileSystemStatic(utFs)) assert.NotNil(t, entry) assert.Equal(t, utZapLogger, entry.ZapLoggerEntry) assert.Equal(t, utEventLogger, entry.EventLoggerEntry) assert.Equal(t, utPath, entry.Path) assert.Equal(t, utFs, entry.Fs) assert.NotNil(t, entry.Template) assert.Equal(t, utName, entry.EntryName) } func TestStaticFileHandlerEntry_Bootstrap(t *testing.T) { defer assertNotPanic(t) // without eventId in context entry := RegisterStaticFileHandlerEntry() entry.Bootstrap(context.TODO()) // with eventId in context entry.Bootstrap(context.TODO()) } func TestStaticFileHandlerEntry_Interrupt(t *testing.T) { defer assertNotPanic(t) // without eventId in context entry := RegisterStaticFileHandlerEntry() entry.Interrupt(context.TODO()) // with eventId in context entry.Interrupt(context.TODO()) } func TestStaticFileHandlerEntry_EntryFunctions(t *testing.T) { entry := RegisterStaticFileHandlerEntry() assert.NotEmpty(t, entry.GetName()) assert.NotEmpty(t, entry.GetType()) assert.NotEmpty(t, entry.GetDescription()) assert.NotEmpty(t, entry.String()) assert.Nil(t, entry.UnmarshalJSON([]byte{})) } func TestStaticFileHandlerEntry_GetFileHandler(t *testing.T) { currDir := t.TempDir() os.MkdirAll(path.Join(currDir, "ut-dir"), os.ModePerm) os.WriteFile(path.Join(currDir, "ut-file"), []byte("ut content"), os.ModePerm) entry := RegisterStaticFileHandlerEntry( WithFileSystemStatic(http.Dir(currDir))) entry.Bootstrap(context.TODO()) handler := entry.GetFileHandler() // expect to get list of files writer := httptest.NewRecorder() req := &http.Request{ URL: &url.URL{ Path: "/rk/v1/static/", }, } handler(writer, req) assert.Equal(t, http.StatusOK, writer.Code) assert.Contains(t, writer.Body.String(), "Index of") // expect to get files to download writer = httptest.NewRecorder() req = &http.Request{ URL: &url.URL{ Path: "/rk/v1/static/ut-file", }, } handler(writer, req) assert.Equal(t, http.StatusOK, writer.Code) assert.NotEmpty(t, writer.Header().Get("Content-Disposition")) assert.NotEmpty(t, writer.Header().Get("Content-Type")) assert.Contains(t, writer.Body.String(), "ut content") } func TestRegisterStaticFileHandlerEntryWithConfig(t *testing.T) { // with disabled config := &BootConfigStaticHandler{ Enabled: false, } assert.Nil(t, RegisterStaticFileHandlerEntryWithConfig(config, "", nil, nil)) // enabled config.Enabled = true config.SourceType = "local" config.SourcePath = t.TempDir() assert.NotNil(t, RegisterStaticFileHandlerEntryWithConfig(config, "", nil, nil)) }
#!/usr/bin/env bash LOG_DIR=log/ hdd=512 drop=0.2 layer=2 EXPERIMENT_NAME=Tree_Ensemble_v5_hdd_${hdd}_ly_${layer}_drop_${drop}_check RESUME_PATH=./model/${EXPERIMENT_NAME}_best.pt #RESUME_PATH=./model/Tree_Ensemble_v5_best.pt python3 distributed_train.py -lr=0.001 \ -layer=$layer \ -hdd=$hdd \ -dr=$drop \ -dec=Tree2Seq \ -bsz=64 \ -ds=kvr \ -task=kvr \ -t= \ --mode=test \ --experiment=$EXPERIMENT_NAME \ --gpu_ranks 0 1 2 3 \ --worker 2 \ --resume=$RESUME_PATH \ --max-epoch 50 \ --distributed \ --print_freq 5 \ --world_size 4 |& tee $LOG_DIR/${EXPERIMENT_NAME}_test.txt # --no-kb-embed \ # -add-norm \ # --debug \
#!/bin/bash sudo rsync --progress -avi -e"ssh -i /home/moodle_backup/.ssh/id_rsa" --exclude="tool_heartbeat.test" --exclude="sessions/*" --exclude="cachestore_file/*" moodle_backup@content.midmich.edu:/path/to/moodledata/ /var/moodledata/
#! /usr/bin/env nix-shell #! nix-shell -i "bats -t" -p bats -p coreutils setup () { nix-env -e holochain hc } teardown () { nix-env -e holochain hc } @test "holochain trycp_server install" { echo '# trycp_server should not be instaled at first' >&3 ! [ -x "$( command -v trycp_server )" ] echo '# install trycp_server' >&3 nix-env -f . -iA holochain.trycp_server echo '# trycp_server should be installed now' >&3 [ -x "$( command -v trycp_server )" ] version="$( trycp_server -V )" echo "# smoke test trycp_server version result: $version" >&3 [[ "$version" == "trycp_server 0.0."* ]] echo '# uninstall trycp_server' >&3 nix-env -e trycp_server echo '# trycp_server should not be installed now' >&3 ! [ -x "$( command -v trycp_server )" ] } @test "holochain sim2h_server install" { echo '# sim2h_server should not be instaled at first' >&3 ! [ -x "$( command -v sim2h_server )" ] echo '# install sim2h_server' >&3 nix-env -f . -iA holochain.sim2h_server echo '# sim2h_server should be installed now' >&3 [ -x "$( command -v sim2h_server )" ] version="$( sim2h_server -V 2>/dev/null )" echo "# smoke test sim2h_server version result: $version" >&3 [[ "$version" == "sim2h-server 0.0."* ]] echo '# uninstall sim2h_server' >&3 nix-env -e sim2h_server echo '# sim2h_server should not be installed now' >&3 ! [ -x "$( command -v sim2h_server )" ] } @test "holochain conductor install" { echo '# holochain should not be installed at first' >&3 ! [ -x "$( command -v holochain )" ] ! [ -x "$( command -v hc )" ] echo '# install holochain without hc' >&3 nix-env -f . -iA holochain.holochain echo '# holochain should be installed now' >&3 [ -x "$( command -v holochain )" ] ! [ -x "$( command -v hc )" ] version="$( holochain -V )" echo "# smoke test holochain version result: $version" >&3 [[ "$version" == "holochain 0.0."* ]] echo '# uninstall holochain' >&3 nix-env -e holochain echo '# holochain should not be installed now' >&3 ! [ -x "$( command -v holochain )" ] ! [ -x "$( command -v hc )" ] } @test "hc cli install" { # https://github.com/holochain/holonix/issues/12 export TMP=$( mktemp -p /tmp -d ) export TMPDIR=$TMP # this setting of $USER should not be needed once new docker is built export USER=$(id -u -n) export deps=('holochain' 'npm' 'cargo') export app_name=my_first_app export zome_name=my_zome echo '# hc should not be installed at first' >&3 ! [ -x "$(command -v hc)" ] echo '# hc deps should not be globally visible' >&3 for i in ${!deps[@]} do echo "# check ${deps[$i]} not exists" >&3 ! [ -x "$(command -v ${deps[$i]})" ] done echo '# install hc without explicitly installing holochain' >&3 nix-env -f . -iA holochain.hc echo '# hc should be installed now' >&3 [ -x "$(command -v hc)" ] version="$( hc -V )" echo "# smoke test holochain version result: $version" >&3 [[ "$version" == "hc 0.0."* ]] echo '# hc deps should not be globally visible' >&3 for i in ${!deps[@]} do echo "# check ${deps[$i]} not exists" >&3 ! [ -x "$(command -v ${deps[$i]})" ] done echo '# steps adapted from quickstart 2019-09-11' >&3 echo '# hc init "$TMP/$app_name"' >&3 hc init "$TMP/$app_name" echo '# cd "$TMP/$app_name"' >&3 cd "$TMP/$app_name" echo '# hc generate "zomes/$zome_name"' >&3 hc generate "zomes/$zome_name" echo '# hc test' >&3 hc test echo '# teardown' >&3 nix-env -e hc echo '# hc should not be installed now' >&3 ! [ -x "$(command -v hc)" ] echo '# hc deps should not be globally visible' >&3 for i in ${!deps[@]} do echo "# check ${deps[$i]} not exists" >&3 ! [ -x "$(command -v ${deps[$i]})" ] done }
from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.svm import LinearSVC # Vectorize vectorizer = TfidfVectorizer() X = vectorizer.fit_transform(texts) # Train and evaluate model clf = LinearSVC() clf.fit(X, labels) scores = clf.score(X, labels)
<reponame>tanshuai/reference-wallet<filename>backend/tests/wallet_tests/resources/seeds/one_funds_pull_pre_approval.py import uuid from datetime import datetime from offchain import FundPullPreApprovalStatus from diem_utils.types.currencies import DiemCurrency from wallet.services.offchain.fund_pull_pre_approval import Role from wallet.storage.models import FundsPullPreApprovalCommand ADDRESS = "tdm1pwm5m35ayknjr0s67pk9xdf5mwp3nwq6ef67s55gpjwrqf" ADDRESS_2 = "tdm1pztdjx2z8wp0q25jakqeklk0nxj2wmk2kg9whu8c3fdm9u" BILLER_ADDRESS = "tdm1pzmhcxpnyns7m035ctdqmexxad8ptgazxhllvyscesqdgp" TIMESTAMP = 1802010490 EXPIRED_TIMESTAMP = 1581085690 class OneFundsPullPreApproval: @staticmethod def run( db_session, biller_address=BILLER_ADDRESS, address=ADDRESS, funds_pull_pre_approval_id=str(uuid.uuid4()), status=FundPullPreApprovalStatus.valid, max_cumulative_unit="week", max_cumulative_unit_value=1, account_id=1, role=Role.PAYER, offchain_sent=False, ) -> FundsPullPreApprovalCommand: command = FundsPullPreApprovalCommand( account_id=account_id, address=address, biller_address=biller_address, funds_pull_pre_approval_id=funds_pull_pre_approval_id, funds_pull_pre_approval_type="consent", expiration_timestamp=datetime(2027, 3, 3, 10, 10, 10), max_cumulative_unit=max_cumulative_unit, max_cumulative_unit_value=max_cumulative_unit_value, max_cumulative_amount=10_000_000_000, max_cumulative_amount_currency=DiemCurrency.XUS, max_transaction_amount=10_000_000, max_transaction_amount_currency=DiemCurrency.XUS, description="OneFundsPullPreApprovalRun", status=status, role=role, offchain_sent=offchain_sent, ) db_session.add(command) db_session.commit() return command
package Chapter1_4High; import edu.princeton.cs.algs4.Stack; public class QueueWithTwoStacks<T> { private Stack<T> stack1; private Stack<T> stack2; public QueueWithTwoStacks() { stack1 = new Stack<T>(); stack2 = new Stack<T>(); } public void enqueue(T item) { stack1.push(item); } public T dequeue() { if (stack1.size() < 1 && stack2.size() < 1) { System.out.println("Queue is empty"); return null; } //把stack1清空 while (stack1.size() > 1) { //这里不是大于0,所以stack1最终还有一个元素没有放到stack2中,还在stack1里 T element = stack1.pop(); stack2.push(element); } T ele = stack1.pop(); //这里才把原来stack1中最后一个剩余的元素Pop()出来,存在最后要返回的变量ele里 //把stack2清空 while (stack2.size() > 0) { //stack2只含有原来stack1中从第二个元素开始到最后一个元素,所以再push回stack1时,第一个元素已经没了,相当于队列中的dequeue T element = stack2.pop(); stack1.push(element); } return ele; } public static void main(String[] args) { QueueWithTwoStacks gfg = new QueueWithTwoStacks(); gfg.enqueue("我的"); gfg.enqueue("名字"); gfg.enqueue("叫"); gfg.enqueue("yyc"); gfg.enqueue("hacker"); System.out.println(gfg.dequeue()); System.out.println(gfg.dequeue()); System.out.println(gfg.dequeue()); System.out.println(gfg.dequeue()); System.out.println(gfg.dequeue()); System.out.println(gfg.dequeue()); } }
from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder # training data train_data = [[1, 'Honda', 'Accord', 'Silver'], [2, 'Toyota', 'Camry', 'Silver'], [3, 'Nissan', 'Altima', 'Black'], [4, 'Hyundai', 'Sonata', 'White']] # separate the features and labels X, Y = [], [] for features in train_data: X.append(features[1:3]) Y.append(features[3]) # encode the labels label_encoder = LabelEncoder() Y = label_encoder.fit_transform(Y) # create and train the classifier model = LogisticRegression() X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.33, random_state=42) model.fit(X_train, y_train) # predict on new data x_pred = [['Volkswagen', 'Jetta']] prediction = label_encoder.inverse_transform(model.predict(x_pred)) print("Predicted color of the car is:", prediction[0]) # Silver
#!/bin/bash # start client python3.9 client/index.py --path ./log/client.log --pkLoc ./keys/pairC/private_key.pem --pbftHost 172.24.100.163 --pbftPort 10004
<reponame>trevorhein-matc/theTwistedLeafSite<filename>src/pages/sources.js import React from "react"; import SourceCard from "../components/SourceCard/SourceCard"; import { graphql } from 'gatsby'; import NavBar from '../components/NavBar' import GridLayout from '../components/GridLayout'; import Grid from '@material-ui/core/Grid'; const SourcePage = ({ data }) => ( <NavBar> {/* <SourceCardBox> {data.allContentfulSourceCard.edges.map((edge, index) => ( <SourceCard key={edge.node.id}> <SourceCard.CardImage src={edge.node.sourceImage.fluid.src} /> <a href={edge.node.sourceLink}> <SourceCard.CardButton> {edge.node.title} </SourceCard.CardButton> </a> {edge.node.tags && edge.node.tags.map((tag, i) => ( <SourceCard.CardButton key={i}> {tag} </SourceCard.CardButton> ))} </SourceCard> ))} </SourceCardBox> */} <GridLayout> {data.allContentfulSourceCard.edges.map((edge) => ( <Grid item xs={12} sm={6} md={6} key={edge.node.id}> <SourceCard data={edge.node}> </SourceCard> </Grid> ))} </GridLayout> </NavBar> ); export default SourcePage export const query = graphql` query sourcePageQuery { allContentfulSourceCard( sort: {fields: [title], order: ASC } ) { edges { node { id title tags sourceLink publishDate (formatString: "dddd DD MMMM YYYY") sourceImage { fluid { src } } description { childMarkdownRemark { excerpt } } } } } } `;
<filename>frontend/src/components/event-overview-dialog/index.js import React, { Component, PropTypes } from 'react' import { connect } from 'react-redux' import { Link } from 'react-router' import { hideEventOverview } from 'actions/event-overview' import Dialog from 'material-ui/Dialog' import EventOverview from 'components/event-overview' class OverviewDialog extends Component { static get propTypes () { return { onHideOverview: PropTypes.func, event: PropTypes.shape({ id: PropTypes.number, group_id: PropTypes.string, topic: PropTypes.string, entity_id: PropTypes.string, event_type: PropTypes.string, event_time: PropTypes.string, event_version: PropTypes.string, checksum: PropTypes.string, payload: PropTypes.object, overviewVisible: PropTypes.bool }) } } static get defaultProps () { return { event: {} } } render () { return ( <Dialog modal={false} autoScrollBodyContent className='event-overview-dialog' title={this.dialogTitle()} open={!!this.props.event.overviewVisible} onRequestClose={() => this.hideOverview()} contentStyle={{maxWidth: '1024px'}} bodyStyle={{maxWidth: '1024px'}} actions={[]}> <EventOverview {...this.props.event} /> </Dialog> ) } hideOverview () { this.props.onHideOverview(this.props.event) } dialogTitle () { return ( <h3> <Link className='dialog-title' to={`/events/${this.props.event.id}`}> {`#${this.props.event.id}`} </Link> </h3> ) } } export default connect( (state, ownProps) => ownProps, { onHideOverview: hideEventOverview } )(OverviewDialog)
<filename>packages/src/rocket-punch/rule/readDirectoryPatterns.ts export const readDirectoryPatterns: [string[], string[], string[]] = [ // extensions ['.ts', '.tsx', '.js', '.jsx'], // excludes [ // exclude tests '**/*.(spec|test).(js|jsx|ts|tsx)', '**/__*', // exclude public '**/public', '**/bin', ], // includes ['**/*'], ];
<gh_stars>0 module Elibri module ONIX module Release_3_0 #Klasa reprezentująca produkt #Niektóre pola mogą pozostać bez wartości - zależy to od formy produktu class Product include Inspector #:nodoc: ATTRIBUTES = [ :height, :width, :thickness, :weight, :ean, :isbn13, :number_of_pages, :duration, :file_size, :publisher_name, :publisher_id, :imprint_name, :current_state, :reading_age_from, :reading_age_to, :table_of_contents, :description, :reviews, :excerpts, :series, :title, :subtitle, :collection_title, :collection_part, :full_title, :original_title, :trade_title, :parsed_publishing_date, :record_reference, :deletion_text, :cover_type, :cover_price, :vat, :pkwiu, :additional_info, :product_composition, :publisher, :product_form, :no_contributor, :edition_statement, :edition_type_onix_code, :number_of_illustrations, :publishing_status, :publishing_date, :premiere, :front_cover, :series_names, :city_of_publication, :preview_exists, :short_description, :sale_restricted_to_poland, :technical_protection_onix_code, :unlimited_licence, :hyphenated_isbn, :preorder_embargo_date, :additional_trade_information, :number_of_pieces, :players_number_from, :players_number_to, :playing_time_from, :playing_time_to ] #:nodoc: RELATIONS = [ :contributors, #IMPORTANT :related_products, :languages, :measures, :supply_details, :measures, :title_details, :collections, :extents, :thema_subjects, :publisher_subjects, :audience_ranges, :text_contents, #IMPORTANT :supporting_resources, #for example: cover :sales_restrictions, :authors, :ghostwriters, :scenarists, :originators, :illustrators, :photographers, :author_of_prefaces, :drawers, :cover_designers, :inked_or_colored_bys, :editors, :revisors, :translators, :editor_in_chiefs, :read_bys ] def inspect_include_fields [:record_reference, :full_title, :front_cover, :publisher, :isbn13, :ean, :premiere, :contributors, :languages, :description, :product_form_name, :technical_protection, :digital_formats] end #:doc: #wysokość w milimetrach attr_reader :height #szerokość w milimetrach attr_reader :width #gruboś w milimetrach attr_reader :thickness #waga w gramach attr_reader :weight #ean, jeśli jest inny, niż isbn13 attr_reader :ean #isbn13 - bez kresek attr_reader :isbn13 #ilość stron w książce drukowanej attr_reader :number_of_pages #czas trwania nagrania w audiobooku, w minutach attr_reader :duration #nazwa wydawnictwa attr_reader :publisher_name #ID wydawnictwa w systemie elibri attr_reader :publisher_id #Imprint, jeśli wydawnictwo używa imprintów. Jeżeli wydawnictwo podało imprint, to ta wartość powinna zostać wyświetlona #użytkownikowi w sklepie jako nazwa wydawnictwa. attr_reader :imprint_name #Status produktu - jedna z wartości: announced, :preorder, :published, :out_of_print, :deleted attr_reader :current_state #Wiek czytelnika - od attr_reader :reading_age_from #Wiek czytelnika - do attr_reader :reading_age_to #Spis treści - jeśli wydawca takowy umieścił, instancja TextContent attr_reader :table_of_contents #Opis produktu, instancja TextContent attr_reader :description #lista serii, w postaci [nazwa serii, numer w serii] attr_reader :series #tytuł ksiażki attr_reader :title #podtytuł attr_reader :subtitle #nazwa cyklu (częste przy komiksach, gdy seria jest częścią tytułu, np. Thorgal) attr_reader :collection_title #numer w cyklu attr_reader :collection_part #pełen tytuł attr_reader :full_title #tytuł oryginału attr_reader :original_title #krótki opis, jeśli wydawca takowy zamieści, instancja TextContent attr_reader :short_description #data końca licencji, jeśli licencja nie jest bezterminowa, w formacie YYYYMMDD attr_reader :licence_limited_to_before_type_cast #data końca licencji, jeśli licencja nie jest bezterminowa, instancja Date attr_reader :licence_limited_to #lista formatów, w jakich jest dostępny ebook (PDF, MOBI, EPUB) attr_reader :digital_formats #sposób zabezpieczania pliki (DRM, WATERMARK) - pliki dostępne w API transakcyjnym zawsze będą chronione watermarkiem attr_reader :technical_protection attr_reader :technical_protection_onix_code #record reference - wewnętrzny identyfikator rekordu, niezmienny i unikatowy attr_reader :record_reference #typ okładki, np. 'miękka ze skrzydełkami' attr_reader :cover_type #sugerowana cena detaliczna brutto produktu attr_reader :cover_price #stawka VAT attr_reader :vat #PKWiU attr_reader :pkwiu #PDWExclusiveness attr_reader :pdw_exclusiveness #AdditionalInfo attr_reader :additional_info #kod ONIX typu produktu, np. 'BA' - lista dostępna pod adresem #https://github.com/elibri/elibri_onix_dict/blob/master/lib/elibri_onix_dict/onix_3_0/serialized/ProductFormCode.yml attr_reader :product_form #nazwa typu produktu, małe litery, np. 'book' - patrz pełna lista pod adresem #https://github.com/elibri/elibri_onix_dict/blob/master/lib/elibri_onix_dict/onix_3_0/serialized/ProductFormCode.yml attr_reader :product_form_name #lista autorów, tłumaczy i innych, którzy mieli wkład w książkę, lista instancji Contributor attr_reader :contributors #lista języków, lista intancji Language attr_reader :languages #informacja o numerze wydania attr_reader :edition_statement #informacja o type wydanie, kod onix attr_reader :edition_type_onix_code #liczba ilustracji attr_reader :number_of_illustrations #reprezentacja xml dla produktu attr_reader :to_xml #miasto, w którym została wydana ksiażka attr_reader :city_of_publication #informacje o fragmentach utworów (produkty cyfrowe) attr_reader :excerpt_infos #informacje o plikach master (produkty cyfrowe) attr_reader :file_infos #isbn z kreskami attr_reader :hyphenated_isbn #dodatkowa informacja handlowa attr_reader :additional_trade_information #ilość elementów (puzzle, gry planszowe) attr_reader :number_of_pieces #min. ilość graczy - gry planszowe attr_reader :players_number_from #max. ilość graczy - gry planszowe attr_reader :players_number_to #min. czas gry - gry planszowe attr_reader :playing_time_from #max. czas gry - gry planszowe attr_reader :playing_time_to #cn code attr_reader :cn_code #kraj produkcji attr_reader :country_of_manufacture #:nodoc: attr_reader :text_contents attr_reader :file_size attr_reader :reviews attr_reader :excerpts attr_reader :trade_title attr_reader :notification_type attr_reader :deletion_text attr_reader :product_composition attr_reader :measures attr_reader :imprint attr_reader :publisher attr_reader :publishing_status attr_reader :title_details attr_reader :collections attr_reader :extents attr_reader :thema_subjects attr_reader :publisher_subjects attr_reader :audience_ranges attr_reader :supply_details attr_reader :identifiers attr_reader :supporting_resources attr_reader :sales_restrictions attr_reader :publishing_date attr_reader :related_products attr_reader :preorder_embargo_date #:nodoc: attr_accessor :sale_restricted_to_poland, :unlimited_licence, :no_contributor, :preview_exists #:doc: def initialize(data) @to_xml = data.to_s #initialize variables that need to be array ##descriptive_details @text_contents = [] @supporting_resources = [] ##collateral_details @measures = [] @title_details = [] @collections = [] @contributors = [] @languages = [] @extents = [] @thema_subjects = [] @publisher_subjects = [] @audience_ranges = [] ##publishing_details @sales_restrictions = [] @excerpt_infos = [] @cover_type = nil #moving to parsing attributes @record_reference = data.at_css('RecordReference').try(:text) @notification_type = data.at_css('NotificationType').try(:text) @deletion_text = data.at_css('DeletionText').try(:text) if data.namespaces.values.any? { |uri| uri =~ /elibri/ } @cover_type = data.at_xpath('elibri:CoverType').try(:text) @pkwiu = data.at_xpath('elibri:PKWiU').try(:text) @hyphenated_isbn = data.at_xpath('elibri:HyphenatedISBN').try(:text) @pdw_exclusiveness = data.at_xpath('elibri:PDWExclusiveness').try(:text) @additional_info = data.at_xpath('elibri:AdditionalInfo').try(:text) end @identifiers = data.children.find_all { |node| node.name == 'ProductIdentifier' }.map { |ident_data| ProductIdentifier.new(ident_data) } begin @related_products = data.at_css('RelatedMaterial').css('RelatedProduct').map { |related_data| RelatedProduct.new(related_data) } rescue @related_products = [] end begin @supply_details = data.at_css('ProductSupply').css('SupplyDetail').map { |supply_data| SupplyDetail.new(supply_data) } rescue @supply_details = [] end if data.namespaces.values.any? { |uri| uri =~ /elibri/ } && (data.at_xpath('elibri:Vat') || data.at_xpath('elibri:CoverPrice')) @cover_price = BigDecimal(data.at_xpath('elibri:CoverPrice').try(:text)) if data.at_xpath('elibri:CoverPrice') @vat = data.at_xpath('elibri:Vat').try(:text).try(:to_i) else price_sd = @supply_details.find { |sd| sd.supplier && sd.supplier.role == Elibri::ONIX::Dict::Release_3_0::SupplierRole::PUB_TO_RET } if price_sd && price_sd.price && price_sd.price && price_sd.price.type == Elibri::ONIX::Dict::Release_3_0::PriceTypeCode::RRP_WITH_TAX @vat = price_sd.price.tax_rate_percent.to_i @cover_price = price_sd.price.amount @additional_trade_information = price_sd.additional_trade_information end end descriptive_details_setup(data.at_css('DescriptiveDetail')) if data.at_css('DescriptiveDetail') collateral_details_setup(data.at_css('CollateralDetail')) if data.at_css('CollateralDetail') if data.namespaces.values.any? { |uri| uri =~ /elibri/ } && data.at_xpath('elibri:preview_exists') @preview_exists = (data.at_xpath('elibri:preview_exists').text == "true") else @preview_exists = @supporting_resources.find { |sr| sr.content_type_name == "widget" && sr.link =~ /p.elibri.com.pl/ }.present? end product_form_features_setup(data.css("ProductFormFeature")) publishing_details_setup(data.at_css('PublishingDetail')) if data.at_css('PublishingDetail') licence_information_setup(data) begin @excerpt_infos = data.at_xpath("elibri:excerpts").xpath("elibri:excerpt").map { |node| ExcerptInfo.new(node) } rescue demo = @supporting_resources.find { |sr| sr.content_type_name == "sample_content" } if demo @excerpt_infos = demo.data.css("ResourceVersion").map { |node| ExcerptInfo.new(node) } end end @file_infos = data.css("BodyResource").map { |node| FileInfo.new(node) } after_parse end def licence_information_setup(data) if data.namespaces.values.any? { |uri| uri =~ /elibri/ } && (data.at_xpath("elibri:SaleNotRestricted") || data.at_xpath("elibri:SaleRestrictedTo")) if data.at_xpath("elibri:SaleNotRestricted") @unlimited_licence = true elsif date = data.at_xpath("elibri:SaleRestrictedTo").try(:text) @unlimited_licence = false @licence_limited_to_before_type_cast = date @licence_limited_to = _parse_date(date) end else daten = data.css('PublishingDate').find { |d| d.at_css("PublishingDateRole") && d.at_css("PublishingDateRole").text == Elibri::ONIX::Dict::Release_3_0::PublishingDateRole::OUT_OF_PRINT_DATE } if daten date = daten.at_css('Date').text @licence_limited_to_before_type_cast = date @licence_limited_to = _parse_date(date) @unlimited_licence = false else @unlimited_licence = true end end end def product_form_features_setup(data) data.each do |feature| ftype = feature.at_css("ProductFormFeatureType").inner_text v1, v2 = feature.at_css("ProductFormFeatureValue, ProductFormFeatureDescription").inner_text.split("-").map(&:to_i) if ftype == Elibri::ONIX::Dict::Release_3_0::ProductFormFeatureType::NUMBER_OF_GAME_PIECES @number_of_pieces = v1 elsif ftype == Elibri::ONIX::Dict::Release_3_0::ProductFormFeatureType::GAME_PLAYERS @players_number_from = v1 @players_number_to = v2 elsif ftype == Elibri::ONIX::Dict::Release_3_0::ProductFormFeatureType::GAME_PLAY_TIME @playing_time_from = v1 @playing_time_to = v2 end end end def descriptive_details_setup(data) @country_of_manufacture = data.at_css("CountryOfManufacture").try(:text) @product_composition = data.at_css('ProductComposition').try(:text) @product_form = data.at_css('ProductForm').try(:text) if @product_form if @product_form.starts_with?("B") && !@cover_type @cover_type = Elibri::ONIX::Dict::CoverType.determine_cover_type(@product_form, data.at_css('ProductFormDetail').try(:text)) end if Elibri::ONIX::Dict::Release_3_0::ProductFormCode::find_by_onix_code(@product_form) @product_form_name = Elibri::ONIX::Dict::Release_3_0::ProductFormCode::find_by_onix_code(@product_form).name(:en).downcase end simplified_product_form = @product_form.starts_with?("B") ? "BA" : @product_form if Elibri::ONIX::Dict::Release_3_0::ProductFormCode::find_by_onix_code(simplified_product_form).try!(:digital?) @digital_formats = [] data.css("ProductFormDetail").each do |format| format_name = Elibri::ONIX::Dict::Release_3_0::ProductFormDetail::find_by_onix_code(format.text).try(:name) @digital_formats << format_name.upcase.gsub("MOBIPOCKET", "MOBI") if format_name end end end data.css('ProductClassification').each do |cl| cl_type = cl.at_css('ProductClassificationType').text cl_value = cl.at_css('ProductClassificationCode').text if cl_type == Elibri::ONIX::Dict::Release_3_0::ProductClassificationType::PKWIU @pkwiu = cl_value elsif cl_type == Elibri::ONIX::Dict::Release_3_0::ProductClassificationType::CN @cn_code = cl_value end end @measures = data.css('Measure').map { |measure_data| Measure.new(measure_data) } @title_details = data.children.find_all { |node| node.name == 'TitleDetail' }.map { |title_data| TitleDetail.new(title_data) } @collections = data.css('Collection').map { |collection_data| Collection.new(collection_data) } @contributors = data.css('Contributor').map { |contributor_data| Contributor.new(contributor_data) } @no_contributor = !!data.at_css('NoContributor') @languages = data.css('Language').map { |language_data| Language.new(language_data) } @extents = data.css('Extent').map { |extent_data| Extent.new(extent_data) } @publisher_subjects = data.css('Subject').find_all { |sd| %w{24}.include?(sd.at_css('SubjectSchemeIdentifier').try(:text)) }.map { |sd| PublisherSubject.new(sd) } @thema_subjects = data.css('Subject').find_all { |sd| %w{93 94 95 96 97 98 99}.include?(sd.at_css('SubjectSchemeIdentifier').try(:text)) }.map { |sd| ThemaSubject.new(sd) } @audience_ranges = data.css('AudienceRange').map { |audience_data| AudienceRange.new(audience_data) } #zabezpiecznie pliku if protection = data.at_css("EpubTechnicalProtection").try(:text) @technical_protection = Elibri::ONIX::Dict::Release_3_0::EpubTechnicalProtection::find_by_onix_code(protection).try(:name) @technical_protection_onix_code = protection end @edition_statement = data.at_css('EditionStatement').try(:text) if Elibri::ONIX::Dict::Release_3_0::EditionType.find_by_onix_code(data.at_css('EditionType').try(:text)) @edition_type_onix_code = data.at_css('EditionType').try(:text) end @number_of_illustrations = data.at_css('NumberOfIllustrations').try(:text).try(:to_i) end def collateral_details_setup(data) @text_contents = data.css('TextContent').map { |text_detail| TextContent.new(text_detail) } @supporting_resources = data.css('SupportingResource').map { |supporting_data| SupportingResource.new(supporting_data) } end def publishing_details_setup(data) @imprint = Imprint.new(data.at_css('Imprint')) if data.at_css('Imprint') @publisher = Publisher.new(data.at_css('Publisher')) if data.at_css('Publisher') @publishing_status = data.at_css('PublishingStatus').try(:text) @city_of_publication = data.at_css("CityOfPublication").try(:text) publication_dates = data.css('PublishingDate').map do |node| PublishingDate.new(node) end @publishing_date = publication_dates.find { |date| date.role == Elibri::ONIX::Dict::Release_3_0::PublishingDateRole::PUBLICATION_DATE } preorder_embargo_date_as_object = publication_dates.find { |date| date.role == Elibri::ONIX::Dict::Release_3_0::PublishingDateRole::PREORDER_EMBARGO_DATE } @preorder_embargo_date = Date.new(*preorder_embargo_date_as_object.parsed) if preorder_embargo_date_as_object @sales_restrictions = data.css('SalesRestriction').map { |restriction_data| SalesRestriction.new(restriction_data) } #ograniczenia terytorialne if data.at_css("CountriesIncluded").try(:text) == "PL" @sale_restricted_to_poland = true else @sale_restricted_to_poland = false end end def sales_restrictions? @sales_restrictions.size > 0 end #flaga, czy sprzedaż książki jest ograniczona do Polski def sale_restricted_to_poland? @sale_restricted_to_poland end #flaga informująca, czy licencja jest bezterminowa def unlimited_licence? @unlimited_licence end #flaga - true, jeśli produkt nie ma żadnego autora def no_contributor? @no_contributor end #flaga, czy książka to praca zbiorowa? def unnamed_persons? @contributors.size == 1 && contributors[0].unnamed_persons.present? end #flaga, czy istnieje podgląd produktu def preview_exists? @preview_exists end def authors unnamed_persons? ? ["pr<NAME>"] : @contributors.find_all { |c| c.role_name == "author" }.map(&:person_name) end [:ghostwriter, :scenarist, :originator, :illustrator, :photographer, :author_of_preface, :drawer, :cover_designer, :inked_or_colored_by, :editor, :revisor, :translator, :editor_in_chief, :read_by].each do |role| define_method "#{role}s" do @contributors.find_all { |c| c.role_name == role.to_s }.map(&:person_name) end end [:announced, :preorder, :published, :out_of_print].each do |state| define_method "#{state}?" do current_state == state end end #okładka ksiązki, instance SupportingResource def front_cover @supporting_resources.find { |resource| resource.content_type_name == "front_cover" } end #lista nazwa serii, do których należy produkt def series_names @series.map { |series| series[0] } end #data premiery, jako instancja Date (tylko wtedy, gdy dokładna data jest znana) def premiere Date.new(*parsed_publishing_date) if parsed_publishing_date.size == 3 rescue ArgumentError nil end def related_products_record_references related_products.map(&:record_reference) end #:nodoc: def proprietary_identifiers @identifiers.find_all { |i| i.identifier_type == "proprietary" }.inject({}) { |res, ident| res[ident.type_name] = ident.value; res } end #data premiery w postaci listy [rok, miesiąc, dzień], [rok, miesiąc], [rok], lub pustej listy - jeśli data premiery nie jest znana #(data premiery może nie być znana w przypadku backlisty) def parsed_publishing_date if sales_restrictions? date = sales_restrictions[0].end_date [date.year, date.month, date.day] elsif publishing_date publishing_date.parsed else [] end end private def find_title(code) @title_details.find {|title_detail| title_detail.type == code} end def after_parse %w{height width thickness weight}.each do |mn| instance_variable_set("@#{mn}", measures.find { |m| m.type_name == mn }.try(:measurement)) end @ean = @identifiers.find { |identifier| identifier.identifier_type == "ean" }.try(:value) @number_of_pages = @extents.find {|extent| extent.type_name == "page_count" }.try(:value) @duration = @extents.find {|extent| extent.type_name == "duration" }.try(:value) @file_size = @extents.find {|extent| extent.type_name == "file_size" }.try(:value) @publisher_name = @publisher.name if publisher @publisher_id = @publisher.eid if publisher @imprint_name = @imprint.name if imprint @isbn13 = @identifiers.find { |identifier| identifier.identifier_type == "isbn13" }.try(:value) @hyphenated_isbn ||= @isbn13 @reading_age_from = @audience_ranges.find {|ar| (ar.qualifier == "18") && (ar.precision == "03")}.try(:value).try(:to_i) @reading_age_to = @audience_ranges.find {|ar| (ar.qualifier == "18") && (ar.precision == "04")}.try(:value).try(:to_i) @table_of_contents = @text_contents.find { |t| t.type_name == "table_of_contents" } @description = @text_contents.find { |t| t.type_name == "main_description" } @short_description = @text_contents.find { |t| t.type_name == "short_description" } @reviews = @text_contents.find_all { |t| t.type_name == "review" } @excerpts = @text_contents.find_all { |t| t.type_name == "excerpt" } @series = @collections.map { |c| [c.title_detail.elements[0].title, c.title_detail.elements[0].part_number] } distinctive_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::DISTINCTIVE_TITLE) if distinctive_title @title = distinctive_title.product_level.try(:title) @subtitle = distinctive_title.product_level.try(:subtitle) @collection_title = distinctive_title.collection_level.try(:title) @collection_part = distinctive_title.collection_level.try(:part_number) end @full_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::DISTINCTIVE_TITLE).try(:full_title) @original_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::ORIGINAL_TITLE).try(:full_title) @trade_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::DISTRIBUTORS_TITLE).try(:full_title) compute_state! end def compute_state! if @notification_type || @publishing_status if @notification_type == "01" @current_state = :announced elsif @notification_type == "02" @current_state = :preorder elsif @notification_type == "05" @current_state = :deleted else if @publishing_status == "04" @current_state = :published elsif @publishing_status == "07" @current_state = :out_of_print elsif @notification_type == "03" @current_state = :published else raise "cannot determine the state of the product #{@record_reference}" end end end end def _parse_date(string) Date.new(string[0...4].to_i, string[4...6].to_i, string[6...8].to_i) rescue ArgumentError raise "Invalid date '#{string}' when parsing date for #{@record_reference}" end end end end end
# export LC_TIME=en_US.UTF-8 if ! vim --serverlist | grep -q -w POST; then vim -g --servername POST & sleep 1 else vim -g --servername POST --remote-sent ":remote_foreground()" fi set -e statef='../_data/article.yml' n=0 eval $(cat $statef 2>/dev/null | eyml ) stamp=$(date +%Y-%m-%d) echo stamp: $stamp file="${stamp}-post-$n.md" echo "file: $file" date=$(date +"%c") if [ ! -e $file ]; then cat <<EOF > $file --- title: "Article $n ($stamp)" layout: post stamp: $stamp date: 2019-09-24 18:04:23 CEST created: $date updated: $date inode: 2019-09-24 17:51:16.546610500 +0200 access: 2019-09-24 18:03:35.339925900 +0200 description: "This is a description of article $n" --- body here ... QmWHT7rY4dGjofJ6XtGHLHEPtGeuVg94v8iUL7WAuZpbkj EOF n=$(expr $n + 1); sed -i "s/^n: .*/n: $n/" $statef fi vim --servername POST --remote-wait-tab-silent "$file"
<reponame>learnforpractice/micropython-cpp import utime import machine from hwconfig import LED, BUTTON # machine.time_pulse_us() function demo print("""\ Let's play an interesting game: You click button as fast as you can, and I tell you how slow you are. Ready? Cliiiiick! """) while 1: delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000) if delay < 0: print("Well, you're *really* slow") else: print("You are as slow as %d microseconds!" % delay) utime.sleep_ms(10)
#!/bin/bash cd $HOME/aws-panorama-samples export AWS_REGION=us-east-1 export LD_LIBRARY_PATH=$HOME/glibc-2.27-subset:$LD_LIBRARY_PATH jupyter-lab --no-browser --allow-root --port 8888 --notebook-dir ~
model = Sequential() model.add(Conv2D(64, (7, 7,), input_shape=(32, 32, 3), strides=(2,2))) model.add(Activation('relu')) model.add(BatchNormalization()) model.add(MaxPooling2D(pool_size=(2,2))) model.add(Conv2D(64, (3, 3), strides=(2, 2))) model.add(Activation('relu')) model.add(BatchNormalization()) model.add(MaxPooling2D(pool_size=(2,2))) model.add(Conv2D(128, (3, 3), strides=(2, 2))) model.add(Activation('relu')) model.add(BatchNormalization()) model.add(MaxPooling2D(pool_size=(2,2))) model.add(Flatten()) model.add(Dense(64)) model.add(Activation('relu')) model.add(BatchNormalization()) model.add(Dropout(0.5)) model.add(Dense(num_classes)) model.add(Activation('softmax')) model.compile(loss='categorical_crossentropy', metrics=['accuracy'], optimizer='adam')
rm /tmp/alloctest-pr_rw.ready &>/dev/null rm /tmp/alloctest-pr_rw.done &>/dev/null BM_NAME=$1 THP=$2 BM_PID=$3 echo "mkdir /home/akshaybavisk/work/Yaniv/home/idanyani/hash-vs-radix/benchmarks/$BM_NAME" mkdir /home/akshaybavisk/work/Yaniv/home/idanyani/hash-vs-radix/benchmarks/$BM_NAME PERFOP="/home/akshaybavisk/work/Yaniv/home/idanyani/hash-vs-radix/benchmarks/$BM_NAME/$THP-perf" while [ ! -f /tmp/alloctest-pr_rw.ready ]; do sleep 0.05 done echo "perf stat -p $BM_PID -e inst_retired.any_p:u,mem_inst_retired.all_loads:u,mem_inst_retired.all_stores:u,dtlb_store_misses.stlb_hit:u,dtlb_load_misses.stlb_hit:u,mem_inst_retired.stlb_miss_loads:u,mem_inst_retired.stlb_miss_stores:u,dtlb_store_misses.walk_pending:u,dtlb_load_misses.walk_pending:u,cycles:u 2> $PERFOP" perf stat -p $BM_PID -e inst_retired.any_p:u,mem_inst_retired.all_loads:u,mem_inst_retired.all_stores:u,dtlb_store_misses.stlb_hit:u,dtlb_load_misses.stlb_hit:u,mem_inst_retired.stlb_miss_loads:u,mem_inst_retired.stlb_miss_stores:u,dtlb_store_misses.walk_pending:u,dtlb_load_misses.walk_pending:u,cycles:u 2> $PERFOP PERF_PID=$! while [ ! -f /tmp/alloctest-pr_rw.done ]; do sleep 0.05 done #kill -INT $PERF_PID
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: edge.proto package com.ciat.bim.server.edge.gen; /** * Protobuf type {@code edge.UplinkMsg} */ public final class UplinkMsg extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:edge.UplinkMsg) UplinkMsgOrBuilder { private static final long serialVersionUID = 0L; // Use UplinkMsg.newBuilder() to construct. private UplinkMsg(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private UplinkMsg() { entityData_ = java.util.Collections.emptyList(); deviceUpdateMsg_ = java.util.Collections.emptyList(); deviceCredentialsUpdateMsg_ = java.util.Collections.emptyList(); alarmUpdateMsg_ = java.util.Collections.emptyList(); relationUpdateMsg_ = java.util.Collections.emptyList(); ruleChainMetadataRequestMsg_ = java.util.Collections.emptyList(); attributesRequestMsg_ = java.util.Collections.emptyList(); relationRequestMsg_ = java.util.Collections.emptyList(); userCredentialsRequestMsg_ = java.util.Collections.emptyList(); deviceCredentialsRequestMsg_ = java.util.Collections.emptyList(); deviceRpcCallMsg_ = java.util.Collections.emptyList(); deviceProfileDevicesRequestMsg_ = java.util.Collections.emptyList(); widgetBundleTypesRequestMsg_ = java.util.Collections.emptyList(); entityViewsRequestMsg_ = java.util.Collections.emptyList(); } @Override @SuppressWarnings({"unused"}) protected Object newInstance( UnusedPrivateParameter unused) { return new UplinkMsg(); } @Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private UplinkMsg( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new 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: { uplinkMsgId_ = input.readInt32(); break; } case 18: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { entityData_ = new java.util.ArrayList<EntityDataProto>(); mutable_bitField0_ |= 0x00000001; } entityData_.add( input.readMessage(EntityDataProto.parser(), extensionRegistry)); break; } case 26: { if (!((mutable_bitField0_ & 0x00000002) != 0)) { deviceUpdateMsg_ = new java.util.ArrayList<DeviceUpdateMsg>(); mutable_bitField0_ |= 0x00000002; } deviceUpdateMsg_.add( input.readMessage(DeviceUpdateMsg.parser(), extensionRegistry)); break; } case 34: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { deviceCredentialsUpdateMsg_ = new java.util.ArrayList<DeviceCredentialsUpdateMsg>(); mutable_bitField0_ |= 0x00000004; } deviceCredentialsUpdateMsg_.add( input.readMessage(DeviceCredentialsUpdateMsg.parser(), extensionRegistry)); break; } case 42: { if (!((mutable_bitField0_ & 0x00000008) != 0)) { alarmUpdateMsg_ = new java.util.ArrayList<AlarmUpdateMsg>(); mutable_bitField0_ |= 0x00000008; } alarmUpdateMsg_.add( input.readMessage(AlarmUpdateMsg.parser(), extensionRegistry)); break; } case 50: { if (!((mutable_bitField0_ & 0x00000010) != 0)) { relationUpdateMsg_ = new java.util.ArrayList<RelationUpdateMsg>(); mutable_bitField0_ |= 0x00000010; } relationUpdateMsg_.add( input.readMessage(RelationUpdateMsg.parser(), extensionRegistry)); break; } case 58: { if (!((mutable_bitField0_ & 0x00000020) != 0)) { ruleChainMetadataRequestMsg_ = new java.util.ArrayList<RuleChainMetadataRequestMsg>(); mutable_bitField0_ |= 0x00000020; } ruleChainMetadataRequestMsg_.add( input.readMessage(RuleChainMetadataRequestMsg.parser(), extensionRegistry)); break; } case 66: { if (!((mutable_bitField0_ & 0x00000040) != 0)) { attributesRequestMsg_ = new java.util.ArrayList<AttributesRequestMsg>(); mutable_bitField0_ |= 0x00000040; } attributesRequestMsg_.add( input.readMessage(AttributesRequestMsg.parser(), extensionRegistry)); break; } case 74: { if (!((mutable_bitField0_ & 0x00000080) != 0)) { relationRequestMsg_ = new java.util.ArrayList<RelationRequestMsg>(); mutable_bitField0_ |= 0x00000080; } relationRequestMsg_.add( input.readMessage(RelationRequestMsg.parser(), extensionRegistry)); break; } case 82: { if (!((mutable_bitField0_ & 0x00000100) != 0)) { userCredentialsRequestMsg_ = new java.util.ArrayList<UserCredentialsRequestMsg>(); mutable_bitField0_ |= 0x00000100; } userCredentialsRequestMsg_.add( input.readMessage(UserCredentialsRequestMsg.parser(), extensionRegistry)); break; } case 90: { if (!((mutable_bitField0_ & 0x00000200) != 0)) { deviceCredentialsRequestMsg_ = new java.util.ArrayList<DeviceCredentialsRequestMsg>(); mutable_bitField0_ |= 0x00000200; } deviceCredentialsRequestMsg_.add( input.readMessage(DeviceCredentialsRequestMsg.parser(), extensionRegistry)); break; } case 98: { if (!((mutable_bitField0_ & 0x00000400) != 0)) { deviceRpcCallMsg_ = new java.util.ArrayList<DeviceRpcCallMsg>(); mutable_bitField0_ |= 0x00000400; } deviceRpcCallMsg_.add( input.readMessage(DeviceRpcCallMsg.parser(), extensionRegistry)); break; } case 106: { if (!((mutable_bitField0_ & 0x00000800) != 0)) { deviceProfileDevicesRequestMsg_ = new java.util.ArrayList<DeviceProfileDevicesRequestMsg>(); mutable_bitField0_ |= 0x00000800; } deviceProfileDevicesRequestMsg_.add( input.readMessage(DeviceProfileDevicesRequestMsg.parser(), extensionRegistry)); break; } case 114: { if (!((mutable_bitField0_ & 0x00001000) != 0)) { widgetBundleTypesRequestMsg_ = new java.util.ArrayList<WidgetBundleTypesRequestMsg>(); mutable_bitField0_ |= 0x00001000; } widgetBundleTypesRequestMsg_.add( input.readMessage(WidgetBundleTypesRequestMsg.parser(), extensionRegistry)); break; } case 122: { if (!((mutable_bitField0_ & 0x00002000) != 0)) { entityViewsRequestMsg_ = new java.util.ArrayList<EntityViewsRequestMsg>(); mutable_bitField0_ |= 0x00002000; } entityViewsRequestMsg_.add( input.readMessage(EntityViewsRequestMsg.parser(), extensionRegistry)); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { entityData_ = java.util.Collections.unmodifiableList(entityData_); } if (((mutable_bitField0_ & 0x00000002) != 0)) { deviceUpdateMsg_ = java.util.Collections.unmodifiableList(deviceUpdateMsg_); } if (((mutable_bitField0_ & 0x00000004) != 0)) { deviceCredentialsUpdateMsg_ = java.util.Collections.unmodifiableList(deviceCredentialsUpdateMsg_); } if (((mutable_bitField0_ & 0x00000008) != 0)) { alarmUpdateMsg_ = java.util.Collections.unmodifiableList(alarmUpdateMsg_); } if (((mutable_bitField0_ & 0x00000010) != 0)) { relationUpdateMsg_ = java.util.Collections.unmodifiableList(relationUpdateMsg_); } if (((mutable_bitField0_ & 0x00000020) != 0)) { ruleChainMetadataRequestMsg_ = java.util.Collections.unmodifiableList(ruleChainMetadataRequestMsg_); } if (((mutable_bitField0_ & 0x00000040) != 0)) { attributesRequestMsg_ = java.util.Collections.unmodifiableList(attributesRequestMsg_); } if (((mutable_bitField0_ & 0x00000080) != 0)) { relationRequestMsg_ = java.util.Collections.unmodifiableList(relationRequestMsg_); } if (((mutable_bitField0_ & 0x00000100) != 0)) { userCredentialsRequestMsg_ = java.util.Collections.unmodifiableList(userCredentialsRequestMsg_); } if (((mutable_bitField0_ & 0x00000200) != 0)) { deviceCredentialsRequestMsg_ = java.util.Collections.unmodifiableList(deviceCredentialsRequestMsg_); } if (((mutable_bitField0_ & 0x00000400) != 0)) { deviceRpcCallMsg_ = java.util.Collections.unmodifiableList(deviceRpcCallMsg_); } if (((mutable_bitField0_ & 0x00000800) != 0)) { deviceProfileDevicesRequestMsg_ = java.util.Collections.unmodifiableList(deviceProfileDevicesRequestMsg_); } if (((mutable_bitField0_ & 0x00001000) != 0)) { widgetBundleTypesRequestMsg_ = java.util.Collections.unmodifiableList(widgetBundleTypesRequestMsg_); } if (((mutable_bitField0_ & 0x00002000) != 0)) { entityViewsRequestMsg_ = java.util.Collections.unmodifiableList(entityViewsRequestMsg_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return EdgeProtos.internal_static_edge_UplinkMsg_descriptor; } @Override protected FieldAccessorTable internalGetFieldAccessorTable() { return EdgeProtos.internal_static_edge_UplinkMsg_fieldAccessorTable .ensureFieldAccessorsInitialized( UplinkMsg.class, Builder.class); } public static final int UPLINKMSGID_FIELD_NUMBER = 1; private int uplinkMsgId_; /** * <code>int32 uplinkMsgId = 1;</code> * @return The uplinkMsgId. */ @Override public int getUplinkMsgId() { return uplinkMsgId_; } public static final int ENTITYDATA_FIELD_NUMBER = 2; private java.util.List<EntityDataProto> entityData_; /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ @Override public java.util.List<EntityDataProto> getEntityDataList() { return entityData_; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ @Override public java.util.List<? extends EntityDataProtoOrBuilder> getEntityDataOrBuilderList() { return entityData_; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ @Override public int getEntityDataCount() { return entityData_.size(); } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ @Override public EntityDataProto getEntityData(int index) { return entityData_.get(index); } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ @Override public EntityDataProtoOrBuilder getEntityDataOrBuilder( int index) { return entityData_.get(index); } public static final int DEVICEUPDATEMSG_FIELD_NUMBER = 3; private java.util.List<DeviceUpdateMsg> deviceUpdateMsg_; /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ @Override public java.util.List<DeviceUpdateMsg> getDeviceUpdateMsgList() { return deviceUpdateMsg_; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ @Override public java.util.List<? extends DeviceUpdateMsgOrBuilder> getDeviceUpdateMsgOrBuilderList() { return deviceUpdateMsg_; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ @Override public int getDeviceUpdateMsgCount() { return deviceUpdateMsg_.size(); } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ @Override public DeviceUpdateMsg getDeviceUpdateMsg(int index) { return deviceUpdateMsg_.get(index); } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ @Override public DeviceUpdateMsgOrBuilder getDeviceUpdateMsgOrBuilder( int index) { return deviceUpdateMsg_.get(index); } public static final int DEVICECREDENTIALSUPDATEMSG_FIELD_NUMBER = 4; private java.util.List<DeviceCredentialsUpdateMsg> deviceCredentialsUpdateMsg_; /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ @Override public java.util.List<DeviceCredentialsUpdateMsg> getDeviceCredentialsUpdateMsgList() { return deviceCredentialsUpdateMsg_; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ @Override public java.util.List<? extends DeviceCredentialsUpdateMsgOrBuilder> getDeviceCredentialsUpdateMsgOrBuilderList() { return deviceCredentialsUpdateMsg_; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ @Override public int getDeviceCredentialsUpdateMsgCount() { return deviceCredentialsUpdateMsg_.size(); } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ @Override public DeviceCredentialsUpdateMsg getDeviceCredentialsUpdateMsg(int index) { return deviceCredentialsUpdateMsg_.get(index); } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ @Override public DeviceCredentialsUpdateMsgOrBuilder getDeviceCredentialsUpdateMsgOrBuilder( int index) { return deviceCredentialsUpdateMsg_.get(index); } public static final int ALARMUPDATEMSG_FIELD_NUMBER = 5; private java.util.List<AlarmUpdateMsg> alarmUpdateMsg_; /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ @Override public java.util.List<AlarmUpdateMsg> getAlarmUpdateMsgList() { return alarmUpdateMsg_; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ @Override public java.util.List<? extends AlarmUpdateMsgOrBuilder> getAlarmUpdateMsgOrBuilderList() { return alarmUpdateMsg_; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ @Override public int getAlarmUpdateMsgCount() { return alarmUpdateMsg_.size(); } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ @Override public AlarmUpdateMsg getAlarmUpdateMsg(int index) { return alarmUpdateMsg_.get(index); } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ @Override public AlarmUpdateMsgOrBuilder getAlarmUpdateMsgOrBuilder( int index) { return alarmUpdateMsg_.get(index); } public static final int RELATIONUPDATEMSG_FIELD_NUMBER = 6; private java.util.List<RelationUpdateMsg> relationUpdateMsg_; /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ @Override public java.util.List<RelationUpdateMsg> getRelationUpdateMsgList() { return relationUpdateMsg_; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ @Override public java.util.List<? extends RelationUpdateMsgOrBuilder> getRelationUpdateMsgOrBuilderList() { return relationUpdateMsg_; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ @Override public int getRelationUpdateMsgCount() { return relationUpdateMsg_.size(); } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ @Override public RelationUpdateMsg getRelationUpdateMsg(int index) { return relationUpdateMsg_.get(index); } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ @Override public RelationUpdateMsgOrBuilder getRelationUpdateMsgOrBuilder( int index) { return relationUpdateMsg_.get(index); } public static final int RULECHAINMETADATAREQUESTMSG_FIELD_NUMBER = 7; private java.util.List<RuleChainMetadataRequestMsg> ruleChainMetadataRequestMsg_; /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ @Override public java.util.List<RuleChainMetadataRequestMsg> getRuleChainMetadataRequestMsgList() { return ruleChainMetadataRequestMsg_; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ @Override public java.util.List<? extends RuleChainMetadataRequestMsgOrBuilder> getRuleChainMetadataRequestMsgOrBuilderList() { return ruleChainMetadataRequestMsg_; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ @Override public int getRuleChainMetadataRequestMsgCount() { return ruleChainMetadataRequestMsg_.size(); } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ @Override public RuleChainMetadataRequestMsg getRuleChainMetadataRequestMsg(int index) { return ruleChainMetadataRequestMsg_.get(index); } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ @Override public RuleChainMetadataRequestMsgOrBuilder getRuleChainMetadataRequestMsgOrBuilder( int index) { return ruleChainMetadataRequestMsg_.get(index); } public static final int ATTRIBUTESREQUESTMSG_FIELD_NUMBER = 8; private java.util.List<AttributesRequestMsg> attributesRequestMsg_; /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ @Override public java.util.List<AttributesRequestMsg> getAttributesRequestMsgList() { return attributesRequestMsg_; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ @Override public java.util.List<? extends AttributesRequestMsgOrBuilder> getAttributesRequestMsgOrBuilderList() { return attributesRequestMsg_; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ @Override public int getAttributesRequestMsgCount() { return attributesRequestMsg_.size(); } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ @Override public AttributesRequestMsg getAttributesRequestMsg(int index) { return attributesRequestMsg_.get(index); } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ @Override public AttributesRequestMsgOrBuilder getAttributesRequestMsgOrBuilder( int index) { return attributesRequestMsg_.get(index); } public static final int RELATIONREQUESTMSG_FIELD_NUMBER = 9; private java.util.List<RelationRequestMsg> relationRequestMsg_; /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ @Override public java.util.List<RelationRequestMsg> getRelationRequestMsgList() { return relationRequestMsg_; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ @Override public java.util.List<? extends RelationRequestMsgOrBuilder> getRelationRequestMsgOrBuilderList() { return relationRequestMsg_; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ @Override public int getRelationRequestMsgCount() { return relationRequestMsg_.size(); } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ @Override public RelationRequestMsg getRelationRequestMsg(int index) { return relationRequestMsg_.get(index); } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ @Override public RelationRequestMsgOrBuilder getRelationRequestMsgOrBuilder( int index) { return relationRequestMsg_.get(index); } public static final int USERCREDENTIALSREQUESTMSG_FIELD_NUMBER = 10; private java.util.List<UserCredentialsRequestMsg> userCredentialsRequestMsg_; /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ @Override public java.util.List<UserCredentialsRequestMsg> getUserCredentialsRequestMsgList() { return userCredentialsRequestMsg_; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ @Override public java.util.List<? extends UserCredentialsRequestMsgOrBuilder> getUserCredentialsRequestMsgOrBuilderList() { return userCredentialsRequestMsg_; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ @Override public int getUserCredentialsRequestMsgCount() { return userCredentialsRequestMsg_.size(); } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ @Override public UserCredentialsRequestMsg getUserCredentialsRequestMsg(int index) { return userCredentialsRequestMsg_.get(index); } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ @Override public UserCredentialsRequestMsgOrBuilder getUserCredentialsRequestMsgOrBuilder( int index) { return userCredentialsRequestMsg_.get(index); } public static final int DEVICECREDENTIALSREQUESTMSG_FIELD_NUMBER = 11; private java.util.List<DeviceCredentialsRequestMsg> deviceCredentialsRequestMsg_; /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ @Override public java.util.List<DeviceCredentialsRequestMsg> getDeviceCredentialsRequestMsgList() { return deviceCredentialsRequestMsg_; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ @Override public java.util.List<? extends DeviceCredentialsRequestMsgOrBuilder> getDeviceCredentialsRequestMsgOrBuilderList() { return deviceCredentialsRequestMsg_; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ @Override public int getDeviceCredentialsRequestMsgCount() { return deviceCredentialsRequestMsg_.size(); } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ @Override public DeviceCredentialsRequestMsg getDeviceCredentialsRequestMsg(int index) { return deviceCredentialsRequestMsg_.get(index); } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ @Override public DeviceCredentialsRequestMsgOrBuilder getDeviceCredentialsRequestMsgOrBuilder( int index) { return deviceCredentialsRequestMsg_.get(index); } public static final int DEVICERPCCALLMSG_FIELD_NUMBER = 12; private java.util.List<DeviceRpcCallMsg> deviceRpcCallMsg_; /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ @Override public java.util.List<DeviceRpcCallMsg> getDeviceRpcCallMsgList() { return deviceRpcCallMsg_; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ @Override public java.util.List<? extends DeviceRpcCallMsgOrBuilder> getDeviceRpcCallMsgOrBuilderList() { return deviceRpcCallMsg_; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ @Override public int getDeviceRpcCallMsgCount() { return deviceRpcCallMsg_.size(); } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ @Override public DeviceRpcCallMsg getDeviceRpcCallMsg(int index) { return deviceRpcCallMsg_.get(index); } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ @Override public DeviceRpcCallMsgOrBuilder getDeviceRpcCallMsgOrBuilder( int index) { return deviceRpcCallMsg_.get(index); } public static final int DEVICEPROFILEDEVICESREQUESTMSG_FIELD_NUMBER = 13; private java.util.List<DeviceProfileDevicesRequestMsg> deviceProfileDevicesRequestMsg_; /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ @Override public java.util.List<DeviceProfileDevicesRequestMsg> getDeviceProfileDevicesRequestMsgList() { return deviceProfileDevicesRequestMsg_; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ @Override public java.util.List<? extends DeviceProfileDevicesRequestMsgOrBuilder> getDeviceProfileDevicesRequestMsgOrBuilderList() { return deviceProfileDevicesRequestMsg_; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ @Override public int getDeviceProfileDevicesRequestMsgCount() { return deviceProfileDevicesRequestMsg_.size(); } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ @Override public DeviceProfileDevicesRequestMsg getDeviceProfileDevicesRequestMsg(int index) { return deviceProfileDevicesRequestMsg_.get(index); } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ @Override public DeviceProfileDevicesRequestMsgOrBuilder getDeviceProfileDevicesRequestMsgOrBuilder( int index) { return deviceProfileDevicesRequestMsg_.get(index); } public static final int WIDGETBUNDLETYPESREQUESTMSG_FIELD_NUMBER = 14; private java.util.List<WidgetBundleTypesRequestMsg> widgetBundleTypesRequestMsg_; /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ @Override public java.util.List<WidgetBundleTypesRequestMsg> getWidgetBundleTypesRequestMsgList() { return widgetBundleTypesRequestMsg_; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ @Override public java.util.List<? extends WidgetBundleTypesRequestMsgOrBuilder> getWidgetBundleTypesRequestMsgOrBuilderList() { return widgetBundleTypesRequestMsg_; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ @Override public int getWidgetBundleTypesRequestMsgCount() { return widgetBundleTypesRequestMsg_.size(); } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ @Override public WidgetBundleTypesRequestMsg getWidgetBundleTypesRequestMsg(int index) { return widgetBundleTypesRequestMsg_.get(index); } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ @Override public WidgetBundleTypesRequestMsgOrBuilder getWidgetBundleTypesRequestMsgOrBuilder( int index) { return widgetBundleTypesRequestMsg_.get(index); } public static final int ENTITYVIEWSREQUESTMSG_FIELD_NUMBER = 15; private java.util.List<EntityViewsRequestMsg> entityViewsRequestMsg_; /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ @Override public java.util.List<EntityViewsRequestMsg> getEntityViewsRequestMsgList() { return entityViewsRequestMsg_; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ @Override public java.util.List<? extends EntityViewsRequestMsgOrBuilder> getEntityViewsRequestMsgOrBuilderList() { return entityViewsRequestMsg_; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ @Override public int getEntityViewsRequestMsgCount() { return entityViewsRequestMsg_.size(); } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ @Override public EntityViewsRequestMsg getEntityViewsRequestMsg(int index) { return entityViewsRequestMsg_.get(index); } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ @Override public EntityViewsRequestMsgOrBuilder getEntityViewsRequestMsgOrBuilder( int index) { return entityViewsRequestMsg_.get(index); } private byte memoizedIsInitialized = -1; @Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (uplinkMsgId_ != 0) { output.writeInt32(1, uplinkMsgId_); } for (int i = 0; i < entityData_.size(); i++) { output.writeMessage(2, entityData_.get(i)); } for (int i = 0; i < deviceUpdateMsg_.size(); i++) { output.writeMessage(3, deviceUpdateMsg_.get(i)); } for (int i = 0; i < deviceCredentialsUpdateMsg_.size(); i++) { output.writeMessage(4, deviceCredentialsUpdateMsg_.get(i)); } for (int i = 0; i < alarmUpdateMsg_.size(); i++) { output.writeMessage(5, alarmUpdateMsg_.get(i)); } for (int i = 0; i < relationUpdateMsg_.size(); i++) { output.writeMessage(6, relationUpdateMsg_.get(i)); } for (int i = 0; i < ruleChainMetadataRequestMsg_.size(); i++) { output.writeMessage(7, ruleChainMetadataRequestMsg_.get(i)); } for (int i = 0; i < attributesRequestMsg_.size(); i++) { output.writeMessage(8, attributesRequestMsg_.get(i)); } for (int i = 0; i < relationRequestMsg_.size(); i++) { output.writeMessage(9, relationRequestMsg_.get(i)); } for (int i = 0; i < userCredentialsRequestMsg_.size(); i++) { output.writeMessage(10, userCredentialsRequestMsg_.get(i)); } for (int i = 0; i < deviceCredentialsRequestMsg_.size(); i++) { output.writeMessage(11, deviceCredentialsRequestMsg_.get(i)); } for (int i = 0; i < deviceRpcCallMsg_.size(); i++) { output.writeMessage(12, deviceRpcCallMsg_.get(i)); } for (int i = 0; i < deviceProfileDevicesRequestMsg_.size(); i++) { output.writeMessage(13, deviceProfileDevicesRequestMsg_.get(i)); } for (int i = 0; i < widgetBundleTypesRequestMsg_.size(); i++) { output.writeMessage(14, widgetBundleTypesRequestMsg_.get(i)); } for (int i = 0; i < entityViewsRequestMsg_.size(); i++) { output.writeMessage(15, entityViewsRequestMsg_.get(i)); } unknownFields.writeTo(output); } @Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (uplinkMsgId_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, uplinkMsgId_); } for (int i = 0; i < entityData_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, entityData_.get(i)); } for (int i = 0; i < deviceUpdateMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, deviceUpdateMsg_.get(i)); } for (int i = 0; i < deviceCredentialsUpdateMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, deviceCredentialsUpdateMsg_.get(i)); } for (int i = 0; i < alarmUpdateMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, alarmUpdateMsg_.get(i)); } for (int i = 0; i < relationUpdateMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, relationUpdateMsg_.get(i)); } for (int i = 0; i < ruleChainMetadataRequestMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, ruleChainMetadataRequestMsg_.get(i)); } for (int i = 0; i < attributesRequestMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(8, attributesRequestMsg_.get(i)); } for (int i = 0; i < relationRequestMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(9, relationRequestMsg_.get(i)); } for (int i = 0; i < userCredentialsRequestMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(10, userCredentialsRequestMsg_.get(i)); } for (int i = 0; i < deviceCredentialsRequestMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(11, deviceCredentialsRequestMsg_.get(i)); } for (int i = 0; i < deviceRpcCallMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(12, deviceRpcCallMsg_.get(i)); } for (int i = 0; i < deviceProfileDevicesRequestMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(13, deviceProfileDevicesRequestMsg_.get(i)); } for (int i = 0; i < widgetBundleTypesRequestMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(14, widgetBundleTypesRequestMsg_.get(i)); } for (int i = 0; i < entityViewsRequestMsg_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(15, entityViewsRequestMsg_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @Override public boolean equals(final Object obj) { if (obj == this) { return true; } if (!(obj instanceof UplinkMsg)) { return super.equals(obj); } UplinkMsg other = (UplinkMsg) obj; if (getUplinkMsgId() != other.getUplinkMsgId()) return false; if (!getEntityDataList() .equals(other.getEntityDataList())) return false; if (!getDeviceUpdateMsgList() .equals(other.getDeviceUpdateMsgList())) return false; if (!getDeviceCredentialsUpdateMsgList() .equals(other.getDeviceCredentialsUpdateMsgList())) return false; if (!getAlarmUpdateMsgList() .equals(other.getAlarmUpdateMsgList())) return false; if (!getRelationUpdateMsgList() .equals(other.getRelationUpdateMsgList())) return false; if (!getRuleChainMetadataRequestMsgList() .equals(other.getRuleChainMetadataRequestMsgList())) return false; if (!getAttributesRequestMsgList() .equals(other.getAttributesRequestMsgList())) return false; if (!getRelationRequestMsgList() .equals(other.getRelationRequestMsgList())) return false; if (!getUserCredentialsRequestMsgList() .equals(other.getUserCredentialsRequestMsgList())) return false; if (!getDeviceCredentialsRequestMsgList() .equals(other.getDeviceCredentialsRequestMsgList())) return false; if (!getDeviceRpcCallMsgList() .equals(other.getDeviceRpcCallMsgList())) return false; if (!getDeviceProfileDevicesRequestMsgList() .equals(other.getDeviceProfileDevicesRequestMsgList())) return false; if (!getWidgetBundleTypesRequestMsgList() .equals(other.getWidgetBundleTypesRequestMsgList())) return false; if (!getEntityViewsRequestMsgList() .equals(other.getEntityViewsRequestMsgList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + UPLINKMSGID_FIELD_NUMBER; hash = (53 * hash) + getUplinkMsgId(); if (getEntityDataCount() > 0) { hash = (37 * hash) + ENTITYDATA_FIELD_NUMBER; hash = (53 * hash) + getEntityDataList().hashCode(); } if (getDeviceUpdateMsgCount() > 0) { hash = (37 * hash) + DEVICEUPDATEMSG_FIELD_NUMBER; hash = (53 * hash) + getDeviceUpdateMsgList().hashCode(); } if (getDeviceCredentialsUpdateMsgCount() > 0) { hash = (37 * hash) + DEVICECREDENTIALSUPDATEMSG_FIELD_NUMBER; hash = (53 * hash) + getDeviceCredentialsUpdateMsgList().hashCode(); } if (getAlarmUpdateMsgCount() > 0) { hash = (37 * hash) + ALARMUPDATEMSG_FIELD_NUMBER; hash = (53 * hash) + getAlarmUpdateMsgList().hashCode(); } if (getRelationUpdateMsgCount() > 0) { hash = (37 * hash) + RELATIONUPDATEMSG_FIELD_NUMBER; hash = (53 * hash) + getRelationUpdateMsgList().hashCode(); } if (getRuleChainMetadataRequestMsgCount() > 0) { hash = (37 * hash) + RULECHAINMETADATAREQUESTMSG_FIELD_NUMBER; hash = (53 * hash) + getRuleChainMetadataRequestMsgList().hashCode(); } if (getAttributesRequestMsgCount() > 0) { hash = (37 * hash) + ATTRIBUTESREQUESTMSG_FIELD_NUMBER; hash = (53 * hash) + getAttributesRequestMsgList().hashCode(); } if (getRelationRequestMsgCount() > 0) { hash = (37 * hash) + RELATIONREQUESTMSG_FIELD_NUMBER; hash = (53 * hash) + getRelationRequestMsgList().hashCode(); } if (getUserCredentialsRequestMsgCount() > 0) { hash = (37 * hash) + USERCREDENTIALSREQUESTMSG_FIELD_NUMBER; hash = (53 * hash) + getUserCredentialsRequestMsgList().hashCode(); } if (getDeviceCredentialsRequestMsgCount() > 0) { hash = (37 * hash) + DEVICECREDENTIALSREQUESTMSG_FIELD_NUMBER; hash = (53 * hash) + getDeviceCredentialsRequestMsgList().hashCode(); } if (getDeviceRpcCallMsgCount() > 0) { hash = (37 * hash) + DEVICERPCCALLMSG_FIELD_NUMBER; hash = (53 * hash) + getDeviceRpcCallMsgList().hashCode(); } if (getDeviceProfileDevicesRequestMsgCount() > 0) { hash = (37 * hash) + DEVICEPROFILEDEVICESREQUESTMSG_FIELD_NUMBER; hash = (53 * hash) + getDeviceProfileDevicesRequestMsgList().hashCode(); } if (getWidgetBundleTypesRequestMsgCount() > 0) { hash = (37 * hash) + WIDGETBUNDLETYPESREQUESTMSG_FIELD_NUMBER; hash = (53 * hash) + getWidgetBundleTypesRequestMsgList().hashCode(); } if (getEntityViewsRequestMsgCount() > 0) { hash = (37 * hash) + ENTITYVIEWSREQUESTMSG_FIELD_NUMBER; hash = (53 * hash) + getEntityViewsRequestMsgList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static UplinkMsg parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static UplinkMsg parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static UplinkMsg parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static UplinkMsg parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static UplinkMsg parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static UplinkMsg parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static UplinkMsg parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static UplinkMsg 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 UplinkMsg parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static UplinkMsg 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 UplinkMsg parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static UplinkMsg parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(UplinkMsg prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @Override protected Builder newBuilderForType( BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code edge.UplinkMsg} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:edge.UplinkMsg) UplinkMsgOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return EdgeProtos.internal_static_edge_UplinkMsg_descriptor; } @Override protected FieldAccessorTable internalGetFieldAccessorTable() { return EdgeProtos.internal_static_edge_UplinkMsg_fieldAccessorTable .ensureFieldAccessorsInitialized( UplinkMsg.class, Builder.class); } // Construct using UplinkMsg.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getEntityDataFieldBuilder(); getDeviceUpdateMsgFieldBuilder(); getDeviceCredentialsUpdateMsgFieldBuilder(); getAlarmUpdateMsgFieldBuilder(); getRelationUpdateMsgFieldBuilder(); getRuleChainMetadataRequestMsgFieldBuilder(); getAttributesRequestMsgFieldBuilder(); getRelationRequestMsgFieldBuilder(); getUserCredentialsRequestMsgFieldBuilder(); getDeviceCredentialsRequestMsgFieldBuilder(); getDeviceRpcCallMsgFieldBuilder(); getDeviceProfileDevicesRequestMsgFieldBuilder(); getWidgetBundleTypesRequestMsgFieldBuilder(); getEntityViewsRequestMsgFieldBuilder(); } } @Override public Builder clear() { super.clear(); uplinkMsgId_ = 0; if (entityDataBuilder_ == null) { entityData_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { entityDataBuilder_.clear(); } if (deviceUpdateMsgBuilder_ == null) { deviceUpdateMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); } else { deviceUpdateMsgBuilder_.clear(); } if (deviceCredentialsUpdateMsgBuilder_ == null) { deviceCredentialsUpdateMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { deviceCredentialsUpdateMsgBuilder_.clear(); } if (alarmUpdateMsgBuilder_ == null) { alarmUpdateMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); } else { alarmUpdateMsgBuilder_.clear(); } if (relationUpdateMsgBuilder_ == null) { relationUpdateMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); } else { relationUpdateMsgBuilder_.clear(); } if (ruleChainMetadataRequestMsgBuilder_ == null) { ruleChainMetadataRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); } else { ruleChainMetadataRequestMsgBuilder_.clear(); } if (attributesRequestMsgBuilder_ == null) { attributesRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000040); } else { attributesRequestMsgBuilder_.clear(); } if (relationRequestMsgBuilder_ == null) { relationRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000080); } else { relationRequestMsgBuilder_.clear(); } if (userCredentialsRequestMsgBuilder_ == null) { userCredentialsRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000100); } else { userCredentialsRequestMsgBuilder_.clear(); } if (deviceCredentialsRequestMsgBuilder_ == null) { deviceCredentialsRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000200); } else { deviceCredentialsRequestMsgBuilder_.clear(); } if (deviceRpcCallMsgBuilder_ == null) { deviceRpcCallMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000400); } else { deviceRpcCallMsgBuilder_.clear(); } if (deviceProfileDevicesRequestMsgBuilder_ == null) { deviceProfileDevicesRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000800); } else { deviceProfileDevicesRequestMsgBuilder_.clear(); } if (widgetBundleTypesRequestMsgBuilder_ == null) { widgetBundleTypesRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00001000); } else { widgetBundleTypesRequestMsgBuilder_.clear(); } if (entityViewsRequestMsgBuilder_ == null) { entityViewsRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00002000); } else { entityViewsRequestMsgBuilder_.clear(); } return this; } @Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return EdgeProtos.internal_static_edge_UplinkMsg_descriptor; } @Override public UplinkMsg getDefaultInstanceForType() { return UplinkMsg.getDefaultInstance(); } @Override public UplinkMsg build() { UplinkMsg result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @Override public UplinkMsg buildPartial() { UplinkMsg result = new UplinkMsg(this); int from_bitField0_ = bitField0_; result.uplinkMsgId_ = uplinkMsgId_; if (entityDataBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { entityData_ = java.util.Collections.unmodifiableList(entityData_); bitField0_ = (bitField0_ & ~0x00000001); } result.entityData_ = entityData_; } else { result.entityData_ = entityDataBuilder_.build(); } if (deviceUpdateMsgBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { deviceUpdateMsg_ = java.util.Collections.unmodifiableList(deviceUpdateMsg_); bitField0_ = (bitField0_ & ~0x00000002); } result.deviceUpdateMsg_ = deviceUpdateMsg_; } else { result.deviceUpdateMsg_ = deviceUpdateMsgBuilder_.build(); } if (deviceCredentialsUpdateMsgBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { deviceCredentialsUpdateMsg_ = java.util.Collections.unmodifiableList(deviceCredentialsUpdateMsg_); bitField0_ = (bitField0_ & ~0x00000004); } result.deviceCredentialsUpdateMsg_ = deviceCredentialsUpdateMsg_; } else { result.deviceCredentialsUpdateMsg_ = deviceCredentialsUpdateMsgBuilder_.build(); } if (alarmUpdateMsgBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0)) { alarmUpdateMsg_ = java.util.Collections.unmodifiableList(alarmUpdateMsg_); bitField0_ = (bitField0_ & ~0x00000008); } result.alarmUpdateMsg_ = alarmUpdateMsg_; } else { result.alarmUpdateMsg_ = alarmUpdateMsgBuilder_.build(); } if (relationUpdateMsgBuilder_ == null) { if (((bitField0_ & 0x00000010) != 0)) { relationUpdateMsg_ = java.util.Collections.unmodifiableList(relationUpdateMsg_); bitField0_ = (bitField0_ & ~0x00000010); } result.relationUpdateMsg_ = relationUpdateMsg_; } else { result.relationUpdateMsg_ = relationUpdateMsgBuilder_.build(); } if (ruleChainMetadataRequestMsgBuilder_ == null) { if (((bitField0_ & 0x00000020) != 0)) { ruleChainMetadataRequestMsg_ = java.util.Collections.unmodifiableList(ruleChainMetadataRequestMsg_); bitField0_ = (bitField0_ & ~0x00000020); } result.ruleChainMetadataRequestMsg_ = ruleChainMetadataRequestMsg_; } else { result.ruleChainMetadataRequestMsg_ = ruleChainMetadataRequestMsgBuilder_.build(); } if (attributesRequestMsgBuilder_ == null) { if (((bitField0_ & 0x00000040) != 0)) { attributesRequestMsg_ = java.util.Collections.unmodifiableList(attributesRequestMsg_); bitField0_ = (bitField0_ & ~0x00000040); } result.attributesRequestMsg_ = attributesRequestMsg_; } else { result.attributesRequestMsg_ = attributesRequestMsgBuilder_.build(); } if (relationRequestMsgBuilder_ == null) { if (((bitField0_ & 0x00000080) != 0)) { relationRequestMsg_ = java.util.Collections.unmodifiableList(relationRequestMsg_); bitField0_ = (bitField0_ & ~0x00000080); } result.relationRequestMsg_ = relationRequestMsg_; } else { result.relationRequestMsg_ = relationRequestMsgBuilder_.build(); } if (userCredentialsRequestMsgBuilder_ == null) { if (((bitField0_ & 0x00000100) != 0)) { userCredentialsRequestMsg_ = java.util.Collections.unmodifiableList(userCredentialsRequestMsg_); bitField0_ = (bitField0_ & ~0x00000100); } result.userCredentialsRequestMsg_ = userCredentialsRequestMsg_; } else { result.userCredentialsRequestMsg_ = userCredentialsRequestMsgBuilder_.build(); } if (deviceCredentialsRequestMsgBuilder_ == null) { if (((bitField0_ & 0x00000200) != 0)) { deviceCredentialsRequestMsg_ = java.util.Collections.unmodifiableList(deviceCredentialsRequestMsg_); bitField0_ = (bitField0_ & ~0x00000200); } result.deviceCredentialsRequestMsg_ = deviceCredentialsRequestMsg_; } else { result.deviceCredentialsRequestMsg_ = deviceCredentialsRequestMsgBuilder_.build(); } if (deviceRpcCallMsgBuilder_ == null) { if (((bitField0_ & 0x00000400) != 0)) { deviceRpcCallMsg_ = java.util.Collections.unmodifiableList(deviceRpcCallMsg_); bitField0_ = (bitField0_ & ~0x00000400); } result.deviceRpcCallMsg_ = deviceRpcCallMsg_; } else { result.deviceRpcCallMsg_ = deviceRpcCallMsgBuilder_.build(); } if (deviceProfileDevicesRequestMsgBuilder_ == null) { if (((bitField0_ & 0x00000800) != 0)) { deviceProfileDevicesRequestMsg_ = java.util.Collections.unmodifiableList(deviceProfileDevicesRequestMsg_); bitField0_ = (bitField0_ & ~0x00000800); } result.deviceProfileDevicesRequestMsg_ = deviceProfileDevicesRequestMsg_; } else { result.deviceProfileDevicesRequestMsg_ = deviceProfileDevicesRequestMsgBuilder_.build(); } if (widgetBundleTypesRequestMsgBuilder_ == null) { if (((bitField0_ & 0x00001000) != 0)) { widgetBundleTypesRequestMsg_ = java.util.Collections.unmodifiableList(widgetBundleTypesRequestMsg_); bitField0_ = (bitField0_ & ~0x00001000); } result.widgetBundleTypesRequestMsg_ = widgetBundleTypesRequestMsg_; } else { result.widgetBundleTypesRequestMsg_ = widgetBundleTypesRequestMsgBuilder_.build(); } if (entityViewsRequestMsgBuilder_ == null) { if (((bitField0_ & 0x00002000) != 0)) { entityViewsRequestMsg_ = java.util.Collections.unmodifiableList(entityViewsRequestMsg_); bitField0_ = (bitField0_ & ~0x00002000); } result.entityViewsRequestMsg_ = entityViewsRequestMsg_; } else { result.entityViewsRequestMsg_ = entityViewsRequestMsgBuilder_.build(); } onBuilt(); return result; } @Override public Builder clone() { return super.clone(); } @Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return super.setField(field, value); } @Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) { return super.setRepeatedField(field, index, value); } @Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return super.addRepeatedField(field, value); } @Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof UplinkMsg) { return mergeFrom((UplinkMsg)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(UplinkMsg other) { if (other == UplinkMsg.getDefaultInstance()) return this; if (other.getUplinkMsgId() != 0) { setUplinkMsgId(other.getUplinkMsgId()); } if (entityDataBuilder_ == null) { if (!other.entityData_.isEmpty()) { if (entityData_.isEmpty()) { entityData_ = other.entityData_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureEntityDataIsMutable(); entityData_.addAll(other.entityData_); } onChanged(); } } else { if (!other.entityData_.isEmpty()) { if (entityDataBuilder_.isEmpty()) { entityDataBuilder_.dispose(); entityDataBuilder_ = null; entityData_ = other.entityData_; bitField0_ = (bitField0_ & ~0x00000001); entityDataBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getEntityDataFieldBuilder() : null; } else { entityDataBuilder_.addAllMessages(other.entityData_); } } } if (deviceUpdateMsgBuilder_ == null) { if (!other.deviceUpdateMsg_.isEmpty()) { if (deviceUpdateMsg_.isEmpty()) { deviceUpdateMsg_ = other.deviceUpdateMsg_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureDeviceUpdateMsgIsMutable(); deviceUpdateMsg_.addAll(other.deviceUpdateMsg_); } onChanged(); } } else { if (!other.deviceUpdateMsg_.isEmpty()) { if (deviceUpdateMsgBuilder_.isEmpty()) { deviceUpdateMsgBuilder_.dispose(); deviceUpdateMsgBuilder_ = null; deviceUpdateMsg_ = other.deviceUpdateMsg_; bitField0_ = (bitField0_ & ~0x00000002); deviceUpdateMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDeviceUpdateMsgFieldBuilder() : null; } else { deviceUpdateMsgBuilder_.addAllMessages(other.deviceUpdateMsg_); } } } if (deviceCredentialsUpdateMsgBuilder_ == null) { if (!other.deviceCredentialsUpdateMsg_.isEmpty()) { if (deviceCredentialsUpdateMsg_.isEmpty()) { deviceCredentialsUpdateMsg_ = other.deviceCredentialsUpdateMsg_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureDeviceCredentialsUpdateMsgIsMutable(); deviceCredentialsUpdateMsg_.addAll(other.deviceCredentialsUpdateMsg_); } onChanged(); } } else { if (!other.deviceCredentialsUpdateMsg_.isEmpty()) { if (deviceCredentialsUpdateMsgBuilder_.isEmpty()) { deviceCredentialsUpdateMsgBuilder_.dispose(); deviceCredentialsUpdateMsgBuilder_ = null; deviceCredentialsUpdateMsg_ = other.deviceCredentialsUpdateMsg_; bitField0_ = (bitField0_ & ~0x00000004); deviceCredentialsUpdateMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDeviceCredentialsUpdateMsgFieldBuilder() : null; } else { deviceCredentialsUpdateMsgBuilder_.addAllMessages(other.deviceCredentialsUpdateMsg_); } } } if (alarmUpdateMsgBuilder_ == null) { if (!other.alarmUpdateMsg_.isEmpty()) { if (alarmUpdateMsg_.isEmpty()) { alarmUpdateMsg_ = other.alarmUpdateMsg_; bitField0_ = (bitField0_ & ~0x00000008); } else { ensureAlarmUpdateMsgIsMutable(); alarmUpdateMsg_.addAll(other.alarmUpdateMsg_); } onChanged(); } } else { if (!other.alarmUpdateMsg_.isEmpty()) { if (alarmUpdateMsgBuilder_.isEmpty()) { alarmUpdateMsgBuilder_.dispose(); alarmUpdateMsgBuilder_ = null; alarmUpdateMsg_ = other.alarmUpdateMsg_; bitField0_ = (bitField0_ & ~0x00000008); alarmUpdateMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getAlarmUpdateMsgFieldBuilder() : null; } else { alarmUpdateMsgBuilder_.addAllMessages(other.alarmUpdateMsg_); } } } if (relationUpdateMsgBuilder_ == null) { if (!other.relationUpdateMsg_.isEmpty()) { if (relationUpdateMsg_.isEmpty()) { relationUpdateMsg_ = other.relationUpdateMsg_; bitField0_ = (bitField0_ & ~0x00000010); } else { ensureRelationUpdateMsgIsMutable(); relationUpdateMsg_.addAll(other.relationUpdateMsg_); } onChanged(); } } else { if (!other.relationUpdateMsg_.isEmpty()) { if (relationUpdateMsgBuilder_.isEmpty()) { relationUpdateMsgBuilder_.dispose(); relationUpdateMsgBuilder_ = null; relationUpdateMsg_ = other.relationUpdateMsg_; bitField0_ = (bitField0_ & ~0x00000010); relationUpdateMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRelationUpdateMsgFieldBuilder() : null; } else { relationUpdateMsgBuilder_.addAllMessages(other.relationUpdateMsg_); } } } if (ruleChainMetadataRequestMsgBuilder_ == null) { if (!other.ruleChainMetadataRequestMsg_.isEmpty()) { if (ruleChainMetadataRequestMsg_.isEmpty()) { ruleChainMetadataRequestMsg_ = other.ruleChainMetadataRequestMsg_; bitField0_ = (bitField0_ & ~0x00000020); } else { ensureRuleChainMetadataRequestMsgIsMutable(); ruleChainMetadataRequestMsg_.addAll(other.ruleChainMetadataRequestMsg_); } onChanged(); } } else { if (!other.ruleChainMetadataRequestMsg_.isEmpty()) { if (ruleChainMetadataRequestMsgBuilder_.isEmpty()) { ruleChainMetadataRequestMsgBuilder_.dispose(); ruleChainMetadataRequestMsgBuilder_ = null; ruleChainMetadataRequestMsg_ = other.ruleChainMetadataRequestMsg_; bitField0_ = (bitField0_ & ~0x00000020); ruleChainMetadataRequestMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRuleChainMetadataRequestMsgFieldBuilder() : null; } else { ruleChainMetadataRequestMsgBuilder_.addAllMessages(other.ruleChainMetadataRequestMsg_); } } } if (attributesRequestMsgBuilder_ == null) { if (!other.attributesRequestMsg_.isEmpty()) { if (attributesRequestMsg_.isEmpty()) { attributesRequestMsg_ = other.attributesRequestMsg_; bitField0_ = (bitField0_ & ~0x00000040); } else { ensureAttributesRequestMsgIsMutable(); attributesRequestMsg_.addAll(other.attributesRequestMsg_); } onChanged(); } } else { if (!other.attributesRequestMsg_.isEmpty()) { if (attributesRequestMsgBuilder_.isEmpty()) { attributesRequestMsgBuilder_.dispose(); attributesRequestMsgBuilder_ = null; attributesRequestMsg_ = other.attributesRequestMsg_; bitField0_ = (bitField0_ & ~0x00000040); attributesRequestMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getAttributesRequestMsgFieldBuilder() : null; } else { attributesRequestMsgBuilder_.addAllMessages(other.attributesRequestMsg_); } } } if (relationRequestMsgBuilder_ == null) { if (!other.relationRequestMsg_.isEmpty()) { if (relationRequestMsg_.isEmpty()) { relationRequestMsg_ = other.relationRequestMsg_; bitField0_ = (bitField0_ & ~0x00000080); } else { ensureRelationRequestMsgIsMutable(); relationRequestMsg_.addAll(other.relationRequestMsg_); } onChanged(); } } else { if (!other.relationRequestMsg_.isEmpty()) { if (relationRequestMsgBuilder_.isEmpty()) { relationRequestMsgBuilder_.dispose(); relationRequestMsgBuilder_ = null; relationRequestMsg_ = other.relationRequestMsg_; bitField0_ = (bitField0_ & ~0x00000080); relationRequestMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRelationRequestMsgFieldBuilder() : null; } else { relationRequestMsgBuilder_.addAllMessages(other.relationRequestMsg_); } } } if (userCredentialsRequestMsgBuilder_ == null) { if (!other.userCredentialsRequestMsg_.isEmpty()) { if (userCredentialsRequestMsg_.isEmpty()) { userCredentialsRequestMsg_ = other.userCredentialsRequestMsg_; bitField0_ = (bitField0_ & ~0x00000100); } else { ensureUserCredentialsRequestMsgIsMutable(); userCredentialsRequestMsg_.addAll(other.userCredentialsRequestMsg_); } onChanged(); } } else { if (!other.userCredentialsRequestMsg_.isEmpty()) { if (userCredentialsRequestMsgBuilder_.isEmpty()) { userCredentialsRequestMsgBuilder_.dispose(); userCredentialsRequestMsgBuilder_ = null; userCredentialsRequestMsg_ = other.userCredentialsRequestMsg_; bitField0_ = (bitField0_ & ~0x00000100); userCredentialsRequestMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getUserCredentialsRequestMsgFieldBuilder() : null; } else { userCredentialsRequestMsgBuilder_.addAllMessages(other.userCredentialsRequestMsg_); } } } if (deviceCredentialsRequestMsgBuilder_ == null) { if (!other.deviceCredentialsRequestMsg_.isEmpty()) { if (deviceCredentialsRequestMsg_.isEmpty()) { deviceCredentialsRequestMsg_ = other.deviceCredentialsRequestMsg_; bitField0_ = (bitField0_ & ~0x00000200); } else { ensureDeviceCredentialsRequestMsgIsMutable(); deviceCredentialsRequestMsg_.addAll(other.deviceCredentialsRequestMsg_); } onChanged(); } } else { if (!other.deviceCredentialsRequestMsg_.isEmpty()) { if (deviceCredentialsRequestMsgBuilder_.isEmpty()) { deviceCredentialsRequestMsgBuilder_.dispose(); deviceCredentialsRequestMsgBuilder_ = null; deviceCredentialsRequestMsg_ = other.deviceCredentialsRequestMsg_; bitField0_ = (bitField0_ & ~0x00000200); deviceCredentialsRequestMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDeviceCredentialsRequestMsgFieldBuilder() : null; } else { deviceCredentialsRequestMsgBuilder_.addAllMessages(other.deviceCredentialsRequestMsg_); } } } if (deviceRpcCallMsgBuilder_ == null) { if (!other.deviceRpcCallMsg_.isEmpty()) { if (deviceRpcCallMsg_.isEmpty()) { deviceRpcCallMsg_ = other.deviceRpcCallMsg_; bitField0_ = (bitField0_ & ~0x00000400); } else { ensureDeviceRpcCallMsgIsMutable(); deviceRpcCallMsg_.addAll(other.deviceRpcCallMsg_); } onChanged(); } } else { if (!other.deviceRpcCallMsg_.isEmpty()) { if (deviceRpcCallMsgBuilder_.isEmpty()) { deviceRpcCallMsgBuilder_.dispose(); deviceRpcCallMsgBuilder_ = null; deviceRpcCallMsg_ = other.deviceRpcCallMsg_; bitField0_ = (bitField0_ & ~0x00000400); deviceRpcCallMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDeviceRpcCallMsgFieldBuilder() : null; } else { deviceRpcCallMsgBuilder_.addAllMessages(other.deviceRpcCallMsg_); } } } if (deviceProfileDevicesRequestMsgBuilder_ == null) { if (!other.deviceProfileDevicesRequestMsg_.isEmpty()) { if (deviceProfileDevicesRequestMsg_.isEmpty()) { deviceProfileDevicesRequestMsg_ = other.deviceProfileDevicesRequestMsg_; bitField0_ = (bitField0_ & ~0x00000800); } else { ensureDeviceProfileDevicesRequestMsgIsMutable(); deviceProfileDevicesRequestMsg_.addAll(other.deviceProfileDevicesRequestMsg_); } onChanged(); } } else { if (!other.deviceProfileDevicesRequestMsg_.isEmpty()) { if (deviceProfileDevicesRequestMsgBuilder_.isEmpty()) { deviceProfileDevicesRequestMsgBuilder_.dispose(); deviceProfileDevicesRequestMsgBuilder_ = null; deviceProfileDevicesRequestMsg_ = other.deviceProfileDevicesRequestMsg_; bitField0_ = (bitField0_ & ~0x00000800); deviceProfileDevicesRequestMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDeviceProfileDevicesRequestMsgFieldBuilder() : null; } else { deviceProfileDevicesRequestMsgBuilder_.addAllMessages(other.deviceProfileDevicesRequestMsg_); } } } if (widgetBundleTypesRequestMsgBuilder_ == null) { if (!other.widgetBundleTypesRequestMsg_.isEmpty()) { if (widgetBundleTypesRequestMsg_.isEmpty()) { widgetBundleTypesRequestMsg_ = other.widgetBundleTypesRequestMsg_; bitField0_ = (bitField0_ & ~0x00001000); } else { ensureWidgetBundleTypesRequestMsgIsMutable(); widgetBundleTypesRequestMsg_.addAll(other.widgetBundleTypesRequestMsg_); } onChanged(); } } else { if (!other.widgetBundleTypesRequestMsg_.isEmpty()) { if (widgetBundleTypesRequestMsgBuilder_.isEmpty()) { widgetBundleTypesRequestMsgBuilder_.dispose(); widgetBundleTypesRequestMsgBuilder_ = null; widgetBundleTypesRequestMsg_ = other.widgetBundleTypesRequestMsg_; bitField0_ = (bitField0_ & ~0x00001000); widgetBundleTypesRequestMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getWidgetBundleTypesRequestMsgFieldBuilder() : null; } else { widgetBundleTypesRequestMsgBuilder_.addAllMessages(other.widgetBundleTypesRequestMsg_); } } } if (entityViewsRequestMsgBuilder_ == null) { if (!other.entityViewsRequestMsg_.isEmpty()) { if (entityViewsRequestMsg_.isEmpty()) { entityViewsRequestMsg_ = other.entityViewsRequestMsg_; bitField0_ = (bitField0_ & ~0x00002000); } else { ensureEntityViewsRequestMsgIsMutable(); entityViewsRequestMsg_.addAll(other.entityViewsRequestMsg_); } onChanged(); } } else { if (!other.entityViewsRequestMsg_.isEmpty()) { if (entityViewsRequestMsgBuilder_.isEmpty()) { entityViewsRequestMsgBuilder_.dispose(); entityViewsRequestMsgBuilder_ = null; entityViewsRequestMsg_ = other.entityViewsRequestMsg_; bitField0_ = (bitField0_ & ~0x00002000); entityViewsRequestMsgBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getEntityViewsRequestMsgFieldBuilder() : null; } else { entityViewsRequestMsgBuilder_.addAllMessages(other.entityViewsRequestMsg_); } } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @Override public final boolean isInitialized() { return true; } @Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { UplinkMsg parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (UplinkMsg) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private int uplinkMsgId_ ; /** * <code>int32 uplinkMsgId = 1;</code> * @return The uplinkMsgId. */ @Override public int getUplinkMsgId() { return uplinkMsgId_; } /** * <code>int32 uplinkMsgId = 1;</code> * @param value The uplinkMsgId to set. * @return This builder for chaining. */ public Builder setUplinkMsgId(int value) { uplinkMsgId_ = value; onChanged(); return this; } /** * <code>int32 uplinkMsgId = 1;</code> * @return This builder for chaining. */ public Builder clearUplinkMsgId() { uplinkMsgId_ = 0; onChanged(); return this; } private java.util.List<EntityDataProto> entityData_ = java.util.Collections.emptyList(); private void ensureEntityDataIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { entityData_ = new java.util.ArrayList<EntityDataProto>(entityData_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< EntityDataProto, EntityDataProto.Builder, EntityDataProtoOrBuilder> entityDataBuilder_; /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public java.util.List<EntityDataProto> getEntityDataList() { if (entityDataBuilder_ == null) { return java.util.Collections.unmodifiableList(entityData_); } else { return entityDataBuilder_.getMessageList(); } } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public int getEntityDataCount() { if (entityDataBuilder_ == null) { return entityData_.size(); } else { return entityDataBuilder_.getCount(); } } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public EntityDataProto getEntityData(int index) { if (entityDataBuilder_ == null) { return entityData_.get(index); } else { return entityDataBuilder_.getMessage(index); } } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder setEntityData( int index, EntityDataProto value) { if (entityDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureEntityDataIsMutable(); entityData_.set(index, value); onChanged(); } else { entityDataBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder setEntityData( int index, EntityDataProto.Builder builderForValue) { if (entityDataBuilder_ == null) { ensureEntityDataIsMutable(); entityData_.set(index, builderForValue.build()); onChanged(); } else { entityDataBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder addEntityData(EntityDataProto value) { if (entityDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureEntityDataIsMutable(); entityData_.add(value); onChanged(); } else { entityDataBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder addEntityData( int index, EntityDataProto value) { if (entityDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureEntityDataIsMutable(); entityData_.add(index, value); onChanged(); } else { entityDataBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder addEntityData( EntityDataProto.Builder builderForValue) { if (entityDataBuilder_ == null) { ensureEntityDataIsMutable(); entityData_.add(builderForValue.build()); onChanged(); } else { entityDataBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder addEntityData( int index, EntityDataProto.Builder builderForValue) { if (entityDataBuilder_ == null) { ensureEntityDataIsMutable(); entityData_.add(index, builderForValue.build()); onChanged(); } else { entityDataBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder addAllEntityData( Iterable<? extends EntityDataProto> values) { if (entityDataBuilder_ == null) { ensureEntityDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, entityData_); onChanged(); } else { entityDataBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder clearEntityData() { if (entityDataBuilder_ == null) { entityData_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { entityDataBuilder_.clear(); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public Builder removeEntityData(int index) { if (entityDataBuilder_ == null) { ensureEntityDataIsMutable(); entityData_.remove(index); onChanged(); } else { entityDataBuilder_.remove(index); } return this; } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public EntityDataProto.Builder getEntityDataBuilder( int index) { return getEntityDataFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public EntityDataProtoOrBuilder getEntityDataOrBuilder( int index) { if (entityDataBuilder_ == null) { return entityData_.get(index); } else { return entityDataBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public java.util.List<? extends EntityDataProtoOrBuilder> getEntityDataOrBuilderList() { if (entityDataBuilder_ != null) { return entityDataBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(entityData_); } } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public EntityDataProto.Builder addEntityDataBuilder() { return getEntityDataFieldBuilder().addBuilder( EntityDataProto.getDefaultInstance()); } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public EntityDataProto.Builder addEntityDataBuilder( int index) { return getEntityDataFieldBuilder().addBuilder( index, EntityDataProto.getDefaultInstance()); } /** * <code>repeated .edge.EntityDataProto entityData = 2;</code> */ public java.util.List<EntityDataProto.Builder> getEntityDataBuilderList() { return getEntityDataFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< EntityDataProto, EntityDataProto.Builder, EntityDataProtoOrBuilder> getEntityDataFieldBuilder() { if (entityDataBuilder_ == null) { entityDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< EntityDataProto, EntityDataProto.Builder, EntityDataProtoOrBuilder>( entityData_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); entityData_ = null; } return entityDataBuilder_; } private java.util.List<DeviceUpdateMsg> deviceUpdateMsg_ = java.util.Collections.emptyList(); private void ensureDeviceUpdateMsgIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { deviceUpdateMsg_ = new java.util.ArrayList<DeviceUpdateMsg>(deviceUpdateMsg_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceUpdateMsg, DeviceUpdateMsg.Builder, DeviceUpdateMsgOrBuilder> deviceUpdateMsgBuilder_; /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public java.util.List<DeviceUpdateMsg> getDeviceUpdateMsgList() { if (deviceUpdateMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(deviceUpdateMsg_); } else { return deviceUpdateMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public int getDeviceUpdateMsgCount() { if (deviceUpdateMsgBuilder_ == null) { return deviceUpdateMsg_.size(); } else { return deviceUpdateMsgBuilder_.getCount(); } } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public DeviceUpdateMsg getDeviceUpdateMsg(int index) { if (deviceUpdateMsgBuilder_ == null) { return deviceUpdateMsg_.get(index); } else { return deviceUpdateMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder setDeviceUpdateMsg( int index, DeviceUpdateMsg value) { if (deviceUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceUpdateMsgIsMutable(); deviceUpdateMsg_.set(index, value); onChanged(); } else { deviceUpdateMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder setDeviceUpdateMsg( int index, DeviceUpdateMsg.Builder builderForValue) { if (deviceUpdateMsgBuilder_ == null) { ensureDeviceUpdateMsgIsMutable(); deviceUpdateMsg_.set(index, builderForValue.build()); onChanged(); } else { deviceUpdateMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder addDeviceUpdateMsg(DeviceUpdateMsg value) { if (deviceUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceUpdateMsgIsMutable(); deviceUpdateMsg_.add(value); onChanged(); } else { deviceUpdateMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder addDeviceUpdateMsg( int index, DeviceUpdateMsg value) { if (deviceUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceUpdateMsgIsMutable(); deviceUpdateMsg_.add(index, value); onChanged(); } else { deviceUpdateMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder addDeviceUpdateMsg( DeviceUpdateMsg.Builder builderForValue) { if (deviceUpdateMsgBuilder_ == null) { ensureDeviceUpdateMsgIsMutable(); deviceUpdateMsg_.add(builderForValue.build()); onChanged(); } else { deviceUpdateMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder addDeviceUpdateMsg( int index, DeviceUpdateMsg.Builder builderForValue) { if (deviceUpdateMsgBuilder_ == null) { ensureDeviceUpdateMsgIsMutable(); deviceUpdateMsg_.add(index, builderForValue.build()); onChanged(); } else { deviceUpdateMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder addAllDeviceUpdateMsg( Iterable<? extends DeviceUpdateMsg> values) { if (deviceUpdateMsgBuilder_ == null) { ensureDeviceUpdateMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, deviceUpdateMsg_); onChanged(); } else { deviceUpdateMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder clearDeviceUpdateMsg() { if (deviceUpdateMsgBuilder_ == null) { deviceUpdateMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { deviceUpdateMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public Builder removeDeviceUpdateMsg(int index) { if (deviceUpdateMsgBuilder_ == null) { ensureDeviceUpdateMsgIsMutable(); deviceUpdateMsg_.remove(index); onChanged(); } else { deviceUpdateMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public DeviceUpdateMsg.Builder getDeviceUpdateMsgBuilder( int index) { return getDeviceUpdateMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public DeviceUpdateMsgOrBuilder getDeviceUpdateMsgOrBuilder( int index) { if (deviceUpdateMsgBuilder_ == null) { return deviceUpdateMsg_.get(index); } else { return deviceUpdateMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public java.util.List<? extends DeviceUpdateMsgOrBuilder> getDeviceUpdateMsgOrBuilderList() { if (deviceUpdateMsgBuilder_ != null) { return deviceUpdateMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(deviceUpdateMsg_); } } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public DeviceUpdateMsg.Builder addDeviceUpdateMsgBuilder() { return getDeviceUpdateMsgFieldBuilder().addBuilder( DeviceUpdateMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public DeviceUpdateMsg.Builder addDeviceUpdateMsgBuilder( int index) { return getDeviceUpdateMsgFieldBuilder().addBuilder( index, DeviceUpdateMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceUpdateMsg deviceUpdateMsg = 3;</code> */ public java.util.List<DeviceUpdateMsg.Builder> getDeviceUpdateMsgBuilderList() { return getDeviceUpdateMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceUpdateMsg, DeviceUpdateMsg.Builder, DeviceUpdateMsgOrBuilder> getDeviceUpdateMsgFieldBuilder() { if (deviceUpdateMsgBuilder_ == null) { deviceUpdateMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< DeviceUpdateMsg, DeviceUpdateMsg.Builder, DeviceUpdateMsgOrBuilder>( deviceUpdateMsg_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); deviceUpdateMsg_ = null; } return deviceUpdateMsgBuilder_; } private java.util.List<DeviceCredentialsUpdateMsg> deviceCredentialsUpdateMsg_ = java.util.Collections.emptyList(); private void ensureDeviceCredentialsUpdateMsgIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { deviceCredentialsUpdateMsg_ = new java.util.ArrayList<DeviceCredentialsUpdateMsg>(deviceCredentialsUpdateMsg_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceCredentialsUpdateMsg, DeviceCredentialsUpdateMsg.Builder, DeviceCredentialsUpdateMsgOrBuilder> deviceCredentialsUpdateMsgBuilder_; /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public java.util.List<DeviceCredentialsUpdateMsg> getDeviceCredentialsUpdateMsgList() { if (deviceCredentialsUpdateMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(deviceCredentialsUpdateMsg_); } else { return deviceCredentialsUpdateMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public int getDeviceCredentialsUpdateMsgCount() { if (deviceCredentialsUpdateMsgBuilder_ == null) { return deviceCredentialsUpdateMsg_.size(); } else { return deviceCredentialsUpdateMsgBuilder_.getCount(); } } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public DeviceCredentialsUpdateMsg getDeviceCredentialsUpdateMsg(int index) { if (deviceCredentialsUpdateMsgBuilder_ == null) { return deviceCredentialsUpdateMsg_.get(index); } else { return deviceCredentialsUpdateMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder setDeviceCredentialsUpdateMsg( int index, DeviceCredentialsUpdateMsg value) { if (deviceCredentialsUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceCredentialsUpdateMsgIsMutable(); deviceCredentialsUpdateMsg_.set(index, value); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder setDeviceCredentialsUpdateMsg( int index, DeviceCredentialsUpdateMsg.Builder builderForValue) { if (deviceCredentialsUpdateMsgBuilder_ == null) { ensureDeviceCredentialsUpdateMsgIsMutable(); deviceCredentialsUpdateMsg_.set(index, builderForValue.build()); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder addDeviceCredentialsUpdateMsg(DeviceCredentialsUpdateMsg value) { if (deviceCredentialsUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceCredentialsUpdateMsgIsMutable(); deviceCredentialsUpdateMsg_.add(value); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder addDeviceCredentialsUpdateMsg( int index, DeviceCredentialsUpdateMsg value) { if (deviceCredentialsUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceCredentialsUpdateMsgIsMutable(); deviceCredentialsUpdateMsg_.add(index, value); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder addDeviceCredentialsUpdateMsg( DeviceCredentialsUpdateMsg.Builder builderForValue) { if (deviceCredentialsUpdateMsgBuilder_ == null) { ensureDeviceCredentialsUpdateMsgIsMutable(); deviceCredentialsUpdateMsg_.add(builderForValue.build()); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder addDeviceCredentialsUpdateMsg( int index, DeviceCredentialsUpdateMsg.Builder builderForValue) { if (deviceCredentialsUpdateMsgBuilder_ == null) { ensureDeviceCredentialsUpdateMsgIsMutable(); deviceCredentialsUpdateMsg_.add(index, builderForValue.build()); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder addAllDeviceCredentialsUpdateMsg( Iterable<? extends DeviceCredentialsUpdateMsg> values) { if (deviceCredentialsUpdateMsgBuilder_ == null) { ensureDeviceCredentialsUpdateMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, deviceCredentialsUpdateMsg_); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder clearDeviceCredentialsUpdateMsg() { if (deviceCredentialsUpdateMsgBuilder_ == null) { deviceCredentialsUpdateMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public Builder removeDeviceCredentialsUpdateMsg(int index) { if (deviceCredentialsUpdateMsgBuilder_ == null) { ensureDeviceCredentialsUpdateMsgIsMutable(); deviceCredentialsUpdateMsg_.remove(index); onChanged(); } else { deviceCredentialsUpdateMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public DeviceCredentialsUpdateMsg.Builder getDeviceCredentialsUpdateMsgBuilder( int index) { return getDeviceCredentialsUpdateMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public DeviceCredentialsUpdateMsgOrBuilder getDeviceCredentialsUpdateMsgOrBuilder( int index) { if (deviceCredentialsUpdateMsgBuilder_ == null) { return deviceCredentialsUpdateMsg_.get(index); } else { return deviceCredentialsUpdateMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public java.util.List<? extends DeviceCredentialsUpdateMsgOrBuilder> getDeviceCredentialsUpdateMsgOrBuilderList() { if (deviceCredentialsUpdateMsgBuilder_ != null) { return deviceCredentialsUpdateMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(deviceCredentialsUpdateMsg_); } } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public DeviceCredentialsUpdateMsg.Builder addDeviceCredentialsUpdateMsgBuilder() { return getDeviceCredentialsUpdateMsgFieldBuilder().addBuilder( DeviceCredentialsUpdateMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public DeviceCredentialsUpdateMsg.Builder addDeviceCredentialsUpdateMsgBuilder( int index) { return getDeviceCredentialsUpdateMsgFieldBuilder().addBuilder( index, DeviceCredentialsUpdateMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = 4;</code> */ public java.util.List<DeviceCredentialsUpdateMsg.Builder> getDeviceCredentialsUpdateMsgBuilderList() { return getDeviceCredentialsUpdateMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceCredentialsUpdateMsg, DeviceCredentialsUpdateMsg.Builder, DeviceCredentialsUpdateMsgOrBuilder> getDeviceCredentialsUpdateMsgFieldBuilder() { if (deviceCredentialsUpdateMsgBuilder_ == null) { deviceCredentialsUpdateMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< DeviceCredentialsUpdateMsg, DeviceCredentialsUpdateMsg.Builder, DeviceCredentialsUpdateMsgOrBuilder>( deviceCredentialsUpdateMsg_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); deviceCredentialsUpdateMsg_ = null; } return deviceCredentialsUpdateMsgBuilder_; } private java.util.List<AlarmUpdateMsg> alarmUpdateMsg_ = java.util.Collections.emptyList(); private void ensureAlarmUpdateMsgIsMutable() { if (!((bitField0_ & 0x00000008) != 0)) { alarmUpdateMsg_ = new java.util.ArrayList<AlarmUpdateMsg>(alarmUpdateMsg_); bitField0_ |= 0x00000008; } } private com.google.protobuf.RepeatedFieldBuilderV3< AlarmUpdateMsg, AlarmUpdateMsg.Builder, AlarmUpdateMsgOrBuilder> alarmUpdateMsgBuilder_; /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public java.util.List<AlarmUpdateMsg> getAlarmUpdateMsgList() { if (alarmUpdateMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(alarmUpdateMsg_); } else { return alarmUpdateMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public int getAlarmUpdateMsgCount() { if (alarmUpdateMsgBuilder_ == null) { return alarmUpdateMsg_.size(); } else { return alarmUpdateMsgBuilder_.getCount(); } } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public AlarmUpdateMsg getAlarmUpdateMsg(int index) { if (alarmUpdateMsgBuilder_ == null) { return alarmUpdateMsg_.get(index); } else { return alarmUpdateMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder setAlarmUpdateMsg( int index, AlarmUpdateMsg value) { if (alarmUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAlarmUpdateMsgIsMutable(); alarmUpdateMsg_.set(index, value); onChanged(); } else { alarmUpdateMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder setAlarmUpdateMsg( int index, AlarmUpdateMsg.Builder builderForValue) { if (alarmUpdateMsgBuilder_ == null) { ensureAlarmUpdateMsgIsMutable(); alarmUpdateMsg_.set(index, builderForValue.build()); onChanged(); } else { alarmUpdateMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder addAlarmUpdateMsg(AlarmUpdateMsg value) { if (alarmUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAlarmUpdateMsgIsMutable(); alarmUpdateMsg_.add(value); onChanged(); } else { alarmUpdateMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder addAlarmUpdateMsg( int index, AlarmUpdateMsg value) { if (alarmUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAlarmUpdateMsgIsMutable(); alarmUpdateMsg_.add(index, value); onChanged(); } else { alarmUpdateMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder addAlarmUpdateMsg( AlarmUpdateMsg.Builder builderForValue) { if (alarmUpdateMsgBuilder_ == null) { ensureAlarmUpdateMsgIsMutable(); alarmUpdateMsg_.add(builderForValue.build()); onChanged(); } else { alarmUpdateMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder addAlarmUpdateMsg( int index, AlarmUpdateMsg.Builder builderForValue) { if (alarmUpdateMsgBuilder_ == null) { ensureAlarmUpdateMsgIsMutable(); alarmUpdateMsg_.add(index, builderForValue.build()); onChanged(); } else { alarmUpdateMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder addAllAlarmUpdateMsg( Iterable<? extends AlarmUpdateMsg> values) { if (alarmUpdateMsgBuilder_ == null) { ensureAlarmUpdateMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, alarmUpdateMsg_); onChanged(); } else { alarmUpdateMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder clearAlarmUpdateMsg() { if (alarmUpdateMsgBuilder_ == null) { alarmUpdateMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { alarmUpdateMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public Builder removeAlarmUpdateMsg(int index) { if (alarmUpdateMsgBuilder_ == null) { ensureAlarmUpdateMsgIsMutable(); alarmUpdateMsg_.remove(index); onChanged(); } else { alarmUpdateMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public AlarmUpdateMsg.Builder getAlarmUpdateMsgBuilder( int index) { return getAlarmUpdateMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public AlarmUpdateMsgOrBuilder getAlarmUpdateMsgOrBuilder( int index) { if (alarmUpdateMsgBuilder_ == null) { return alarmUpdateMsg_.get(index); } else { return alarmUpdateMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public java.util.List<? extends AlarmUpdateMsgOrBuilder> getAlarmUpdateMsgOrBuilderList() { if (alarmUpdateMsgBuilder_ != null) { return alarmUpdateMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(alarmUpdateMsg_); } } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public AlarmUpdateMsg.Builder addAlarmUpdateMsgBuilder() { return getAlarmUpdateMsgFieldBuilder().addBuilder( AlarmUpdateMsg.getDefaultInstance()); } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public AlarmUpdateMsg.Builder addAlarmUpdateMsgBuilder( int index) { return getAlarmUpdateMsgFieldBuilder().addBuilder( index, AlarmUpdateMsg.getDefaultInstance()); } /** * <code>repeated .edge.AlarmUpdateMsg alarmUpdateMsg = 5;</code> */ public java.util.List<AlarmUpdateMsg.Builder> getAlarmUpdateMsgBuilderList() { return getAlarmUpdateMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< AlarmUpdateMsg, AlarmUpdateMsg.Builder, AlarmUpdateMsgOrBuilder> getAlarmUpdateMsgFieldBuilder() { if (alarmUpdateMsgBuilder_ == null) { alarmUpdateMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< AlarmUpdateMsg, AlarmUpdateMsg.Builder, AlarmUpdateMsgOrBuilder>( alarmUpdateMsg_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); alarmUpdateMsg_ = null; } return alarmUpdateMsgBuilder_; } private java.util.List<RelationUpdateMsg> relationUpdateMsg_ = java.util.Collections.emptyList(); private void ensureRelationUpdateMsgIsMutable() { if (!((bitField0_ & 0x00000010) != 0)) { relationUpdateMsg_ = new java.util.ArrayList<RelationUpdateMsg>(relationUpdateMsg_); bitField0_ |= 0x00000010; } } private com.google.protobuf.RepeatedFieldBuilderV3< RelationUpdateMsg, RelationUpdateMsg.Builder, RelationUpdateMsgOrBuilder> relationUpdateMsgBuilder_; /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public java.util.List<RelationUpdateMsg> getRelationUpdateMsgList() { if (relationUpdateMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(relationUpdateMsg_); } else { return relationUpdateMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public int getRelationUpdateMsgCount() { if (relationUpdateMsgBuilder_ == null) { return relationUpdateMsg_.size(); } else { return relationUpdateMsgBuilder_.getCount(); } } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public RelationUpdateMsg getRelationUpdateMsg(int index) { if (relationUpdateMsgBuilder_ == null) { return relationUpdateMsg_.get(index); } else { return relationUpdateMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder setRelationUpdateMsg( int index, RelationUpdateMsg value) { if (relationUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRelationUpdateMsgIsMutable(); relationUpdateMsg_.set(index, value); onChanged(); } else { relationUpdateMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder setRelationUpdateMsg( int index, RelationUpdateMsg.Builder builderForValue) { if (relationUpdateMsgBuilder_ == null) { ensureRelationUpdateMsgIsMutable(); relationUpdateMsg_.set(index, builderForValue.build()); onChanged(); } else { relationUpdateMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder addRelationUpdateMsg(RelationUpdateMsg value) { if (relationUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRelationUpdateMsgIsMutable(); relationUpdateMsg_.add(value); onChanged(); } else { relationUpdateMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder addRelationUpdateMsg( int index, RelationUpdateMsg value) { if (relationUpdateMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRelationUpdateMsgIsMutable(); relationUpdateMsg_.add(index, value); onChanged(); } else { relationUpdateMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder addRelationUpdateMsg( RelationUpdateMsg.Builder builderForValue) { if (relationUpdateMsgBuilder_ == null) { ensureRelationUpdateMsgIsMutable(); relationUpdateMsg_.add(builderForValue.build()); onChanged(); } else { relationUpdateMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder addRelationUpdateMsg( int index, RelationUpdateMsg.Builder builderForValue) { if (relationUpdateMsgBuilder_ == null) { ensureRelationUpdateMsgIsMutable(); relationUpdateMsg_.add(index, builderForValue.build()); onChanged(); } else { relationUpdateMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder addAllRelationUpdateMsg( Iterable<? extends RelationUpdateMsg> values) { if (relationUpdateMsgBuilder_ == null) { ensureRelationUpdateMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, relationUpdateMsg_); onChanged(); } else { relationUpdateMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder clearRelationUpdateMsg() { if (relationUpdateMsgBuilder_ == null) { relationUpdateMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { relationUpdateMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public Builder removeRelationUpdateMsg(int index) { if (relationUpdateMsgBuilder_ == null) { ensureRelationUpdateMsgIsMutable(); relationUpdateMsg_.remove(index); onChanged(); } else { relationUpdateMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public RelationUpdateMsg.Builder getRelationUpdateMsgBuilder( int index) { return getRelationUpdateMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public RelationUpdateMsgOrBuilder getRelationUpdateMsgOrBuilder( int index) { if (relationUpdateMsgBuilder_ == null) { return relationUpdateMsg_.get(index); } else { return relationUpdateMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public java.util.List<? extends RelationUpdateMsgOrBuilder> getRelationUpdateMsgOrBuilderList() { if (relationUpdateMsgBuilder_ != null) { return relationUpdateMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(relationUpdateMsg_); } } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public RelationUpdateMsg.Builder addRelationUpdateMsgBuilder() { return getRelationUpdateMsgFieldBuilder().addBuilder( RelationUpdateMsg.getDefaultInstance()); } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public RelationUpdateMsg.Builder addRelationUpdateMsgBuilder( int index) { return getRelationUpdateMsgFieldBuilder().addBuilder( index, RelationUpdateMsg.getDefaultInstance()); } /** * <code>repeated .edge.RelationUpdateMsg relationUpdateMsg = 6;</code> */ public java.util.List<RelationUpdateMsg.Builder> getRelationUpdateMsgBuilderList() { return getRelationUpdateMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< RelationUpdateMsg, RelationUpdateMsg.Builder, RelationUpdateMsgOrBuilder> getRelationUpdateMsgFieldBuilder() { if (relationUpdateMsgBuilder_ == null) { relationUpdateMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< RelationUpdateMsg, RelationUpdateMsg.Builder, RelationUpdateMsgOrBuilder>( relationUpdateMsg_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); relationUpdateMsg_ = null; } return relationUpdateMsgBuilder_; } private java.util.List<RuleChainMetadataRequestMsg> ruleChainMetadataRequestMsg_ = java.util.Collections.emptyList(); private void ensureRuleChainMetadataRequestMsgIsMutable() { if (!((bitField0_ & 0x00000020) != 0)) { ruleChainMetadataRequestMsg_ = new java.util.ArrayList<RuleChainMetadataRequestMsg>(ruleChainMetadataRequestMsg_); bitField0_ |= 0x00000020; } } private com.google.protobuf.RepeatedFieldBuilderV3< RuleChainMetadataRequestMsg, RuleChainMetadataRequestMsg.Builder, RuleChainMetadataRequestMsgOrBuilder> ruleChainMetadataRequestMsgBuilder_; /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public java.util.List<RuleChainMetadataRequestMsg> getRuleChainMetadataRequestMsgList() { if (ruleChainMetadataRequestMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(ruleChainMetadataRequestMsg_); } else { return ruleChainMetadataRequestMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public int getRuleChainMetadataRequestMsgCount() { if (ruleChainMetadataRequestMsgBuilder_ == null) { return ruleChainMetadataRequestMsg_.size(); } else { return ruleChainMetadataRequestMsgBuilder_.getCount(); } } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public RuleChainMetadataRequestMsg getRuleChainMetadataRequestMsg(int index) { if (ruleChainMetadataRequestMsgBuilder_ == null) { return ruleChainMetadataRequestMsg_.get(index); } else { return ruleChainMetadataRequestMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder setRuleChainMetadataRequestMsg( int index, RuleChainMetadataRequestMsg value) { if (ruleChainMetadataRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRuleChainMetadataRequestMsgIsMutable(); ruleChainMetadataRequestMsg_.set(index, value); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder setRuleChainMetadataRequestMsg( int index, RuleChainMetadataRequestMsg.Builder builderForValue) { if (ruleChainMetadataRequestMsgBuilder_ == null) { ensureRuleChainMetadataRequestMsgIsMutable(); ruleChainMetadataRequestMsg_.set(index, builderForValue.build()); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder addRuleChainMetadataRequestMsg(RuleChainMetadataRequestMsg value) { if (ruleChainMetadataRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRuleChainMetadataRequestMsgIsMutable(); ruleChainMetadataRequestMsg_.add(value); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder addRuleChainMetadataRequestMsg( int index, RuleChainMetadataRequestMsg value) { if (ruleChainMetadataRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRuleChainMetadataRequestMsgIsMutable(); ruleChainMetadataRequestMsg_.add(index, value); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder addRuleChainMetadataRequestMsg( RuleChainMetadataRequestMsg.Builder builderForValue) { if (ruleChainMetadataRequestMsgBuilder_ == null) { ensureRuleChainMetadataRequestMsgIsMutable(); ruleChainMetadataRequestMsg_.add(builderForValue.build()); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder addRuleChainMetadataRequestMsg( int index, RuleChainMetadataRequestMsg.Builder builderForValue) { if (ruleChainMetadataRequestMsgBuilder_ == null) { ensureRuleChainMetadataRequestMsgIsMutable(); ruleChainMetadataRequestMsg_.add(index, builderForValue.build()); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder addAllRuleChainMetadataRequestMsg( Iterable<? extends RuleChainMetadataRequestMsg> values) { if (ruleChainMetadataRequestMsgBuilder_ == null) { ensureRuleChainMetadataRequestMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, ruleChainMetadataRequestMsg_); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder clearRuleChainMetadataRequestMsg() { if (ruleChainMetadataRequestMsgBuilder_ == null) { ruleChainMetadataRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public Builder removeRuleChainMetadataRequestMsg(int index) { if (ruleChainMetadataRequestMsgBuilder_ == null) { ensureRuleChainMetadataRequestMsgIsMutable(); ruleChainMetadataRequestMsg_.remove(index); onChanged(); } else { ruleChainMetadataRequestMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public RuleChainMetadataRequestMsg.Builder getRuleChainMetadataRequestMsgBuilder( int index) { return getRuleChainMetadataRequestMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public RuleChainMetadataRequestMsgOrBuilder getRuleChainMetadataRequestMsgOrBuilder( int index) { if (ruleChainMetadataRequestMsgBuilder_ == null) { return ruleChainMetadataRequestMsg_.get(index); } else { return ruleChainMetadataRequestMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public java.util.List<? extends RuleChainMetadataRequestMsgOrBuilder> getRuleChainMetadataRequestMsgOrBuilderList() { if (ruleChainMetadataRequestMsgBuilder_ != null) { return ruleChainMetadataRequestMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(ruleChainMetadataRequestMsg_); } } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public RuleChainMetadataRequestMsg.Builder addRuleChainMetadataRequestMsgBuilder() { return getRuleChainMetadataRequestMsgFieldBuilder().addBuilder( RuleChainMetadataRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public RuleChainMetadataRequestMsg.Builder addRuleChainMetadataRequestMsgBuilder( int index) { return getRuleChainMetadataRequestMsgFieldBuilder().addBuilder( index, RuleChainMetadataRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.RuleChainMetadataRequestMsg ruleChainMetadataRequestMsg = 7;</code> */ public java.util.List<RuleChainMetadataRequestMsg.Builder> getRuleChainMetadataRequestMsgBuilderList() { return getRuleChainMetadataRequestMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< RuleChainMetadataRequestMsg, RuleChainMetadataRequestMsg.Builder, RuleChainMetadataRequestMsgOrBuilder> getRuleChainMetadataRequestMsgFieldBuilder() { if (ruleChainMetadataRequestMsgBuilder_ == null) { ruleChainMetadataRequestMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< RuleChainMetadataRequestMsg, RuleChainMetadataRequestMsg.Builder, RuleChainMetadataRequestMsgOrBuilder>( ruleChainMetadataRequestMsg_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); ruleChainMetadataRequestMsg_ = null; } return ruleChainMetadataRequestMsgBuilder_; } private java.util.List<AttributesRequestMsg> attributesRequestMsg_ = java.util.Collections.emptyList(); private void ensureAttributesRequestMsgIsMutable() { if (!((bitField0_ & 0x00000040) != 0)) { attributesRequestMsg_ = new java.util.ArrayList<AttributesRequestMsg>(attributesRequestMsg_); bitField0_ |= 0x00000040; } } private com.google.protobuf.RepeatedFieldBuilderV3< AttributesRequestMsg, AttributesRequestMsg.Builder, AttributesRequestMsgOrBuilder> attributesRequestMsgBuilder_; /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public java.util.List<AttributesRequestMsg> getAttributesRequestMsgList() { if (attributesRequestMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(attributesRequestMsg_); } else { return attributesRequestMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public int getAttributesRequestMsgCount() { if (attributesRequestMsgBuilder_ == null) { return attributesRequestMsg_.size(); } else { return attributesRequestMsgBuilder_.getCount(); } } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public AttributesRequestMsg getAttributesRequestMsg(int index) { if (attributesRequestMsgBuilder_ == null) { return attributesRequestMsg_.get(index); } else { return attributesRequestMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder setAttributesRequestMsg( int index, AttributesRequestMsg value) { if (attributesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAttributesRequestMsgIsMutable(); attributesRequestMsg_.set(index, value); onChanged(); } else { attributesRequestMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder setAttributesRequestMsg( int index, AttributesRequestMsg.Builder builderForValue) { if (attributesRequestMsgBuilder_ == null) { ensureAttributesRequestMsgIsMutable(); attributesRequestMsg_.set(index, builderForValue.build()); onChanged(); } else { attributesRequestMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder addAttributesRequestMsg(AttributesRequestMsg value) { if (attributesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAttributesRequestMsgIsMutable(); attributesRequestMsg_.add(value); onChanged(); } else { attributesRequestMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder addAttributesRequestMsg( int index, AttributesRequestMsg value) { if (attributesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAttributesRequestMsgIsMutable(); attributesRequestMsg_.add(index, value); onChanged(); } else { attributesRequestMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder addAttributesRequestMsg( AttributesRequestMsg.Builder builderForValue) { if (attributesRequestMsgBuilder_ == null) { ensureAttributesRequestMsgIsMutable(); attributesRequestMsg_.add(builderForValue.build()); onChanged(); } else { attributesRequestMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder addAttributesRequestMsg( int index, AttributesRequestMsg.Builder builderForValue) { if (attributesRequestMsgBuilder_ == null) { ensureAttributesRequestMsgIsMutable(); attributesRequestMsg_.add(index, builderForValue.build()); onChanged(); } else { attributesRequestMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder addAllAttributesRequestMsg( Iterable<? extends AttributesRequestMsg> values) { if (attributesRequestMsgBuilder_ == null) { ensureAttributesRequestMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, attributesRequestMsg_); onChanged(); } else { attributesRequestMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder clearAttributesRequestMsg() { if (attributesRequestMsgBuilder_ == null) { attributesRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000040); onChanged(); } else { attributesRequestMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public Builder removeAttributesRequestMsg(int index) { if (attributesRequestMsgBuilder_ == null) { ensureAttributesRequestMsgIsMutable(); attributesRequestMsg_.remove(index); onChanged(); } else { attributesRequestMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public AttributesRequestMsg.Builder getAttributesRequestMsgBuilder( int index) { return getAttributesRequestMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public AttributesRequestMsgOrBuilder getAttributesRequestMsgOrBuilder( int index) { if (attributesRequestMsgBuilder_ == null) { return attributesRequestMsg_.get(index); } else { return attributesRequestMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public java.util.List<? extends AttributesRequestMsgOrBuilder> getAttributesRequestMsgOrBuilderList() { if (attributesRequestMsgBuilder_ != null) { return attributesRequestMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(attributesRequestMsg_); } } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public AttributesRequestMsg.Builder addAttributesRequestMsgBuilder() { return getAttributesRequestMsgFieldBuilder().addBuilder( AttributesRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public AttributesRequestMsg.Builder addAttributesRequestMsgBuilder( int index) { return getAttributesRequestMsgFieldBuilder().addBuilder( index, AttributesRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.AttributesRequestMsg attributesRequestMsg = 8;</code> */ public java.util.List<AttributesRequestMsg.Builder> getAttributesRequestMsgBuilderList() { return getAttributesRequestMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< AttributesRequestMsg, AttributesRequestMsg.Builder, AttributesRequestMsgOrBuilder> getAttributesRequestMsgFieldBuilder() { if (attributesRequestMsgBuilder_ == null) { attributesRequestMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< AttributesRequestMsg, AttributesRequestMsg.Builder, AttributesRequestMsgOrBuilder>( attributesRequestMsg_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); attributesRequestMsg_ = null; } return attributesRequestMsgBuilder_; } private java.util.List<RelationRequestMsg> relationRequestMsg_ = java.util.Collections.emptyList(); private void ensureRelationRequestMsgIsMutable() { if (!((bitField0_ & 0x00000080) != 0)) { relationRequestMsg_ = new java.util.ArrayList<RelationRequestMsg>(relationRequestMsg_); bitField0_ |= 0x00000080; } } private com.google.protobuf.RepeatedFieldBuilderV3< RelationRequestMsg, RelationRequestMsg.Builder, RelationRequestMsgOrBuilder> relationRequestMsgBuilder_; /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public java.util.List<RelationRequestMsg> getRelationRequestMsgList() { if (relationRequestMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(relationRequestMsg_); } else { return relationRequestMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public int getRelationRequestMsgCount() { if (relationRequestMsgBuilder_ == null) { return relationRequestMsg_.size(); } else { return relationRequestMsgBuilder_.getCount(); } } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public RelationRequestMsg getRelationRequestMsg(int index) { if (relationRequestMsgBuilder_ == null) { return relationRequestMsg_.get(index); } else { return relationRequestMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder setRelationRequestMsg( int index, RelationRequestMsg value) { if (relationRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRelationRequestMsgIsMutable(); relationRequestMsg_.set(index, value); onChanged(); } else { relationRequestMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder setRelationRequestMsg( int index, RelationRequestMsg.Builder builderForValue) { if (relationRequestMsgBuilder_ == null) { ensureRelationRequestMsgIsMutable(); relationRequestMsg_.set(index, builderForValue.build()); onChanged(); } else { relationRequestMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder addRelationRequestMsg(RelationRequestMsg value) { if (relationRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRelationRequestMsgIsMutable(); relationRequestMsg_.add(value); onChanged(); } else { relationRequestMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder addRelationRequestMsg( int index, RelationRequestMsg value) { if (relationRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRelationRequestMsgIsMutable(); relationRequestMsg_.add(index, value); onChanged(); } else { relationRequestMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder addRelationRequestMsg( RelationRequestMsg.Builder builderForValue) { if (relationRequestMsgBuilder_ == null) { ensureRelationRequestMsgIsMutable(); relationRequestMsg_.add(builderForValue.build()); onChanged(); } else { relationRequestMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder addRelationRequestMsg( int index, RelationRequestMsg.Builder builderForValue) { if (relationRequestMsgBuilder_ == null) { ensureRelationRequestMsgIsMutable(); relationRequestMsg_.add(index, builderForValue.build()); onChanged(); } else { relationRequestMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder addAllRelationRequestMsg( Iterable<? extends RelationRequestMsg> values) { if (relationRequestMsgBuilder_ == null) { ensureRelationRequestMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, relationRequestMsg_); onChanged(); } else { relationRequestMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder clearRelationRequestMsg() { if (relationRequestMsgBuilder_ == null) { relationRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000080); onChanged(); } else { relationRequestMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public Builder removeRelationRequestMsg(int index) { if (relationRequestMsgBuilder_ == null) { ensureRelationRequestMsgIsMutable(); relationRequestMsg_.remove(index); onChanged(); } else { relationRequestMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public RelationRequestMsg.Builder getRelationRequestMsgBuilder( int index) { return getRelationRequestMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public RelationRequestMsgOrBuilder getRelationRequestMsgOrBuilder( int index) { if (relationRequestMsgBuilder_ == null) { return relationRequestMsg_.get(index); } else { return relationRequestMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public java.util.List<? extends RelationRequestMsgOrBuilder> getRelationRequestMsgOrBuilderList() { if (relationRequestMsgBuilder_ != null) { return relationRequestMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(relationRequestMsg_); } } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public RelationRequestMsg.Builder addRelationRequestMsgBuilder() { return getRelationRequestMsgFieldBuilder().addBuilder( RelationRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public RelationRequestMsg.Builder addRelationRequestMsgBuilder( int index) { return getRelationRequestMsgFieldBuilder().addBuilder( index, RelationRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.RelationRequestMsg relationRequestMsg = 9;</code> */ public java.util.List<RelationRequestMsg.Builder> getRelationRequestMsgBuilderList() { return getRelationRequestMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< RelationRequestMsg, RelationRequestMsg.Builder, RelationRequestMsgOrBuilder> getRelationRequestMsgFieldBuilder() { if (relationRequestMsgBuilder_ == null) { relationRequestMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< RelationRequestMsg, RelationRequestMsg.Builder, RelationRequestMsgOrBuilder>( relationRequestMsg_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); relationRequestMsg_ = null; } return relationRequestMsgBuilder_; } private java.util.List<UserCredentialsRequestMsg> userCredentialsRequestMsg_ = java.util.Collections.emptyList(); private void ensureUserCredentialsRequestMsgIsMutable() { if (!((bitField0_ & 0x00000100) != 0)) { userCredentialsRequestMsg_ = new java.util.ArrayList<UserCredentialsRequestMsg>(userCredentialsRequestMsg_); bitField0_ |= 0x00000100; } } private com.google.protobuf.RepeatedFieldBuilderV3< UserCredentialsRequestMsg, UserCredentialsRequestMsg.Builder, UserCredentialsRequestMsgOrBuilder> userCredentialsRequestMsgBuilder_; /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public java.util.List<UserCredentialsRequestMsg> getUserCredentialsRequestMsgList() { if (userCredentialsRequestMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(userCredentialsRequestMsg_); } else { return userCredentialsRequestMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public int getUserCredentialsRequestMsgCount() { if (userCredentialsRequestMsgBuilder_ == null) { return userCredentialsRequestMsg_.size(); } else { return userCredentialsRequestMsgBuilder_.getCount(); } } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public UserCredentialsRequestMsg getUserCredentialsRequestMsg(int index) { if (userCredentialsRequestMsgBuilder_ == null) { return userCredentialsRequestMsg_.get(index); } else { return userCredentialsRequestMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder setUserCredentialsRequestMsg( int index, UserCredentialsRequestMsg value) { if (userCredentialsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureUserCredentialsRequestMsgIsMutable(); userCredentialsRequestMsg_.set(index, value); onChanged(); } else { userCredentialsRequestMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder setUserCredentialsRequestMsg( int index, UserCredentialsRequestMsg.Builder builderForValue) { if (userCredentialsRequestMsgBuilder_ == null) { ensureUserCredentialsRequestMsgIsMutable(); userCredentialsRequestMsg_.set(index, builderForValue.build()); onChanged(); } else { userCredentialsRequestMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder addUserCredentialsRequestMsg(UserCredentialsRequestMsg value) { if (userCredentialsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureUserCredentialsRequestMsgIsMutable(); userCredentialsRequestMsg_.add(value); onChanged(); } else { userCredentialsRequestMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder addUserCredentialsRequestMsg( int index, UserCredentialsRequestMsg value) { if (userCredentialsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureUserCredentialsRequestMsgIsMutable(); userCredentialsRequestMsg_.add(index, value); onChanged(); } else { userCredentialsRequestMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder addUserCredentialsRequestMsg( UserCredentialsRequestMsg.Builder builderForValue) { if (userCredentialsRequestMsgBuilder_ == null) { ensureUserCredentialsRequestMsgIsMutable(); userCredentialsRequestMsg_.add(builderForValue.build()); onChanged(); } else { userCredentialsRequestMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder addUserCredentialsRequestMsg( int index, UserCredentialsRequestMsg.Builder builderForValue) { if (userCredentialsRequestMsgBuilder_ == null) { ensureUserCredentialsRequestMsgIsMutable(); userCredentialsRequestMsg_.add(index, builderForValue.build()); onChanged(); } else { userCredentialsRequestMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder addAllUserCredentialsRequestMsg( Iterable<? extends UserCredentialsRequestMsg> values) { if (userCredentialsRequestMsgBuilder_ == null) { ensureUserCredentialsRequestMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, userCredentialsRequestMsg_); onChanged(); } else { userCredentialsRequestMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder clearUserCredentialsRequestMsg() { if (userCredentialsRequestMsgBuilder_ == null) { userCredentialsRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000100); onChanged(); } else { userCredentialsRequestMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public Builder removeUserCredentialsRequestMsg(int index) { if (userCredentialsRequestMsgBuilder_ == null) { ensureUserCredentialsRequestMsgIsMutable(); userCredentialsRequestMsg_.remove(index); onChanged(); } else { userCredentialsRequestMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public UserCredentialsRequestMsg.Builder getUserCredentialsRequestMsgBuilder( int index) { return getUserCredentialsRequestMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public UserCredentialsRequestMsgOrBuilder getUserCredentialsRequestMsgOrBuilder( int index) { if (userCredentialsRequestMsgBuilder_ == null) { return userCredentialsRequestMsg_.get(index); } else { return userCredentialsRequestMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public java.util.List<? extends UserCredentialsRequestMsgOrBuilder> getUserCredentialsRequestMsgOrBuilderList() { if (userCredentialsRequestMsgBuilder_ != null) { return userCredentialsRequestMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(userCredentialsRequestMsg_); } } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public UserCredentialsRequestMsg.Builder addUserCredentialsRequestMsgBuilder() { return getUserCredentialsRequestMsgFieldBuilder().addBuilder( UserCredentialsRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public UserCredentialsRequestMsg.Builder addUserCredentialsRequestMsgBuilder( int index) { return getUserCredentialsRequestMsgFieldBuilder().addBuilder( index, UserCredentialsRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.UserCredentialsRequestMsg userCredentialsRequestMsg = 10;</code> */ public java.util.List<UserCredentialsRequestMsg.Builder> getUserCredentialsRequestMsgBuilderList() { return getUserCredentialsRequestMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< UserCredentialsRequestMsg, UserCredentialsRequestMsg.Builder, UserCredentialsRequestMsgOrBuilder> getUserCredentialsRequestMsgFieldBuilder() { if (userCredentialsRequestMsgBuilder_ == null) { userCredentialsRequestMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< UserCredentialsRequestMsg, UserCredentialsRequestMsg.Builder, UserCredentialsRequestMsgOrBuilder>( userCredentialsRequestMsg_, ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean()); userCredentialsRequestMsg_ = null; } return userCredentialsRequestMsgBuilder_; } private java.util.List<DeviceCredentialsRequestMsg> deviceCredentialsRequestMsg_ = java.util.Collections.emptyList(); private void ensureDeviceCredentialsRequestMsgIsMutable() { if (!((bitField0_ & 0x00000200) != 0)) { deviceCredentialsRequestMsg_ = new java.util.ArrayList<DeviceCredentialsRequestMsg>(deviceCredentialsRequestMsg_); bitField0_ |= 0x00000200; } } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceCredentialsRequestMsg, DeviceCredentialsRequestMsg.Builder, DeviceCredentialsRequestMsgOrBuilder> deviceCredentialsRequestMsgBuilder_; /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public java.util.List<DeviceCredentialsRequestMsg> getDeviceCredentialsRequestMsgList() { if (deviceCredentialsRequestMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(deviceCredentialsRequestMsg_); } else { return deviceCredentialsRequestMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public int getDeviceCredentialsRequestMsgCount() { if (deviceCredentialsRequestMsgBuilder_ == null) { return deviceCredentialsRequestMsg_.size(); } else { return deviceCredentialsRequestMsgBuilder_.getCount(); } } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public DeviceCredentialsRequestMsg getDeviceCredentialsRequestMsg(int index) { if (deviceCredentialsRequestMsgBuilder_ == null) { return deviceCredentialsRequestMsg_.get(index); } else { return deviceCredentialsRequestMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder setDeviceCredentialsRequestMsg( int index, DeviceCredentialsRequestMsg value) { if (deviceCredentialsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceCredentialsRequestMsgIsMutable(); deviceCredentialsRequestMsg_.set(index, value); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder setDeviceCredentialsRequestMsg( int index, DeviceCredentialsRequestMsg.Builder builderForValue) { if (deviceCredentialsRequestMsgBuilder_ == null) { ensureDeviceCredentialsRequestMsgIsMutable(); deviceCredentialsRequestMsg_.set(index, builderForValue.build()); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder addDeviceCredentialsRequestMsg(DeviceCredentialsRequestMsg value) { if (deviceCredentialsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceCredentialsRequestMsgIsMutable(); deviceCredentialsRequestMsg_.add(value); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder addDeviceCredentialsRequestMsg( int index, DeviceCredentialsRequestMsg value) { if (deviceCredentialsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceCredentialsRequestMsgIsMutable(); deviceCredentialsRequestMsg_.add(index, value); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder addDeviceCredentialsRequestMsg( DeviceCredentialsRequestMsg.Builder builderForValue) { if (deviceCredentialsRequestMsgBuilder_ == null) { ensureDeviceCredentialsRequestMsgIsMutable(); deviceCredentialsRequestMsg_.add(builderForValue.build()); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder addDeviceCredentialsRequestMsg( int index, DeviceCredentialsRequestMsg.Builder builderForValue) { if (deviceCredentialsRequestMsgBuilder_ == null) { ensureDeviceCredentialsRequestMsgIsMutable(); deviceCredentialsRequestMsg_.add(index, builderForValue.build()); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder addAllDeviceCredentialsRequestMsg( Iterable<? extends DeviceCredentialsRequestMsg> values) { if (deviceCredentialsRequestMsgBuilder_ == null) { ensureDeviceCredentialsRequestMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, deviceCredentialsRequestMsg_); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder clearDeviceCredentialsRequestMsg() { if (deviceCredentialsRequestMsgBuilder_ == null) { deviceCredentialsRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000200); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public Builder removeDeviceCredentialsRequestMsg(int index) { if (deviceCredentialsRequestMsgBuilder_ == null) { ensureDeviceCredentialsRequestMsgIsMutable(); deviceCredentialsRequestMsg_.remove(index); onChanged(); } else { deviceCredentialsRequestMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public DeviceCredentialsRequestMsg.Builder getDeviceCredentialsRequestMsgBuilder( int index) { return getDeviceCredentialsRequestMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public DeviceCredentialsRequestMsgOrBuilder getDeviceCredentialsRequestMsgOrBuilder( int index) { if (deviceCredentialsRequestMsgBuilder_ == null) { return deviceCredentialsRequestMsg_.get(index); } else { return deviceCredentialsRequestMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public java.util.List<? extends DeviceCredentialsRequestMsgOrBuilder> getDeviceCredentialsRequestMsgOrBuilderList() { if (deviceCredentialsRequestMsgBuilder_ != null) { return deviceCredentialsRequestMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(deviceCredentialsRequestMsg_); } } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public DeviceCredentialsRequestMsg.Builder addDeviceCredentialsRequestMsgBuilder() { return getDeviceCredentialsRequestMsgFieldBuilder().addBuilder( DeviceCredentialsRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public DeviceCredentialsRequestMsg.Builder addDeviceCredentialsRequestMsgBuilder( int index) { return getDeviceCredentialsRequestMsgFieldBuilder().addBuilder( index, DeviceCredentialsRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = 11;</code> */ public java.util.List<DeviceCredentialsRequestMsg.Builder> getDeviceCredentialsRequestMsgBuilderList() { return getDeviceCredentialsRequestMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceCredentialsRequestMsg, DeviceCredentialsRequestMsg.Builder, DeviceCredentialsRequestMsgOrBuilder> getDeviceCredentialsRequestMsgFieldBuilder() { if (deviceCredentialsRequestMsgBuilder_ == null) { deviceCredentialsRequestMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< DeviceCredentialsRequestMsg, DeviceCredentialsRequestMsg.Builder, DeviceCredentialsRequestMsgOrBuilder>( deviceCredentialsRequestMsg_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); deviceCredentialsRequestMsg_ = null; } return deviceCredentialsRequestMsgBuilder_; } private java.util.List<DeviceRpcCallMsg> deviceRpcCallMsg_ = java.util.Collections.emptyList(); private void ensureDeviceRpcCallMsgIsMutable() { if (!((bitField0_ & 0x00000400) != 0)) { deviceRpcCallMsg_ = new java.util.ArrayList<DeviceRpcCallMsg>(deviceRpcCallMsg_); bitField0_ |= 0x00000400; } } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceRpcCallMsg, DeviceRpcCallMsg.Builder, DeviceRpcCallMsgOrBuilder> deviceRpcCallMsgBuilder_; /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public java.util.List<DeviceRpcCallMsg> getDeviceRpcCallMsgList() { if (deviceRpcCallMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(deviceRpcCallMsg_); } else { return deviceRpcCallMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public int getDeviceRpcCallMsgCount() { if (deviceRpcCallMsgBuilder_ == null) { return deviceRpcCallMsg_.size(); } else { return deviceRpcCallMsgBuilder_.getCount(); } } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public DeviceRpcCallMsg getDeviceRpcCallMsg(int index) { if (deviceRpcCallMsgBuilder_ == null) { return deviceRpcCallMsg_.get(index); } else { return deviceRpcCallMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder setDeviceRpcCallMsg( int index, DeviceRpcCallMsg value) { if (deviceRpcCallMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceRpcCallMsgIsMutable(); deviceRpcCallMsg_.set(index, value); onChanged(); } else { deviceRpcCallMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder setDeviceRpcCallMsg( int index, DeviceRpcCallMsg.Builder builderForValue) { if (deviceRpcCallMsgBuilder_ == null) { ensureDeviceRpcCallMsgIsMutable(); deviceRpcCallMsg_.set(index, builderForValue.build()); onChanged(); } else { deviceRpcCallMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder addDeviceRpcCallMsg(DeviceRpcCallMsg value) { if (deviceRpcCallMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceRpcCallMsgIsMutable(); deviceRpcCallMsg_.add(value); onChanged(); } else { deviceRpcCallMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder addDeviceRpcCallMsg( int index, DeviceRpcCallMsg value) { if (deviceRpcCallMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceRpcCallMsgIsMutable(); deviceRpcCallMsg_.add(index, value); onChanged(); } else { deviceRpcCallMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder addDeviceRpcCallMsg( DeviceRpcCallMsg.Builder builderForValue) { if (deviceRpcCallMsgBuilder_ == null) { ensureDeviceRpcCallMsgIsMutable(); deviceRpcCallMsg_.add(builderForValue.build()); onChanged(); } else { deviceRpcCallMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder addDeviceRpcCallMsg( int index, DeviceRpcCallMsg.Builder builderForValue) { if (deviceRpcCallMsgBuilder_ == null) { ensureDeviceRpcCallMsgIsMutable(); deviceRpcCallMsg_.add(index, builderForValue.build()); onChanged(); } else { deviceRpcCallMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder addAllDeviceRpcCallMsg( Iterable<? extends DeviceRpcCallMsg> values) { if (deviceRpcCallMsgBuilder_ == null) { ensureDeviceRpcCallMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, deviceRpcCallMsg_); onChanged(); } else { deviceRpcCallMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder clearDeviceRpcCallMsg() { if (deviceRpcCallMsgBuilder_ == null) { deviceRpcCallMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000400); onChanged(); } else { deviceRpcCallMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public Builder removeDeviceRpcCallMsg(int index) { if (deviceRpcCallMsgBuilder_ == null) { ensureDeviceRpcCallMsgIsMutable(); deviceRpcCallMsg_.remove(index); onChanged(); } else { deviceRpcCallMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public DeviceRpcCallMsg.Builder getDeviceRpcCallMsgBuilder( int index) { return getDeviceRpcCallMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public DeviceRpcCallMsgOrBuilder getDeviceRpcCallMsgOrBuilder( int index) { if (deviceRpcCallMsgBuilder_ == null) { return deviceRpcCallMsg_.get(index); } else { return deviceRpcCallMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public java.util.List<? extends DeviceRpcCallMsgOrBuilder> getDeviceRpcCallMsgOrBuilderList() { if (deviceRpcCallMsgBuilder_ != null) { return deviceRpcCallMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(deviceRpcCallMsg_); } } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public DeviceRpcCallMsg.Builder addDeviceRpcCallMsgBuilder() { return getDeviceRpcCallMsgFieldBuilder().addBuilder( DeviceRpcCallMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public DeviceRpcCallMsg.Builder addDeviceRpcCallMsgBuilder( int index) { return getDeviceRpcCallMsgFieldBuilder().addBuilder( index, DeviceRpcCallMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceRpcCallMsg deviceRpcCallMsg = 12;</code> */ public java.util.List<DeviceRpcCallMsg.Builder> getDeviceRpcCallMsgBuilderList() { return getDeviceRpcCallMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceRpcCallMsg, DeviceRpcCallMsg.Builder, DeviceRpcCallMsgOrBuilder> getDeviceRpcCallMsgFieldBuilder() { if (deviceRpcCallMsgBuilder_ == null) { deviceRpcCallMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< DeviceRpcCallMsg, DeviceRpcCallMsg.Builder, DeviceRpcCallMsgOrBuilder>( deviceRpcCallMsg_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); deviceRpcCallMsg_ = null; } return deviceRpcCallMsgBuilder_; } private java.util.List<DeviceProfileDevicesRequestMsg> deviceProfileDevicesRequestMsg_ = java.util.Collections.emptyList(); private void ensureDeviceProfileDevicesRequestMsgIsMutable() { if (!((bitField0_ & 0x00000800) != 0)) { deviceProfileDevicesRequestMsg_ = new java.util.ArrayList<DeviceProfileDevicesRequestMsg>(deviceProfileDevicesRequestMsg_); bitField0_ |= 0x00000800; } } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceProfileDevicesRequestMsg, DeviceProfileDevicesRequestMsg.Builder, DeviceProfileDevicesRequestMsgOrBuilder> deviceProfileDevicesRequestMsgBuilder_; /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public java.util.List<DeviceProfileDevicesRequestMsg> getDeviceProfileDevicesRequestMsgList() { if (deviceProfileDevicesRequestMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(deviceProfileDevicesRequestMsg_); } else { return deviceProfileDevicesRequestMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public int getDeviceProfileDevicesRequestMsgCount() { if (deviceProfileDevicesRequestMsgBuilder_ == null) { return deviceProfileDevicesRequestMsg_.size(); } else { return deviceProfileDevicesRequestMsgBuilder_.getCount(); } } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public DeviceProfileDevicesRequestMsg getDeviceProfileDevicesRequestMsg(int index) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { return deviceProfileDevicesRequestMsg_.get(index); } else { return deviceProfileDevicesRequestMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder setDeviceProfileDevicesRequestMsg( int index, DeviceProfileDevicesRequestMsg value) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceProfileDevicesRequestMsgIsMutable(); deviceProfileDevicesRequestMsg_.set(index, value); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder setDeviceProfileDevicesRequestMsg( int index, DeviceProfileDevicesRequestMsg.Builder builderForValue) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { ensureDeviceProfileDevicesRequestMsgIsMutable(); deviceProfileDevicesRequestMsg_.set(index, builderForValue.build()); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder addDeviceProfileDevicesRequestMsg(DeviceProfileDevicesRequestMsg value) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceProfileDevicesRequestMsgIsMutable(); deviceProfileDevicesRequestMsg_.add(value); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder addDeviceProfileDevicesRequestMsg( int index, DeviceProfileDevicesRequestMsg value) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDeviceProfileDevicesRequestMsgIsMutable(); deviceProfileDevicesRequestMsg_.add(index, value); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder addDeviceProfileDevicesRequestMsg( DeviceProfileDevicesRequestMsg.Builder builderForValue) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { ensureDeviceProfileDevicesRequestMsgIsMutable(); deviceProfileDevicesRequestMsg_.add(builderForValue.build()); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder addDeviceProfileDevicesRequestMsg( int index, DeviceProfileDevicesRequestMsg.Builder builderForValue) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { ensureDeviceProfileDevicesRequestMsgIsMutable(); deviceProfileDevicesRequestMsg_.add(index, builderForValue.build()); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder addAllDeviceProfileDevicesRequestMsg( Iterable<? extends DeviceProfileDevicesRequestMsg> values) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { ensureDeviceProfileDevicesRequestMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, deviceProfileDevicesRequestMsg_); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder clearDeviceProfileDevicesRequestMsg() { if (deviceProfileDevicesRequestMsgBuilder_ == null) { deviceProfileDevicesRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000800); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public Builder removeDeviceProfileDevicesRequestMsg(int index) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { ensureDeviceProfileDevicesRequestMsgIsMutable(); deviceProfileDevicesRequestMsg_.remove(index); onChanged(); } else { deviceProfileDevicesRequestMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public DeviceProfileDevicesRequestMsg.Builder getDeviceProfileDevicesRequestMsgBuilder( int index) { return getDeviceProfileDevicesRequestMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public DeviceProfileDevicesRequestMsgOrBuilder getDeviceProfileDevicesRequestMsgOrBuilder( int index) { if (deviceProfileDevicesRequestMsgBuilder_ == null) { return deviceProfileDevicesRequestMsg_.get(index); } else { return deviceProfileDevicesRequestMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public java.util.List<? extends DeviceProfileDevicesRequestMsgOrBuilder> getDeviceProfileDevicesRequestMsgOrBuilderList() { if (deviceProfileDevicesRequestMsgBuilder_ != null) { return deviceProfileDevicesRequestMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(deviceProfileDevicesRequestMsg_); } } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public DeviceProfileDevicesRequestMsg.Builder addDeviceProfileDevicesRequestMsgBuilder() { return getDeviceProfileDevicesRequestMsgFieldBuilder().addBuilder( DeviceProfileDevicesRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public DeviceProfileDevicesRequestMsg.Builder addDeviceProfileDevicesRequestMsgBuilder( int index) { return getDeviceProfileDevicesRequestMsgFieldBuilder().addBuilder( index, DeviceProfileDevicesRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.DeviceProfileDevicesRequestMsg deviceProfileDevicesRequestMsg = 13;</code> */ public java.util.List<DeviceProfileDevicesRequestMsg.Builder> getDeviceProfileDevicesRequestMsgBuilderList() { return getDeviceProfileDevicesRequestMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< DeviceProfileDevicesRequestMsg, DeviceProfileDevicesRequestMsg.Builder, DeviceProfileDevicesRequestMsgOrBuilder> getDeviceProfileDevicesRequestMsgFieldBuilder() { if (deviceProfileDevicesRequestMsgBuilder_ == null) { deviceProfileDevicesRequestMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< DeviceProfileDevicesRequestMsg, DeviceProfileDevicesRequestMsg.Builder, DeviceProfileDevicesRequestMsgOrBuilder>( deviceProfileDevicesRequestMsg_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean()); deviceProfileDevicesRequestMsg_ = null; } return deviceProfileDevicesRequestMsgBuilder_; } private java.util.List<WidgetBundleTypesRequestMsg> widgetBundleTypesRequestMsg_ = java.util.Collections.emptyList(); private void ensureWidgetBundleTypesRequestMsgIsMutable() { if (!((bitField0_ & 0x00001000) != 0)) { widgetBundleTypesRequestMsg_ = new java.util.ArrayList<WidgetBundleTypesRequestMsg>(widgetBundleTypesRequestMsg_); bitField0_ |= 0x00001000; } } private com.google.protobuf.RepeatedFieldBuilderV3< WidgetBundleTypesRequestMsg, WidgetBundleTypesRequestMsg.Builder, WidgetBundleTypesRequestMsgOrBuilder> widgetBundleTypesRequestMsgBuilder_; /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public java.util.List<WidgetBundleTypesRequestMsg> getWidgetBundleTypesRequestMsgList() { if (widgetBundleTypesRequestMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(widgetBundleTypesRequestMsg_); } else { return widgetBundleTypesRequestMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public int getWidgetBundleTypesRequestMsgCount() { if (widgetBundleTypesRequestMsgBuilder_ == null) { return widgetBundleTypesRequestMsg_.size(); } else { return widgetBundleTypesRequestMsgBuilder_.getCount(); } } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public WidgetBundleTypesRequestMsg getWidgetBundleTypesRequestMsg(int index) { if (widgetBundleTypesRequestMsgBuilder_ == null) { return widgetBundleTypesRequestMsg_.get(index); } else { return widgetBundleTypesRequestMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder setWidgetBundleTypesRequestMsg( int index, WidgetBundleTypesRequestMsg value) { if (widgetBundleTypesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureWidgetBundleTypesRequestMsgIsMutable(); widgetBundleTypesRequestMsg_.set(index, value); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder setWidgetBundleTypesRequestMsg( int index, WidgetBundleTypesRequestMsg.Builder builderForValue) { if (widgetBundleTypesRequestMsgBuilder_ == null) { ensureWidgetBundleTypesRequestMsgIsMutable(); widgetBundleTypesRequestMsg_.set(index, builderForValue.build()); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder addWidgetBundleTypesRequestMsg(WidgetBundleTypesRequestMsg value) { if (widgetBundleTypesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureWidgetBundleTypesRequestMsgIsMutable(); widgetBundleTypesRequestMsg_.add(value); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder addWidgetBundleTypesRequestMsg( int index, WidgetBundleTypesRequestMsg value) { if (widgetBundleTypesRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureWidgetBundleTypesRequestMsgIsMutable(); widgetBundleTypesRequestMsg_.add(index, value); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder addWidgetBundleTypesRequestMsg( WidgetBundleTypesRequestMsg.Builder builderForValue) { if (widgetBundleTypesRequestMsgBuilder_ == null) { ensureWidgetBundleTypesRequestMsgIsMutable(); widgetBundleTypesRequestMsg_.add(builderForValue.build()); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder addWidgetBundleTypesRequestMsg( int index, WidgetBundleTypesRequestMsg.Builder builderForValue) { if (widgetBundleTypesRequestMsgBuilder_ == null) { ensureWidgetBundleTypesRequestMsgIsMutable(); widgetBundleTypesRequestMsg_.add(index, builderForValue.build()); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder addAllWidgetBundleTypesRequestMsg( Iterable<? extends WidgetBundleTypesRequestMsg> values) { if (widgetBundleTypesRequestMsgBuilder_ == null) { ensureWidgetBundleTypesRequestMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, widgetBundleTypesRequestMsg_); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder clearWidgetBundleTypesRequestMsg() { if (widgetBundleTypesRequestMsgBuilder_ == null) { widgetBundleTypesRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00001000); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public Builder removeWidgetBundleTypesRequestMsg(int index) { if (widgetBundleTypesRequestMsgBuilder_ == null) { ensureWidgetBundleTypesRequestMsgIsMutable(); widgetBundleTypesRequestMsg_.remove(index); onChanged(); } else { widgetBundleTypesRequestMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public WidgetBundleTypesRequestMsg.Builder getWidgetBundleTypesRequestMsgBuilder( int index) { return getWidgetBundleTypesRequestMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public WidgetBundleTypesRequestMsgOrBuilder getWidgetBundleTypesRequestMsgOrBuilder( int index) { if (widgetBundleTypesRequestMsgBuilder_ == null) { return widgetBundleTypesRequestMsg_.get(index); } else { return widgetBundleTypesRequestMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public java.util.List<? extends WidgetBundleTypesRequestMsgOrBuilder> getWidgetBundleTypesRequestMsgOrBuilderList() { if (widgetBundleTypesRequestMsgBuilder_ != null) { return widgetBundleTypesRequestMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(widgetBundleTypesRequestMsg_); } } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public WidgetBundleTypesRequestMsg.Builder addWidgetBundleTypesRequestMsgBuilder() { return getWidgetBundleTypesRequestMsgFieldBuilder().addBuilder( WidgetBundleTypesRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public WidgetBundleTypesRequestMsg.Builder addWidgetBundleTypesRequestMsgBuilder( int index) { return getWidgetBundleTypesRequestMsgFieldBuilder().addBuilder( index, WidgetBundleTypesRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.WidgetBundleTypesRequestMsg widgetBundleTypesRequestMsg = 14;</code> */ public java.util.List<WidgetBundleTypesRequestMsg.Builder> getWidgetBundleTypesRequestMsgBuilderList() { return getWidgetBundleTypesRequestMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< WidgetBundleTypesRequestMsg, WidgetBundleTypesRequestMsg.Builder, WidgetBundleTypesRequestMsgOrBuilder> getWidgetBundleTypesRequestMsgFieldBuilder() { if (widgetBundleTypesRequestMsgBuilder_ == null) { widgetBundleTypesRequestMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< WidgetBundleTypesRequestMsg, WidgetBundleTypesRequestMsg.Builder, WidgetBundleTypesRequestMsgOrBuilder>( widgetBundleTypesRequestMsg_, ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); widgetBundleTypesRequestMsg_ = null; } return widgetBundleTypesRequestMsgBuilder_; } private java.util.List<EntityViewsRequestMsg> entityViewsRequestMsg_ = java.util.Collections.emptyList(); private void ensureEntityViewsRequestMsgIsMutable() { if (!((bitField0_ & 0x00002000) != 0)) { entityViewsRequestMsg_ = new java.util.ArrayList<EntityViewsRequestMsg>(entityViewsRequestMsg_); bitField0_ |= 0x00002000; } } private com.google.protobuf.RepeatedFieldBuilderV3< EntityViewsRequestMsg, EntityViewsRequestMsg.Builder, EntityViewsRequestMsgOrBuilder> entityViewsRequestMsgBuilder_; /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public java.util.List<EntityViewsRequestMsg> getEntityViewsRequestMsgList() { if (entityViewsRequestMsgBuilder_ == null) { return java.util.Collections.unmodifiableList(entityViewsRequestMsg_); } else { return entityViewsRequestMsgBuilder_.getMessageList(); } } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public int getEntityViewsRequestMsgCount() { if (entityViewsRequestMsgBuilder_ == null) { return entityViewsRequestMsg_.size(); } else { return entityViewsRequestMsgBuilder_.getCount(); } } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public EntityViewsRequestMsg getEntityViewsRequestMsg(int index) { if (entityViewsRequestMsgBuilder_ == null) { return entityViewsRequestMsg_.get(index); } else { return entityViewsRequestMsgBuilder_.getMessage(index); } } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder setEntityViewsRequestMsg( int index, EntityViewsRequestMsg value) { if (entityViewsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureEntityViewsRequestMsgIsMutable(); entityViewsRequestMsg_.set(index, value); onChanged(); } else { entityViewsRequestMsgBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder setEntityViewsRequestMsg( int index, EntityViewsRequestMsg.Builder builderForValue) { if (entityViewsRequestMsgBuilder_ == null) { ensureEntityViewsRequestMsgIsMutable(); entityViewsRequestMsg_.set(index, builderForValue.build()); onChanged(); } else { entityViewsRequestMsgBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder addEntityViewsRequestMsg(EntityViewsRequestMsg value) { if (entityViewsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureEntityViewsRequestMsgIsMutable(); entityViewsRequestMsg_.add(value); onChanged(); } else { entityViewsRequestMsgBuilder_.addMessage(value); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder addEntityViewsRequestMsg( int index, EntityViewsRequestMsg value) { if (entityViewsRequestMsgBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureEntityViewsRequestMsgIsMutable(); entityViewsRequestMsg_.add(index, value); onChanged(); } else { entityViewsRequestMsgBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder addEntityViewsRequestMsg( EntityViewsRequestMsg.Builder builderForValue) { if (entityViewsRequestMsgBuilder_ == null) { ensureEntityViewsRequestMsgIsMutable(); entityViewsRequestMsg_.add(builderForValue.build()); onChanged(); } else { entityViewsRequestMsgBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder addEntityViewsRequestMsg( int index, EntityViewsRequestMsg.Builder builderForValue) { if (entityViewsRequestMsgBuilder_ == null) { ensureEntityViewsRequestMsgIsMutable(); entityViewsRequestMsg_.add(index, builderForValue.build()); onChanged(); } else { entityViewsRequestMsgBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder addAllEntityViewsRequestMsg( Iterable<? extends EntityViewsRequestMsg> values) { if (entityViewsRequestMsgBuilder_ == null) { ensureEntityViewsRequestMsgIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, entityViewsRequestMsg_); onChanged(); } else { entityViewsRequestMsgBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder clearEntityViewsRequestMsg() { if (entityViewsRequestMsgBuilder_ == null) { entityViewsRequestMsg_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00002000); onChanged(); } else { entityViewsRequestMsgBuilder_.clear(); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public Builder removeEntityViewsRequestMsg(int index) { if (entityViewsRequestMsgBuilder_ == null) { ensureEntityViewsRequestMsgIsMutable(); entityViewsRequestMsg_.remove(index); onChanged(); } else { entityViewsRequestMsgBuilder_.remove(index); } return this; } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public EntityViewsRequestMsg.Builder getEntityViewsRequestMsgBuilder( int index) { return getEntityViewsRequestMsgFieldBuilder().getBuilder(index); } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public EntityViewsRequestMsgOrBuilder getEntityViewsRequestMsgOrBuilder( int index) { if (entityViewsRequestMsgBuilder_ == null) { return entityViewsRequestMsg_.get(index); } else { return entityViewsRequestMsgBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public java.util.List<? extends EntityViewsRequestMsgOrBuilder> getEntityViewsRequestMsgOrBuilderList() { if (entityViewsRequestMsgBuilder_ != null) { return entityViewsRequestMsgBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(entityViewsRequestMsg_); } } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public EntityViewsRequestMsg.Builder addEntityViewsRequestMsgBuilder() { return getEntityViewsRequestMsgFieldBuilder().addBuilder( EntityViewsRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public EntityViewsRequestMsg.Builder addEntityViewsRequestMsgBuilder( int index) { return getEntityViewsRequestMsgFieldBuilder().addBuilder( index, EntityViewsRequestMsg.getDefaultInstance()); } /** * <code>repeated .edge.EntityViewsRequestMsg entityViewsRequestMsg = 15;</code> */ public java.util.List<EntityViewsRequestMsg.Builder> getEntityViewsRequestMsgBuilderList() { return getEntityViewsRequestMsgFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< EntityViewsRequestMsg, EntityViewsRequestMsg.Builder, EntityViewsRequestMsgOrBuilder> getEntityViewsRequestMsgFieldBuilder() { if (entityViewsRequestMsgBuilder_ == null) { entityViewsRequestMsgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< EntityViewsRequestMsg, EntityViewsRequestMsg.Builder, EntityViewsRequestMsgOrBuilder>( entityViewsRequestMsg_, ((bitField0_ & 0x00002000) != 0), getParentForChildren(), isClean()); entityViewsRequestMsg_ = null; } return entityViewsRequestMsgBuilder_; } @Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:edge.UplinkMsg) } // @@protoc_insertion_point(class_scope:edge.UplinkMsg) private static final UplinkMsg DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new UplinkMsg(); } public static UplinkMsg getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<UplinkMsg> PARSER = new com.google.protobuf.AbstractParser<UplinkMsg>() { @Override public UplinkMsg parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new UplinkMsg(input, extensionRegistry); } }; public static com.google.protobuf.Parser<UplinkMsg> parser() { return PARSER; } @Override public com.google.protobuf.Parser<UplinkMsg> getParserForType() { return PARSER; } @Override public UplinkMsg getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
export default /* glsl */ `uniform vec4 geometryResolution; #ifdef POSITION_STPQ varying vec4 vSTPQ; #endif #ifdef POSITION_U varying float vU; #endif #ifdef POSITION_UV varying vec2 vUV; #endif #ifdef POSITION_UVW varying vec3 vUVW; #endif #ifdef POSITION_UVWO varying vec4 vUVWO; #endif // External vec3 getPosition(vec4 xyzw, in vec4 stpqIn, out vec4 stpqOut); vec3 getMeshPosition(vec4 xyzw, float canonical) { vec4 stpqOut, stpqIn = xyzw * geometryResolution; vec3 xyz = getPosition(xyzw, stpqIn, stpqOut); #ifdef POSITION_MAP if (canonical > 0.5) { #ifdef POSITION_STPQ vSTPQ = stpqOut; #endif #ifdef POSITION_U vU = stpqOut.x; #endif #ifdef POSITION_UV vUV = stpqOut.xy; #endif #ifdef POSITION_UVW vUVW = stpqOut.xyz; #endif #ifdef POSITION_UVWO vUVWO = stpqOut; #endif } #endif return xyz; } `;
from __future__ import division # ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ----------------------------------------------------------------------------- from unittest import TestCase, main, skipIf from os import environ from os.path import join from tempfile import mkdtemp import pandas as pd from datetime import datetime from h5py import File from qiita_files.demux import to_hdf5 from qiita_ware.exceptions import ComputeError, EBISubmissionError from qiita_ware.commands import submit_EBI from qiita_db.study import Study, StudyPerson from qiita_db.software import DefaultParameters, Parameters from qiita_db.artifact import Artifact from qiita_db.metadata_template.prep_template import PrepTemplate from qiita_db.metadata_template.sample_template import SampleTemplate from qiita_db.user import User from qiita_core.util import qiita_test_checker @qiita_test_checker() class CommandsTests(TestCase): def setUp(self): self.files_to_remove = [] self.temp_dir = mkdtemp() self.files_to_remove.append(self.temp_dir) def write_demux_files(self, prep_template, generate_hdf5=True): """Writes a demux test file to avoid duplication of code""" fna_fp = join(self.temp_dir, 'seqs.fna') demux_fp = join(self.temp_dir, 'demux.seqs') if generate_hdf5: with open(fna_fp, 'w') as f: f.write(FASTA_EXAMPLE) with File(demux_fp, "w") as f: to_hdf5(fna_fp, f) else: with open(demux_fp, 'w') as f: f.write('') if prep_template.artifact is None: ppd = Artifact.create( [(demux_fp, 6)], "Demultiplexed", prep_template=prep_template) else: params = Parameters.from_default_params( DefaultParameters(1), {'input_data': prep_template.artifact.id}) ppd = Artifact.create( [(demux_fp, 6)], "Demultiplexed", parents=[prep_template.artifact], processing_parameters=params) return ppd def generate_new_study_with_preprocessed_data(self): """Creates a new study up to the processed data for testing""" info = { "timeseries_type_id": 1, "metadata_complete": True, "mixs_compliant": True, "number_samples_collected": 3, "number_samples_promised": 3, "study_alias": "Test EBI", "study_description": "Study for testing EBI", "study_abstract": "Study for testing EBI", "emp_person_id": StudyPerson(2), "principal_investigator_id": StudyPerson(3), "lab_person_id": StudyPerson(1) } study = Study.create(User('<EMAIL>'), "Test EBI study", info) metadata_dict = { 'Sample1': {'collection_timestamp': datetime(2015, 6, 1, 7, 0, 0), 'physical_specimen_location': 'location1', 'taxon_id': 9606, 'scientific_name': '<NAME>', 'Description': 'Test Sample 1'}, 'Sample2': {'collection_timestamp': datetime(2015, 6, 2, 7, 0, 0), 'physical_specimen_location': 'location1', 'taxon_id': 9606, 'scientific_name': '<NAME>', 'Description': 'Test Sample 2'}, 'Sample3': {'collection_timestamp': datetime(2015, 6, 3, 7, 0, 0), 'physical_specimen_location': 'location1', 'taxon_id': 9606, 'scientific_name': 'homo sapiens', 'Description': 'Test Sample 3'} } metadata = pd.DataFrame.from_dict(metadata_dict, orient='index', dtype=str) SampleTemplate.create(metadata, study) metadata_dict = { 'Sample1': {'primer': 'GTGCCAGCMGCCGCGGTAA', 'barcode': 'CGTAGAGCTCTC', 'center_name': 'KnightLab', 'platform': 'ILLUMINA', 'instrument_model': 'Illumina MiSeq', 'library_construction_protocol': 'Protocol ABC', 'experiment_design_description': "Random value 1"}, 'Sample2': {'primer': 'GTGCCAGCMGCCGCGGTAA', 'barcode': 'CGTAGAGCTCTA', 'center_name': 'KnightLab', 'platform': 'ILLUMINA', 'instrument_model': 'Illumina MiSeq', 'library_construction_protocol': 'Protocol ABC', 'experiment_design_description': "Random value 2"}, 'Sample3': {'primer': 'GTGCCAGCMGCCGCGGTAA', 'barcode': 'CGTAGAGCTCTT', 'center_name': 'KnightLab', 'platform': 'ILLUMINA', 'instrument_model': 'Illumina MiSeq', 'library_construction_protocol': 'Protocol ABC', 'experiment_design_description': "Random value 3"}, } metadata = pd.DataFrame.from_dict(metadata_dict, orient='index', dtype=str) pt = PrepTemplate.create(metadata, study, "16S", 'Metagenomics') fna_fp = join(self.temp_dir, 'seqs.fna') demux_fp = join(self.temp_dir, 'demux.seqs') with open(fna_fp, 'w') as f: f.write(FASTA_EXAMPLE_2.format(study.id)) with File(demux_fp, 'w') as f: to_hdf5(fna_fp, f) ppd = Artifact.create( [(demux_fp, 6)], "Demultiplexed", prep_template=pt) return ppd def test_submit_EBI_step_2_failure(self): ppd = self.write_demux_files(PrepTemplate(1), False) with self.assertRaises(EBISubmissionError): submit_EBI(ppd.id, 'VALIDATE', True) @skipIf( environ.get('ASPERA_SCP_PASS', '') == '', 'skip: ascp not configured') def test_submit_EBI_parse_EBI_reply_failure(self): ppd = self.write_demux_files(PrepTemplate(1)) with self.assertRaises(ComputeError) as error: submit_EBI(ppd.id, 'VALIDATE', True) error = str(error.exception) self.assertIn('EBI Submission failed! Log id:', error) self.assertIn('The EBI submission failed:', error) self.assertIn( 'Failed to validate run xml, error: Expected element', error) @skipIf( environ.get('ASPERA_SCP_PASS', '') == '', 'skip: ascp not configured') def test_full_submission(self): artifact = self.generate_new_study_with_preprocessed_data() self.assertEqual( artifact.study.ebi_submission_status, 'not submitted') submit_EBI(artifact.id, 'VALIDATE', True, test=True) self.assertEqual(artifact.study.ebi_submission_status, 'submitted') FASTA_EXAMPLE = """>1.SKB2.640194_1 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKB2.640194_2 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKB2.640194_3 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKM4.640180_4 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKM4.640180_5 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKB3.640195_6 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKB6.640176_7 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKD6.640190_8 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKM6.640187_9 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKD9.640182_10 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKM8.640201_11 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >1.SKM2.640199_12 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC """ FASTA_EXAMPLE_2 = """>{0}.Sample1_1 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >{0}.Sample1_2 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >{0}.Sample1_3 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >{0}.Sample2_4 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >{0}.Sample2_5 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >{0}.Sample2_6 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >{0}.Sample3_7 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >{0}.Sample3_8 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC >{0}.Sample3_9 X orig_bc=X new_bc=X bc_diffs=0 CCACCCAGTAAC """ if __name__ == '__main__': main()
<filename>2-resources/_External-learning-resources/00-Javascript/Node.js_Design_Patterns/Chapter08/14_universal_data_retrieval/src/components/authorPage.js "use strict"; const React = require('react'); const Link = require('react-router').Link; const xhrClient = require('../xhrClient'); class AuthorPage extends React.Component { static loadProps(context, cb) { xhrClient.get(`authors/${context.params.id}`) .then(response => { const author = response.data; cb(null, {author}); }) .catch(error => cb(error)) ; } render() { return ( <div> <h2>{this.props.author.name}'s major works</h2> <ul className="books">{ this.props.author.books.map( (book, key) => <li key={key} className="book">{book}</li> ) }</ul> <Link to="/">Go back to index</Link> </div> ); } } module.exports = AuthorPage;
#! /bin/bash mvn -pl com.yahoo.ycsb:mapkeeper-binding -am package -DskipTests dependency:build-classpath -DincludeScope=compile -Dmdep.outputFilterFile=true
import { Home, NotFound, SignUp, Feed, } from '../Pages'; export const PublicRoutes = [ { exact: true, path: '/', component: Home, key: 'home', }, { exact: true, path: '/signup', component: SignUp, key: 'signup', }, { exact: true, component: NotFound, key: 'notfound', }, ]; export const PrivateRoutes = [ { exact: true, path: '/feed/:category/:id?', component: Feed, key: 'feed', }, ];
<filename>src/apps/terminal/TerminalBuffer.cpp /* * Copyright 2013, Haiku, Inc. All rights reserved. * Copyright 2008, <NAME>, <EMAIL>. * Distributed under the terms of the MIT License. * * Authors: * <NAME>, <EMAIL> * <NAME>, <EMAIL> */ #include "TerminalBuffer.h" #include <algorithm> #include <Message.h> #include "Colors.h" #include "TermApp.h" #include "TermConst.h" // #pragma mark - public methods TerminalBuffer::TerminalBuffer() : BLocker("terminal buffer"), fEncoding(M_UTF8), fAlternateScreen(NULL), fAlternateHistory(NULL), fAlternateScreenOffset(0), fAlternateAttributes(0), fColorsPalette(NULL), fListenerValid(false) { } TerminalBuffer::~TerminalBuffer() { delete fAlternateScreen; delete fAlternateHistory; delete[] fColorsPalette; } status_t TerminalBuffer::Init(int32 width, int32 height, int32 historySize) { if (Sem() < 0) return Sem(); fAlternateScreen = _AllocateLines(width, height); if (fAlternateScreen == NULL) return B_NO_MEMORY; for (int32 i = 0; i < height; i++) fAlternateScreen[i]->Clear(); fColorsPalette = new(std::nothrow) rgb_color[kTermColorCount]; if (fColorsPalette == NULL) return B_NO_MEMORY; for (uint i = 0; i < kTermColorCount; i++) fColorsPalette[i] = TermApp::DefaultPalette()[i]; return BasicTerminalBuffer::Init(width, height, historySize); } void TerminalBuffer::SetListener(BMessenger listener) { fListener = listener; fListenerValid = true; } void TerminalBuffer::UnsetListener() { fListenerValid = false; } int TerminalBuffer::Encoding() const { return fEncoding; } void TerminalBuffer::ReportX10MouseEvent(bool reportX10MouseEvent) { if (fListenerValid) { BMessage message(MSG_REPORT_MOUSE_EVENT); message.AddBool("reportX10MouseEvent", reportX10MouseEvent); fListener.SendMessage(&message); } } void TerminalBuffer::ReportNormalMouseEvent(bool reportNormalMouseEvent) { if (fListenerValid) { BMessage message(MSG_REPORT_MOUSE_EVENT); message.AddBool("reportNormalMouseEvent", reportNormalMouseEvent); fListener.SendMessage(&message); } } void TerminalBuffer::ReportButtonMouseEvent(bool report) { if (fListenerValid) { BMessage message(MSG_REPORT_MOUSE_EVENT); message.AddBool("reportButtonMouseEvent", report); fListener.SendMessage(&message); } } void TerminalBuffer::ReportAnyMouseEvent(bool reportAnyMouseEvent) { if (fListenerValid) { BMessage message(MSG_REPORT_MOUSE_EVENT); message.AddBool("reportAnyMouseEvent", reportAnyMouseEvent); fListener.SendMessage(&message); } } void TerminalBuffer::SetEncoding(int encoding) { fEncoding = encoding; } void TerminalBuffer::SetTitle(const char* title) { if (fListenerValid) { BMessage message(MSG_SET_TERMINAL_TITLE); message.AddString("title", title); fListener.SendMessage(&message); } } void TerminalBuffer::SetColors(uint8* indexes, rgb_color* colors, int32 count, bool dynamic) { if (fListenerValid) { BMessage message(MSG_SET_TERMINAL_COLORS); message.AddInt32("count", count); message.AddBool("dynamic", dynamic); message.AddData("index", B_UINT8_TYPE, indexes, sizeof(uint8), true, count); message.AddData("color", B_RGB_COLOR_TYPE, colors, sizeof(rgb_color), true, count); for (int i = 1; i < count; i++) { message.AddData("index", B_UINT8_TYPE, &indexes[i], sizeof(uint8)); message.AddData("color", B_RGB_COLOR_TYPE, &colors[i], sizeof(rgb_color)); } fListener.SendMessage(&message); } } void TerminalBuffer::ResetColors(uint8* indexes, int32 count, bool dynamic) { if (fListenerValid) { BMessage message(MSG_RESET_TERMINAL_COLORS); message.AddInt32("count", count); message.AddBool("dynamic", dynamic); message.AddData("index", B_UINT8_TYPE, indexes, sizeof(uint8), true, count); for (int i = 1; i < count; i++) message.AddData("index", B_UINT8_TYPE, &indexes[i], sizeof(uint8)); fListener.SendMessage(&message); } } void TerminalBuffer::SetCursorStyle(int32 style, bool blinking) { if (fListenerValid) { BMessage message(MSG_SET_CURSOR_STYLE); message.AddInt32("style", style); message.AddBool("blinking", blinking); fListener.SendMessage(&message); } } void TerminalBuffer::SetCursorBlinking(bool blinking) { if (fListenerValid) { BMessage message(MSG_SET_CURSOR_STYLE); message.AddBool("blinking", blinking); fListener.SendMessage(&message); } } void TerminalBuffer::SetCursorHidden(bool hidden) { if (fListenerValid) { BMessage message(MSG_SET_CURSOR_STYLE); message.AddBool("hidden", hidden); fListener.SendMessage(&message); } } void TerminalBuffer::SetPaletteColor(uint8 index, rgb_color color) { if (index < kTermColorCount) fColorsPalette[index] = color; } rgb_color TerminalBuffer::PaletteColor(uint8 index) { return fColorsPalette[min_c(index, kTermColorCount - 1)]; } int TerminalBuffer::GuessPaletteColor(int red, int green, int blue) { int distance = 255 * 100; int index = -1; for (uint32 i = 0; i < kTermColorCount && distance > 0; i++) { rgb_color color = fColorsPalette[i]; int r = 30 * abs(color.red - red); int g = 59 * abs(color.green - green); int b = 11 * abs(color.blue - blue); int d = r + g + b; if (distance > d) { index = i; distance = d; } } return min_c(index, int(kTermColorCount - 1)); } void TerminalBuffer::NotifyQuit(int32 reason) { if (fListenerValid) { BMessage message(MSG_QUIT_TERMNAL); message.AddInt32("reason", reason); fListener.SendMessage(&message); } } void TerminalBuffer::NotifyListener() { if (fListenerValid) fListener.SendMessage(MSG_TERMINAL_BUFFER_CHANGED); } status_t TerminalBuffer::ResizeTo(int32 width, int32 height) { int32 historyCapacity = 0; if (!fAlternateScreenActive) historyCapacity = HistoryCapacity(); else if (fAlternateHistory != NULL) historyCapacity = fAlternateHistory->Capacity(); return ResizeTo(width, height, historyCapacity); } status_t TerminalBuffer::ResizeTo(int32 width, int32 height, int32 historyCapacity) { // switch to the normal screen buffer first bool alternateScreenActive = fAlternateScreenActive; if (alternateScreenActive) _SwitchScreenBuffer(); int32 oldWidth = fWidth; int32 oldHeight = fHeight; // Resize the normal screen buffer/history. status_t error = BasicTerminalBuffer::ResizeTo(width, height, historyCapacity); if (error != B_OK) { if (alternateScreenActive) _SwitchScreenBuffer(); return error; } // Switch to the alternate screen buffer and resize it. if (fAlternateScreen != NULL) { TermPos cursor = fCursor; fCursor.SetTo(0, 0); fWidth = oldWidth; fHeight = oldHeight; _SwitchScreenBuffer(); error = BasicTerminalBuffer::ResizeTo(width, height, 0); fWidth = width; fHeight = height; fCursor = cursor; // Switch back. if (!alternateScreenActive) _SwitchScreenBuffer(); if (error != B_OK) { // This sucks -- we can't do anything about it. Delete the // alternate screen buffer. _FreeLines(fAlternateScreen, oldHeight); fAlternateScreen = NULL; } } return error; } void TerminalBuffer::UseAlternateScreenBuffer(bool clear) { if (fAlternateScreenActive || fAlternateScreen == NULL) return; _SwitchScreenBuffer(); if (clear) Clear(false); _InvalidateAll(); } void TerminalBuffer::UseNormalScreenBuffer() { if (!fAlternateScreenActive) return; _SwitchScreenBuffer(); _InvalidateAll(); } void TerminalBuffer::_SwitchScreenBuffer() { std::swap(fScreen, fAlternateScreen); std::swap(fHistory, fAlternateHistory); std::swap(fScreenOffset, fAlternateScreenOffset); std::swap(fAttributes, fAlternateAttributes); fAlternateScreenActive = !fAlternateScreenActive; }
sudo pip3 install -r requirements.txt sudo mkdir /var/log/thread/ sudo cp thread_tags.service /lib/systemd/system/ sudo chmod 644 /lib/systemd/system/thread_tags.service sudo chmod +x thread_tags.py sudo systemctl daemon-reload sudo systemctl enable thread_tags.service sudo systemctl start thread_tags.service
#!/usr/bin/env bash ./gradlew distJar mkdir -p /var/log/buck-cache-client # Based by https://ignite.apache.org/docs/latest/perf-and-troubleshooting/memory-tuning # MaxDirectMemorySize should be 4 * walSegmentSize, if we use default walSegmentSize, it will be 256MB /usr/local/opt/openjdk@8/bin/java -Xmx32g -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:MaxDirectMemorySize=256m -Dlog.home=/var/log/buck-cache-client/ -jar cache/build/libs/cache-1.0.0-standalone.jar server cache/src/dist/config/$1.yml
<reponame>nepalez/separator # encoding: utf-8 module Selector # The condition that accepts any value # # @example (see #[]) # class Nothing < Condition include Singleton # @!method [](value) # Returns false # # @example # condition = Selector::Nothing.instance # singleton # condition[:foo] # => false # # @param (see Selector::Condition#[]) # # @return [false] # def [](_value) false end end # class Nothing end # module Selector
# Python program to generate # a unique 6 digit number import random def generate_number(): # Choose a random number # between 10000 and 99999 random_number = random.randint(10000, 99999) # Return the random number return random_number # Driver Code if __name__ == "__main__": print(generate_number())
#!/bin/sh cat >> /etc/sudoers << EOF # added by Dockerfile datamaps ALL=(ALL) NOPASSWD:ALL EOF
package ca.damocles.Damage; public enum DDamageCause { BLOCK_CONTACT, NATURE, EXPLOSION, ATTACK, POTION, SPELL; }
package health import ( "fmt" "go.opentelemetry.io/otel/trace" ) // Option is the health-container options type type Option func(*Health) error // WithChecks adds checks to newly instantiated health-container func WithChecks(checks ...Config) Option { return func(h *Health) error { for _, c := range checks { if err := h.Register(c); err != nil { return fmt.Errorf("could not register check %q: %w", c.Name, err) } } return nil } } // WithTracerProvider sets trace provider for the checks and instrumentation name that will be used // for tracer from trace provider. func WithTracerProvider(tp trace.TracerProvider, instrumentationName string) Option { return func(h *Health) error { h.tp = tp h.instrumentationName = instrumentationName return nil } }
#!/bin/bash set -euo pipefail CWD=${PWD} export CGO_ENABLED=0 GO_FLAGS=${GO_FLAGS:-"-tags netgo"} GO_CMD=${GO_CMD:-"build"} VERBOSE=${VERBOSE:-} BUILD_NAME="dgraph-operator" REPO_PATH="github.com/dgraph-io/dgraph-operator" API_VERSION="v1alpha1" OPERATOR_VERSION=$(git describe --always --tags 2> /dev/null || echo 'unknown') BUILD_DATE=${BUILD_DATE:-$( git log -1 --format='%ci' )} REVISION=$(git rev-parse --short HEAD 2> /dev/null || echo 'unknown') BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null || echo 'unknown') GO_VERSION=$(go version | sed -e 's/^[^0-9.]*\([0-9.]*\).*/\1/') ldseparator="=" ldflags=" -X '${REPO_PATH}/version.APIVersion${ldseparator}${API_VERSION}' -X '${REPO_PATH}/version.OperatorVersion${ldseparator}${OPERATOR_VERSION}' -X '${REPO_PATH}/version.CommitSHA${ldseparator}${REVISION}' -X '${REPO_PATH}/version.Branch${ldseparator}${BRANCH}' -X '${REPO_PATH}/version.CommitTimestamp${ldseparator}${BUILD_DATE}' -X '${REPO_PATH}/version.GoVersion${ldseparator}${GO_VERSION}'" if [ -n "$VERBOSE" ]; then echo "Building with -ldflags $ldflags" fi GOBIN=$PWD go "${GO_CMD}" -o "${BUILD_NAME}" ${GO_FLAGS} -ldflags "${ldflags}" "${REPO_PATH}/cmd/operator" echo "[*] Build Complete." exit 0
<gh_stars>1-10 'use strict'; var expect = require('chai').expect; var hashAdapter = require('../../src/adapters').hash; var differentValidator = require('../../src/validators').different; var MissingArgumentError = require('../../src/errors').MissingArgumentError; describe('different', function () { it('throws an error if selector is missing', function (done) { var fn = function () { differentValidator(); }; expect(fn).to.throw(MissingArgumentError, /selector/); done(); }); it('returns message if values are same', function (done) { var expectedMessage = 'values must be different'; var obj = { foo: 1, bar: 1 }; var rootAdapter = hashAdapter(obj); var fooAdapter = rootAdapter.find('foo'); var rule = differentValidator('bar'); var error = rule(fooAdapter, rootAdapter); expect(error).to.be.instanceOf(Error); expect(error.message).to.equal(expectedMessage); done(); }); it('returns custom message if values are same', function (done) { var expectedMessage = 'expected message'; var obj = { foo: 1, bar: 1 }; var rootAdapter = hashAdapter(obj); var fooAdapter = rootAdapter.find('foo'); var rule = differentValidator('bar', expectedMessage); var error = rule(fooAdapter, rootAdapter); expect(error).to.be.instanceOf(Error); expect(error.message).to.equal(expectedMessage); done(); }); it('returns undefined if values are different', function (done) { var obj = { foo: 1, bar: 2 }; var rootAdapter = hashAdapter(obj); var fooAdapter = rootAdapter.find('foo'); var rule = differentValidator('bar'); var error = rule(fooAdapter, rootAdapter); expect(error).to.be.undefined; done(); }); });
<filename>lib/car/obj/src/cli_init_b_r.c /* **** Notes Initialise. */ # define CAR # include "./../../../incl/config.h" signed(__cdecl cli_init_b_r(signed(cache),signed(arg),signed char(**argp))) { auto signed char *b; if(arg<(0x01)) return(0x00); if(!argp) return(0x00); --arg; if(cache) { embed(0x00,*(arg+(argp))); rl(*(arg+(argp))); } *(arg+(argp)) = (0x00); return(0x01+(cli_init_b_r(cache,arg,argp))); }
<reponame>jd0yle/electron-dr // Modules to control application life and create native browser window const { app, BrowserWindow, Menu } = require('electron') const { ipcMain } = require('electron') // to talk to the browser window const path = require('path') const url = require('url') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let mainWindow let game let sendCommand let hardWired = false // const isMac = process.platform === 'darwin' function createWindow() { // Create the browser window. mainWindow = new BrowserWindow({ width: 1024, height: 768, webPreferences: { preload: path.join(__dirname, 'preload.js'), nodeIntegration: true, // necessary to get icpMain import in the window webSecurity: false, // todo: better solution }, }) mainWindow.webContents.on('did-finish-load', () => { // What should I do on load? }) const template = [ { label: 'File', submenu: [ { label: 'Connect', click: () => messageFrontEnd({type: 'openConnectModal'})}, // { role: isMac ? 'close' : 'quit' } { role: 'quit' }, ], }, { role: 'help', submenu: [ { label: 'Learn More', click: async () => { const { shell } = require('electron') await shell.openExternal('https://electronjs.org') }, }, { label: 'Dev Tools', role: 'toggleDevTools', }, { label: 'Force Reload', role: 'forceReload', }, ], }, ] const menu = Menu.buildFromTemplate(template) Menu.setApplicationMenu(menu) // load the initial page: if (app.commandLine.hasSwitch('dev-mode')) { // hot reloaded webpack dev server: mainWindow.loadURL('http://localhost:3000'); } else { // for prod, load the built page: mainWindow.loadFile(path.join('build', 'index.html')) } // make it big: mainWindow.maximize() // Open the DevTools (if in dev mode): if (app.commandLine.hasSwitch('dev-mode')) mainWindow.webContents.openDevTools() // Emitted when the window is closed: mainWindow.on('closed', function () { // Dereference the window object, usually you would store windows // in an array if your app supports multi windows, this is the time // when you should delete the corresponding element. // todo: send exit command if connected? mainWindow = null }) } // This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. app.on('ready', () => { createWindow() loadDevTools() }) function loadDevTools() { // note: only needs to be loaded once but doesn't hurt to attempt each time // for dev mode only // BrowserWindow.addDevToolsExtension( // path.join(__dirname, 'react-devtools-4.4.0_3') // ) } // Quit when all windows are closed. app.on('window-all-closed', function () { // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q // if (!isMac) app.quit() // todo: quit game first? app.quit() }) app.on('activate', function () { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (mainWindow === null) createWindow() }) // In this file you can include the rest of your app's specific main process // code. You can also put them in separate files and require them here. function hardWire() { const gamePath = path.join(__dirname, "game.js") delete require.cache[gamePath]; game = require("./game.js"); const gameReturns = game(messageFrontEnd) sendCommand = gameReturns.sendCommand; } function messageFrontEnd(message) { mainWindow.webContents.send('message', message) } // todo: can we just hardwire at startup? ipcMain.on('asynchronous-message', (event, command) => { if (!hardWired) { hardWired = true hardWire() } sendCommand(command); // (Command received from player, pass on to game) })
<gh_stars>0 import { Avatar, Box, Button, CircularProgress, Container, CssBaseline, FormControl, Grid, InputLabel, Link, makeStyles, MenuItem, Select, Typography } from "@material-ui/core"; import React, { useEffect, useMemo, useState } from "react"; import { useAppState } from "../../providers/AppStateProvider"; import { MeetingRoom } from '@material-ui/icons' import { Copyright } from "../000_common/Copyright"; import { DeviceInfo } from "../../utils"; import { VirtualBackgroundSegmentationType } from "../../frameProcessors/VirtualBackground"; const useStyles = makeStyles((theme) => ({ paper: { marginTop: theme.spacing(8), display: 'flex', flexDirection: 'column', alignItems: 'center', }, avatar: { margin: theme.spacing(1), backgroundColor: theme.palette.primary.main, }, form: { width: '100%', marginTop: theme.spacing(1), }, submit: { margin: theme.spacing(3, 0, 2), }, formControl: { margin: theme.spacing(1), width: '100%' // minWidth: 120, }, cameraPreview: { width: '50%' }, })); export const WaitingRoom = () => { const classes = useStyles() const { userId, userName, meetingName, audioInputList, videoInputList, audioOutputList, audioInputDeviceSetting, videoInputDeviceSetting, audioOutputDeviceSetting, setStage, handleSignOut, reloadDevices, enterMeeting} = useAppState() const [isLoading, setIsLoading] = useState(false) //// Default Device ID const defaultDeiceId = (deviceList: DeviceInfo[] | null) => { if(!deviceList){ return "None" } const defaultDevice = deviceList.find(dev=>{return dev.deviceId !== "default"}) return defaultDevice ? defaultDevice.deviceId : "None" } const defaultAudioInputDevice = defaultDeiceId(audioInputList) const defaultVideoInputDevice = defaultDeiceId(videoInputList) const defaultAudioOutputDevice = defaultDeiceId(audioOutputList) const [audioInputDeviceId, setAudioInputDeviceId] = useState(defaultAudioInputDevice) const [videoInputDeviceId, setVideoInputDeviceId] = useState(defaultVideoInputDevice) const [audioOutputDeviceId, setAudioOutputDeviceId] = useState(defaultAudioOutputDevice) const [segmentationType, setSegmentationType] = useState<VirtualBackgroundSegmentationType>("GoogleMeetTFLite") const onReloadDeviceClicked = () =>{ reloadDevices() } const onEnterClicked = () => { setIsLoading(true) enterMeeting().then(()=>{ setIsLoading(false) videoInputDeviceSetting!.startLocalVideoTile() setStage("MEETING_ROOM") }).catch(e=>{ setIsLoading(false) console.log(e) }) } useEffect(() => { const videoEl = document.getElementById("camera-preview") as HTMLVideoElement videoInputDeviceSetting!.setPreviewVideoElement(videoEl) },[])// eslint-disable-line useEffect(() => { if (videoInputDeviceId === "None") { videoInputDeviceSetting!.setVideoInput(null).then(()=>{ videoInputDeviceSetting!.stopPreview() }) } else if (videoInputDeviceId=== "File") { // fileInputRef.current!.click() } else { videoInputDeviceSetting!.setVideoInput(videoInputDeviceId).then(()=>{ videoInputDeviceSetting!.startPreview() }) } },[videoInputDeviceId]) // eslint-disable-line useEffect(()=>{ if (segmentationType === "None") { videoInputDeviceSetting!.setVirtualBackgroundSegmentationType("None").then(()=>{ }) } else { videoInputDeviceSetting!.setVirtualBackgroundSegmentationType(segmentationType).then(()=>{ }) } },[segmentationType]) // eslint-disable-line useEffect(()=>{ if (audioInputDeviceId === "None") { audioInputDeviceSetting!.setAudioInput(null) } else { audioInputDeviceSetting!.setAudioInput(audioInputDeviceId) } },[audioInputDeviceId]) // eslint-disable-line useEffect(()=>{ if (audioOutputDeviceId === "None") { audioOutputDeviceSetting!.setAudioOutput(null) } else { audioOutputDeviceSetting!.setAudioOutput(audioOutputDeviceId) } },[audioOutputDeviceId]) // eslint-disable-line const videoPreview = useMemo(()=>{ return (<video id="camera-preview" className={classes.cameraPreview} />) },[])// eslint-disable-line return ( <Container maxWidth="xs" > <CssBaseline /> <div className={classes.paper}> <Avatar className={classes.avatar}> <MeetingRoom /> </Avatar> <Typography variant="h4"> Waiting Meeting </Typography> <Typography> You will join room <br /> (user:{userName}, room:{meetingName}) <br /> Setup your devices. </Typography> <form className={classes.form} noValidate> <Button fullWidth variant="outlined" color="primary" onClick={onReloadDeviceClicked} > reload device list </Button> <FormControl className={classes.formControl} > <InputLabel>Camera</InputLabel> <Select onChange={(e)=>{setVideoInputDeviceId(e.target.value! as string)}} defaultValue={videoInputDeviceId}> <MenuItem disabled value="Video"> <em>Video</em> </MenuItem> {videoInputList?.map(dev => { return <MenuItem value={dev.deviceId} key={dev.deviceId}>{dev.label}</MenuItem> })} </Select> </FormControl> <Typography> Preview.(virtual bg is not applied here yet.) </Typography> {videoPreview} <FormControl className={classes.formControl} > <InputLabel>VirtualBG</InputLabel> <Select onChange={(e)=>{setSegmentationType(e.target.value! as VirtualBackgroundSegmentationType)}} defaultValue={segmentationType}> <MenuItem disabled value="Video"> <em>VirtualBG</em> </MenuItem> <MenuItem value="None"> <em>None</em> </MenuItem> <MenuItem value="BodyPix"> <em>BodyPix</em> </MenuItem> <MenuItem value="GoogleMeet"> <em>GoogleMeet</em> </MenuItem> <MenuItem value="GoogleMeetTFLite"> <em>GoogleMeetTFLite</em> </MenuItem> </Select> </FormControl> <FormControl className={classes.formControl} > <InputLabel>Microhpone</InputLabel> <Select onChange={(e)=>{setAudioInputDeviceId(e.target.value! as string)}} defaultValue={audioInputDeviceId}> <MenuItem disabled value="Video"> <em>Microphone</em> </MenuItem> {audioInputList?.map(dev => { return <MenuItem value={dev.deviceId} key={dev.deviceId}>{dev.label}</MenuItem> })} </Select> </FormControl> <FormControl className={classes.formControl} > <InputLabel>Speaker</InputLabel> <Select onChange={(e)=>{setAudioOutputDeviceId(e.target.value! as string)}} defaultValue={audioOutputDeviceId}> <MenuItem disabled value="Video"> <em>Speaker</em> </MenuItem> {audioOutputList?.map(dev => { return <MenuItem value={dev.deviceId} key={dev.deviceId} >{dev.label}</MenuItem> })} </Select> </FormControl> <Grid container direction="column" alignItems="center" > { isLoading ? <CircularProgress /> : <Button fullWidth variant="contained" color="primary" className={classes.submit} onClick={onEnterClicked} id="submit" > Enter </Button> } </Grid> <Grid container direction="column" > <Grid item xs> <Link onClick={(e: any) => { setStage("ENTRANCE") }}> Go Back </Link> </Grid> <Grid item xs> <Link onClick={(e: any) => { handleSignOut(userId!); setStage("SIGNIN") }}> Sign out </Link> </Grid> </Grid> <Box mt={8}> <Copyright /> </Box> </form> </div> </Container> ) }
import {PriceAmountItem} from "./PriceAmountItem"; import {BehaviorSubject} from "rxjs/BehaviorSubject"; import {PriceCalculation} from "../../domain/server/PriceCalculation"; export class PriceDatabase { dataChange: BehaviorSubject<PriceAmountItem[]> = new BehaviorSubject<PriceAmountItem[]>([]); get data(): PriceAmountItem[] { return this.dataChange.value; } constructor(public priceCalculation: PriceCalculation) { let prices: Array<PriceAmountItem> = []; for (let p of priceCalculation.prices) { let priceItem:PriceAmountItem = {id: p.part.id, description: p.part.getNameTranslated('en'), amount: String(p.count)}; prices.push(priceItem); } this.dataChange.next(prices); } }
<filename>projects/angular-common-components/src/lib/common-components/oc-dropdown-button/oc-dropdown-button.component.spec.ts import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { OcDropdownButtonComponent } from './oc-dropdown-button.component'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { MockSvgIconComponent } from '@openchannel/angular-common-components/src/mock/mock'; describe('OcDropdownButtonComponent', () => { let component: OcDropdownButtonComponent; let fixture: ComponentFixture<OcDropdownButtonComponent>; beforeEach( waitForAsync(() => { TestBed.configureTestingModule({ declarations: [OcDropdownButtonComponent, MockSvgIconComponent], imports: [NgbModule], }).compileComponents(); }), ); beforeEach(() => { fixture = TestBed.createComponent(OcDropdownButtonComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); });
<gh_stars>0 package main import ( "crypto/tls" "encoding/json" "log" "math/rand" "os" "time" gomail "gopkg.in/mail.v2" ) type ConfigJSON struct { From string `json:"from"` To []string `json:"to"` Password string `json:"password"` SMTPHost string `json:"smtp_host"` SMTPPort int `json:"smtp_port"` Subject string `json:"subject"` Content string `json:"content"` } var Config ConfigJSON func parseConfig() { conf := os.Getenv("MAIL_CONFIG") if conf == "" { conf = "config.json" } file, err := os.Open(conf) if err != nil { log.Fatalf("Read config file err: %v\n", err) } j := json.NewDecoder(file) err = j.Decode(&Config) if err != nil { log.Fatalf("Parse config failed: %v\n", err) } defer file.Close() } func sendMail() error { m := gomail.NewMessage() m.SetHeader("From", Config.From) m.SetHeader("To", Config.To...) m.SetHeader("Subject", Config.Subject) m.SetBody("text/plain", Config.Content) d := gomail.NewDialer(Config.SMTPHost, Config.SMTPPort, Config.From, Config.Password) d.TLSConfig = &tls.Config{InsecureSkipVerify: true} if err := d.DialAndSend(m); err != nil { return err } return nil } func init() { rand.Seed(time.Now().UnixNano()) } func randomInt(min, max int) int { return min + rand.Intn(max-min+1) } func main() { parseConfig() for { if err := sendMail(); err != nil { log.Fatal(err) } second := randomInt(80000, 86400) time.Sleep(time.Duration(second) * time.Second) } }
<gh_stars>0 /* eslint-disable no-console */ /* * * BOOK selectors * */ import { createSelector } from "reselect"; import { initialState } from "./reducer"; /** * Direct selector to the book state domain */ const selectBookDomain = state => state.get("book", initialState); /** * Other specific selectors */ const makeBookApiDataSelector = () => createSelector(selectBookDomain, substate => { console.log( "BOOK_STATE_APIDATA in selector", substate.get("BOOK_STATE_APIDATA") ); return substate.get("BOOK_STATE_APIDATA"); }); /** * MEDIA LIVE specific selectors */ const makeBookGetChannelSelector = () => createSelector(selectBookDomain, substate => { console.log( "BOOK_STATE_CHANNEL in selector", substate.get("BOOK_STATE_CHANNEL") ); return substate.get("BOOK_STATE_CHANNEL"); }); const makeBookGetAWSResponseSelector = () => createSelector(selectBookDomain, substate => { console.log( "BOOK_STATE_CHANNEL in selector", substate.get("BOOK_STATE_AWS_RESPONSE") ); return substate.get("BOOK_STATE_AWS_RESPONSE"); }); const makeBookGetInputSelector = () => createSelector(selectBookDomain, substate => { console.log( "BOOK_STATE_INPUT in selector", substate.get("BOOK_STATE_INPUT") ); return substate.get("BOOK_STATE_INPUT"); }); /** * Default selector used by Book */ const makeSelectBook = () => createSelector(selectBookDomain, substate => substate.toJS()); export default makeSelectBook; export { selectBookDomain, makeBookApiDataSelector, makeBookGetChannelSelector, makeBookGetAWSResponseSelector, makeBookGetInputSelector, };
go build -i -v -ldflags="-s -w"
/* Copyright 2017 IBM Corp. 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.ibm.cloud.appid.android.api.tokens; import com.ibm.cloud.appid.android.internal.tokens.AccessTokenImpl; import com.ibm.cloud.appid.android.testing.helpers.Consts; import com.ibm.mobilefirstplatform.appid_clientsdk_android.BuildConfig; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import static org.assertj.core.api.Java6Assertions.*; @RunWith (RobolectricTestRunner.class) @FixMethodOrder (MethodSorters.NAME_ASCENDING) @Config (constants = BuildConfig.class) public class AccessToken_Test { @Test () public void testWithValidAccessToken () { AccessToken accessToken = new AccessTokenImpl(Consts.ACCESS_TOKEN); assertThat(accessToken).isNotNull(); assertThat(accessToken.getScope()).isEqualTo("openid appid_default appid_readprofile appid_readuserattr appid_writeuserattr appid_authenticated"); } }
<gh_stars>10-100 import { Request } from '../types/request' import { Response } from '../types/response' export function forwardRequest(request: Request): Promise<Response> { return new Promise((resolve, reject) => { chrome.runtime.sendMessage(request, (response: Response) => { if (!response) return reject(chrome.runtime.lastError) return resolve(response) }) }) }
<reponame>gcusnieux/jooby /** * Apache License * Version 2.0, January 2004 * http://www.apache.org/licenses/ * * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION * * 1. Definitions. * * "License" shall mean the terms and conditions for use, reproduction, * and distribution as defined by Sections 1 through 9 of this document. * * "Licensor" shall mean the copyright owner or entity authorized by * the copyright owner that is granting the License. * * "Legal Entity" shall mean the union of the acting entity and all * other entities that control, are controlled by, or are under common * control with that entity. For the purposes of this definition, * "control" means (i) the power, direct or indirect, to cause the * direction or management of such entity, whether by contract or * otherwise, or (ii) ownership of fifty percent (50%) or more of the * outstanding shares, or (iii) beneficial ownership of such entity. * * "You" (or "Your") shall mean an individual or Legal Entity * exercising permissions granted by this License. * * "Source" form shall mean the preferred form for making modifications, * including but not limited to software source code, documentation * source, and configuration files. * * "Object" form shall mean any form resulting from mechanical * transformation or translation of a Source form, including but * not limited to compiled object code, generated documentation, * and conversions to other media types. * * "Work" shall mean the work of authorship, whether in Source or * Object form, made available under the License, as indicated by a * copyright notice that is included in or attached to the work * (an example is provided in the Appendix below). * * "Derivative Works" shall mean any work, whether in Source or Object * form, that is based on (or derived from) the Work and for which the * editorial revisions, annotations, elaborations, or other modifications * represent, as a whole, an original work of authorship. For the purposes * of this License, Derivative Works shall not include works that remain * separable from, or merely link (or bind by name) to the interfaces of, * the Work and Derivative Works thereof. * * "Contribution" shall mean any work of authorship, including * the original version of the Work and any modifications or additions * to that Work or Derivative Works thereof, that is intentionally * submitted to Licensor for inclusion in the Work by the copyright owner * or by an individual or Legal Entity authorized to submit on behalf of * the copyright owner. For the purposes of this definition, "submitted" * means any form of electronic, verbal, or written communication sent * to the Licensor or its representatives, including but not limited to * communication on electronic mailing lists, source code control systems, * and issue tracking systems that are managed by, or on behalf of, the * Licensor for the purpose of discussing and improving the Work, but * excluding communication that is conspicuously marked or otherwise * designated in writing by the copyright owner as "Not a Contribution." * * "Contributor" shall mean Licensor and any individual or Legal Entity * on behalf of whom a Contribution has been received by Licensor and * subsequently incorporated within the Work. * * 2. Grant of Copyright License. Subject to the terms and conditions of * this License, each Contributor hereby grants to You a perpetual, * worldwide, non-exclusive, no-charge, royalty-free, irrevocable * copyright license to reproduce, prepare Derivative Works of, * publicly display, publicly perform, sublicense, and distribute the * Work and such Derivative Works in Source or Object form. * * 3. Grant of Patent License. Subject to the terms and conditions of * this License, each Contributor hereby grants to You a perpetual, * worldwide, non-exclusive, no-charge, royalty-free, irrevocable * (except as stated in this section) patent license to make, have made, * use, offer to sell, sell, import, and otherwise transfer the Work, * where such license applies only to those patent claims licensable * by such Contributor that are necessarily infringed by their * Contribution(s) alone or by combination of their Contribution(s) * with the Work to which such Contribution(s) was submitted. If You * institute patent litigation against any entity (including a * cross-claim or counterclaim in a lawsuit) alleging that the Work * or a Contribution incorporated within the Work constitutes direct * or contributory patent infringement, then any patent licenses * granted to You under this License for that Work shall terminate * as of the date such litigation is filed. * * 4. Redistribution. You may reproduce and distribute copies of the * Work or Derivative Works thereof in any medium, with or without * modifications, and in Source or Object form, provided that You * meet the following conditions: * * (a) You must give any other recipients of the Work or * Derivative Works a copy of this License; and * * (b) You must cause any modified files to carry prominent notices * stating that You changed the files; and * * (c) You must retain, in the Source form of any Derivative Works * that You distribute, all copyright, patent, trademark, and * attribution notices from the Source form of the Work, * excluding those notices that do not pertain to any part of * the Derivative Works; and * * (d) If the Work includes a "NOTICE" text file as part of its * distribution, then any Derivative Works that You distribute must * include a readable copy of the attribution notices contained * within such NOTICE file, excluding those notices that do not * pertain to any part of the Derivative Works, in at least one * of the following places: within a NOTICE text file distributed * as part of the Derivative Works; within the Source form or * documentation, if provided along with the Derivative Works; or, * within a display generated by the Derivative Works, if and * wherever such third-party notices normally appear. The contents * of the NOTICE file are for informational purposes only and * do not modify the License. You may add Your own attribution * notices within Derivative Works that You distribute, alongside * or as an addendum to the NOTICE text from the Work, provided * that such additional attribution notices cannot be construed * as modifying the License. * * You may add Your own copyright statement to Your modifications and * may provide additional or different license terms and conditions * for use, reproduction, or distribution of Your modifications, or * for any such Derivative Works as a whole, provided Your use, * reproduction, and distribution of the Work otherwise complies with * the conditions stated in this License. * * 5. Submission of Contributions. Unless You explicitly state otherwise, * any Contribution intentionally submitted for inclusion in the Work * by You to the Licensor shall be under the terms and conditions of * this License, without any additional terms or conditions. * Notwithstanding the above, nothing herein shall supersede or modify * the terms of any separate license agreement you may have executed * with Licensor regarding such Contributions. * * 6. Trademarks. This License does not grant permission to use the trade * names, trademarks, service marks, or product names of the Licensor, * except as required for reasonable and customary use in describing the * origin of the Work and reproducing the content of the NOTICE file. * * 7. Disclaimer of Warranty. Unless required by applicable law or * agreed to in writing, Licensor provides the Work (and each * Contributor provides its Contributions) on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied, including, without limitation, any warranties or conditions * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A * PARTICULAR PURPOSE. You are solely responsible for determining the * appropriateness of using or redistributing the Work and assume any * risks associated with Your exercise of permissions under this License. * * 8. Limitation of Liability. In no event and under no legal theory, * whether in tort (including negligence), contract, or otherwise, * unless required by applicable law (such as deliberate and grossly * negligent acts) or agreed to in writing, shall any Contributor be * liable to You for damages, including any direct, indirect, special, * incidental, or consequential damages of any character arising as a * result of this License or out of the use or inability to use the * Work (including but not limited to damages for loss of goodwill, * work stoppage, computer failure or malfunction, or any and all * other commercial damages or losses), even if such Contributor * has been advised of the possibility of such damages. * * 9. Accepting Warranty or Additional Liability. While redistributing * the Work or Derivative Works thereof, You may choose to offer, * and charge a fee for, acceptance of support, warranty, indemnity, * or other liability obligations and/or rights consistent with this * License. However, in accepting such obligations, You may act only * on Your own behalf and on Your sole responsibility, not on behalf * of any other Contributor, and only if You agree to indemnify, * defend, and hold each Contributor harmless for any liability * incurred by, or claims asserted against, such Contributor by reason * of your accepting any such warranty or additional liability. * * END OF TERMS AND CONDITIONS * * APPENDIX: How to apply the Apache License to your work. * * To apply the Apache License to your work, attach the following * boilerplate notice, with the fields enclosed by brackets "{}" * replaced with your own identifying information. (Don't include * the brackets!) The text should be enclosed in the appropriate * comment syntax for the file format. We also recommend that a * file or class name and description of purpose be included on the * same "printed page" as the copyright notice for easier * identification within third-party archives. * * Copyright 2014 <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. */ package org.jooby.neo4j; import static iot.jcypher.database.DBProperties.DATABASE_DIR; import static iot.jcypher.database.DBProperties.SERVER_ROOT_URI; import static java.util.Objects.requireNonNull; import java.io.IOException; import java.lang.reflect.Field; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.Properties; import java.util.concurrent.atomic.AtomicInteger; import org.jooby.Env; import org.jooby.Env.ServiceKey; import org.jooby.Jooby.Module; import org.neo4j.driver.v1.AuthTokens; import org.neo4j.driver.v1.Driver; import org.neo4j.driver.v1.GraphDatabase; import org.neo4j.driver.v1.Session; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.factory.GraphDatabaseBuilder; import org.neo4j.graphdb.factory.GraphDatabaseFactory; import org.neo4j.logging.slf4j.Slf4jLogProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.bridge.SLF4JBridgeHandler; import com.google.inject.Binder; import com.typesafe.config.Config; import com.typesafe.config.ConfigException; import com.typesafe.config.ConfigFactory; import com.typesafe.config.ConfigValue; import com.typesafe.config.ConfigValueFactory; import com.typesafe.config.ConfigValueType; import iot.jcypher.database.DBProperties; import iot.jcypher.database.IDBAccess; import iot.jcypher.database.embedded.AbstractEmbeddedDBAccess; import iot.jcypher.database.embedded.EmbeddedDBAccess; import iot.jcypher.database.remote.BoltDBAccess; /** * <h1>neo4j</h1> * <p> * <a href="https://neo4j.com">Neo4j</a> is a highly scalable native graph database that leverages * data relationships as first-class entities, helping enterprises build intelligent applications to * meet today’s evolving data challenges. * </p> * * <p> * This module give you access to <a href="https://neo4j.com">neo4j</a> and * <a href="https://github.com/Wolfgang-Schuetzelhofer/jcypher">jcypher</a> APIs. * </p> * * <h2>exports</h2> * <ul> * <li>GraphDatabaseService for embedded neo4j instances.</li> * <li>Driver and Session objects for remote instances</li> * <li>IDBAccess object</li> * </ul> * * <h2>usage</h2> * * <pre>{@code * { * use(new Neo4j()); * * get("/driver", () -> { * // work with driver * Driver driver = require(Driver.class); * }); * * get("/session", () -> { * // work with session * Session session = require(Session.class); * }); * * get("/dbaccess", () -> { * // work with driver * BoltDBAccess dbaccess = require(BoltDBAccess.class); * }); * } * }</pre> * * <p> * application.conf * </p> * <pre> * db.url = "bolt://localhost:7687" * db.user = myuser * db.password = <PASSWORD> * </pre> * * <h2>embedded</h2> * <p> * In addition to remote access using <code>bolt</code> protocol, this module provide * access to <code>embedded</code> neo4j instances: * </p> * * <p> * In memory mode: * </p> * <pre>{@code * { * use(new Neo4j("mem")); * } * }</pre> * * <p> * File system mode: * </p> * <pre>{@code * { * use(new Neo4j("fs")); * } * }</pre> * * <p> * Optionally you can specify the desired path: * </p> * <pre>{@code * { * use(new Neo4j(Paths.get("path", "mydb"))); * } * }</pre> * * <p> * The embedded mode allow you to access {@link GraphDatabaseService} instances: * </p> * * <pre>{@code * { * use(new Neo4j("mem")); * * get("/", () -> { * GraphDatabaseService db = require(GraphDatabaseService.class); * }); * } * }</pre> * * <p> * As well as {@link EmbeddedDBAccess}: * </p> * <pre>{@code * { * use(new Neo4j("mem")); * * get("/", () -> { * EmbeddedDBAccess db = require(EmbeddedDBAccess.class); * }); * } * }</pre> * * <h2>runtime modules</h2> * <p> * This option is available for <code>embedded</code> Neo4j instances and we allow to configure one * or more runtime modules via <code>.conf</code> file: * </p> * * <pre> * com.graphaware.runtime.enabled = true * * com.graphaware.module = [{ * class: com.graphaware.neo4j.expire.ExpirationModuleBootstrapper * nodeExpirationProperty: _expire * }, { * class: com.graphaware.neo4j.expire.AnotherModule * modProp: modValue * }] * </pre> * * <p> * You first need to <code>enabled</code> the graph runtime framework by setting the * <code>com.graphaware.runtime.enabled</code> property. * </p> * * <p> * Then you need to add one or more modules under the <code>com.graphaware.module</code> * property path. * </p> * * <h2>two or more connections</h2> * <p> * Two or more connection is available by setting and installing multiples {@link Neo4j} modules: * </p> * * <pre>{@code * { * use(new Neo4j("db1")); * * use(new Neo4j("db2")); * * get("/", () -> { * Driver db1 = require("db1", Driver.class); * BoltDBAccess bolt1 = require("db1", BoltDBAccess.class); * * Driver db2 = require("db2", Driver.class); * BoltDBAccess bolt2 = require("db2", BoltDBAccess.class); * }); * } * }</pre> * * <p> * application.conf: * </p> * * <pre> * db1.url = "bolt://localhost:7687" * db1.user = db1user * db1.password = <PASSWORD> * * db2.url = "bolt://localhost:7687" * db2.user = db2user * db2.password = <PASSWORD> * </pre> * * <h2>options</h2> * <p> * <a href="https://neo4j.com">Neo4j</a> options are available via <code>.conf</code> file: * </p> * * <pre> * neo4j.dbms.read_only = true * neo4j.unsupported.dbms.block_size.array_properties = 120 * </pre> * * @author edgar * @author sbcd90 */ public class Neo4j implements Module { static { if (!SLF4JBridgeHandler.isInstalled()) { SLF4JBridgeHandler.removeHandlersForRootLogger(); SLF4JBridgeHandler.install(); } } /** The logging system. */ private final Logger log = LoggerFactory.getLogger(getClass()); private String db; /** * Creates a new {@link Neo4j} module. * * @param db Database type: <code>mem</code>, <code>fs</code>, * <code>path</code> for embedded database or <code>property</code> pointing the * a database server or one of the previously described values. */ public Neo4j(final String db) { this.db = requireNonNull(db, "Database required."); } /** * Creates a new embedded {@link Neo4j} module. * * @param db Path to store the database. */ public Neo4j(final Path db) { this(db.toAbsolutePath().toString()); } /** * Creates a new {@link Neo4j} module a <code>db</code> property must be defined in your * <code>.conf</code> file. Property value must be one of: <code>mem</code>, <code>fs</code>, * <code>file system path</code> or <code>bolt url</code>. * */ public Neo4j() { this("db"); } @SuppressWarnings({"unchecked", "rawtypes" }) @Override public void configure(final Env env, final Config conf, final Binder binder) throws Throwable { String db = database(conf, this.db); Properties props = props(neo4j(conf, this.db)); ServiceKey keys = env.serviceKey(); IDBAccess dbaccess = dbaccess(conf, this.db, db, props, keys, binder); Arrays.asList(props.getProperty(SERVER_ROOT_URI), props.getProperty(DATABASE_DIR)) .stream() .filter(Objects::nonNull) .findFirst() .ifPresent(it -> log.info("Starting neo4j: {}", it)); Class dbaccessType = dbaccess.getClass(); keys.generate(IDBAccess.class, this.db, k -> binder.bind(k).toInstance(dbaccess)); keys.generate(dbaccessType, this.db, k -> binder.bind(k).toInstance(dbaccess)); env.onStop(dbaccess::close); } @Override public Config config() { return ConfigFactory.empty(getClass().getName().toLowerCase() + ".conf") .withValue("neo4j.session.label", ConfigValueFactory.fromAnyRef("session")); } private Config neo4j(final Config conf, final String db) { Config result = conf.hasPath("com.graphaware") ? ConfigFactory.empty().withValue("com.graphaware", conf.getConfig("com.graphaware").root()) : ConfigFactory.empty(); String[] paths = {"neo4j", db, "neo4j." + db }; for (String path : paths) { try { if (conf.hasPath(path)) { Config it = conf.getConfig(path); result = it.withFallback(result); } } catch (ConfigException x) { // Skip/ignore bad path } } return result; } @SuppressWarnings("deprecation") private IDBAccess dbaccess(final Config conf, final String dbkey, final String db, final Properties props, final Env.ServiceKey keys, final Binder binder) throws Exception { // remote if (db.startsWith("bolt")) { String username = conf.getString(dbkey + ".user"); String password = conf.getString(dbkey + ".password"); Driver driver = GraphDatabase.driver(db, AuthTokens.basic(username, password)); Session session = driver.session(); props.setProperty(DBProperties.SERVER_ROOT_URI, db); keys.generate(Driver.class, dbkey, k -> binder.bind(k).toInstance(driver)); keys.generate(Session.class, dbkey, k -> binder.bind(k).toInstance(session)); BoltDBAccess dbaccess = new BoltDBAccess(); dbaccess.initialize(props); driverhack(dbaccess, driver); return dbaccess; } boolean mem = db.equals("mem"); Path path = (db.equals("fs") || mem ? Paths.get(conf.getString("application.tmpdir")).resolve("neo4j" + db) : Paths.get(db)).toAbsolutePath(); props.setProperty(DBProperties.DATABASE_DIR, path.toString()); if (mem) { // clean up existing database rm(path); } GraphDatabaseBuilder builder = new GraphDatabaseFactory() .setUserLogProvider(new Slf4jLogProvider()) .newEmbeddedDatabaseBuilder(path.toFile()); props.forEach((k, v) -> builder.setConfig(k.toString(), v.toString())); GraphDatabaseService graphDatabaseService = builder.newGraphDatabase(); keys.generate(GraphDatabaseService.class, dbkey, k -> binder.bind(k).toInstance(graphDatabaseService)); EmbeddedDBAccess dbaccess = new EmbeddedDBAccess(); dbaccess.initialize(props); dbServicehack(dbaccess, graphDatabaseService); return dbaccess; } private String database(final Config conf, final String db) { String[] paths = {db + ".url", db }; for (String path : paths) { if (conf.hasPath(path)) { return conf.getString(path); } } if (db.equals("db")) { throw new ConfigException.Missing(db); } // path return db; } private Properties props(final Config conf) { Properties props = new Properties(); conf.entrySet().stream() .filter(it -> !it.getKey().startsWith("com.graphaware.module")) .forEach(prop -> { String key = prop.getKey(); Object value = prop.getValue().unwrapped(); props.put(key, value); }); // write module: if (conf.hasPath("com.graphaware.module")) { ConfigValue raw = conf.getValue("com.graphaware.module"); List<Config> modules = new ArrayList<>(); if (raw.valueType() == ConfigValueType.LIST) { modules.addAll(conf.getConfigList("com.graphaware.module")); } else { modules.add(conf.getConfig("com.graphaware.module")); } AtomicInteger nextOrder = new AtomicInteger(0); modules.forEach(module -> { String type = module.getString("class"); int order = nextOrder.incrementAndGet(); String key = "com.graphaware.module.m" + order; props.put(key + "." + order, type); module.withoutPath("class").root() .forEach((k, v) -> props.put(key + "." + k, v.unwrapped().toString())); }); } log.debug("neo4j properties: {}", props); return props; } static void driverhack(final BoltDBAccess dbaccess, final Driver value) throws Exception { fieldhack(BoltDBAccess.class, dbaccess, "driver", value); } static void dbServicehack(final EmbeddedDBAccess dbaccess, final GraphDatabaseService value) throws Exception { fieldhack(AbstractEmbeddedDBAccess.class, dbaccess, "graphDb", value); } @SuppressWarnings("rawtypes") static void fieldhack(final Class owner, final Object instance, final String name, final Object value) throws Exception { Field field = owner.getDeclaredField(name); field.setAccessible(true); field.set(instance, value); } static void rm(final Path path) throws IOException { if (Files.exists(path)) { Files.walkFileTree(path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { Files.delete(file); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(final Path dir, final IOException exc) throws IOException { Files.delete(dir); return FileVisitResult.CONTINUE; } }); } } }
<gh_stars>1-10 import type { CodecHash, Hash } from '../interfaces'; import type { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types'; import type { CompactEncodable } from './types'; import BN from 'bn.js'; /** * @name Compact * @description * A compact length-encoding codec wrapper. It performs the same function as Length, however * differs in that it uses a variable number of bytes to do the actual encoding. This is mostly * used by other types to add length-prefixed encoding, or in the case of wrapped types, taking * a number and making the compact representation thereof */ export declare class Compact<T extends CompactEncodable> implements ICompact<T> { #private; readonly registry: Registry; createdAtHash?: Hash; constructor(registry: Registry, Type: Constructor<T> | keyof InterfaceTypes, value?: Compact<T> | AnyNumber); static with<T extends CompactEncodable>(Type: Constructor<T> | keyof InterfaceTypes): Constructor<Compact<T>>; /** @internal */ static decodeCompact<T extends CompactEncodable>(registry: Registry, Type: Constructor<T>, value: Compact<T> | AnyNumber): CompactEncodable; /** * @description The length of the value when encoded as a Uint8Array */ get encodedLength(): number; /** * @description returns a hash of the contents */ get hash(): CodecHash; /** * @description Checks if the value is an empty value */ get isEmpty(): boolean; /** * @description Returns the number of bits in the value */ bitLength(): number; /** * @description Compares the value of the input to see if there is a match */ eq(other?: unknown): boolean; /** * @description Returns a BigInt representation of the number */ toBigInt(): bigint; /** * @description Returns the BN representation of the number */ toBn(): BN; /** * @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation */ toHex(isLe?: boolean): string; /** * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information */ toHuman(isExtended?: boolean): AnyJson; /** * @description Converts the Object to JSON, typically used for RPC transfers */ toJSON(): AnyJson; /** * @description Returns the number representation for the value */ toNumber(): number; /** * @description Returns the base runtime type name for this instance */ toRawType(): string; /** * @description Returns the string representation of the value */ toString(): string; /** * @description Encodes the value as a Uint8Array as per the SCALE specifications * @param isBare true when the value has none of the type-specific prefixes (internal) */ toU8a(isBare?: boolean): Uint8Array; /** * @description Returns the embedded [[UInt]] or [[Moment]] value */ unwrap(): T; }
<reponame>AttractiveMinki/Alzzabaegi package com.mycom.app.domain.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; import java.util.Date; @Entity @Data @AllArgsConstructor @NoArgsConstructor @DynamicInsert @DynamicUpdate @Table(name="STAGE") public class Stage { @Id private long StageId; @Column(length = 20) private String userId; private int gameCode; private int curStage; }
<gh_stars>0 for x, y in map(None, a, b): print x, y
<reponame>abhatikar/training_extensions /** * Copyright (c) 2020 Intel Corporation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import {IAbstractList} from '@idlp/root/models'; import {IProblem} from '@idlp/routed/problem-list/problem-list.models'; export class ProblemList { static readonly type = 'PROBLEM_LIST'; constructor(public data: IAbstractList<IProblem>) { } } export class ProblemCreate { static readonly type = 'PROBLEM_CREATE'; constructor(public data: IProblem) { } } export class ProblemDelete { static readonly type = 'PROBLEM_DELETE'; constructor(public data: any) { } }
module ChangeSets class MemberRelationshipChangeSet attr_writer :applicable_policies include ::ChangeSets::SimpleMaintenanceTransmitter def applicable?(member, resource, now_or_future_active_policies) return false if member.blank? return false if resource.relationships.empty? # Put a check here to see if there even ARE relationship entries on the # resource !select_applicable_policies(member, resource, now_or_future_active_policies).empty? end def perform_update(member, resource, now_or_future_active_policies) policies_to_transmit = select_applicable_policies(member, resource, now_or_future_active_policies) relationship_mapping = member_relationship_mapping(member, resource) policies_to_transmit.each do |pol| member_ids_to_search = pol.active_member_ids updated_member_id = nil pol.enrollees.each do |en| if !en.subscriber? if member_ids_to_search.include?(en.m_id) if relationship_mapping.has_key?(en.m_id) if relationship_mapping[en.m_id] != en.rel_code en.update_attributes!({:rel_code => relationship_mapping[en.m_id]}) notify_policies("change", "personnel_data", en.m_id, [pol], "urn:openhbx:terms:v1:enrollment#change_relationship") end end end end end end true end def member_relationship_mapping(member, resource) relationship_mapping = {} resource.relationships.each do |rel| if (member.hbx_member_id == rel.object_individual_member_id) relationship_mapping[rel.subject_individual_member_id] = rel.glue_relationship end end relationship_mapping end # Find applicable policies to be updated due to relationship change. Only supports IVL market # Return array of applicable policies. Return empty array if no relationship changed. def select_applicable_policies(member, resource, policy_list) return @applicable_policies if @applicable_policies @applicable_policies = [] relationship_mapping = member_relationship_mapping(member, resource) has_dependent_policies = policy_list.select do |pol| (pol.active_member_ids.count > 1) && (pol.subscriber.m_id == member.hbx_member_id) && (!pol.is_shop?) end return [] if has_dependent_policies.empty? has_dependent_policies.each do |pol| pol.enrollees.each do |en| unless en.subscriber? if relationship_mapping.has_key?(en.m_id) if (en.rel_code != relationship_mapping[en.m_id]) @applicable_policies << pol break end end end end end @applicable_policies end #end select_applicable_policies end end
#!/usr/bin/env bash # installer for pyvenv # create directory .pyvenv if it doesn't exist already [ ! -d "~/.pyvenv" ] && mkdir ~/.pyvenv # move pyvenv and create_python there /usr/bin/cp pyvenv create_python ~/.pyvenv # source cat <<EOF >> ~/.bashrc # pyvenv setup ########################################################### source $HOME/.pyvenv/pyvenv ########################################################### EOF echo "Installation completed!"
package jadx.core.dex.nodes; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.function.Consumer; import java.util.function.Function; import org.jetbrains.annotations.Nullable; import jadx.api.ICodeWriter; import jadx.api.plugins.input.insns.InsnData; import jadx.core.dex.attributes.AFlag; import jadx.core.dex.attributes.AType; import jadx.core.dex.attributes.nodes.LineAttrNode; import jadx.core.dex.instructions.InsnType; import jadx.core.dex.instructions.args.ArgType; import jadx.core.dex.instructions.args.InsnArg; import jadx.core.dex.instructions.args.InsnWrapArg; import jadx.core.dex.instructions.args.RegisterArg; import jadx.core.dex.instructions.args.SSAVar; import jadx.core.utils.InsnRemover; import jadx.core.utils.InsnUtils; import jadx.core.utils.Utils; import jadx.core.utils.exceptions.JadxRuntimeException; public class InsnNode extends LineAttrNode { protected final InsnType insnType; private RegisterArg result; private final List<InsnArg> arguments; protected int offset; public InsnNode(InsnType type, int argsCount) { this(type, argsCount == 0 ? Collections.emptyList() : new ArrayList<>(argsCount)); } public InsnNode(InsnType type, List<InsnArg> args) { this.insnType = type; this.arguments = args; this.offset = -1; for (InsnArg arg : args) { attachArg(arg); } } public static InsnNode wrapArg(InsnArg arg) { InsnNode insn = new InsnNode(InsnType.ONE_ARG, 1); insn.addArg(arg); return insn; } public void setResult(@Nullable RegisterArg res) { this.result = res; if (res != null) { res.setParentInsn(this); SSAVar ssaVar = res.getSVar(); if (ssaVar != null) { ssaVar.setAssign(res); } } } public void addArg(InsnArg arg) { arguments.add(arg); attachArg(arg); } public void setArg(int n, InsnArg arg) { arguments.set(n, arg); attachArg(arg); } protected void attachArg(InsnArg arg) { arg.setParentInsn(this); if (arg.isRegister()) { RegisterArg reg = (RegisterArg) arg; SSAVar ssaVar = reg.getSVar(); if (ssaVar != null) { ssaVar.use(reg); } } } public InsnType getType() { return insnType; } public RegisterArg getResult() { return result; } public Iterable<InsnArg> getArguments() { return arguments; } public int getArgsCount() { return arguments.size(); } public InsnArg getArg(int n) { return arguments.get(n); } public boolean containsArg(InsnArg arg) { if (getArgsCount() == 0) { return false; } for (InsnArg a : arguments) { if (a == arg) { return true; } } return false; } public boolean containsVar(RegisterArg arg) { if (getArgsCount() == 0) { return false; } return InsnUtils.containsVar(arguments, arg); } /** * Replace instruction arg with another using recursive search. */ public boolean replaceArg(InsnArg from, InsnArg to) { int count = getArgsCount(); for (int i = 0; i < count; i++) { InsnArg arg = arguments.get(i); if (arg == from) { InsnRemover.unbindArgUsage(null, arg); setArg(i, to); return true; } if (arg.isInsnWrap() && ((InsnWrapArg) arg).getWrapInsn().replaceArg(from, to)) { return true; } } return false; } protected boolean removeArg(InsnArg arg) { int index = getArgIndex(arg); if (index == -1) { return false; } removeArg(index); return true; } public InsnArg removeArg(int index) { InsnArg arg = arguments.get(index); arguments.remove(index); InsnRemover.unbindArgUsage(null, arg); return arg; } public int getArgIndex(InsnArg arg) { int count = getArgsCount(); for (int i = 0; i < count; i++) { if (arg == arguments.get(i)) { return i; } } return -1; } protected void addReg(InsnData insn, int i, ArgType type) { addArg(InsnArg.reg(insn, i, type)); } protected void addReg(int regNum, ArgType type) { addArg(InsnArg.reg(regNum, type)); } protected void addLit(long literal, ArgType type) { addArg(InsnArg.lit(literal, type)); } protected void addLit(InsnData insn, ArgType type) { addArg(InsnArg.lit(insn, type)); } public int getOffset() { return offset; } public void setOffset(int offset) { this.offset = offset; } public void getRegisterArgs(Collection<RegisterArg> collection) { for (InsnArg arg : this.getArguments()) { if (arg.isRegister()) { collection.add((RegisterArg) arg); } else if (arg.isInsnWrap()) { ((InsnWrapArg) arg).getWrapInsn().getRegisterArgs(collection); } } } public boolean isConstInsn() { switch (getType()) { case CONST: case CONST_STR: case CONST_CLASS: return true; default: return false; } } public boolean canRemoveResult() { switch (getType()) { case INVOKE: case CONSTRUCTOR: return true; default: return false; } } public boolean canReorder() { if (contains(AFlag.DONT_GENERATE)) { if (getType() == InsnType.MONITOR_EXIT) { return false; } return true; } for (InsnArg arg : getArguments()) { if (arg.isInsnWrap()) { InsnNode wrapInsn = ((InsnWrapArg) arg).getWrapInsn(); if (!wrapInsn.canReorder()) { return false; } } } switch (getType()) { case CONST: case CONST_STR: case CONST_CLASS: case CAST: case MOVE: case ARITH: case NEG: case CMP_L: case CMP_G: case CHECK_CAST: case INSTANCE_OF: case FILL_ARRAY: case FILLED_NEW_ARRAY: case NEW_ARRAY: case STR_CONCAT: return true; default: return false; } } public boolean canReorderRecursive() { if (!canReorder()) { return false; } for (InsnArg arg : this.getArguments()) { if (arg.isInsnWrap()) { InsnNode wrapInsn = ((InsnWrapArg) arg).getWrapInsn(); if (!wrapInsn.canReorderRecursive()) { return false; } } } return true; } public boolean containsWrappedInsn() { for (InsnArg arg : this.getArguments()) { if (arg.isInsnWrap()) { return true; } } return false; } /** * Visit this instruction and all inner (wrapped) instructions */ public void visitInsns(Consumer<InsnNode> visitor) { visitor.accept(this); for (InsnArg arg : this.getArguments()) { if (arg.isInsnWrap()) { ((InsnWrapArg) arg).getWrapInsn().visitInsns(visitor); } } } /** * Visit this instruction and all inner (wrapped) instructions * To terminate visiting return non-null value */ @Nullable public <R> R visitInsns(Function<InsnNode, R> visitor) { R result = visitor.apply(this); if (result != null) { return result; } for (InsnArg arg : this.getArguments()) { if (arg.isInsnWrap()) { InsnNode innerInsn = ((InsnWrapArg) arg).getWrapInsn(); R res = innerInsn.visitInsns(visitor); if (res != null) { return res; } } } return null; } /** * 'Soft' equals, don't compare arguments, only instruction specific parameters. */ public boolean isSame(InsnNode other) { if (this == other) { return true; } if (insnType != other.insnType) { return false; } int size = arguments.size(); if (size != other.arguments.size()) { return false; } // check wrapped instructions for (int i = 0; i < size; i++) { InsnArg arg = arguments.get(i); InsnArg otherArg = other.arguments.get(i); if (arg.isInsnWrap()) { if (!otherArg.isInsnWrap()) { return false; } InsnNode wrapInsn = ((InsnWrapArg) arg).getWrapInsn(); InsnNode otherWrapInsn = ((InsnWrapArg) otherArg).getWrapInsn(); if (!wrapInsn.isSame(otherWrapInsn)) { return false; } } } return true; } /** * 'Hard' equals, compare all arguments */ public boolean isDeepEquals(InsnNode other) { if (this == other) { return true; } return isSame(other) && Objects.equals(result, other.result) && Objects.equals(arguments, other.arguments); } protected final <T extends InsnNode> T copyCommonParams(T copy) { if (copy.getArgsCount() == 0) { for (InsnArg arg : this.getArguments()) { copy.addArg(arg.duplicate()); } } copy.copyAttributesFrom(this); copy.copyLines(this); copy.setOffset(this.getOffset()); return copy; } public void copyAttributesFrom(InsnNode attrNode) { super.copyAttributesFrom(attrNode); this.addSourceLineFrom(attrNode); } /** * Make copy of InsnNode object. * <br> * NOTE: can't copy instruction with result argument * (SSA variable can't be used in two different assigns). * <br> * Prefer use next methods: * <ul> * <li>{@link #copyWithoutResult()} to explicitly state that result not needed * <li>{@link #copy(RegisterArg)} to provide new result arg * <li>{@link #copyWithNewSsaVar(MethodNode)} to make new SSA variable for result arg * </ul> */ public InsnNode copy() { if (this.getClass() != InsnNode.class) { throw new JadxRuntimeException("Copy method not implemented in insn class " + this.getClass().getSimpleName()); } return copyCommonParams(new InsnNode(insnType, getArgsCount())); } /** * See {@link #copy()} */ @SuppressWarnings("unchecked") public <T extends InsnNode> T copyWithoutResult() { return (T) copy(); } public InsnNode copyWithoutSsa() { InsnNode copy = copyWithoutResult(); if (result != null) { if (result.getSVar() == null) { copy.setResult(result.duplicate()); } else { throw new JadxRuntimeException("Can't copy if SSA var is set"); } } return copy; } /** * See {@link #copy()} */ public InsnNode copy(RegisterArg newReturnArg) { InsnNode copy = copy(); copy.setResult(newReturnArg); return copy; } /** * See {@link #copy()} */ public InsnNode copyWithNewSsaVar(MethodNode mth) { RegisterArg result = getResult(); if (result == null) { throw new JadxRuntimeException("Result in null"); } int regNum = result.getRegNum(); RegisterArg resDupArg = result.duplicate(regNum, null); mth.makeNewSVar(resDupArg); return copy(resDupArg); } /** * Fix SSAVar info in register arguments. * Must be used after altering instructions. */ public void rebindArgs() { RegisterArg resArg = getResult(); if (resArg != null) { resArg.getSVar().setAssign(resArg); } for (InsnArg arg : getArguments()) { if (arg instanceof RegisterArg) { RegisterArg reg = (RegisterArg) arg; SSAVar ssaVar = reg.getSVar(); ssaVar.use(reg); ssaVar.updateUsedInPhiList(); } else if (arg instanceof InsnWrapArg) { ((InsnWrapArg) arg).getWrapInsn().rebindArgs(); } } } public boolean canThrowException() { switch (getType()) { case RETURN: case IF: case GOTO: case MOVE: case MOVE_EXCEPTION: case NEG: case CONST: case CONST_STR: case CONST_CLASS: case CMP_L: case CMP_G: case NOP: return false; default: return true; } } public void inheritMetadata(InsnNode sourceInsn) { if (insnType == InsnType.RETURN) { this.copyLines(sourceInsn); if (this.contains(AFlag.SYNTHETIC)) { this.setOffset(sourceInsn.getOffset()); this.rewriteAttributeFrom(sourceInsn, AType.CODE_COMMENTS); } else { this.copyAttributeFrom(sourceInsn, AType.CODE_COMMENTS); } } else { this.copyAttributeFrom(sourceInsn, AType.CODE_COMMENTS); this.addSourceLineFrom(sourceInsn); } } /** * Compare instruction only by identity. */ @SuppressWarnings("EmptyMethod") @Override public final int hashCode() { return super.hashCode(); } /** * Compare instruction only by identity. */ @Override public final boolean equals(Object obj) { return super.equals(obj); } protected void appendArgs(StringBuilder sb) { if (arguments.isEmpty()) { return; } String argsStr = Utils.listToString(arguments); if (argsStr.length() < 120) { sb.append(argsStr); } else { // wrap args String separator = ICodeWriter.NL + " "; sb.append(separator).append(Utils.listToString(arguments, separator)); sb.append(ICodeWriter.NL); } } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(InsnUtils.formatOffset(offset)); sb.append(": "); sb.append(InsnUtils.insnTypeToString(insnType)); if (result != null) { sb.append(result).append(" = "); } appendArgs(sb); return sb.toString(); } }
<gh_stars>1-10 import { currentDriver } from '../../../../dataSources'; import { services } from '../../../../dataSources/services'; const getSQLValue = value => { const quotedStringRegex = /^".*"$/; let sqlValue = value; if (!quotedStringRegex.test(value)) { sqlValue = value.toLowerCase(); } return sqlValue.replace(/['"]+/g, ''); }; const getDefaultSchema = driver => { if (driver === 'postgres') return 'public'; if (driver === 'mssql') return 'dbo'; }; export const parseCreateSQL = (sql, driver = currentDriver) => { const _objects = []; const regExp = services[driver].createSQLRegex; const matches = sql.match(new RegExp(regExp, 'gmi')); if (matches) { matches.forEach(element => { const itemMatch = element.match(new RegExp(regExp, 'i')); if (itemMatch && itemMatch.length === 6) { const _object = {}; const type = itemMatch[1]; // If group 5 is undefined, use group 3 and 4 for schema and table respectively // If group 5 is present, use group 5 for table name using public schema. let name; let schema; if (itemMatch[5]) { name = itemMatch[5]; schema = getDefaultSchema(driver); } else { name = itemMatch[4]; schema = itemMatch[3]; } _object.type = type.toLowerCase(); _object.name = getSQLValue(name); _object.schema = getSQLValue(schema); _objects.push(_object); } }); } return _objects; };
<filename>exercises/src/test/scala/fpinscala/datastructures/ListSpec.scala package fpinscala.datastructures import org.scalatest.{FlatSpec, Matchers} class ListSpec extends FlatSpec with Matchers { // Exercise 2 "A List" should "fail to get the tail of Nil" in { a[RuntimeException] shouldBe thrownBy(List.tail(Nil)) } it should "get the tail of a non empty list" in { List.tail(List(1, 2, 3)) shouldBe List(2, 3) } it should "get Nil as the tail of a single element list" in { List.tail(List(true)) shouldBe Nil } // Exercise 3 it should "set the head of a non empty list" in { List.setHead(List(1, 2, 3), 0) shouldBe List(0, 2, 3) } it should "set the head of Nil" in { List.setHead(Nil, 1) shouldBe List(1) } // Exercise 4 it should "attempt to drop 3 elements from Nil" in { List.drop(Nil, 3) shouldBe Nil } it should "drop 2 elements from a non empty list" in { List.drop(List(1, 2, 3), 2) shouldBe List(3) } it should "drop n elements from a list with n - 1 elements in it" in { List.drop(List(1, 2, 3), 4) shouldBe Nil } // Exercise 5 it should "drop elements from Nil while the provided predicate keeps returning true" in { List.dropWhile(Nil, (_: Int) => true) shouldBe Nil } it should "drop all elements from non empty list while the provided predicate keeps returning true" in { List.dropWhile(List(1, 2, 3), (_: Int) => true) shouldBe Nil } it should "drop elements from a list of integers while they are even" in { List.dropWhile(List(2, 4, 5, 6), (i: Int) => i % 2 == 0) shouldBe List(5, 6) } // Exercise 6 it should "get Nil as the init of Nil" in { List.init(Nil) shouldBe Nil } it should "get the init of a non empty list" in { List.init(List(1, 2, 3)) shouldBe List(1, 2) } // Exercise 9 it should "calculate the length of Nil as 0" in { List.length(Nil) shouldBe 0 } it should "calculate the length of Cons with Nil tail as 1" in { List.length(Cons("first!", Nil)) shouldBe 1 } it should "calculate the length of List constructed from varargs correctly" in { List.length(List(1, 2)) shouldBe 2 } it should "calculate the length of List constructed by appending 2 lists as the sum of their lengths" in { List.length(List.append(List(1, 2), List(3))) shouldBe 3 } // Exercise 10 it should "subtract elements of a list starting from left" in { List.foldLeft(List(1, 2, 3), 0)(_ - _) shouldBe -6 } it should "get zero element from foldLeft on Nil" in { List.foldLeft(Nil, 42)((_, _) => fail()) shouldBe 42 } // Exercise 11 it should "calculate sum, product and length using foldLeft" in { List.sum3(List(1, 2, 3)) shouldBe 6 List.product3(List(2, 4, -1)) shouldBe -8 List.length2(Nil) shouldBe 0 List.length2(List(1, 2, 3)) shouldBe 3 } // Exercise 12 it should "reverse Nil" in { List.reverse(Nil) shouldBe Nil } it should "reverse a non empty list" in { List.reverse(List(1, 2, 3)) shouldBe List(3, 2, 1) } // Exercise 13 it should "left fold elements of Nil using foldRight" in { List.foldLeft2(Nil, true)((_, _) => false) shouldBe true } it should "left fold elements of a non empty list using foldRight" in { List.foldLeft2(List(1, 2, 3), 0)(_ - _) shouldBe -6 } it should "right fold elements of Nil using foldLeft" in { List.foldRight2(Nil, true)((_, _) => false) shouldBe true } it should "right fold elements of a non empty list using foldLeft" in { List.foldRight2(List(1, 2, 3), 0)(_ - _) shouldBe 2 } // Exercise 14 it should "append Nil and non empty list using a fold" in { List.append2(Nil, List(1, 2)) shouldBe List(1, 2) } it should "append non empty list and Nil using a fold" in { List.append2(List(1, 2), Nil) shouldBe List(1, 2) } it should "append two non empty lists using a fold" in { List.append2(List(1, 2), List(3, 4)) shouldBe List(1, 2, 3, 4) } // Exercise 15 it should "flatten Nil" in { List.flatten(Nil) shouldBe Nil } it should "flatten a list of lists" in { List.flatten(List(List(1), List(2))) shouldBe List(1, 2) } // Exercise 16 it should "add 1 to each element of a list of integers" in { List.inc(List(1, 3, 5)) shouldBe List(2, 4, 6) } // Exercise 17 it should "map every element of a list of doubles to string" in { List.d2s(List(0.5d, 0.4d, 0.3d)) shouldBe List("0.5", "0.4", "0.3") } // Exercise 18 it should "map Nil" in { List.map(Nil)((_: Int) => fail()) shouldBe Nil } it should "map a non empty list" in { List.map(List(1, 2))(i => "doubled: " + (i * 2)) shouldBe List( "doubled: 2", "doubled: 4") } // Exercise 19 it should "filter elements of Nil" in { List.filter(Nil)((_: Int) => true) shouldBe Nil } it should "filter elements of a non empty list" in { List.filter(List(1, 2, 3, 4))(_ % 2 == 0) shouldBe List(2, 4) } // Exercise 20 it should "flatMap Nil by applying the function 0 times" in { List.flatMap(Nil)((_: Int) => fail()) shouldBe Nil } it should "repeat every element of a non empty list" in { List.flatMap(List(1, 2, 3))(i => List(i, i)) shouldBe List(1, 1, 2, 2, 3, 3) } it should "drain the list of all elements" in { List.flatMap(List('a', 'b', 'c'))(_ => Nil) shouldBe Nil } // Exercise 21 it should "filter elements of Nil using flatMap" in { List.filter2(Nil)((_: Int) => true) shouldBe Nil } it should "filter elements of a non empty list using flatMap" in { List.filter2(List(1, 2, 3, 4))(_ % 2 == 0) shouldBe List(2, 4) } // Exercise 22 it should "add corresponding elements from 2 lists, one of which is Nil" in { List.addTogether(List(1, 2), Nil) shouldBe Nil List.addTogether(Nil, List(1, 2)) shouldBe Nil } it should "add corresponding elements from 2 provided, non empty lists" in { List.addTogether(List(1, 2, 3), List(10, 20)) shouldBe List(11, 22) } // Exercise 23 it should "zip two lists, one of which is Nil, together" in { List.zipWith(List(1, 2), Nil)((_, _) => fail()) shouldBe Nil List.zipWith(Nil, List(1, 2))((_, _) => fail()) shouldBe Nil } it should "zip two non empty lists together" in { List.zipWith(List(1, 2), List("dog", "cats"))((e1, e2) => e1 + " " + e2) shouldBe List( "1 dog", "2 cats") } // Exercise 24 it should "find subsequence of a list where there is one" in { List.hasSubsequence(List(1, 2, 3), List(1, 2)) shouldBe true } it should "find empty subsequence in a non empty list" in { List.hasSubsequence(List(1, 2), Nil) shouldBe true } it should "find empty subsequence in Nil" in { List.hasSubsequence(Nil, Nil) shouldBe true } it should "not find subsequence of a list where there is none" in { List.hasSubsequence(List(1, 2), List(2, 3)) shouldBe false } it should "not find non empty subsequence of Nil" in { List.hasSubsequence(Nil, List(1)) shouldBe false } }
import React from 'react'; import { StyleSheet, View, TextInput, TouchableOpacity } from 'react-native'; const ProfileForm = () => { return ( <View style={styles.container}> <TextInput style={styles.input} placeholder="Name" /> <TextInput style={styles.input} placeholder="Email" /> <TextInput style={styles.input} placeholder="Phone Number" /> <TouchableOpacity style={styles.button}> <Text style={styles.buttonText}>Save</Text> </TouchableOpacity> </View> ); }; const styles = StyleSheet.create({ container: { flex: 1, padding: 20 }, input: { borderWidth: 1, borderColor: '#D7D7D7', height: 50, marginBottom: 20, paddingLeft: 10 }, button: { backgroundColor: '#7DCEA0', height: 50, justifyContent: 'center', alignItems: 'center' }, buttonText: { color: '#ffffff', fontWeight: 'bold' } }); export default ProfileForm;
import React from 'react'; import ReactDOM from 'react-dom'; const MovieList = (props) => { return ( <ul> {props.movies.map(movie => <li key={movie.name}>{movie.name}: {movie.year}</li>)} </ul> ); } function App() { const movies = [ {name: "Star Wars", year: 1977}, {name: "Beverly Hills Cop", year: 1984}, {name: "Avengers: Endgame", year: 2019} ]; return ( <div> <MovieList movies={movies} /> </div> ); } ReactDOM.render( <App />, document.getElementById('root') );
#!/usr/bin/env bash echo ">> Provisioning VM for Placeholder Project" export DEBIAN_FRONTEND=noninteractive echo ">> Populating database with default data" cd /home/vagrant/lumenbarebone php artisan migrate --seed echo ">> copying laravel env" cp /home/vagrant/lumenbarebone/.env.example /home/vagrant/lumenbarebone/.env cd /home/vagrant/lumenbarebone echo ">> composer install" composer install --verbose echo ">> Finished provision!"
<reponame>zhangyut/wolf<filename>Billiard_2D/app/src/main/java/com/bn/d2/bill/PicLoadUtil.java package com.bn.d2.bill; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; public class PicLoadUtil { public static Bitmap LoadBitmap(Resources res,int picId) { Bitmap result=BitmapFactory.decodeResource(res, picId); return result; } public static Bitmap scaleToFit(Bitmap bm,float ratio) { float width = bm.getWidth(); float height = bm.getHeight(); Matrix m1 = new Matrix(); m1.postScale(ratio, ratio); Bitmap bmResult = Bitmap.createBitmap(bm, 0, 0, (int)width, (int)height, m1, true); return bmResult; } public static Bitmap scaleToFitFullScreen(Bitmap bm,float wRatio,float hRatio) { float width = bm.getWidth(); float height = bm.getHeight(); Matrix m1 = new Matrix(); m1.postScale(wRatio, hRatio); Bitmap bmResult = Bitmap.createBitmap(bm, 0, 0, (int)width, (int)height, m1, true); return bmResult; } }
package commands import ( "provisioner/provisioner" "strings" "provisioner/fs" ) type SetupCFDot struct { CmdRunner provisioner.CmdRunner FS provisioner.FS } func (s *SetupCFDot) Run() error { setupFileContentsBytes, err := s.FS.Read("/var/vcap/jobs/cfdot/bin/setup") if err != nil { return err } return s.FS.Write("/etc/profile.d/cfdot.sh", strings.NewReader(string(setupFileContentsBytes)), fs.FileModeRootReadWrite) } func (s *SetupCFDot) Distro() string { return provisioner.DistributionOSS }
#!/bin/bash UTF8_IPADIC_PATH=./db/ipadic SHAPED_CSV_PATH=./db/csv SQL_PATH=./db/sqlite PATH_TO=$UTF8_IPADIC_PATH \ db/pickup-ipadic-csv.bash PATH_FROM=$UTF8_IPADIC_PATH PATH_TO=$SHAPED_CSV_PATH \ db/format-ipadic-csv.bash CSV_PATH=$SHAPED_CSV_PATH SQL_PATH=$SQL_PATH SQL_NAME=$SQL_NAME\ db/csv2sqlite.bash cp -r $SQL_PATH/words.sqlite3 $COPY_TO
import { Typegoose, prop } from 'typegoose'; export class Category extends Typegoose { @prop({ required: true, index: true }) id?: string; @prop({ required: true }) title?: string; @prop() description?: string; }
<filename>src/main/java/com/example/ui/GetEditRoute.java package com.example.ui; import com.example.appl.CardRepository; import com.example.model.Status; import spark.*; import java.util.HashMap; import java.util.Objects; /** * The {@code GET /editCard} route handler. * Displays the page containing the form for modifying an existing card. * Grabs the card's current data and passes it on to the Freemarker template to pre-fill its fields. * * @author <a href='mailto:<EMAIL>'><NAME></a> */ public class GetEditRoute implements Route { static final String VIEW_NAME = "editCard.ftl"; static final String TITLE = "Edit Card"; private TemplateEngine templateEngine; private CardRepository cardRepository; /** * Constructor for the {@code GET /editCard} route handler. * @param templateEngine The TemplateEngine used for rendering HTML. * @param cardRepository The CardRespository instance holding the Cards for the app */ public GetEditRoute(TemplateEngine templateEngine, CardRepository cardRepository) { Objects.requireNonNull(cardRepository, "cardRepository must not be null"); Objects.requireNonNull(templateEngine, "templateEngine must not be null"); this.templateEngine = templateEngine; this.cardRepository = cardRepository; } /** * {@inheritDoc} */ @Override public Object handle(Request request, Response response) { HashMap<String, Object> vm = new HashMap<>(); String cardUuid = request.queryParams("id"); vm.put("card", cardRepository.getCard(cardUuid)); vm.put("title", TITLE); // Comment-out if you don't want to dynamically build the statuses list. vm.put("statuses", Status.class.getEnumConstants()); return templateEngine.render(new ModelAndView(vm, VIEW_NAME)); } }
<gh_stars>0 try: anobj.lower() + anobj + ''
<reponame>yanbowe/taro-vue3-pinia<gh_stars>1-10 export default defineAppConfig({ pages: ['pages/index/index'], window: { backgroundColor: '#fff', backgroundTextStyle: 'light', navigationBarBackgroundColor: '#fff', navigationBarTitleText: 'Taro3', navigationBarTextStyle: 'black' }, subPackages: [ { root: 'package', pages: ['packageA/index', 'packageB/index'] } ] });
<gh_stars>0 import { Component, OnInit, Input, OnChanges, Output, EventEmitter, } from "@angular/core"; import { AuditTransactionService } from "src/app/services/audit/audit-transaction/audit-transaction.service"; import { AppComponent } from "src/app/app.component"; import { DialogService } from "src/app/services/dialog/dialog.service"; @Component({ selector: "app-audit-transaction-form", templateUrl: "./audit-transaction-form.component.html", styleUrls: ["./audit-transaction-form.component.scss"], }) export class AuditTransactionFormComponent implements OnInit, OnChanges { @Input() rowData: any; @Input() selectedAccountDetails: any; @Input() tempSavedData: any; @Input() defaultScenario: any; @Output() reloadRequest = new EventEmitter<any>(); //Transaction properties scenarios: any; statusCodes: any; actionCodes: any; responsibility = ["client", "website"]; callbackApplicable: boolean; initialLoad: boolean; selectedScenario: string; selectedStatusCode: string; selectedActionCode: string; selectedResponsibility: string; selectedCallBackDate: string; selectedAgentNotes: string; selectedCategory: string; selectedSubcategory: string; transactionData: any; addError: any; onEdit: any; isDisabled: any; remarks: any; categories: any; subcategories: any; constructor( private transactionService: AuditTransactionService, private dialogService: DialogService ) {} ngOnInit() { this.addError = false; this.onEdit = false; this.isDisabled = true; this.callbackApplicable = true; this.initialLoad = true; } ngOnChanges() { if ( this.tempSavedData && this.tempSavedData.Rowid && this.tempSavedData.Rowid == this.rowData.Rowid ) { this.getAllScenarioMaster(); this.getAllCategories(); } } private getAllScenarioMaster() { this.transactionService .getAllScenarioMaster(AppComponent.getCurrentClient().clientId) .subscribe((data: any) => { if (data) { this.scenarios = data; if (this.rowData.Scenario) { this.selectedScenario = this.rowData.Scenario; this.setCallbackApplicable(); this.getAllStatusCodeOperation(this.getScenarioId()); } } }); } private getAllStatusCodeOperation(scnId) { if (!scnId) { return; } this.transactionService .getAllStatusCodeOperation( AppComponent.getCurrentClient().clientId, scnId ) .subscribe((data: any) => { this.statusCodes = data; if (this.initialLoad) { if (this.rowData.Statuscode) { this.selectedStatusCode = this.rowData.Statuscode; this.getAllActioncodeOperation(this.getStatusId()); } } else { if (this.selectedStatusCode) { this.getAllActioncodeOperation(this.getStatusId()); } } }); } private getAllActioncodeOperation(statusID) { if (!statusID) { return; } this.transactionService .getAllActioncodeOperation( AppComponent.getCurrentClient().clientId, statusID ) .subscribe((data: any) => { this.actionCodes = data; if (this.initialLoad) { if (this.rowData.ActionCode) { this.selectedActionCode = this.rowData.ActionCode; } } else { this.selectedActionCode = ""; } }); } private getAllCategories() { this.transactionService.getErrorCatagory().subscribe((data: any) => { this.categories = data; }); } private getSubcategories(category) { let categoryId = null; for (let i = 0; i < this.categories.length; i++) { if (this.categories[i].category == category) { categoryId = this.categories[i].cid; break; } } this.transactionService .getErrorSubCatagory(categoryId) .subscribe((data: any) => { this.subcategories = data; }); } onScenarioChange($event) { this.selectedScenario = $event; this.initialLoad = false; this.selectedStatusCode = ""; this.selectedActionCode = ""; this.rowData.ActionCode = ""; this.actionCodes = null; this.setCallbackApplicable(); this.getAllStatusCodeOperation(this.getScenarioId()); } setCallbackApplicable() { if (this.isDisabled) { return; } let callbackApplicable = null; for (let i = 0; i < this.scenarios.length; i++) { if (this.selectedScenario == this.scenarios[i].scenarioName) { callbackApplicable = this.scenarios[i].callbackApplicable; } } if (!callbackApplicable) { for (let i = 0; i < this.scenarios.length; i++) { if ( this.rowData.Scenario && this.rowData.Scenario == this.scenarios[i].scenarioName ) { callbackApplicable = this.scenarios[i].callbackApplicable; } } } if (callbackApplicable && callbackApplicable == "Y") { this.callbackApplicable = false; } else { this.callbackApplicable = true; } } onStatusCodeChange($event) { this.selectedStatusCode = $event; this.getAllActioncodeOperation(this.getStatusId()); } onActionCodeChange($event) { this.selectedActionCode = $event; } onResponsibilityChange($event) { this.selectedResponsibility = $event; } onAgentNotesChange($event) { this.selectedAgentNotes = $event; } onCategoryChange($event) { this.selectedCategory = $event; this.getSubcategories(this.selectedCategory); } onSubcategoryChange($event) { this.selectedSubcategory = $event; } onRemarksChange($event) { this.remarks = $event; } onEditSelection(selectedAccount) { this.onEdit = true; this.isDisabled = false; this.setCallbackApplicable(); } onUpdate(selectedAccount) { if (!selectedAccount || !selectedAccount.Rowid) { return; } let data = { clientId: AppComponent.getCurrentClient().clientId, rowid: selectedAccount.Rowid, scenario: this.selectedScenario, scnId: 0, statusCode: this.selectedStatusCode, statusid: 0, actionCode: this.selectedActionCode, billable: 0, externalCount: 0, internalCount: 0, responsibility: this.selectedResponsibility, fupdate: null, agentNotes: this.selectedAgentNotes, }; if (this.selectedScenario) { data.scenario = this.selectedScenario; data.scnId = this.getScenarioId(); } else { this.dialogService.openInfoModal("Scenario is required"); return; } if (this.selectedStatusCode) { data.statusCode = this.selectedStatusCode; data.statusid = this.getStatusId(); } else { this.dialogService.openInfoModal("StatusCode is required"); return; } if (this.selectedActionCode) { data.actionCode = this.selectedActionCode; data.billable = this.getBillable(this.selectedActionCode); data.externalCount = this.getExternalCount(this.selectedActionCode); data.internalCount = this.getInternalCount(this.selectedActionCode); } else { this.dialogService.openInfoModal("ActionCode is required"); return; } if (this.selectedResponsibility) { data.responsibility = this.selectedResponsibility; } else { if (this.rowData.Responsibility) { data.responsibility = this.rowData.Responsibility; } else { this.dialogService.openInfoModal("Responsibility is required"); return; } } if (this.selectedAgentNotes) { data.agentNotes = this.selectedAgentNotes; } else { if (this.rowData.AgentNotes) { data.agentNotes = this.rowData.AgentNotes; } else { this.dialogService.openInfoModal("Agent Notes is required"); return; } } if (this.selectedCallBackDate) { data.fupdate = this.selectedCallBackDate; } else { if (this.rowData.FupDate) { data.fupdate = this.rowData.FupDate; } else { delete data.fupdate; } } this.transactionService .updateCurrentAccountByAuditor(data) .subscribe((data) => { if (data) { //Refresh parent component from child this.dialogService.openSuccessModal( "Account was updated successfully" ); this.reloadRequest.emit(true); } else { this.dialogService.openErrorModal( "Error occured while updating account" ); this.reloadRequest.emit(true); } }); } onAddError(selectedAccount) { this.addError = true; } onSaveError(selectedAccount) { let data = { category: null, subCategory: null, auditRemarks: null, rowid: selectedAccount.Rowid, }; if (this.selectedCategory) { data.category = this.selectedCategory; } else { this.dialogService.openInfoModal("Category is required"); return; } if (this.selectedSubcategory) { data.category = this.selectedSubcategory; } else { this.dialogService.openInfoModal("Sub Category is required"); return; } if (this.remarks) { data.auditRemarks = this.remarks; } else { this.dialogService.openInfoModal("Audit Remarks is required"); return; } this.transactionService.saveAccountWithError(data).subscribe((data) => { if (data) { //Refresh parent component from child this.dialogService.openSuccessModal("Account was saved with error"); this.reloadRequest.emit(true); } else { this.reloadRequest.emit(true); this.dialogService.openErrorModal("Error occured while saving account"); } }); } onSaveAudit(selectedAccount) { let data = { rowid: selectedAccount.Rowid, }; this.transactionService.saveAccount(data).subscribe((data) => { if (data) { //Refresh parent component from child this.dialogService.openSuccessModal("Account was saved"); this.reloadRequest.emit(true); } else { this.reloadRequest.emit(true); this.dialogService.openErrorModal("Error occured while saving account"); } }); } getScenarioId() { for (let i = 0; i < this.scenarios.length; i++) { if (this.selectedScenario == this.scenarios[i].scenarioName) { return this.scenarios[i].scenarioID; } } } getStatusId() { for (let i = 0; i < this.statusCodes.length; i++) { if ( this.selectedStatusCode == this.statusCodes[i].statusCode || this.rowData.Statuscode == this.statusCodes[i].statusCode ) { return this.statusCodes[i].statusId; } } } getExternalCount(action) { for (let i = 0; i < this.actionCodes.length; i++) { if (action == this.actionCodes[i].actioncode) { let data = this.actionCodes[i].aid_IA_EA_B.split("|"); return data[2]; } } } getInternalCount(action) { for (let i = 0; i < this.actionCodes.length; i++) { if (action == this.actionCodes[i].actioncode) { let data = this.actionCodes[i].aid_IA_EA_B.split("|"); return data[1]; } } } getBillable(action) { for (let i = 0; i < this.actionCodes.length; i++) { if (action == this.actionCodes[i].actioncode) { let data = this.actionCodes[i].aid_IA_EA_B.split("|"); return data[3]; } } } onCallbackDateSelection($e) { let date = new Date($e); let year = date.getFullYear().toString(); let month = (date.getMonth() + 1).toString(); let day = date.getDate().toString(); if (month) { if (month.toString().length == 1) { month = "0".toString().concat(month.toString()); } } if (day) { if (day.toString().length == 1) { day = "0".toString().concat(day.toString()); } } this.selectedCallBackDate = year + "-" + month + "-" + day; } }
import { Cookie } from '../types'; class CookieManager { private cookies: Cookie[] = []; public setCookie(name: string, value: string, expirationDate: Date): void { const newCookie: Cookie = { name, value, expirationDate }; this.cookies.push(newCookie); } public getCookie(name: string): Cookie | undefined { return this.cookies.find(cookie => cookie.name === name); } public deleteCookie(name: string): void { this.cookies = this.cookies.filter(cookie => cookie.name !== name); } }
<filename>src/context/update.js<gh_stars>10-100 const update = state => { const { _step, _serverDelay, _clientDelay, _scale, _size } = state; const now = Date.now(); state._stop0 = new Date( Math.floor((now - _serverDelay - _clientDelay) / _step) * _step ); state._start0 = new Date(state._stop0 - _size * _step); state._stop1 = new Date(Math.floor((now - _serverDelay) / _step) * _step); state._start1 = new Date(state._stop1 - _size * _step); _scale.domain([state._start0, state._stop0]); return state; }; export default update;
<filename>libs/product/src/models/shop.interface.ts import { Identifiable } from '@price-depo-ui/data-handling'; import { Address } from './address.interface'; export interface Shop extends Identifiable<string> { name: string; address: Address; chainStoreId?: string; }
#!/bin/bash # Execute 'docker-compose xxx', where the value of xxx is provided by # the first command-line arg, or $1. This script mostly exits for # documentation, and as a shortcut for docker-compose. # # Usage: # $ ./compose.sh up # $ ./compose.sh ps # $ ./compose.sh down # # <NAME>, Microsoft, May 2021 # Check if a command-line argument is provided if [ -z "$1" ]; then echo "Usage: $0 <command>" exit 1 fi # Execute the corresponding docker-compose command based on the provided argument case "$1" in up) docker-compose up ;; ps) docker-compose ps ;; down) docker-compose down ;; *) echo "Invalid command. Supported commands: up, ps, down" exit 1 ;; esac
#!/bin/bash # Run this script on a drop.zip file created during a build when figureNNN.png files are created by # failing tests on plotting code. For full instructions, see # libraries/Utilities/psbutils/filecheck.py SCRIPT=$(dirname $0)/../libraries/Utilities/psbutils/install_artifact_files.py if [ ! -e "$SCRIPT" ] then echo File not found: "$SCRIPT" exit -1 fi python "$SCRIPT" "$@"
$(function(){ $('#formauditpendinglist').dataTable({ "bPaginate": true, "iDisplayLength": 50, "bProcessing": true, "bServerSide": true, "sAjaxSource": Django.url('form-audit-data') }); });
const Profiles = require('../../models/profileModel'); function checkIfProfileExists(req, res, next) { const { profileId } = req.body; Profiles.findById(profileId).then((profile) => { if (profile) { next(); } else { res.status(404).json({ error: 'ProfileNotFound' }); } }); } module.exports = checkIfProfileExists;
package jframe.qcloud.model; import java.util.Map; /** * https://cloud.tencent.com/document/product/436/14048 * * <p> * "expiredTime": 1494563462, * "credentials": { * "sessionToken": "sessionTokenXXXXX", * "tmpSecretId": "tmpSecretIdXXXXX", * "tmpSecretKey": "<KEY>" * } * </p> * * 临时签名 * * @author dzh * @date Aug 5, 2018 1:13:36 AM * @version 0.0.1 */ public class TmpSecret { private long expiredTime; private Map<String, String> credentials; public long getExpiredTime() { return expiredTime; } public void setExpiredTime(long expiredTime) { this.expiredTime = expiredTime; } public Map<String, String> getCredentials() { return credentials; } public void setCredentials(Map<String, String> credentials) { this.credentials = credentials; } public String getSessionToken() { return credentials == null ? null : credentials.get("sessionToken"); } public String getTmpSecretId() { return credentials == null ? null : credentials.get("tmpSecretId"); } public String getTmpSecretKey() { return credentials == null ? null : credentials.get("tmpSecretKey"); } }
export CUDA_VISIBLE_DEVICES=1 export export FLAGS_fraction_of_gpu_memory_to_use=0.1 python train.py --data_dir dataset --conf kitti_3d_multi_warmup
import { FilesEngine } from "./common" ; import { PathVar } from "../etc/other/paths" export class Env_FilesLoader extends FilesEngine{ static isLoaded:boolean = false static load(){ if(Env_FilesLoader.isLoaded) return new Env_FilesLoader() // Env_FilesLoader.isLoaded = true } constructor(){ super() super.recursiveSearch(PathVar.getProcessEnv(), "env.js", {runFiles:true}); super.recursiveSearch(PathVar.getAppEnvModule(), "env.js", {runFiles:true}); } }
public class PrimeSum { public int sumPrimes(int n) { boolean[] prime = new boolean[n + 1]; Arrays.fill(prime, true); for (int p = 2; p * p <= n; p++) { if (prime[p] == true) { for (int i = p * p; i <= n; i += p) prime[i] = false; } } int sum = 0; for (int p = 2; p <= n; p++) { if (prime[p]) sum += p; } return sum; } public static void main(String args[]) { int n = 10; System.out.println(sumPrimes(n)); } }
<filename>src/components/Loading/Loading.tsx import React from "react"; import "./Loading.css"; function Loading(props: any) { return ( <div className="display-card" style={{ padding: "24px", margin: "12px" }}> <div className="card-img-style"></div> <div className="loading-info"> <div></div> <div></div> <div></div> </div> </div> ); } export default Loading;
import Foundation let xmlString = "<tag>Hello World!</tag>" if let xmlData = xmlString.data(using: .utf8) { do { let xmlDocument = try XMLDocument(data: xmlData) let tag = xmlDocument.rootElement()?.name print(tag!) // Output: "tag" } catch { print(error) } }
function create2DArray(rows, columns) { let array = new Array(rows); for (let i = 0; i < rows; i++) { array[i] = new Array(columns); } return array; }
#-*- coding: UTF-8 -*- ''' Created by WangQL 2019.4.25 aims to select the series suitable for deep learning. get 'B80f', 'I70f', 'B70f', 'B80', 'B70s' from original CT scans and copy them to another dir ''' import pydicom import cv2 import os import shutil import tqdm path = '/home/wangqiuli/Data/pneumonia/chest3/' pathdir = '/home/wangqiuli/Data/pneumonia/SecondNormal/' patients = os.listdir(path) print("number of patitents: ", len(patients)) b80ffiles = [] seriesNumber = [] kernellist = [] # slicethickness = ['B80f', 'I70f', 'B70f', 'B80', 'B70s'] record = open('failedCasesNormal.txt', 'w') for patient in tqdm.tqdm(patients): files = os.listdir(path + patient) bestdicom = [] dictfordicoms = {} for onefile in (files): ds = pydicom.dcmread(os.path.join(path, patient, onefile)) if ("ConvolutionKernel" in ds.dir()) and ('SeriesDescription' in ds.dir()): convKernel = ds.data_element("ConvolutionKernel").value se = ds.data_element("SeriesNumber").value thickness = ds.data_element("SliceThickness").value SPO = ds.data_element('SeriesDescription').value if ('SPO' not in SPO) and ('MPR' not in SPO): if convKernel == 'B80f': dictkeys = dictfordicoms.keys() if not se in dictkeys: dictfordicoms[se] = 1 else: dictfordicoms[se] += 1 if convKernel == 'I70f': dictkeys = dictfordicoms.keys() if not se in dictkeys: dictfordicoms[se] = 1 else: dictfordicoms[se] += 1 if convKernel == 'B70f': dictkeys = dictfordicoms.keys() if not se in dictkeys: dictfordicoms[se] = 1 else: dictfordicoms[se] += 1 if convKernel == 'B80': dictkeys = dictfordicoms.keys() if not se in dictkeys: dictfordicoms[se] = 1 else: dictfordicoms[se] += 1 if convKernel == 'B70s': dictkeys = dictfordicoms.keys() if not se in dictkeys: dictfordicoms[se] = 1 else: dictfordicoms[se] += 1 if convKernel == 'B31f': dictkeys = dictfordicoms.keys() if not se in dictkeys: dictfordicoms[se] = 1 else: dictfordicoms[se] += 1 if convKernel[0] == 'I31f': dictkeys = dictfordicoms.keys() if not se in dictkeys: dictfordicoms[se] = 1 else: dictfordicoms[se] += 1 if (len(dictfordicoms.keys()) > 0): key_name = max(dictfordicoms, key=dictfordicoms.get) ''' os.makedirs(path) shutil.copy(sourceDir, targetDir) isExists=os.path.exists(path) ''' if not os.path.exists(pathdir + patient): os.makedirs(pathdir + patient) for onefile in files: ds = pydicom.dcmread(os.path.join(path, patient, onefile)) if "ConvolutionKernel" in ds.dir(): se = ds.data_element("SeriesNumber").value thickness = ds.data_element("SliceThickness").value if se == key_name: shutil.copy(os.path.join(path, patient, onefile), os.path.join(pathdir, patient, onefile)) else: record.write(patient + '\n') record.close()
npm install rm -rf ./log rm -rf ./mqtt-server.tar tar -cvf mqtt-server.tar ./ echo "Ifc654321" scp /Users/xplusz/workspace/mqtt-server/mqtt-server.tar root@47.116.75.164:/www/wwwroot/fcity/mqtt-server/ rm -rf ./mqtt-server.tar
import {Injectable} from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, CanLoad, Route, Router, RouterStateSnapshot } from '@angular/router'; import {AuthService} from './auth.service'; @Injectable() export class AuthGuard implements CanLoad, CanActivate, CanActivateChild { constructor(private authService: AuthService, private router: Router) { } canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> | boolean { return this._checkLoginStatus(); } canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> | boolean { return this._checkLoginStatus(); } canLoad(route: Route): Promise<boolean> | boolean { return this._checkLoginStatus(); } private _checkLoginStatus() { const status = this.authService.checkLoginStatus(); if (status instanceof Promise) { status.then(() => this._redirect('/login')) } else { this._redirect('/login'); } return status; } private _redirect(redirectTo:string = '/login') { if (!this.authService.isLoggedIn) { this.router.navigate([redirectTo]); } } }
package io.github.rcarlosdasilva.weixin.api.weixin.impl; import java.util.UUID; import org.apache.commons.codec.digest.DigestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import io.github.rcarlosdasilva.weixin.api.BasicApi; import io.github.rcarlosdasilva.weixin.api.weixin.CertificateApi; import io.github.rcarlosdasilva.weixin.common.ApiAddress; import io.github.rcarlosdasilva.weixin.common.Utils; import io.github.rcarlosdasilva.weixin.common.dictionary.WebAuthorizeScope; import io.github.rcarlosdasilva.weixin.core.OpenPlatform; import io.github.rcarlosdasilva.weixin.core.Registry; import io.github.rcarlosdasilva.weixin.core.Weixin; import io.github.rcarlosdasilva.weixin.core.cache.CacheHandler; import io.github.rcarlosdasilva.weixin.core.exception.CanNotFetchAccessTokenException; import io.github.rcarlosdasilva.weixin.core.exception.CanNotFetchOpenPlatformLicensorAccessTokenException; import io.github.rcarlosdasilva.weixin.core.exception.InvalidAccountException; import io.github.rcarlosdasilva.weixin.core.exception.LostWeixinLicensedRefreshTokenException; import io.github.rcarlosdasilva.weixin.core.json.Json; import io.github.rcarlosdasilva.weixin.core.listener.AccessTokenUpdatedListener; import io.github.rcarlosdasilva.weixin.core.listener.JsTicketUpdatedListener; import io.github.rcarlosdasilva.weixin.model.AccessToken; import io.github.rcarlosdasilva.weixin.model.JsTicket; import io.github.rcarlosdasilva.weixin.model.JsapiSignature; import io.github.rcarlosdasilva.weixin.model.WeixinAccount; import io.github.rcarlosdasilva.weixin.model.request.certificate.AccessTokenRequest; import io.github.rcarlosdasilva.weixin.model.request.certificate.JsTicketRequest; import io.github.rcarlosdasilva.weixin.model.request.certificate.WaAccessTokenRefreshRequest; import io.github.rcarlosdasilva.weixin.model.request.certificate.WaAccessTokenRequest; import io.github.rcarlosdasilva.weixin.model.request.certificate.WaAccessTokenVerifyRequest; import io.github.rcarlosdasilva.weixin.model.response.certificate.AccessTokenResponse; import io.github.rcarlosdasilva.weixin.model.response.certificate.JsTicketResponse; import io.github.rcarlosdasilva.weixin.model.response.certificate.WaAccessTokenResponse; import io.github.rcarlosdasilva.weixin.model.response.open.auth.OpenPlatformAuthGetLicenseInformationResponse; /** * 认证相关API实现 * * @author <a href="mailto:<EMAIL>"><NAME></a> */ public class CertificateApiImpl extends BasicApi implements CertificateApi { private final Logger logger = LoggerFactory.getLogger(CertificateApiImpl.class); public CertificateApiImpl(String accountKey) { super(accountKey); } @Override public synchronized String askAccessToken() { AccessToken token = CacheHandler.of(AccessToken.class).get(this.accountKey); if (token != null && !token.isExpired()) { return token.getAccessToken(); } if (null == token) { logger.debug("For:{} >> 无缓存过的access_token,请求access_token", this.accountKey); } else { logger.debug("For:{} >> 因access_token过期,重新请求。失效的access_token:[{}]", this.accountKey, token); } final WeixinAccount account = Registry.lookup(this.accountKey); if (account == null) { // 不应该为空 throw new InvalidAccountException(); } while (true) { token = CacheHandler.of(AccessToken.class).get(this.accountKey); if (token != null && !token.isExpired()) { break; } String identifier = CacheHandler.of(AccessToken.class).lock(this.accountKey, 2000, true); if (Strings.isNullOrEmpty(identifier)) { try { Thread.sleep(100); continue; } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (account.isWithOpenPlatform()) { // 使用微信开放平台获取access_token。在公众号授权后,会自动获取第一次授权方的access_token final String refreshToken = null == token ? account.getRefreshToken() : token.getRefreshToken(); token = refreshLicensedAccessToken(account.getAppId(), refreshToken); } else { // 使用公众号appid和appsecret获取access_token token = requestAccessToken(); } CacheHandler.of(AccessToken.class).unlock(this.accountKey, identifier); } if (token == null) { logger.error("无法获取微信公众号的access_token"); throw new CanNotFetchAccessTokenException(); } return token.getAccessToken(); } @Override public void refreshAccessToken() { requestAccessToken(); } @Override public void updateAccessToken(String token, long expiredAt) { if (Strings.isNullOrEmpty(token) || expiredAt < 0) { logger.warn("For:{} >> 使用错误的数据更新token: {}, {}", this.accountKey, token, expiredAt); return; } long expiresIn = 7200L * 1000L; if (expiredAt > 0) { expiresIn = expiredAt - System.currentTimeMillis(); } String responseMock = String.format("{'access_token':'%s','expires_in':%s}", token, (expiresIn / 1000)); AccessToken accessToken = Json.fromJson(responseMock, AccessTokenResponse.class); accessToken.setAccountMark(this.accountKey); CacheHandler.of(AccessToken.class).put(this.accountKey, accessToken); } /** * 更新使用开放平台的授权方的access_token. * * @return 请求结果 */ private synchronized AccessToken refreshLicensedAccessToken(String licensorAppId, String refreshToken) { Preconditions.checkNotNull(licensorAppId); if (Strings.isNullOrEmpty(refreshToken)) { logger.error("找不到正确的授权方access_token刷新令牌,或许需要授权方重新授权"); throw new LostWeixinLicensedRefreshTokenException(); } OpenPlatformAuthGetLicenseInformationResponse response = OpenPlatform.certificate() .refreshLicensorAccessToken(licensorAppId, refreshToken); if (response == null || Strings.isNullOrEmpty(response.getLicensedAccessToken().getAccessToken())) { logger.error("获取不到授权方的access_token"); throw new CanNotFetchOpenPlatformLicensorAccessTokenException(); } AccessToken accessToken = response.getLicensedAccessToken(); accessToken.setAccountMark(this.accountKey); CacheHandler.of(AccessToken.class).put(this.accountKey, accessToken); logger.debug("For:{} >> 开放平台更新授权方access_token:[{}]", this.accountKey, accessToken.getAccessToken()); return accessToken; } /** * 真正请求access_token代码. * * @return 请求结果 */ private synchronized AccessToken requestAccessToken() { logger.debug("For:{} >> 正在获取access_token", this.accountKey); WeixinAccount account = Registry.lookup(this.accountKey); AccessTokenRequest requestModel = new AccessTokenRequest(); requestModel.setAppId(account.getAppId()); requestModel.setAppSecret(account.getAppSecret()); AccessToken accessToken = get(AccessTokenResponse.class, requestModel); if (accessToken != null) { accessToken.setAccountMark(this.accountKey); CacheHandler.of(AccessToken.class).put(this.accountKey, accessToken); logger.debug("For:{} >> 获取到access_token:[{}]", this.accountKey, accessToken.getAccessToken()); final AccessTokenUpdatedListener listener = Registry .listener(AccessTokenUpdatedListener.class); if (listener != null) { logger.debug("For:{} >> 调用监听器AccessTokenUpdatedListener", this.accountKey); listener.updated(account.getKey(), account.getAppId(), accessToken.getAccessToken(), accessToken.getExpiresIn()); } return accessToken; } return null; } @Override public final String askJsTicket() { JsTicket ticket = CacheHandler.of(JsTicket.class).get(this.accountKey); if (ticket != null && !ticket.isExpired()) { return ticket.getJsTicket(); } if (null == ticket) { logger.debug("For:{} >> 无缓存过的jsapi_ticket,请求jsapi_ticket", this.accountKey); } else { logger.debug("For:{} >> 因jsapi_ticket过期,重新请求。失效的jsapi_ticket:[{}]", this.accountKey, ticket); } while (true) { ticket = CacheHandler.of(JsTicket.class).get(this.accountKey); if (ticket != null && !ticket.isExpired()) { break; } String identifier = CacheHandler.of(JsTicket.class).lock(this.accountKey, 2000, true); if (Strings.isNullOrEmpty(identifier)) { try { Thread.sleep(100); continue; } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } ticket = requestJsTicket(); CacheHandler.of(AccessToken.class).unlock(this.accountKey, identifier); } return null == ticket ? null : ticket.getJsTicket(); } @Override public void refreshJsTicket() { requestJsTicket(); } @Override public void updateJsTicket(String ticket, long expiredAt) { if (Strings.isNullOrEmpty(ticket) || expiredAt < 0) { logger.warn("For:{} >> 使用错误的数据更新ticket: {}, {}", this.accountKey, ticket, expiredAt); return; } long expiresIn = 7200L * 1000L; if (expiredAt > 0) { expiresIn = expiredAt - System.currentTimeMillis(); } String responseMock = String.format("{'access_token':'%s','expires_in':%s}", ticket, (expiresIn / 1000)); JsTicketResponse responseModel = Json.fromJson(responseMock, JsTicketResponse.class); responseModel.updateExpireAt(); CacheHandler.of(JsTicket.class).put(this.accountKey, responseModel); } /** * 真正请求jsapi_ticket代码. * * @return 请求结果 */ private synchronized JsTicketResponse requestJsTicket() { logger.debug("For:{} >> 正在获取jsapi_ticket", this.accountKey); JsTicketRequest requestModel = new JsTicketRequest(); JsTicketResponse responseModel = get(JsTicketResponse.class, requestModel); if (responseModel != null) { responseModel.updateExpireAt(); CacheHandler.of(JsTicket.class).put(this.accountKey, responseModel); logger.debug("For:{} >> 获取jsapi_ticket:[{}]", this.accountKey, responseModel.getJsTicket()); final JsTicketUpdatedListener listener = Registry.listener(JsTicketUpdatedListener.class); if (listener != null) { logger.debug("For:{} >> 调用监听器JsTicketUpdatedListener", this.accountKey); WeixinAccount account = Registry.lookup(this.accountKey); listener.updated(account.getKey(), account.getAppId(), responseModel.getJsTicket(), responseModel.getExpiresIn()); } return responseModel; } return null; } @Override public WaAccessTokenResponse askWebAuthorizeAccessToken(String code) { WeixinAccount account = Registry.lookup(this.accountKey); WaAccessTokenRequest requestModel = new WaAccessTokenRequest(); requestModel.setAppId(account.getAppId()); requestModel.setAppSecret(account.getAppSecret()); requestModel.setCode(code); return get(WaAccessTokenResponse.class, requestModel); } @Override public WaAccessTokenResponse refreshWebAuthorizeAccessToken(String refreshToken) { WeixinAccount account = Registry.lookup(this.accountKey); WaAccessTokenRefreshRequest requestModel = new WaAccessTokenRefreshRequest(); requestModel.setAppId(account.getAppId()); requestModel.setRefreshToken(refreshToken); return get(WaAccessTokenResponse.class, requestModel); } @Override public boolean verifyWebAuthorizeAccessToken(String accessToken, String openId) { WaAccessTokenVerifyRequest requestModel = new WaAccessTokenVerifyRequest(); requestModel.setAccessToken(accessToken); requestModel.setOpenId(openId); return get(Boolean.class, requestModel); } @Override public String webAuthorize(WebAuthorizeScope scope, String redirectTo, String param) { WeixinAccount account = Registry.lookup(this.accountKey); return new StringBuilder(ApiAddress.URL_WEB_AUTHORIZE).append("?appid=") .append(account.getAppId()).append("&redirect_uri=").append(Utils.urlEncode(redirectTo)) .append("&response_type=code&scope=").append(scope) .append(Strings.isNullOrEmpty(param) ? "" : ("&state=" + param)).append("#wechat_redirect") .toString(); } @Override public String webAuthorize(WebAuthorizeScope scope, String redirectTo) { return webAuthorize(scope, redirectTo, null); } @Override public JsapiSignature generateJsapiSignature(String url) { WeixinAccount account = Registry.lookup(this.accountKey); String ticket = Weixin.with(this.accountKey).certificate().askJsTicket(); String timestamp = Long.toString(System.currentTimeMillis() / 1000); String nonce = UUID.randomUUID().toString(); String raw = new StringBuilder("jsapi_ticket=").append(ticket).append("&noncestr=") .append(nonce).append("&timestamp=").append(timestamp).append("&url=").append(url) .toString(); String signature = null; signature = DigestUtils.sha1Hex(raw); return new JsapiSignature(account.getAppId(), ticket, signature, url, timestamp, nonce); } }
<reponame>JLLeitschuh/Symfony-2-Eclipse-Plugin /******************************************************************************* * This file is part of the Symfony eclipse plugin. * * (c) <NAME> <<EMAIL>> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. ******************************************************************************/ package com.dubture.symfony.ui.editor.template; import org.eclipse.jface.text.templates.TemplateContext; import org.eclipse.jface.text.templates.TemplateVariable; import org.eclipse.jface.text.templates.TemplateVariableResolver; /** * * Resolves ${extends} variables in code templates. * * @author <NAME> <<EMAIL>> * */ public class ExtendsStatementVariableResolver extends TemplateVariableResolver { public ExtendsStatementVariableResolver(String type, String description) { super(type, description); } @Override public void resolve(TemplateVariable variable, TemplateContext context) { if (context instanceof SymfonyTemplateContext) { SymfonyTemplateContext symfonyContext = (SymfonyTemplateContext) context; try { String value = (String) symfonyContext.getTemplateVariable("extends"); if (value != null && value.length() > 0) { String statement = "extends " + value; variable.setValue(statement); } else { variable.setValue(""); } variable.setResolved(true); } catch (Exception e) { e.printStackTrace(); } } } }
#/bin/bash #user="website" #pass="website" #database="website" if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] ; then echo "You need to type import.sh [user] [password] [database]" else user=$1 pass=$2 database=$3 sqls=`ls *.sql` for i in $sqls do echo "mysql -u $user --password=**** $database < $i" mysql -u $user --password=$pass $database < $i done fi
#!/bin/bash ## PubSubDemo [config] `dirname $0`/run.sh org.demo.PubSubDemo2 -props config.xml $*
<reponame>vharsh/cattle2<gh_stars>0 package io.cattle.platform.audit; public enum AuditEventType { delete, update, create, UNKNOWN, reconcile }
/******************************************************************************* * Copyright 2015 InfinitiesSoft Solutions 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.infinities.skyport.async.service; import javax.annotation.Nullable; import com.infinities.skyport.async.service.compute.AsyncAffinityGroupSupport; import com.infinities.skyport.async.service.compute.AsyncAutoScalingSupport; import com.infinities.skyport.async.service.compute.AsyncMachineImageSupport; import com.infinities.skyport.async.service.compute.AsyncSnapshotSupport; import com.infinities.skyport.async.service.compute.AsyncVirtualMachineSupport; import com.infinities.skyport.async.service.compute.AsyncVolumeSupport; public interface AsyncComputeServices { /** * @return access to support for affinity groups in the cloud provider */ public @Nullable AsyncAffinityGroupSupport getAffinityGroupSupport(); /** * @return access to support for auto-scaling capabilities native to the * cloud provider */ public @Nullable AsyncAutoScalingSupport getAutoScalingSupport(); /** * @return access to support for images/templates in the cloud provider */ public @Nullable AsyncMachineImageSupport getImageSupport(); /** * @return access to support for volume snapshots in the cloud provider */ public @Nullable AsyncSnapshotSupport getSnapshotSupport(); /** * @return access to support for virtual machines in the cloud provider */ public @Nullable AsyncVirtualMachineSupport getVirtualMachineSupport(); /** * @return access to support for volumes in the cloud provider */ public @Nullable AsyncVolumeSupport getVolumeSupport(); /** * @return indicates whether or not the cloud provider supports affinity * groups */ public boolean hasAffinityGroupSupport(); /** * @return indicates whether or not the cloud provider supports native * auto-scaling capabilities */ public boolean hasAutoScalingSupport(); /** * @return indicates whether or not the cloud provider supports * images/templates */ public boolean hasImageSupport(); /** * @return indicates whether or not the cloud provider supports snapshotting * volumes */ public boolean hasSnapshotSupport(); /** * @return indicates whether or not the cloud provider supports virtual * machines */ public boolean hasVirtualMachineSupport(); /** * @return indicates whether or not the cloud provider supports block or * network volumes */ public boolean hasVolumeSupport(); void initialize() throws Exception; void close(); }
#! /bin/bash flume-ng agent --name newsAgent --conf-file ./flume_config.cfg -f $FLUME_HOME/conf/flume-conf.properties.template -Dflume.root.logger=DEBUG,console
import math def calculate_torus_volume(R=None, r=None, DV=None, dVMode='abs', ind=None, VType='Tor', VLim=None, Out='(X,Y,Z)', margin=1.e-9): if R is None or r is None: return None # Return None if major or minor radius is not provided volume = 2 * math.pi**2 * R * r**2 # Calculate the volume of the torus if DV is not None: # If volume differential is provided if dVMode == 'abs': volume += DV # Add the absolute volume differential elif dVMode == 'rel': volume *= (1 + DV) # Add the relative volume differential if VLim is not None: # If volume limit is provided volume = min(volume, VLim) # Ensure the volume does not exceed the limit return volume
<reponame>tuw-eeg/GEOPHIRES-web import { SimulationData } from '@modules/simulation-provider/model'; import { createContext, Dispatch, SetStateAction } from 'react'; export type SimulationContextType = { simulationData?: SimulationData; setSimulationData?: Dispatch<SetStateAction<SimulationData>>; }; export const SimulationContext = createContext<SimulationContextType>({});
<gh_stars>1-10 "use strict"; const umdModule = require('./umdModule'); console.log(umdModule.sayHello('Server!'));
<reponame>PolymeshNetwork/common<gh_stars>1-10 // Copyright 2017-2021 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 import { sr25519DeriveKeypairSoft } from '@polkadot/wasm-crypto'; import { createDeriveFn } from './derive'; export const schnorrkelDeriveSoft = createDeriveFn(sr25519DeriveKeypairSoft);
echo "Querying the '_fica.fica_status' table on canonical DB" docker exec -it db-canonical psql -P pager=off -h db-canonical -U postgres -p 5432 -d canonical_db -c 'SELECT * FROM _fica.fica_status;' echo "Querying the '_fica.fica_status_history' table on canonical DB" docker exec -it db-canonical psql -P pager=off -h db-canonical -U postgres -p 5432 -d canonical_db -c 'SELECT * FROM _fica.fica_status_history;'
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-05-09 11:48 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mapdata', '0065_auto_20170509_1140'), ] operations = [ migrations.AlterModelOptions( name='space', options={'verbose_name': 'Space', 'verbose_name_plural': 'Spaces'}, ), migrations.AddField( model_name='door', name='level', field=models.CharField(choices=[('', 'normal'), ('upper', 'upper'), ('lower', 'lower')], default='', max_length=16, verbose_name='level'), ), migrations.AlterField( model_name='space', name='section', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='spaces', to='mapdata.Section', verbose_name='section'), ), ]
import keras.backend as K from keras.layers import Layer, concatenate class SquareConcatLayer(Layer): def __init__(self, axis, **kwargs): self.axis = axis super(SquareConcatLayer, self).__init__(**kwargs) def build(self, input_shape): super(SquareConcatLayer, self).build(input_shape) def call(self, inputs): squared_input = K.square(inputs) concatenated_output = concatenate([inputs, squared_input], axis=self.axis) return concatenated_output def compute_output_shape(self, input_shape): return input_shape[:self.axis] + (input_shape[self.axis] * 2,) + input_shape[self.axis+1:]
<filename>server/admin-api/routes.js const Router = require('@koa/router') const koaJwt = require('koa-jwt') const handle = require('./controllers/index') const { adminSecret } = require('../config') const judge = require('../middlewares/judge') // 实例化路由对象,并设置路由前缀 const router = new Router({ prefix: '/api/admin' }) // 使用koa-jwt 生成验证token 的中间件函数 const auth = koaJwt({ secret: adminSecret }) // 文件上传 router.post('/upload/:mime/:type?', auth, handle.upload) // 管理员 router.post('/login', handle.login) router.post('/auth', auth, handle.auth) router.get('/admin', handle.adminList) router.get('/admin/:id', handle.itemAdmin) router.put('/admin/:id', auth, judge, handle.updateAdmin) router.delete('/admin/:id', auth, judge, handle.delAdmin) router.post('/admin', auth, judge, handle.addAdmin) // 文章 router.get('/article', handle.articleList) router.get('/article/growth', handle.articleGrowth) router.delete('/article/:id', auth, judge, handle.delArticle) // 标签 router.get('/tag', handle.tagList) router.get('/tag/proportion', handle.getTagProportion) router.get('/tag/:id', handle.itemTag) router.put('/tag/:id', auth, judge, handle.updateTag) router.delete('/tag/:id', auth, judge, handle.delTag) router.post('/tag', auth, judge, handle.addTag) // 用户 router.get('/user', handle.userList) router.get('/user/growth', handle.userGrowth) router.delete('/user/:id', auth, judge, handle.delUser) module.exports = router
<reponame>dino993/SeleniumFull var webdriver = require('selenium-webdriver'), chrome = require('selenium-webdriver/chrome'), safari = require('selenium-webdriver/safari'), phantomjs = require('selenium-webdriver/phantomjs'), firefox = require('selenium-webdriver/firefox'), By = webdriver.By, until = webdriver.until, test = require('selenium-webdriver/testing'), generalParameters = require('./../generalParameters'); test.describe('Task 11', function() { var driver; test.before(function() { var options = new chrome.Options(); options.addArguments(["start-fullscreen"]); driver = new webdriver.Builder() //.withCapabilities({'marionette': true}) .forBrowser('chrome') .setChromeOptions(options) .build(); driver.getCapabilities().then(function(caps) { console.log(caps); driver.manage().timeouts().implicitlyWait(10000/*ms*/); }); }); var emailPrefix = generalParameters.XGenerate.randString(5); var email = emailPrefix + "@<EMAIL>"; var password = <PASSWORD>; test.it('Task 11 - do registration', function() { driver.get("http://localhost/litecart/en/create_account"); driver.findElement(By.name("firstname")).sendKeys("MyName"); driver.findElement(By.name("lastname")).sendKeys("MySername"); driver.findElement(By.name("address1")).sendKeys("MyAddress"); driver.findElement(By.name("postcode")).sendKeys("MyPostcode"); driver.findElement(By.name("city")).sendKeys("MyCity"); driver.findElement(By.css(".select2-selection.select2-selection--single")).click(); driver.findElement(By.xpath("//*[@class='select2-results__option'][text()='Albania']")).click(); driver.findElement(By.name("email")).sendKeys(email); driver.findElement(By.name("phone")).sendKeys("+79169999999"); driver.findElement(By.name("password")).sendKeys(password); driver.findElement(By.name("confirmed_password")).sendKeys(password); driver.findElement(By.name("create_account")).click(); driver.findElement(By.xpath("//*[text()='Logout']")).click(); driver.findElement(By.name('email')).sendKeys(email); driver.findElement(By.name('password')).sendKeys(password); driver.findElement(By.name('login')).click(); driver.wait(until.titleIs('My Store'), 1000); }); test.after(function() { driver.sleep(2000); driver.quit(); }); });
<filename>0839-Similar String Groups/cpp_0839/Solution1.h /** * @author ooooo * @date 2021/2/26 16:34 */ #ifndef CPP_0839__SOLUTION1_H_ #define CPP_0839__SOLUTION1_H_ #include <iostream> #include <vector> #include <set> using namespace std; class Solution { public: struct UF { vector<int> p; int n; UF(int n) : p(n), n(n) { for (int i = 0; i < n; ++i) { p[i] = i; } } int find(int i) { if (p[i] == i) return i; return p[i] = find(p[i]); } bool connect(int i, int j) { int pi = find(i), pj = find(j); if (pi == pj) { return true; } p[pi] = pj; n--; return false; } }; int numSimilarGroups(vector<string> &strs) { int n = strs.size(); UF uf(n); for (int i = 0; i < n; ++i) { for (int j = i+1; j < n; ++j) { int pi = uf.find(i), pj = uf.find(j); if (pi == pj) continue; if(check(strs[i], strs[j])) { uf.connect(i, j); } } } return uf.n; } bool check(string &s1, string &s2) { int cnt = 0; for (int i = 0; i < s1.size(); ++i) { if (s1[i] != s2[i]) { cnt++; } } return cnt <= 2; } }; #endif //CPP_0839__SOLUTION1_H_
# generated from colcon_bash/shell/template/prefix_chain.bash.em # This script extends the environment with the environment of other prefix # paths which were sourced when this file was generated as well as all packages # contained in this prefix path. # function to source another script with conditional trace output # first argument: the path of the script _colcon_prefix_chain_bash_source_script() { if [ -f "$1" ]; then if [ -n "$COLCON_TRACE" ]; then echo ". \"$1\"" fi . "$1" else echo "not found: \"$1\"" 1>&2 fi } # source chained prefixes # setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script COLCON_CURRENT_PREFIX="/opt/ros/foxy" _colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash" # setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script COLCON_CURRENT_PREFIX="/home/david/ros2_ws/install" _colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash" # source this prefix # setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script COLCON_CURRENT_PREFIX="$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)" _colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash" unset COLCON_CURRENT_PREFIX unset _colcon_prefix_chain_bash_source_script